var backend = (function(exports) {
	Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
	//#region \0rolldown/runtime.js
	var __create = Object.create;
	var __defProp = Object.defineProperty;
	var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
	var __getOwnPropNames = Object.getOwnPropertyNames;
	var __getProtoOf = Object.getPrototypeOf;
	var __hasOwnProp = Object.prototype.hasOwnProperty;
	var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
	var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
	var __exportAll = (all, no_symbols) => {
		let target = {};
		for (var name in all) __defProp(target, name, {
			get: all[name],
			enumerable: true
		});
		if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
		return target;
	};
	var __copyProps = (to, from, except, desc) => {
		if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
			key = keys[i];
			if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
				get: ((k) => from[k]).bind(null, key),
				enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
			});
		}
		return to;
	};
	var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
		value: mod,
		enumerable: true
	}) : target, mod));
	var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
	//#endregion
	//#region ../../node_modules/vite-plugin-node-polyfills/shims/global/dist/index.js
	var global;
	var init_dist$2 = __esmMin((() => {
		global = globalThis || self;
	}));
	//#endregion
	//#region ../../node_modules/vite-plugin-node-polyfills/shims/process/dist/index.js
	function getDefaultExportFromCjs(x) {
		return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
	}
	function defaultSetTimout() {
		throw new Error("setTimeout has not been defined");
	}
	function defaultClearTimeout() {
		throw new Error("clearTimeout has not been defined");
	}
	function runTimeout(fun) {
		if (cachedSetTimeout === setTimeout) return setTimeout(fun, 0);
		if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
			cachedSetTimeout = setTimeout;
			return setTimeout(fun, 0);
		}
		try {
			return cachedSetTimeout(fun, 0);
		} catch (e) {
			try {
				return cachedSetTimeout.call(null, fun, 0);
			} catch (e) {
				return cachedSetTimeout.call(this, fun, 0);
			}
		}
	}
	function runClearTimeout(marker) {
		if (cachedClearTimeout === clearTimeout) return clearTimeout(marker);
		if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
			cachedClearTimeout = clearTimeout;
			return clearTimeout(marker);
		}
		try {
			return cachedClearTimeout(marker);
		} catch (e) {
			try {
				return cachedClearTimeout.call(null, marker);
			} catch (e) {
				return cachedClearTimeout.call(this, marker);
			}
		}
	}
	function cleanUpNextTick() {
		if (!draining || !currentQueue) return;
		draining = false;
		if (currentQueue.length) queue = currentQueue.concat(queue);
		else queueIndex = -1;
		if (queue.length) drainQueue();
	}
	function drainQueue() {
		if (draining) return;
		var timeout = runTimeout(cleanUpNextTick);
		draining = true;
		var len = queue.length;
		while (len) {
			currentQueue = queue;
			queue = [];
			while (++queueIndex < len) if (currentQueue) currentQueue[queueIndex].run();
			queueIndex = -1;
			len = queue.length;
		}
		currentQueue = null;
		draining = false;
		runClearTimeout(timeout);
	}
	function Item(fun, array) {
		this.fun = fun;
		this.array = array;
	}
	function noop$1() {}
	var browser, process, cachedSetTimeout, cachedClearTimeout, queue, draining, currentQueue, queueIndex, browserExports, process$1;
	var init_dist$1 = __esmMin((() => {
		browser = { exports: {} };
		process = browser.exports = {};
		(function() {
			try {
				if (typeof setTimeout === "function") cachedSetTimeout = setTimeout;
				else cachedSetTimeout = defaultSetTimout;
			} catch (e) {
				cachedSetTimeout = defaultSetTimout;
			}
			try {
				if (typeof clearTimeout === "function") cachedClearTimeout = clearTimeout;
				else cachedClearTimeout = defaultClearTimeout;
			} catch (e) {
				cachedClearTimeout = defaultClearTimeout;
			}
		})();
		queue = [];
		draining = false;
		queueIndex = -1;
		process.nextTick = function(fun) {
			var args = new Array(arguments.length - 1);
			if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) args[i - 1] = arguments[i];
			queue.push(new Item(fun, args));
			if (queue.length === 1 && !draining) runTimeout(drainQueue);
		};
		Item.prototype.run = function() {
			this.fun.apply(null, this.array);
		};
		process.title = "browser";
		process.browser = true;
		process.env = {};
		process.argv = [];
		process.version = "";
		process.versions = {};
		process.on = noop$1;
		process.addListener = noop$1;
		process.once = noop$1;
		process.off = noop$1;
		process.removeListener = noop$1;
		process.removeAllListeners = noop$1;
		process.emit = noop$1;
		process.prependListener = noop$1;
		process.prependOnceListener = noop$1;
		process.listeners = function(name) {
			return [];
		};
		process.binding = function(name) {
			throw new Error("process.binding is not supported");
		};
		process.cwd = function() {
			return "/";
		};
		process.chdir = function(dir) {
			throw new Error("process.chdir is not supported");
		};
		process.umask = function() {
			return 0;
		};
		browserExports = browser.exports;
		process$1 = /* @__PURE__ */ getDefaultExportFromCjs(browserExports);
	}));
	//#endregion
	//#region ../loot-core/src/platform/server/log/index.ts
	init_dist$2();
	init_dist$1();
	var verboseMode = true;
	function setVerboseMode(verbose) {
		verboseMode = verbose;
	}
	var logger = {
		info: (...args) => {
			if (verboseMode) console.log(...args);
		},
		warn: (...args) => {
			console.warn(...args);
		},
		log: (...args) => {
			if (verboseMode) console.log(...args);
		},
		error: (...args) => {
			console.error(...args);
		},
		debug: (...args) => {
			if (verboseMode) console.debug(...args);
		},
		group: (...args) => {
			if (verboseMode) console.group(...args);
		},
		groupEnd: () => {
			if (verboseMode) console.groupEnd();
		}
	};
	//#endregion
	//#region ../loot-core/src/platform/server/indexeddb/index.ts
	var openedDb = _openDatabase();
	function _openDatabase() {
		return new Promise((resolve, reject) => {
			const openRequest = indexedDB.open("actual", 9);
			openRequest.onupgradeneeded = function(e) {
				const db = e.target.result;
				if (db.objectStoreNames.contains("filesystem")) db.deleteObjectStore("filesystem");
				if (db.objectStoreNames.contains("messages")) db.deleteObjectStore("messages");
				if (!db.objectStoreNames.contains("asyncStorage")) db.createObjectStore("asyncStorage");
				if (!db.objectStoreNames.contains("files")) db.createObjectStore("files", { keyPath: "filepath" });
			};
			openRequest.onblocked = (e) => logger.log("blocked", e);
			openRequest.onerror = () => {
				logger.log("openRequest error");
				reject(/* @__PURE__ */ new Error("indexeddb-failure: Could not open IndexedDB"));
			};
			openRequest.onsuccess = function(e) {
				const db = e.target.result;
				db.onversionchange = () => {
					db.close();
				};
				db.onerror = function(event) {
					const error = event.target?.error;
					logger.log("Database error:", error);
					if (event.target && error) {
						if (error.name === "QuotaExceededError") throw new Error("indexeddb-quota-error");
					}
				};
				resolve(db);
			};
		});
	}
	var getStore = function(db, name) {
		const trans = db.transaction([name], "readwrite");
		return {
			trans,
			store: trans.objectStore(name)
		};
	};
	var get$4 = async function(store, key) {
		return new Promise((resolve, reject) => {
			const req = store.get(key);
			req.onsuccess = () => {
				resolve(req.result);
			};
			req.onerror = (e) => reject(e);
		});
	};
	var set = async function(store, item) {
		return new Promise((resolve, reject) => {
			const req = store.put(item);
			req.onsuccess = () => resolve(void 0);
			req.onerror = (e) => reject(e);
		});
	};
	var del$1 = async function(store, key) {
		return new Promise((resolve, reject) => {
			const req = store.delete(key);
			req.onsuccess = () => resolve(void 0);
			req.onerror = (e) => reject(e);
		});
	};
	var getDatabase$1 = function() {
		return openedDb;
	};
	//#endregion
	//#region ../loot-core/src/platform/server/asyncStorage/index.ts
	var init$5 = function() {};
	var getItem = async function(key) {
		const objectStore = (await getDatabase$1()).transaction(["asyncStorage"], "readonly").objectStore("asyncStorage");
		return new Promise((resolve, reject) => {
			const req = objectStore.get(key);
			req.onerror = (e) => reject(e);
			req.onsuccess = (e) => resolve(e.target.result);
		});
	};
	var setItem = async function(key, value) {
		const transaction = (await getDatabase$1()).transaction(["asyncStorage"], "readwrite");
		const objectStore = transaction.objectStore("asyncStorage");
		new Promise((resolve, reject) => {
			const req = objectStore.put(value, key);
			req.onerror = (e) => reject(e);
			req.onsuccess = () => resolve(void 0);
			transaction.commit();
		});
	};
	var removeItem = async function(key) {
		const transaction = (await getDatabase$1()).transaction(["asyncStorage"], "readwrite");
		const objectStore = transaction.objectStore("asyncStorage");
		return new Promise((resolve, reject) => {
			const req = objectStore.delete(key);
			req.onerror = (e) => reject(e);
			req.onsuccess = () => resolve(void 0);
			transaction.commit();
		});
	};
	async function multiGet(keys) {
		const transaction = (await getDatabase$1()).transaction(["asyncStorage"], "readonly");
		const objectStore = transaction.objectStore("asyncStorage");
		const results = await Promise.all(keys.map((key) => {
			return new Promise((resolve, reject) => {
				const req = objectStore.get(key);
				req.onerror = (e) => reject(e);
				req.onsuccess = (e) => {
					const target = e.target;
					resolve([key, target.result]);
				};
			});
		}));
		transaction.commit();
		return results.reduce((acc, [key, value]) => {
			acc[key] = value;
			return acc;
		}, {});
	}
	var multiRemove = async function(keys) {
		const transaction = (await getDatabase$1()).transaction(["asyncStorage"], "readwrite");
		const objectStore = transaction.objectStore("asyncStorage");
		const promise = Promise.all(keys.map((key) => {
			return new Promise((resolve, reject) => {
				const req = objectStore.delete(key);
				req.onerror = (e) => reject(e);
				req.onsuccess = () => resolve(void 0);
			});
		}));
		transaction.commit();
		await promise;
	};
	//#endregion
	//#region ../loot-core/src/platform/exceptions/index.ts
	var captureException = function(exc) {
		logger.error("[Exception]", exc);
	};
	var captureBreadcrumb = function(crumb) {
		logger.info("[Breadcrumb]", crumb);
	};
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/typeof.js
	function _typeof(o) {
		"@babel/helpers - typeof";
		return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
			return typeof o;
		} : function(o) {
			return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
		}, _typeof(o);
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/toPrimitive.js
	function toPrimitive(t, r) {
		if ("object" != _typeof(t) || !t) return t;
		var e = t[Symbol.toPrimitive];
		if (void 0 !== e) {
			var i = e.call(t, r || "default");
			if ("object" != _typeof(i)) return i;
			throw new TypeError("@@toPrimitive must return a primitive value.");
		}
		return ("string" === r ? String : Number)(t);
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/toPropertyKey.js
	function toPropertyKey(t) {
		var i = toPrimitive(t, "string");
		return "symbol" == _typeof(i) ? i : i + "";
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/defineProperty.js
	function _defineProperty(e, r, t) {
		return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
			value: t,
			enumerable: !0,
			configurable: !0,
			writable: !0
		}) : e[r] = t, e;
	}
	//#endregion
	//#region ../loot-core/src/server/errors.ts
	var PostError = class extends Error {
		constructor(reason, meta) {
			super("PostError: " + reason);
			_defineProperty(this, "meta", void 0);
			_defineProperty(this, "reason", void 0);
			_defineProperty(this, "type", void 0);
			this.type = "PostError";
			this.reason = reason;
			this.meta = meta;
		}
	};
	var BankSyncError$1 = class extends Error {
		constructor(reason, category, code) {
			super("BankSyncError: " + reason);
			_defineProperty(this, "reason", void 0);
			_defineProperty(this, "category", void 0);
			_defineProperty(this, "code", void 0);
			_defineProperty(this, "type", void 0);
			this.type = "BankSyncError";
			this.reason = reason;
			this.category = category;
			this.code = code;
		}
	};
	var HTTPError = class extends Error {
		constructor(code, body) {
			super(`HTTPError: unsuccessful status code (${code}): ${body}`);
			_defineProperty(this, "statusCode", void 0);
			_defineProperty(this, "responseBody", void 0);
			this.statusCode = code;
			this.responseBody = body;
		}
	};
	var SyncError = class extends Error {
		constructor(reason, meta) {
			super("SyncError: " + reason);
			_defineProperty(this, "meta", void 0);
			_defineProperty(this, "reason", void 0);
			this.reason = reason;
			this.meta = meta;
		}
	};
	var ValidationError = class extends Error {};
	var TransactionError = class extends Error {};
	var RuleError = class extends Error {
		constructor(name, message) {
			super("RuleError: " + message);
			_defineProperty(this, "type", void 0);
			this.type = name;
		}
	};
	function APIError(msg, meta) {
		return {
			type: "APIError",
			message: msg,
			meta
		};
	}
	function FileDownloadError(reason, meta) {
		return {
			type: "FileDownloadError",
			reason,
			meta
		};
	}
	function FileUploadError(reason, meta) {
		return {
			type: "FileUploadError",
			reason,
			meta
		};
	}
	//#endregion
	//#region ../loot-core/src/shared/async.ts
	function sequential(fn) {
		const sequenceState = {
			running: null,
			queue: []
		};
		function pump() {
			const next = sequenceState.queue.shift();
			if (next !== void 0) run(next.args, next.resolve, next.reject);
			else sequenceState.running = null;
		}
		function run(args, resolve, reject) {
			sequenceState.running = fn.apply(null, args).then((val) => {
				pump();
				resolve(val);
			}, (err) => {
				pump();
				reject(err);
			});
		}
		return ((...args) => {
			if (!sequenceState.running) return new Promise((resolve, reject) => {
				return run(args, resolve, reject);
			});
			else return new Promise((resolve, reject) => {
				sequenceState.queue.push({
					resolve,
					reject,
					args
				});
			});
		});
	}
	function once(fn) {
		let promise = null;
		return (...args) => {
			if (!promise) {
				promise = fn.apply(null, args).finally(() => {
					promise = null;
				});
				return promise;
			}
			return promise;
		};
	}
	//#endregion
	//#region ../loot-core/src/server/mutators.ts
	var runningMethods = /* @__PURE__ */ new Set();
	var currentContext = null;
	var mutatingMethods = /* @__PURE__ */ new WeakMap();
	var globalMutationsEnabled = false;
	var _latestHandlerNames = [];
	function mutator(handler) {
		mutatingMethods.set(handler, true);
		return handler;
	}
	function isMutating(handler) {
		return mutatingMethods.has(handler);
	}
	async function flushRunningMethods() {
		await wait(200);
		while (runningMethods.size > 0) {
			await Promise.all([...runningMethods.values()]);
			await wait(100);
		}
	}
	function wait(time) {
		return new Promise((resolve) => setTimeout(resolve, time));
	}
	async function runHandler(handler, args, { undoTag, name } = {}) {
		_latestHandlerNames.push(name);
		if (_latestHandlerNames.length > 5) _latestHandlerNames = _latestHandlerNames.slice(-5);
		if (mutatingMethods.has(handler)) return runMutator(() => handler(args), { undoTag });
		if (name === "close-budget") await flushRunningMethods();
		const promise = handler(args);
		runningMethods.add(promise);
		promise.then(() => {
			runningMethods.delete(promise);
		});
		return promise;
	}
	function _runMutator(func, initialContext = {}) {
		currentContext = initialContext;
		return func().finally(() => {
			currentContext = null;
		});
	}
	var runMutator = sequential(_runMutator);
	function withMutatorContext(context, func) {
		if (currentContext == null && !globalMutationsEnabled) {
			captureBreadcrumb("Recent methods: " + _latestHandlerNames.join(", "));
			captureException(/* @__PURE__ */ new Error("withMutatorContext: mutator not running"));
			return func();
		}
		const prevContext = currentContext;
		currentContext = {
			...currentContext,
			...context
		};
		return func().finally(() => {
			currentContext = prevContext;
		});
	}
	function getMutatorContext() {
		if (currentContext == null) {
			captureBreadcrumb({
				category: "server",
				message: "Recent methods: " + _latestHandlerNames.join(", ")
			});
			return {};
		}
		if (currentContext == null && globalMutationsEnabled) return {};
		return currentContext;
	}
	//#endregion
	//#region ../loot-core/src/platform/server/connection/index.ts
	function getGlobalObject() {
		const obj = typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : null;
		if (!obj) throw new Error("Cannot get global object");
		return obj;
	}
	getGlobalObject().__globalServerChannel = null;
	function coerceError(error) {
		if (error.type && error.type === "APIError") return error;
		return {
			type: "ServerError",
			message: error.message,
			cause: error
		};
	}
	var init$4 = function(serverChn, handlers) {
		const serverChannel = serverChn;
		getGlobalObject().__globalServerChannel = serverChannel;
		serverChannel.addEventListener("message", (e) => {
			const data = e.data;
			const msg = typeof data === "string" ? JSON.parse(data) : data;
			if (msg.type && (msg.type === "init" || msg.type.startsWith("__"))) return;
			if (msg.name === "client-connected-to-backend") {
				logger.info("Backend: Client connected");
				clearInterval(reconnectToClientInterval);
				return;
			}
			const { id, name, args, undoTag, catchErrors } = msg;
			if (handlers[name]) runHandler(handlers[name], args, {
				undoTag,
				name
			}).then((result) => {
				serverChannel.postMessage({
					type: "reply",
					id,
					result: catchErrors ? {
						data: result,
						error: null
					} : result,
					mutated: isMutating(handlers[name]),
					undoTag
				});
			}, (nativeError) => {
				const error = coerceError(nativeError);
				if (name.startsWith("api/")) serverChannel.postMessage({
					type: "reply",
					id,
					error
				});
				else if (catchErrors) serverChannel.postMessage({
					type: "reply",
					id,
					result: {
						error,
						data: null
					}
				});
				else serverChannel.postMessage({
					type: "error",
					id,
					error
				});
				if (error.type === "ServerError") captureException(nativeError);
				if (!catchErrors) send$1("server-error");
			});
			else {
				logger.error("Unknown server method: " + name);
				captureException(/* @__PURE__ */ new Error("Unknown server method: " + name));
				const unknownMethodError = APIError("Unknown server method: " + name);
				if (catchErrors) serverChannel.postMessage({
					type: "reply",
					id,
					result: {
						error: unknownMethodError,
						data: null
					}
				});
				else serverChannel.postMessage({
					type: "error",
					id,
					error: unknownMethodError
				});
			}
		}, false);
		const RECONNECT_INTERVAL_MS = 200;
		const MAX_RECONNECT_ATTEMPTS = 500;
		let reconnectAttempts = 0;
		const reconnectToClientInterval = setInterval(() => {
			logger.info("Backend: Trying to connect to client");
			serverChannel.postMessage({ type: "connect" });
			reconnectAttempts++;
			if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
				send$1("server-error");
				clearInterval(reconnectToClientInterval);
			}
		}, RECONNECT_INTERVAL_MS);
	};
	var send$1 = function(name, args) {
		const { __globalServerChannel } = getGlobalObject();
		if (__globalServerChannel) __globalServerChannel.postMessage({
			type: "push",
			name,
			args
		});
	};
	var getNumClients = function() {
		return 1;
	};
	//#endregion
	//#region ../../node_modules/absurd-sql/dist/index.js
	var ERRNO_CODES = {
		EPERM: 63,
		ENOENT: 44
	};
	var SQLiteFS$1 = class {
		constructor(FS, backend) {
			this.FS = FS;
			this.backend = backend;
			this.node_ops = {
				getattr: (node) => {
					let fileattr = FS.isFile(node.mode) ? node.contents.getattr() : null;
					let attr = {};
					attr.dev = 1;
					attr.ino = node.id;
					attr.mode = fileattr ? fileattr.mode : node.mode;
					attr.nlink = 1;
					attr.uid = 0;
					attr.gid = 0;
					attr.rdev = node.rdev;
					attr.size = fileattr ? fileattr.size : FS.isDir(node.mode) ? 4096 : 0;
					attr.atime = /* @__PURE__ */ new Date(0);
					attr.mtime = /* @__PURE__ */ new Date(0);
					attr.ctime = /* @__PURE__ */ new Date(0);
					attr.blksize = fileattr ? fileattr.blockSize : 4096;
					attr.blocks = Math.ceil(attr.size / attr.blksize);
					return attr;
				},
				setattr: (node, attr) => {
					if (this.FS.isFile(node.mode)) node.contents.setattr(attr);
					else {
						if (attr.mode != null) node.mode = attr.mode;
						if (attr.size != null) node.size = attr.size;
					}
				},
				lookup: (parent, name) => {
					throw new this.FS.ErrnoError(ERRNO_CODES.ENOENT);
				},
				mknod: (parent, name, mode, dev) => {
					if (name.endsWith(".lock")) throw new Error("Locking via lockfiles is not supported");
					return this.createNode(parent, name, mode, dev);
				},
				rename: (old_node, new_dir, new_name) => {
					throw new Error("rename not implemented");
				},
				unlink: (parent, name) => {
					this.FS.lookupNode(parent, name).contents.delete(name);
				},
				readdir: (node) => {
					throw new Error("readdir not implemented");
				},
				symlink: (parent, newname, oldpath) => {
					throw new Error("symlink not implemented");
				},
				readlink: (node) => {
					throw new Error("symlink not implemented");
				}
			};
			this.stream_ops = {
				open: (stream) => {
					if (this.FS.isFile(stream.node.mode)) stream.node.contents.open();
				},
				close: (stream) => {
					if (this.FS.isFile(stream.node.mode)) stream.node.contents.close();
				},
				read: (stream, buffer, offset, length, position) => {
					return stream.node.contents.read(buffer, offset, length, position);
				},
				write: (stream, buffer, offset, length, position) => {
					return stream.node.contents.write(buffer, offset, length, position);
				},
				llseek: (stream, offset, whence) => {
					var position = offset;
					if (whence === 1) position += stream.position;
					else if (whence === 2) {
						if (FS.isFile(stream.node.mode)) position += stream.node.contents.getattr().size;
					}
					if (position < 0) throw new this.FS.ErrnoError(28);
					return position;
				},
				allocate: (stream, offset, length) => {
					stream.node.contents.setattr({ size: offset + length });
				},
				mmap: (stream, address, length, position, prot, flags) => {
					throw new Error("mmap not implemented");
				},
				msync: (stream, buffer, offset, length, mmapFlags) => {
					throw new Error("msync not implemented");
				},
				fsync: (stream, buffer, offset, length, mmapFlags) => {
					stream.node.contents.fsync();
				}
			};
		}
		mount() {
			return this.createNode(null, "/", 16895, 0);
		}
		lock(path, lockType) {
			let { node } = this.FS.lookupPath(path);
			if (node && node.contents) return node.contents.lock(lockType);
			return true;
		}
		unlock(path, lockType) {
			let { node } = this.FS.lookupPath(path);
			if (node && node.contents) return node.contents.unlock(lockType);
			return true;
		}
		createNode(parent, name, mode, dev) {
			if (!(this.FS.isDir(mode) || this.FS.isFile(mode))) throw new this.FS.ErrnoError(ERRNO_CODES.EPERM);
			var node = this.FS.createNode(parent, name, mode, dev);
			if (this.FS.isDir(node.mode)) {
				node.node_ops = {
					mknod: this.node_ops.mknod,
					lookup: this.node_ops.lookup,
					unlink: this.node_ops.unlink,
					setattr: this.node_ops.setattr
				};
				node.stream_ops = {};
				node.contents = {};
			} else if (this.FS.isFile(node.mode)) {
				node.node_ops = this.node_ops;
				node.stream_ops = this.stream_ops;
				node.contents = this.backend.createFile(name);
			}
			if (parent) {
				parent.contents[name] = node;
				parent.timestamp = node.timestamp;
			}
			return node;
		}
	};
	var SQLiteFS = SQLiteFS$1;
	//#endregion
	//#region ../../node_modules/absurd-sql/dist/indexeddb-backend.js
	init_dist$1();
	var LOCK_TYPES = {
		NONE: 0,
		SHARED: 1,
		RESERVED: 2,
		PENDING: 3,
		EXCLUSIVE: 4
	};
	function getPageSize(bufferView) {
		let int1 = bufferView[16];
		let int2 = bufferView[17];
		return (int1 << 8) + int2;
	}
	function isSafeToWrite(localData, diskData) {
		if (localData != null && diskData != null) {
			let localView = new Uint8Array(localData);
			let diskView = new Uint8Array(diskData);
			for (let i = 24; i < 40; i++) if (localView[i] !== diskView[i]) return false;
			return true;
		}
		return localData == null && diskData == null;
	}
	function range$1(start, end, step) {
		let r = [];
		for (let i = start; i <= end; i += step) r.push(i);
		return r;
	}
	function getBoundaryIndexes(blockSize, start, end) {
		return range$1(start - start % blockSize, end - 1 - (end - 1) % blockSize, blockSize);
	}
	function readChunks(chunks, start, end) {
		let buffer = new ArrayBuffer(end - start);
		let bufferView = new Uint8Array(buffer);
		for (let i = 0; i < chunks.length; i++) {
			let chunk = chunks[i];
			if (chunk.data.constructor.name !== "ArrayBuffer") throw new Error("Chunk data is not an ArrayBuffer");
			let cstart = 0;
			let cend = chunk.data.byteLength;
			if (start > chunk.pos) cstart = start - chunk.pos;
			if (end < chunk.pos + chunk.data.byteLength) cend = end - chunk.pos;
			if (cstart > chunk.data.byteLength || cend < 0) continue;
			let len = cend - cstart;
			bufferView.set(new Uint8Array(chunk.data, cstart, len), chunk.pos - start + cstart);
		}
		return buffer;
	}
	function writeChunks(bufferView, blockSize, start, end) {
		let indexes = getBoundaryIndexes(blockSize, start, end);
		let cursor = 0;
		return indexes.map((index) => {
			let cstart = 0;
			let cend = blockSize;
			if (start > index && start < index + blockSize) cstart = start - index;
			if (end > index && end < index + blockSize) cend = end - index;
			let len = cend - cstart;
			let chunkBuffer = new ArrayBuffer(blockSize);
			if (start > index + blockSize || end <= index) return null;
			let off = bufferView.byteOffset + cursor;
			let available = bufferView.buffer.byteLength - off;
			if (available <= 0) return null;
			let readLength = Math.min(len, available);
			new Uint8Array(chunkBuffer).set(new Uint8Array(bufferView.buffer, off, readLength), cstart);
			cursor += readLength;
			return {
				pos: index,
				data: chunkBuffer,
				offset: cstart,
				length: readLength
			};
		}).filter(Boolean);
	}
	var File$1 = class {
		constructor(filename, ops, meta = null) {
			this.filename = filename;
			this.buffer = /* @__PURE__ */ new Map();
			this.ops = ops;
			this.meta = meta;
			this._metaDirty = false;
			this.writeLock = false;
			this.openHandles = 0;
		}
		bufferChunks(chunks) {
			for (let i = 0; i < chunks.length; i++) {
				let chunk = chunks[i];
				this.buffer.set(chunk.pos, chunk);
			}
		}
		open() {
			this.openHandles++;
			if (this.openHandles === 1) {
				this.ops.open();
				let meta = this.ops.readMeta();
				if (this.meta == null) {
					if (meta == null) meta = { size: 0 };
					this.meta = meta;
				}
			}
			return this.meta;
		}
		close() {
			this.fsync();
			this.openHandles = Math.max(this.openHandles - 1, 0);
			if (this.openHandles === 0) this.ops.close();
		}
		delete() {
			this.ops.delete();
		}
		load(indexes) {
			let status = indexes.reduce((acc, b) => {
				let inMemory = this.buffer.get(b);
				if (inMemory) acc.chunks.push(inMemory);
				else acc.missing.push(b);
				return acc;
			}, {
				chunks: [],
				missing: []
			});
			let missingChunks = [];
			if (status.missing.length > 0) missingChunks = this.ops.readBlocks(status.missing, this.meta.blockSize);
			return status.chunks.concat(missingChunks);
		}
		read(bufferView, offset, length, position) {
			let buffer = bufferView.buffer;
			if (length <= 0) return 0;
			if (position < 0) return 0;
			if (position >= this.meta.size) {
				let view = new Uint8Array(buffer, offset);
				for (let i = 0; i < length; i++) view[i] = 0;
				return length;
			}
			position = Math.max(position, 0);
			let dataLength = Math.min(length, this.meta.size - position);
			let start = position;
			let end = position + dataLength;
			let indexes = getBoundaryIndexes(this.meta.blockSize, start, end);
			let readBuffer = readChunks(this.load(indexes), start, end);
			if (buffer.byteLength - offset < readBuffer.byteLength) throw new Error("Buffer given to `read` is too small");
			let view = new Uint8Array(buffer);
			view.set(new Uint8Array(readBuffer), offset);
			for (let i = dataLength; i < length; i++) view[offset + i] = 0;
			return length;
		}
		write(bufferView, offset, length, position) {
			if (this.meta.blockSize == null) {
				let pageSize = getPageSize(new Uint8Array(bufferView.buffer, bufferView.byteOffset + offset));
				if (![
					512,
					1024,
					2048,
					4096,
					8192,
					16384,
					32768,
					65536
				].includes(pageSize)) throw new Error("File has invalid page size. (the first block of a new file must be written first)");
				this.setattr({ blockSize: pageSize });
			}
			let buffer = bufferView.buffer;
			if (length <= 0) return 0;
			if (position < 0) return 0;
			if (buffer.byteLength === 0) return 0;
			length = Math.min(length, buffer.byteLength - offset);
			let { partialWrites, fullWrites } = writeChunks(new Uint8Array(buffer, offset, length), this.meta.blockSize, position, position + length).reduce((state, write) => {
				if (write.length !== this.meta.blockSize) state.partialWrites.push(write);
				else state.fullWrites.push({
					pos: write.pos,
					data: write.data
				});
				return state;
			}, {
				fullWrites: [],
				partialWrites: []
			});
			let reads = [];
			if (partialWrites.length > 0) reads = this.load(partialWrites.map((w) => w.pos));
			let allWrites = fullWrites.concat(reads.map((read) => {
				let write = partialWrites.find((w) => w.pos === read.pos);
				new Uint8Array(read.data).set(new Uint8Array(write.data, write.offset, write.length), write.offset, write.length);
				return read;
			}));
			this.bufferChunks(allWrites);
			if (position + length > this.meta.size) this.setattr({ size: position + length });
			return length;
		}
		async readIfFallback() {
			if (this.ops.readIfFallback) this.meta = await this.ops.readIfFallback() || { size: 0 };
		}
		lock(lockType) {
			if (!this._recordingLock) this._recordingLock = true;
			if (this.ops.lock(lockType)) {
				if (lockType >= LOCK_TYPES.RESERVED) this.writeLock = true;
				return true;
			}
			return false;
		}
		unlock(lockType) {
			if (lockType === 0) this._recordingLock = false;
			if (this.writeLock) {
				this.fsync();
				this.writeLock = false;
			}
			return this.ops.unlock(lockType);
		}
		fsync() {
			if (this.buffer.size > 0) {
				let first = this.buffer.get(0);
				if (first) {
					let pageSize = getPageSize(new Uint8Array(first.data));
					if (pageSize !== this.meta.blockSize) {
						let buffer = this.buffer;
						this.buffer = /* @__PURE__ */ new Map();
						let writes = [...buffer.values()];
						let totalSize = writes.length * this.meta.blockSize;
						let buf = new ArrayBuffer(totalSize);
						let view = new Uint8Array(buf);
						for (let write of writes) view.set(new Uint8Array(write.data), write.pos);
						this.bufferChunks(writeChunks(view, pageSize, 0, totalSize));
						this.setattr({ blockSize: pageSize });
					}
				}
				this.ops.writeBlocks([...this.buffer.values()], this.meta.blockSize);
			}
			if (this._metaDirty) {
				this.ops.writeMeta({ size: this.meta.size });
				this._metaDirty = false;
			}
			this.buffer = /* @__PURE__ */ new Map();
		}
		setattr(attr) {
			if (this.meta == null) this.meta = {};
			if (attr.mode !== void 0) this.meta.mode = attr.mode;
			if (attr.blockSize !== void 0) this.meta.blockSize = attr.blockSize;
			if (attr.size !== void 0) {
				this.meta.size = attr.size;
				this._metaDirty = true;
			}
		}
		getattr() {
			return this.meta;
		}
	};
	var FINALIZED = 3735928559;
	var WRITEABLE = 0;
	var READABLE = 1;
	var Reader = class {
		constructor(buffer, { initialOffset = 4, useAtomics = true, stream = true, debug, name } = {}) {
			this.buffer = buffer;
			this.atomicView = new Int32Array(buffer);
			this.offset = initialOffset;
			this.useAtomics = useAtomics;
			this.stream = stream;
			this.debug = debug;
			this.name = name;
		}
		log(...args) {
			if (this.debug) console.log(`[reader: ${this.name}]`, ...args);
		}
		waitWrite(name, timeout = null) {
			if (this.useAtomics) {
				this.log(`waiting for ${name}`);
				while (Atomics.load(this.atomicView, 0) === WRITEABLE) {
					if (timeout != null) {
						if (Atomics.wait(this.atomicView, 0, WRITEABLE, timeout) === "timed-out") throw new Error("timeout");
					}
					Atomics.wait(this.atomicView, 0, WRITEABLE, 500);
				}
				this.log(`resumed for ${name}`);
			} else if (this.atomicView[0] !== READABLE) throw new Error("`waitWrite` expected array to be readable");
		}
		flip() {
			this.log("flip");
			if (this.useAtomics) {
				if (Atomics.compareExchange(this.atomicView, 0, READABLE, WRITEABLE) !== READABLE) throw new Error("Read data out of sync! This is disastrous");
				Atomics.notify(this.atomicView, 0);
			} else this.atomicView[0] = WRITEABLE;
			this.offset = 4;
		}
		done() {
			this.waitWrite("done");
			let done = new DataView(this.buffer, this.offset).getUint32(0) === FINALIZED;
			if (done) {
				this.log("done");
				this.flip();
			}
			return done;
		}
		peek(fn) {
			this.peekOffset = this.offset;
			let res = fn();
			this.offset = this.peekOffset;
			this.peekOffset = null;
			return res;
		}
		string(timeout) {
			this.waitWrite("string", timeout);
			let byteLength = this._int32();
			let length = byteLength / 2;
			let dataView = new DataView(this.buffer, this.offset, byteLength);
			let chars = [];
			for (let i = 0; i < length; i++) chars.push(dataView.getUint16(i * 2));
			let str = String.fromCharCode.apply(null, chars);
			this.log("string", str);
			this.offset += byteLength;
			if (this.peekOffset == null) this.flip();
			return str;
		}
		_int32() {
			let byteLength = 4;
			let num = new DataView(this.buffer, this.offset).getInt32();
			this.log("_int32", num);
			this.offset += byteLength;
			return num;
		}
		int32() {
			this.waitWrite("int32");
			let num = this._int32();
			this.log("int32", num);
			if (this.peekOffset == null) this.flip();
			return num;
		}
		bytes() {
			this.waitWrite("bytes");
			let byteLength = this._int32();
			let bytes = new ArrayBuffer(byteLength);
			new Uint8Array(bytes).set(new Uint8Array(this.buffer, this.offset, byteLength));
			this.log("bytes", bytes);
			this.offset += byteLength;
			if (this.peekOffset == null) this.flip();
			return bytes;
		}
	};
	var Writer = class {
		constructor(buffer, { initialOffset = 4, useAtomics = true, stream = true, debug, name } = {}) {
			this.buffer = buffer;
			this.atomicView = new Int32Array(buffer);
			this.offset = initialOffset;
			this.useAtomics = useAtomics;
			this.stream = stream;
			this.debug = debug;
			this.name = name;
			if (this.useAtomics) Atomics.store(this.atomicView, 0, WRITEABLE);
			else this.atomicView[0] = WRITEABLE;
		}
		log(...args) {
			if (this.debug) console.log(`[writer: ${this.name}]`, ...args);
		}
		waitRead(name) {
			if (this.useAtomics) {
				this.log(`waiting for ${name}`);
				if (Atomics.compareExchange(this.atomicView, 0, WRITEABLE, READABLE) !== WRITEABLE) throw new Error("Wrote something into unwritable buffer! This is disastrous");
				Atomics.notify(this.atomicView, 0);
				while (Atomics.load(this.atomicView, 0) === READABLE) Atomics.wait(this.atomicView, 0, READABLE, 500);
				this.log(`resumed for ${name}`);
			} else this.atomicView[0] = READABLE;
			this.offset = 4;
		}
		finalize() {
			this.log("finalizing");
			new DataView(this.buffer, this.offset).setUint32(0, FINALIZED);
			this.waitRead("finalize");
		}
		string(str) {
			this.log("string", str);
			let byteLength = str.length * 2;
			this._int32(byteLength);
			let dataView = new DataView(this.buffer, this.offset, byteLength);
			for (let i = 0; i < str.length; i++) dataView.setUint16(i * 2, str.charCodeAt(i));
			this.offset += byteLength;
			this.waitRead("string");
		}
		_int32(num) {
			let byteLength = 4;
			new DataView(this.buffer, this.offset).setInt32(0, num);
			this.offset += byteLength;
		}
		int32(num) {
			this.log("int32", num);
			this._int32(num);
			this.waitRead("int32");
		}
		bytes(buffer) {
			this.log("bytes", buffer);
			let byteLength = buffer.byteLength;
			this._int32(byteLength);
			new Uint8Array(this.buffer, this.offset).set(new Uint8Array(buffer));
			this.offset += byteLength;
			this.waitRead("bytes");
		}
	};
	function positionToKey$1(pos, blockSize) {
		return Math.round(pos / blockSize);
	}
	function startWorker(reader, writer) {
		self.postMessage({
			type: "__absurd:spawn-idb-worker",
			argBuffer: writer.buffer,
			resultBuffer: reader.buffer
		});
		self.addEventListener("message", (e) => {
			switch (e.data.type) {
				case "__perf-deets:start-profile":
					writer.string("profile-start");
					writer.finalize();
					reader.int32();
					reader.done();
					break;
				case "__perf-deets:stop-profile":
					writer.string("profile-stop");
					writer.finalize();
					reader.int32();
					reader.done();
					break;
			}
		});
	}
	var FileOps = class {
		constructor(filename) {
			this.filename = filename;
		}
		getStoreName() {
			return this.filename.replace(/\//g, "-");
		}
		invokeWorker(method, args) {
			if (this.reader == null || this.writer == null) throw new Error(`Attempted ${method} on ${this.filename} but file not open`);
			let reader = this.reader;
			let writer = this.writer;
			switch (method) {
				case "readBlocks": {
					let { name, positions, blockSize } = args;
					let res = [];
					for (let pos of positions) {
						writer.string("readBlock");
						writer.string(name);
						writer.int32(positionToKey$1(pos, blockSize));
						writer.finalize();
						let data = reader.bytes();
						reader.done();
						res.push({
							pos,
							data: data.byteLength === 0 ? new ArrayBuffer(blockSize) : data
						});
					}
					return res;
				}
				case "writeBlocks": {
					let { name, writes, blockSize } = args;
					writer.string("writeBlocks");
					writer.string(name);
					for (let write of writes) {
						writer.int32(positionToKey$1(write.pos, blockSize));
						writer.bytes(write.data);
					}
					writer.finalize();
					let res = reader.int32();
					reader.done();
					return res;
				}
				case "readMeta": {
					writer.string("readMeta");
					writer.string(args.name);
					writer.finalize();
					let size = reader.int32();
					let blockSize = reader.int32();
					reader.done();
					return size === -1 ? null : {
						size,
						blockSize
					};
				}
				case "writeMeta": {
					let { name, meta } = args;
					writer.string("writeMeta");
					writer.string(name);
					writer.int32(meta.size);
					writer.finalize();
					let res = reader.int32();
					reader.done();
					return res;
				}
				case "closeFile": {
					writer.string("closeFile");
					writer.string(args.name);
					writer.finalize();
					let res = reader.int32();
					reader.done();
					return res;
				}
				case "lockFile": {
					writer.string("lockFile");
					writer.string(args.name);
					writer.int32(args.lockType);
					writer.finalize();
					let res = reader.int32();
					reader.done();
					return res === 0;
				}
				case "unlockFile": {
					writer.string("unlockFile");
					writer.string(args.name);
					writer.int32(args.lockType);
					writer.finalize();
					let res = reader.int32();
					reader.done();
					return res === 0;
				}
			}
		}
		lock(lockType) {
			return this.invokeWorker("lockFile", {
				name: this.getStoreName(),
				lockType
			});
		}
		unlock(lockType) {
			return this.invokeWorker("unlockFile", {
				name: this.getStoreName(),
				lockType
			});
		}
		delete() {
			if (this.reader || this.writer) this.close();
			let req = globalThis.indexedDB.deleteDatabase(this.getStoreName());
			req.onerror = () => {
				console.warn(`Deleting ${this.filename} database failed`);
			};
			req.onsuccess = () => {};
		}
		open() {
			this.writer = new Writer(new SharedArrayBuffer(4096 * 9), {
				name: "args (backend)",
				debug: false
			});
			this.reader = new Reader(new SharedArrayBuffer(4096 * 9), {
				name: "results",
				debug: false
			});
			startWorker(this.reader, this.writer);
		}
		close() {
			this.invokeWorker("closeFile", { name: this.getStoreName() });
			this.reader = null;
			this.writer = null;
			this.worker = null;
		}
		readMeta() {
			return this.invokeWorker("readMeta", { name: this.getStoreName() });
		}
		writeMeta(meta) {
			return this.invokeWorker("writeMeta", {
				name: this.getStoreName(),
				meta
			});
		}
		readBlocks(positions, blockSize) {
			if (this.stats) this.stats.read += positions.length;
			return this.invokeWorker("readBlocks", {
				name: this.getStoreName(),
				positions,
				blockSize
			});
		}
		writeBlocks(writes, blockSize) {
			if (this.stats) this.stats.writes += writes.length;
			return this.invokeWorker("writeBlocks", {
				name: this.getStoreName(),
				writes,
				blockSize
			});
		}
	};
	/**
	* https://bugs.webkit.org/show_bug.cgi?id=226547
	* Safari has a horrible bug where IDB requests can hang while the browser is starting up.
	* The only solution is to keep nudging it until it's awake.
	* This probably creates garbage, but garbage is better than totally failing.
	*/
	function idbReady() {
		if (!(!navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent)) || !indexedDB.databases) return Promise.resolve();
		let intervalId;
		return new Promise((resolve) => {
			const tryIdb = () => indexedDB.databases().finally(resolve);
			intervalId = setInterval(tryIdb, 100);
			tryIdb();
		}).finally(() => clearInterval(intervalId));
	}
	function positionToKey(pos, blockSize) {
		return Math.round(pos / blockSize);
	}
	async function openDb(name) {
		await idbReady();
		return new Promise((resolve, reject) => {
			let req = globalThis.indexedDB.open(name, 2);
			req.onsuccess = (event) => {
				let db = event.target.result;
				db.onversionchange = () => {
					console.log("closing because version changed");
					db.close();
				};
				db.onclose = () => {};
				resolve(db);
			};
			req.onupgradeneeded = (event) => {
				let db = event.target.result;
				if (!db.objectStoreNames.contains("data")) db.createObjectStore("data");
			};
			req.onblocked = (e) => console.log("blocked", e);
			req.onerror = req.onabort = (e) => reject(e.target.error);
		});
	}
	var Persistance = class {
		constructor(dbName, onFallbackFailure) {
			this.dbName = dbName;
			this._openDb = null;
			this.hasAlertedFailure = false;
			this.onFallbackFailure = onFallbackFailure;
		}
		async getDb() {
			if (this._openDb) return this._openDb;
			this._openDb = await openDb(this.dbName);
			return this._openDb;
		}
		closeDb() {
			if (this._openDb) {
				this._openDb.close();
				this._openDb = null;
			}
		}
		async readAll() {
			let db = await this.getDb(this.dbName);
			let blocks = /* @__PURE__ */ new Map();
			let store = db.transaction(["data"], "readonly").objectStore("data");
			return new Promise((resolve, reject) => {
				let req = store.openCursor(IDBKeyRange.lowerBound(-1));
				req.onerror = reject;
				req.onsuccess = (e) => {
					let cursor = e.target.result;
					if (cursor) {
						blocks.set(cursor.key, cursor.value);
						cursor.continue();
					} else resolve(blocks);
				};
			});
		}
		async write(writes, cachedFirstBlock, hasLocked) {
			let trans = (await this.getDb(this.dbName)).transaction(["data"], "readwrite");
			let store = trans.objectStore("data");
			await new Promise((resolve, reject) => {
				let req = store.get(0);
				req.onsuccess = (e) => {
					if (hasLocked) {
						if (!isSafeToWrite(req.result, cachedFirstBlock)) {
							if (this.onFallbackFailure && !this.hasAlertedFailure) {
								this.hasAlertedFailure = true;
								this.onFallbackFailure();
							}
							reject(/* @__PURE__ */ new Error("Fallback mode unable to write file changes"));
							return;
						}
					}
					for (let write of writes) store.put(write.value, write.key);
					trans.onsuccess = () => resolve();
					trans.onerror = () => reject();
				};
				req.onerror = reject;
			});
		}
	};
	var FileOpsFallback = class {
		constructor(filename, onFallbackFailure) {
			this.filename = filename;
			this.dbName = this.filename.replace(/\//g, "-");
			this.cachedFirstBlock = null;
			this.writeQueue = null;
			this.blocks = /* @__PURE__ */ new Map();
			this.lockType = 0;
			this.transferBlockOwnership = false;
			this.persistance = new Persistance(this.dbName, onFallbackFailure);
		}
		async readIfFallback() {
			this.transferBlockOwnership = true;
			this.blocks = await this.persistance.readAll();
			return this.readMeta();
		}
		lock(lockType) {
			this.cachedFirstBlock = this.blocks.get(0);
			this.lockType = lockType;
			return true;
		}
		unlock(lockType) {
			if (this.lockType > LOCK_TYPES.SHARED && lockType === LOCK_TYPES.SHARED) this.flush();
			this.lockType = lockType;
			return true;
		}
		delete() {
			let req = globalThis.indexedDB.deleteDatabase(this.dbName);
			req.onerror = () => {
				console.warn(`Deleting ${this.filename} database failed`);
			};
			req.onsuccess = () => {};
		}
		open() {
			this.writeQueue = [];
			this.lockType = 0;
		}
		close() {
			this.flush();
			if (this.transferBlockOwnership) this.transferBlockOwnership = false;
			else this.blocks = /* @__PURE__ */ new Map();
			this.persistance.closeDb();
		}
		readMeta() {
			let metaBlock = this.blocks.get(-1);
			if (metaBlock) {
				let block = this.blocks.get(0);
				return {
					size: metaBlock.size,
					blockSize: getPageSize(new Uint8Array(block))
				};
			}
			return null;
		}
		writeMeta(meta) {
			this.blocks.set(-1, meta);
			this.queueWrite(-1, meta);
		}
		readBlocks(positions, blockSize) {
			let res = [];
			for (let pos of positions) res.push({
				pos,
				data: this.blocks.get(positionToKey(pos, blockSize))
			});
			return res;
		}
		writeBlocks(writes, blockSize) {
			for (let write of writes) {
				let key = positionToKey(write.pos, blockSize);
				this.blocks.set(key, write.data);
				this.queueWrite(key, write.data);
			}
			if (this.lockType <= LOCK_TYPES.SHARED) this.flush();
		}
		queueWrite(key, value) {
			this.writeQueue.push({
				key,
				value
			});
		}
		flush() {
			if (this.writeQueue.length > 0) {
				this.persistance.write(this.writeQueue, this.cachedFirstBlock, this.lockType > LOCK_TYPES.SHARED);
				this.writeQueue = [];
			}
			this.cachedFirstBlock = null;
		}
	};
	var IndexedDBBackend = class {
		constructor(onFallbackFailure) {
			this.onFallbackFailure = onFallbackFailure;
		}
		createFile(filename) {
			let ops;
			if (typeof SharedArrayBuffer !== "undefined") ops = new FileOps(filename);
			else ops = new FileOpsFallback(filename, this.onFallbackFailure);
			let file = new File$1(filename, ops);
			if (process$1.env.NODE_ENV !== "production" || {}.PERF_BUILD) {
				if (this._files == null) this._files = /* @__PURE__ */ new Set();
				this._files.add(file);
			}
			return file;
		}
		startProfile() {
			for (let file of this._files) if (file.ops.writer) {
				let writer = file.ops.writer;
				let reader = file.ops.reader;
				writer.string("profile-start");
				writer.finalize();
				reader.int32();
				reader.done();
			}
		}
		stopProfile() {
			for (let file of this._files) if (file.ops.writer) {
				let writer = file.ops.writer;
				let reader = file.ops.reader;
				writer.string("profile-stop");
				writer.finalize();
				reader.int32();
				reader.done();
			}
		}
	};
	//#endregion
	//#region ../loot-core/src/platform/server/fs/path-join.ts
	function normalizeStringPosix(path, allowAboveRoot) {
		let res = "";
		let lastSegmentLength = 0;
		let lastSlash = -1;
		let dots = 0;
		let code;
		for (let i = 0; i <= path.length; ++i) {
			if (i < path.length) code = path.charCodeAt(i);
			else if (code === 47) break;
			else code = 47;
			if (code === 47) {
				if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) {
					if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
						if (res.length > 2) {
							const lastSlashIndex = res.lastIndexOf("/");
							if (lastSlashIndex !== res.length - 1) {
								if (lastSlashIndex === -1) {
									res = "";
									lastSegmentLength = 0;
								} else {
									res = res.slice(0, lastSlashIndex);
									lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
								}
								lastSlash = i;
								dots = 0;
								continue;
							}
						} else if (res.length === 2 || res.length === 1) {
							res = "";
							lastSegmentLength = 0;
							lastSlash = i;
							dots = 0;
							continue;
						}
					}
					if (allowAboveRoot) {
						if (res.length > 0) res += "/..";
						else res = "..";
						lastSegmentLength = 2;
					}
				} else {
					if (res.length > 0) res += "/" + path.slice(lastSlash + 1, i);
					else res = path.slice(lastSlash + 1, i);
					lastSegmentLength = i - lastSlash - 1;
				}
				lastSlash = i;
				dots = 0;
			} else if (code === 46 && dots !== -1) ++dots;
			else dots = -1;
		}
		return res;
	}
	function normalizePath(path) {
		if (path.length === 0) return ".";
		const isAbsolute = path.charCodeAt(0) === 47;
		const trailingSeparator = path.charCodeAt(path.length - 1) === 47;
		path = normalizeStringPosix(path, !isAbsolute);
		if (path.length === 0 && !isAbsolute) path = ".";
		if (path.length > 0 && trailingSeparator) path += "/";
		if (isAbsolute) return "/" + path;
		return path;
	}
	var join$1 = (...args) => {
		if (args.length === 0) return ".";
		let joined;
		for (let i = 0; i < args.length; ++i) {
			const arg = args[i];
			if (arg.length > 0) if (joined === void 0) joined = arg;
			else joined += "/" + arg;
		}
		if (joined === void 0) return ".";
		return normalizePath(joined);
	};
	//#endregion
	//#region ../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js
	function getLens(b64) {
		var len = b64.length;
		if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
		var validLen = b64.indexOf("=");
		if (validLen === -1) validLen = len;
		var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
		return [validLen, placeHoldersLen];
	}
	function byteLength(b64) {
		var lens = getLens(b64);
		var validLen = lens[0];
		var placeHoldersLen = lens[1];
		return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
	}
	function _byteLength(b64, validLen, placeHoldersLen) {
		return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
	}
	function toByteArray(b64) {
		var tmp;
		var lens = getLens(b64);
		var validLen = lens[0];
		var placeHoldersLen = lens[1];
		var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
		var curByte = 0;
		var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
		var i;
		for (i = 0; i < len; i += 4) {
			tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
			arr[curByte++] = tmp >> 16 & 255;
			arr[curByte++] = tmp >> 8 & 255;
			arr[curByte++] = tmp & 255;
		}
		if (placeHoldersLen === 2) {
			tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
			arr[curByte++] = tmp & 255;
		}
		if (placeHoldersLen === 1) {
			tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
			arr[curByte++] = tmp >> 8 & 255;
			arr[curByte++] = tmp & 255;
		}
		return arr;
	}
	function tripletToBase64(num) {
		return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
	}
	function encodeChunk(uint8, start, end) {
		var tmp;
		var output = [];
		for (var i = start; i < end; i += 3) {
			tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
			output.push(tripletToBase64(tmp));
		}
		return output.join("");
	}
	function fromByteArray(uint8) {
		var tmp;
		var len = uint8.length;
		var extraBytes = len % 3;
		var parts = [];
		var maxChunkLength = 16383;
		for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
		if (extraBytes === 1) {
			tmp = uint8[len - 1];
			parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");
		} else if (extraBytes === 2) {
			tmp = (uint8[len - 2] << 8) + uint8[len - 1];
			parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
		}
		return parts.join("");
	}
	var buffer, base64Js, lookup, revLookup, Arr, code, i, len, ieee754, Buffer$1;
	var init_dist = __esmMin((() => {
		buffer = {};
		base64Js = {};
		base64Js.byteLength = byteLength;
		base64Js.toByteArray = toByteArray;
		base64Js.fromByteArray = fromByteArray;
		lookup = [];
		revLookup = [];
		Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
		code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
		for (i = 0, len = code.length; i < len; ++i) {
			lookup[i] = code[i];
			revLookup[code.charCodeAt(i)] = i;
		}
		revLookup["-".charCodeAt(0)] = 62;
		revLookup["_".charCodeAt(0)] = 63;
		ieee754 = {};
		/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
		ieee754.read = function(buffer, offset, isLE, mLen, nBytes) {
			var e, m;
			var eLen = nBytes * 8 - mLen - 1;
			var eMax = (1 << eLen) - 1;
			var eBias = eMax >> 1;
			var nBits = -7;
			var i = isLE ? nBytes - 1 : 0;
			var d = isLE ? -1 : 1;
			var s = buffer[offset + i];
			i += d;
			e = s & (1 << -nBits) - 1;
			s >>= -nBits;
			nBits += eLen;
			for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
			m = e & (1 << -nBits) - 1;
			e >>= -nBits;
			nBits += mLen;
			for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
			if (e === 0) e = 1 - eBias;
			else if (e === eMax) return m ? NaN : (s ? -1 : 1) * Infinity;
			else {
				m = m + Math.pow(2, mLen);
				e = e - eBias;
			}
			return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
		};
		ieee754.write = function(buffer, value, offset, isLE, mLen, nBytes) {
			var e, m, c;
			var eLen = nBytes * 8 - mLen - 1;
			var eMax = (1 << eLen) - 1;
			var eBias = eMax >> 1;
			var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
			var i = isLE ? 0 : nBytes - 1;
			var d = isLE ? 1 : -1;
			var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
			value = Math.abs(value);
			if (isNaN(value) || value === Infinity) {
				m = isNaN(value) ? 1 : 0;
				e = eMax;
			} else {
				e = Math.floor(Math.log(value) / Math.LN2);
				if (value * (c = Math.pow(2, -e)) < 1) {
					e--;
					c *= 2;
				}
				if (e + eBias >= 1) value += rt / c;
				else value += rt * Math.pow(2, 1 - eBias);
				if (value * c >= 2) {
					e++;
					c /= 2;
				}
				if (e + eBias >= eMax) {
					m = 0;
					e = eMax;
				} else if (e + eBias >= 1) {
					m = (value * c - 1) * Math.pow(2, mLen);
					e = e + eBias;
				} else {
					m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
					e = 0;
				}
			}
			for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8);
			e = e << mLen | m;
			eLen += mLen;
			for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8);
			buffer[offset + i - d] |= s * 128;
		};
		/*!
		* The buffer module from node.js, for the browser.
		*
		* @author   Feross Aboukhadijeh <https://feross.org>
		* @license  MIT
		*/
		(function(exports) {
			const base64 = base64Js;
			const ieee754$1 = ieee754;
			const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
			exports.Buffer = Buffer;
			exports.SlowBuffer = SlowBuffer;
			exports.INSPECT_MAX_BYTES = 50;
			const K_MAX_LENGTH = 2147483647;
			exports.kMaxLength = K_MAX_LENGTH;
			const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
			/**
			* If `Buffer.TYPED_ARRAY_SUPPORT`:
			*   === true    Use Uint8Array implementation (fastest)
			*   === false   Print warning and recommend using `buffer` v4.x which has an Object
			*               implementation (most compatible, even IE6)
			*
			* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
			* Opera 11.6+, iOS 4.2+.
			*
			* We report that the browser does not support typed arrays if the are not subclassable
			* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
			* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
			* for __proto__ and has a buggy typed array implementation.
			*/
			Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
			if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
			function typedArraySupport() {
				try {
					const arr = new GlobalUint8Array(1);
					const proto = { foo: function() {
						return 42;
					} };
					Object.setPrototypeOf(proto, GlobalUint8Array.prototype);
					Object.setPrototypeOf(arr, proto);
					return arr.foo() === 42;
				} catch (e) {
					return false;
				}
			}
			Object.defineProperty(Buffer.prototype, "parent", {
				enumerable: true,
				get: function() {
					if (!Buffer.isBuffer(this)) return void 0;
					return this.buffer;
				}
			});
			Object.defineProperty(Buffer.prototype, "offset", {
				enumerable: true,
				get: function() {
					if (!Buffer.isBuffer(this)) return void 0;
					return this.byteOffset;
				}
			});
			function createBuffer(length) {
				if (length > K_MAX_LENGTH) throw new RangeError("The value \"" + length + "\" is invalid for option \"size\"");
				const buf = new GlobalUint8Array(length);
				Object.setPrototypeOf(buf, Buffer.prototype);
				return buf;
			}
			/**
			* The Buffer constructor returns instances of `Uint8Array` that have their
			* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
			* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
			* and the `Uint8Array` methods. Square bracket notation works as expected -- it
			* returns a single octet.
			*
			* The `Uint8Array` prototype remains unmodified.
			*/
			function Buffer(arg, encodingOrOffset, length) {
				if (typeof arg === "number") {
					if (typeof encodingOrOffset === "string") throw new TypeError("The \"string\" argument must be of type string. Received type number");
					return allocUnsafe(arg);
				}
				return from(arg, encodingOrOffset, length);
			}
			Buffer.poolSize = 8192;
			function from(value, encodingOrOffset, length) {
				if (typeof value === "string") return fromString(value, encodingOrOffset);
				if (GlobalArrayBuffer.isView(value)) return fromArrayView(value);
				if (value == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
				if (isInstance(value, GlobalArrayBuffer) || value && isInstance(value.buffer, GlobalArrayBuffer)) return fromArrayBuffer(value, encodingOrOffset, length);
				if (typeof GlobalSharedArrayBuffer !== "undefined" && (isInstance(value, GlobalSharedArrayBuffer) || value && isInstance(value.buffer, GlobalSharedArrayBuffer))) return fromArrayBuffer(value, encodingOrOffset, length);
				if (typeof value === "number") throw new TypeError("The \"value\" argument must not be of type number. Received type number");
				const valueOf = value.valueOf && value.valueOf();
				if (valueOf != null && valueOf !== value) return Buffer.from(valueOf, encodingOrOffset, length);
				const b = fromObject(value);
				if (b) return b;
				if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
				throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
			}
			/**
			* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
			* if value is a number.
			* Buffer.from(str[, encoding])
			* Buffer.from(array)
			* Buffer.from(buffer)
			* Buffer.from(arrayBuffer[, byteOffset[, length]])
			**/
			Buffer.from = function(value, encodingOrOffset, length) {
				return from(value, encodingOrOffset, length);
			};
			Object.setPrototypeOf(Buffer.prototype, GlobalUint8Array.prototype);
			Object.setPrototypeOf(Buffer, GlobalUint8Array);
			function assertSize(size) {
				if (typeof size !== "number") throw new TypeError("\"size\" argument must be of type number");
				else if (size < 0) throw new RangeError("The value \"" + size + "\" is invalid for option \"size\"");
			}
			function alloc(size, fill, encoding) {
				assertSize(size);
				if (size <= 0) return createBuffer(size);
				if (fill !== void 0) return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
				return createBuffer(size);
			}
			/**
			* Creates a new filled Buffer instance.
			* alloc(size[, fill[, encoding]])
			**/
			Buffer.alloc = function(size, fill, encoding) {
				return alloc(size, fill, encoding);
			};
			function allocUnsafe(size) {
				assertSize(size);
				return createBuffer(size < 0 ? 0 : checked(size) | 0);
			}
			/**
			* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
			* */
			Buffer.allocUnsafe = function(size) {
				return allocUnsafe(size);
			};
			/**
			* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
			*/
			Buffer.allocUnsafeSlow = function(size) {
				return allocUnsafe(size);
			};
			function fromString(string, encoding) {
				if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
				if (!Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
				const length = byteLength(string, encoding) | 0;
				let buf = createBuffer(length);
				const actual = buf.write(string, encoding);
				if (actual !== length) buf = buf.slice(0, actual);
				return buf;
			}
			function fromArrayLike(array) {
				const length = array.length < 0 ? 0 : checked(array.length) | 0;
				const buf = createBuffer(length);
				for (let i = 0; i < length; i += 1) buf[i] = array[i] & 255;
				return buf;
			}
			function fromArrayView(arrayView) {
				if (isInstance(arrayView, GlobalUint8Array)) {
					const copy = new GlobalUint8Array(arrayView);
					return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
				}
				return fromArrayLike(arrayView);
			}
			function fromArrayBuffer(array, byteOffset, length) {
				if (byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError("\"offset\" is outside of buffer bounds");
				if (array.byteLength < byteOffset + (length || 0)) throw new RangeError("\"length\" is outside of buffer bounds");
				let buf;
				if (byteOffset === void 0 && length === void 0) buf = new GlobalUint8Array(array);
				else if (length === void 0) buf = new GlobalUint8Array(array, byteOffset);
				else buf = new GlobalUint8Array(array, byteOffset, length);
				Object.setPrototypeOf(buf, Buffer.prototype);
				return buf;
			}
			function fromObject(obj) {
				if (Buffer.isBuffer(obj)) {
					const len = checked(obj.length) | 0;
					const buf = createBuffer(len);
					if (buf.length === 0) return buf;
					obj.copy(buf, 0, 0, len);
					return buf;
				}
				if (obj.length !== void 0) {
					if (typeof obj.length !== "number" || numberIsNaN(obj.length)) return createBuffer(0);
					return fromArrayLike(obj);
				}
				if (obj.type === "Buffer" && Array.isArray(obj.data)) return fromArrayLike(obj.data);
			}
			function checked(length) {
				if (length >= K_MAX_LENGTH) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
				return length | 0;
			}
			function SlowBuffer(length) {
				if (+length != length) length = 0;
				return Buffer.alloc(+length);
			}
			Buffer.isBuffer = function isBuffer(b) {
				return b != null && b._isBuffer === true && b !== Buffer.prototype;
			};
			Buffer.compare = function compare(a, b) {
				if (isInstance(a, GlobalUint8Array)) a = Buffer.from(a, a.offset, a.byteLength);
				if (isInstance(b, GlobalUint8Array)) b = Buffer.from(b, b.offset, b.byteLength);
				if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
				if (a === b) return 0;
				let x = a.length;
				let y = b.length;
				for (let i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) {
					x = a[i];
					y = b[i];
					break;
				}
				if (x < y) return -1;
				if (y < x) return 1;
				return 0;
			};
			Buffer.isEncoding = function isEncoding(encoding) {
				switch (String(encoding).toLowerCase()) {
					case "hex":
					case "utf8":
					case "utf-8":
					case "ascii":
					case "latin1":
					case "binary":
					case "base64":
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return true;
					default: return false;
				}
			};
			Buffer.concat = function concat(list, length) {
				if (!Array.isArray(list)) throw new TypeError("\"list\" argument must be an Array of Buffers");
				if (list.length === 0) return Buffer.alloc(0);
				let i;
				if (length === void 0) {
					length = 0;
					for (i = 0; i < list.length; ++i) length += list[i].length;
				}
				const buffer = Buffer.allocUnsafe(length);
				let pos = 0;
				for (i = 0; i < list.length; ++i) {
					let buf = list[i];
					if (isInstance(buf, GlobalUint8Array)) if (pos + buf.length > buffer.length) {
						if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
						buf.copy(buffer, pos);
					} else GlobalUint8Array.prototype.set.call(buffer, buf, pos);
					else if (!Buffer.isBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers");
					else buf.copy(buffer, pos);
					pos += buf.length;
				}
				return buffer;
			};
			function byteLength(string, encoding) {
				if (Buffer.isBuffer(string)) return string.length;
				if (GlobalArrayBuffer.isView(string) || isInstance(string, GlobalArrayBuffer)) return string.byteLength;
				if (typeof string !== "string") throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string);
				const len = string.length;
				const mustMatch = arguments.length > 2 && arguments[2] === true;
				if (!mustMatch && len === 0) return 0;
				let loweredCase = false;
				for (;;) switch (encoding) {
					case "ascii":
					case "latin1":
					case "binary": return len;
					case "utf8":
					case "utf-8": return utf8ToBytes(string).length;
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return len * 2;
					case "hex": return len >>> 1;
					case "base64": return base64ToBytes(string).length;
					default:
						if (loweredCase) return mustMatch ? -1 : utf8ToBytes(string).length;
						encoding = ("" + encoding).toLowerCase();
						loweredCase = true;
				}
			}
			Buffer.byteLength = byteLength;
			function slowToString(encoding, start, end) {
				let loweredCase = false;
				if (start === void 0 || start < 0) start = 0;
				if (start > this.length) return "";
				if (end === void 0 || end > this.length) end = this.length;
				if (end <= 0) return "";
				end >>>= 0;
				start >>>= 0;
				if (end <= start) return "";
				if (!encoding) encoding = "utf8";
				while (true) switch (encoding) {
					case "hex": return hexSlice(this, start, end);
					case "utf8":
					case "utf-8": return utf8Slice(this, start, end);
					case "ascii": return asciiSlice(this, start, end);
					case "latin1":
					case "binary": return latin1Slice(this, start, end);
					case "base64": return base64Slice(this, start, end);
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return utf16leSlice(this, start, end);
					default:
						if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
						encoding = (encoding + "").toLowerCase();
						loweredCase = true;
				}
			}
			Buffer.prototype._isBuffer = true;
			function swap(b, n, m) {
				const i = b[n];
				b[n] = b[m];
				b[m] = i;
			}
			Buffer.prototype.swap16 = function swap16() {
				const len = this.length;
				if (len % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
				for (let i = 0; i < len; i += 2) swap(this, i, i + 1);
				return this;
			};
			Buffer.prototype.swap32 = function swap32() {
				const len = this.length;
				if (len % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
				for (let i = 0; i < len; i += 4) {
					swap(this, i, i + 3);
					swap(this, i + 1, i + 2);
				}
				return this;
			};
			Buffer.prototype.swap64 = function swap64() {
				const len = this.length;
				if (len % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
				for (let i = 0; i < len; i += 8) {
					swap(this, i, i + 7);
					swap(this, i + 1, i + 6);
					swap(this, i + 2, i + 5);
					swap(this, i + 3, i + 4);
				}
				return this;
			};
			Buffer.prototype.toString = function toString() {
				const length = this.length;
				if (length === 0) return "";
				if (arguments.length === 0) return utf8Slice(this, 0, length);
				return slowToString.apply(this, arguments);
			};
			Buffer.prototype.toLocaleString = Buffer.prototype.toString;
			Buffer.prototype.equals = function equals(b) {
				if (!Buffer.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
				if (this === b) return true;
				return Buffer.compare(this, b) === 0;
			};
			Buffer.prototype.inspect = function inspect() {
				let str = "";
				const max = exports.INSPECT_MAX_BYTES;
				str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
				if (this.length > max) str += " ... ";
				return "<Buffer " + str + ">";
			};
			if (customInspectSymbol) Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;
			Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
				if (isInstance(target, GlobalUint8Array)) target = Buffer.from(target, target.offset, target.byteLength);
				if (!Buffer.isBuffer(target)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof target);
				if (start === void 0) start = 0;
				if (end === void 0) end = target ? target.length : 0;
				if (thisStart === void 0) thisStart = 0;
				if (thisEnd === void 0) thisEnd = this.length;
				if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) throw new RangeError("out of range index");
				if (thisStart >= thisEnd && start >= end) return 0;
				if (thisStart >= thisEnd) return -1;
				if (start >= end) return 1;
				start >>>= 0;
				end >>>= 0;
				thisStart >>>= 0;
				thisEnd >>>= 0;
				if (this === target) return 0;
				let x = thisEnd - thisStart;
				let y = end - start;
				const len = Math.min(x, y);
				const thisCopy = this.slice(thisStart, thisEnd);
				const targetCopy = target.slice(start, end);
				for (let i = 0; i < len; ++i) if (thisCopy[i] !== targetCopy[i]) {
					x = thisCopy[i];
					y = targetCopy[i];
					break;
				}
				if (x < y) return -1;
				if (y < x) return 1;
				return 0;
			};
			function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
				if (buffer.length === 0) return -1;
				if (typeof byteOffset === "string") {
					encoding = byteOffset;
					byteOffset = 0;
				} else if (byteOffset > 2147483647) byteOffset = 2147483647;
				else if (byteOffset < -2147483648) byteOffset = -2147483648;
				byteOffset = +byteOffset;
				if (numberIsNaN(byteOffset)) byteOffset = dir ? 0 : buffer.length - 1;
				if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
				if (byteOffset >= buffer.length) if (dir) return -1;
				else byteOffset = buffer.length - 1;
				else if (byteOffset < 0) if (dir) byteOffset = 0;
				else return -1;
				if (typeof val === "string") val = Buffer.from(val, encoding);
				if (Buffer.isBuffer(val)) {
					if (val.length === 0) return -1;
					return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
				} else if (typeof val === "number") {
					val = val & 255;
					if (typeof GlobalUint8Array.prototype.indexOf === "function") if (dir) return GlobalUint8Array.prototype.indexOf.call(buffer, val, byteOffset);
					else return GlobalUint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
					return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
				}
				throw new TypeError("val must be string, number or Buffer");
			}
			function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
				let indexSize = 1;
				let arrLength = arr.length;
				let valLength = val.length;
				if (encoding !== void 0) {
					encoding = String(encoding).toLowerCase();
					if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
						if (arr.length < 2 || val.length < 2) return -1;
						indexSize = 2;
						arrLength /= 2;
						valLength /= 2;
						byteOffset /= 2;
					}
				}
				function read(buf, i) {
					if (indexSize === 1) return buf[i];
					else return buf.readUInt16BE(i * indexSize);
				}
				let i;
				if (dir) {
					let foundIndex = -1;
					for (i = byteOffset; i < arrLength; i++) if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
						if (foundIndex === -1) foundIndex = i;
						if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
					} else {
						if (foundIndex !== -1) i -= i - foundIndex;
						foundIndex = -1;
					}
				} else {
					if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
					for (i = byteOffset; i >= 0; i--) {
						let found = true;
						for (let j = 0; j < valLength; j++) if (read(arr, i + j) !== read(val, j)) {
							found = false;
							break;
						}
						if (found) return i;
					}
				}
				return -1;
			}
			Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
				return this.indexOf(val, byteOffset, encoding) !== -1;
			};
			Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
				return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
			};
			Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
				return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
			};
			function hexWrite(buf, string, offset, length) {
				offset = Number(offset) || 0;
				const remaining = buf.length - offset;
				if (!length) length = remaining;
				else {
					length = Number(length);
					if (length > remaining) length = remaining;
				}
				const strLen = string.length;
				if (length > strLen / 2) length = strLen / 2;
				let i;
				for (i = 0; i < length; ++i) {
					const parsed = parseInt(string.substr(i * 2, 2), 16);
					if (numberIsNaN(parsed)) return i;
					buf[offset + i] = parsed;
				}
				return i;
			}
			function utf8Write(buf, string, offset, length) {
				return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
			}
			function asciiWrite(buf, string, offset, length) {
				return blitBuffer(asciiToBytes(string), buf, offset, length);
			}
			function base64Write(buf, string, offset, length) {
				return blitBuffer(base64ToBytes(string), buf, offset, length);
			}
			function ucs2Write(buf, string, offset, length) {
				return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
			}
			Buffer.prototype.write = function write(string, offset, length, encoding) {
				if (offset === void 0) {
					encoding = "utf8";
					length = this.length;
					offset = 0;
				} else if (length === void 0 && typeof offset === "string") {
					encoding = offset;
					length = this.length;
					offset = 0;
				} else if (isFinite(offset)) {
					offset = offset >>> 0;
					if (isFinite(length)) {
						length = length >>> 0;
						if (encoding === void 0) encoding = "utf8";
					} else {
						encoding = length;
						length = void 0;
					}
				} else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
				const remaining = this.length - offset;
				if (length === void 0 || length > remaining) length = remaining;
				if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds");
				if (!encoding) encoding = "utf8";
				let loweredCase = false;
				for (;;) switch (encoding) {
					case "hex": return hexWrite(this, string, offset, length);
					case "utf8":
					case "utf-8": return utf8Write(this, string, offset, length);
					case "ascii":
					case "latin1":
					case "binary": return asciiWrite(this, string, offset, length);
					case "base64": return base64Write(this, string, offset, length);
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return ucs2Write(this, string, offset, length);
					default:
						if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
						encoding = ("" + encoding).toLowerCase();
						loweredCase = true;
				}
			};
			Buffer.prototype.toJSON = function toJSON() {
				return {
					type: "Buffer",
					data: Array.prototype.slice.call(this._arr || this, 0)
				};
			};
			function base64Slice(buf, start, end) {
				if (start === 0 && end === buf.length) return base64.fromByteArray(buf);
				else return base64.fromByteArray(buf.slice(start, end));
			}
			function utf8Slice(buf, start, end) {
				end = Math.min(buf.length, end);
				const res = [];
				let i = start;
				while (i < end) {
					const firstByte = buf[i];
					let codePoint = null;
					let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
					if (i + bytesPerSequence <= end) {
						let secondByte, thirdByte, fourthByte, tempCodePoint;
						switch (bytesPerSequence) {
							case 1:
								if (firstByte < 128) codePoint = firstByte;
								break;
							case 2:
								secondByte = buf[i + 1];
								if ((secondByte & 192) === 128) {
									tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
									if (tempCodePoint > 127) codePoint = tempCodePoint;
								}
								break;
							case 3:
								secondByte = buf[i + 1];
								thirdByte = buf[i + 2];
								if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
									tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
									if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint = tempCodePoint;
								}
								break;
							case 4:
								secondByte = buf[i + 1];
								thirdByte = buf[i + 2];
								fourthByte = buf[i + 3];
								if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
									tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
									if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint = tempCodePoint;
								}
						}
					}
					if (codePoint === null) {
						codePoint = 65533;
						bytesPerSequence = 1;
					} else if (codePoint > 65535) {
						codePoint -= 65536;
						res.push(codePoint >>> 10 & 1023 | 55296);
						codePoint = 56320 | codePoint & 1023;
					}
					res.push(codePoint);
					i += bytesPerSequence;
				}
				return decodeCodePointsArray(res);
			}
			const MAX_ARGUMENTS_LENGTH = 4096;
			function decodeCodePointsArray(codePoints) {
				const len = codePoints.length;
				if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints);
				let res = "";
				let i = 0;
				while (i < len) res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
				return res;
			}
			function asciiSlice(buf, start, end) {
				let ret = "";
				end = Math.min(buf.length, end);
				for (let i = start; i < end; ++i) ret += String.fromCharCode(buf[i] & 127);
				return ret;
			}
			function latin1Slice(buf, start, end) {
				let ret = "";
				end = Math.min(buf.length, end);
				for (let i = start; i < end; ++i) ret += String.fromCharCode(buf[i]);
				return ret;
			}
			function hexSlice(buf, start, end) {
				const len = buf.length;
				if (!start || start < 0) start = 0;
				if (!end || end < 0 || end > len) end = len;
				let out = "";
				for (let i = start; i < end; ++i) out += hexSliceLookupTable[buf[i]];
				return out;
			}
			function utf16leSlice(buf, start, end) {
				const bytes = buf.slice(start, end);
				let res = "";
				for (let i = 0; i < bytes.length - 1; i += 2) res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
				return res;
			}
			Buffer.prototype.slice = function slice(start, end) {
				const len = this.length;
				start = ~~start;
				end = end === void 0 ? len : ~~end;
				if (start < 0) {
					start += len;
					if (start < 0) start = 0;
				} else if (start > len) start = len;
				if (end < 0) {
					end += len;
					if (end < 0) end = 0;
				} else if (end > len) end = len;
				if (end < start) end = start;
				const newBuf = this.subarray(start, end);
				Object.setPrototypeOf(newBuf, Buffer.prototype);
				return newBuf;
			};
			function checkOffset(offset, ext, length) {
				if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
				if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
			}
			Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let val = this[offset];
				let mul = 1;
				let i = 0;
				while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
				return val;
			};
			Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let val = this[offset + --byteLength];
				let mul = 1;
				while (byteLength > 0 && (mul *= 256)) val += this[offset + --byteLength] * mul;
				return val;
			};
			Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 1, this.length);
				return this[offset];
			};
			Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				return this[offset] | this[offset + 1] << 8;
			};
			Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				return this[offset] << 8 | this[offset + 1];
			};
			Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
			};
			Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
			};
			Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
				const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
				return BigInt(lo) + (BigInt(hi) << BigInt(32));
			});
			Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
				const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
				return (BigInt(hi) << BigInt(32)) + BigInt(lo);
			});
			Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let val = this[offset];
				let mul = 1;
				let i = 0;
				while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
				mul *= 128;
				if (val >= mul) val -= Math.pow(2, 8 * byteLength);
				return val;
			};
			Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let i = byteLength;
				let mul = 1;
				let val = this[offset + --i];
				while (i > 0 && (mul *= 256)) val += this[offset + --i] * mul;
				mul *= 128;
				if (val >= mul) val -= Math.pow(2, 8 * byteLength);
				return val;
			};
			Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 1, this.length);
				if (!(this[offset] & 128)) return this[offset];
				return (255 - this[offset] + 1) * -1;
			};
			Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				const val = this[offset] | this[offset + 1] << 8;
				return val & 32768 ? val | 4294901760 : val;
			};
			Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				const val = this[offset + 1] | this[offset] << 8;
				return val & 32768 ? val | 4294901760 : val;
			};
			Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
			};
			Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
			};
			Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
				return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
			});
			Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
				return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
			});
			Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return ieee754$1.read(this, offset, true, 23, 4);
			};
			Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return ieee754$1.read(this, offset, false, 23, 4);
			};
			Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 8, this.length);
				return ieee754$1.read(this, offset, true, 52, 8);
			};
			Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 8, this.length);
				return ieee754$1.read(this, offset, false, 52, 8);
			};
			function checkInt(buf, value, offset, ext, max, min) {
				if (!Buffer.isBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
				if (value > max || value < min) throw new RangeError("\"value\" argument is out of bounds");
				if (offset + ext > buf.length) throw new RangeError("Index out of range");
			}
			Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) {
					const maxBytes = Math.pow(2, 8 * byteLength) - 1;
					checkInt(this, value, offset, byteLength, maxBytes, 0);
				}
				let mul = 1;
				let i = 0;
				this[offset] = value & 255;
				while (++i < byteLength && (mul *= 256)) this[offset + i] = value / mul & 255;
				return offset + byteLength;
			};
			Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) {
					const maxBytes = Math.pow(2, 8 * byteLength) - 1;
					checkInt(this, value, offset, byteLength, maxBytes, 0);
				}
				let i = byteLength - 1;
				let mul = 1;
				this[offset + i] = value & 255;
				while (--i >= 0 && (mul *= 256)) this[offset + i] = value / mul & 255;
				return offset + byteLength;
			};
			Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
				this[offset] = value & 255;
				return offset + 1;
			};
			Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
				this[offset] = value & 255;
				this[offset + 1] = value >>> 8;
				return offset + 2;
			};
			Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
				this[offset] = value >>> 8;
				this[offset + 1] = value & 255;
				return offset + 2;
			};
			Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
				this[offset + 3] = value >>> 24;
				this[offset + 2] = value >>> 16;
				this[offset + 1] = value >>> 8;
				this[offset] = value & 255;
				return offset + 4;
			};
			Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
				this[offset] = value >>> 24;
				this[offset + 1] = value >>> 16;
				this[offset + 2] = value >>> 8;
				this[offset + 3] = value & 255;
				return offset + 4;
			};
			function wrtBigUInt64LE(buf, value, offset, min, max) {
				checkIntBI(value, min, max, buf, offset, 7);
				let lo = Number(value & BigInt(4294967295));
				buf[offset++] = lo;
				lo = lo >> 8;
				buf[offset++] = lo;
				lo = lo >> 8;
				buf[offset++] = lo;
				lo = lo >> 8;
				buf[offset++] = lo;
				let hi = Number(value >> BigInt(32) & BigInt(4294967295));
				buf[offset++] = hi;
				hi = hi >> 8;
				buf[offset++] = hi;
				hi = hi >> 8;
				buf[offset++] = hi;
				hi = hi >> 8;
				buf[offset++] = hi;
				return offset;
			}
			function wrtBigUInt64BE(buf, value, offset, min, max) {
				checkIntBI(value, min, max, buf, offset, 7);
				let lo = Number(value & BigInt(4294967295));
				buf[offset + 7] = lo;
				lo = lo >> 8;
				buf[offset + 6] = lo;
				lo = lo >> 8;
				buf[offset + 5] = lo;
				lo = lo >> 8;
				buf[offset + 4] = lo;
				let hi = Number(value >> BigInt(32) & BigInt(4294967295));
				buf[offset + 3] = hi;
				hi = hi >> 8;
				buf[offset + 2] = hi;
				hi = hi >> 8;
				buf[offset + 1] = hi;
				hi = hi >> 8;
				buf[offset] = hi;
				return offset + 8;
			}
			Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {
				return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
			});
			Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {
				return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
			});
			Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) {
					const limit = Math.pow(2, 8 * byteLength - 1);
					checkInt(this, value, offset, byteLength, limit - 1, -limit);
				}
				let i = 0;
				let mul = 1;
				let sub = 0;
				this[offset] = value & 255;
				while (++i < byteLength && (mul *= 256)) {
					if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) sub = 1;
					this[offset + i] = (value / mul >> 0) - sub & 255;
				}
				return offset + byteLength;
			};
			Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) {
					const limit = Math.pow(2, 8 * byteLength - 1);
					checkInt(this, value, offset, byteLength, limit - 1, -limit);
				}
				let i = byteLength - 1;
				let mul = 1;
				let sub = 0;
				this[offset + i] = value & 255;
				while (--i >= 0 && (mul *= 256)) {
					if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) sub = 1;
					this[offset + i] = (value / mul >> 0) - sub & 255;
				}
				return offset + byteLength;
			};
			Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
				if (value < 0) value = 255 + value + 1;
				this[offset] = value & 255;
				return offset + 1;
			};
			Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
				this[offset] = value & 255;
				this[offset + 1] = value >>> 8;
				return offset + 2;
			};
			Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
				this[offset] = value >>> 8;
				this[offset + 1] = value & 255;
				return offset + 2;
			};
			Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
				this[offset] = value & 255;
				this[offset + 1] = value >>> 8;
				this[offset + 2] = value >>> 16;
				this[offset + 3] = value >>> 24;
				return offset + 4;
			};
			Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
				if (value < 0) value = 4294967295 + value + 1;
				this[offset] = value >>> 24;
				this[offset + 1] = value >>> 16;
				this[offset + 2] = value >>> 8;
				this[offset + 3] = value & 255;
				return offset + 4;
			};
			Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {
				return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
			});
			Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {
				return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
			});
			function checkIEEE754(buf, value, offset, ext, max, min) {
				if (offset + ext > buf.length) throw new RangeError("Index out of range");
				if (offset < 0) throw new RangeError("Index out of range");
			}
			function writeFloat(buf, value, offset, littleEndian, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkIEEE754(buf, value, offset, 4);
				ieee754$1.write(buf, value, offset, littleEndian, 23, 4);
				return offset + 4;
			}
			Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
				return writeFloat(this, value, offset, true, noAssert);
			};
			Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
				return writeFloat(this, value, offset, false, noAssert);
			};
			function writeDouble(buf, value, offset, littleEndian, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkIEEE754(buf, value, offset, 8);
				ieee754$1.write(buf, value, offset, littleEndian, 52, 8);
				return offset + 8;
			}
			Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
				return writeDouble(this, value, offset, true, noAssert);
			};
			Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
				return writeDouble(this, value, offset, false, noAssert);
			};
			Buffer.prototype.copy = function copy(target, targetStart, start, end) {
				if (!Buffer.isBuffer(target)) throw new TypeError("argument should be a Buffer");
				if (!start) start = 0;
				if (!end && end !== 0) end = this.length;
				if (targetStart >= target.length) targetStart = target.length;
				if (!targetStart) targetStart = 0;
				if (end > 0 && end < start) end = start;
				if (end === start) return 0;
				if (target.length === 0 || this.length === 0) return 0;
				if (targetStart < 0) throw new RangeError("targetStart out of bounds");
				if (start < 0 || start >= this.length) throw new RangeError("Index out of range");
				if (end < 0) throw new RangeError("sourceEnd out of bounds");
				if (end > this.length) end = this.length;
				if (target.length - targetStart < end - start) end = target.length - targetStart + start;
				const len = end - start;
				if (this === target && typeof GlobalUint8Array.prototype.copyWithin === "function") this.copyWithin(targetStart, start, end);
				else GlobalUint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);
				return len;
			};
			Buffer.prototype.fill = function fill(val, start, end, encoding) {
				if (typeof val === "string") {
					if (typeof start === "string") {
						encoding = start;
						start = 0;
						end = this.length;
					} else if (typeof end === "string") {
						encoding = end;
						end = this.length;
					}
					if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string");
					if (typeof encoding === "string" && !Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
					if (val.length === 1) {
						const code = val.charCodeAt(0);
						if (encoding === "utf8" && code < 128 || encoding === "latin1") val = code;
					}
				} else if (typeof val === "number") val = val & 255;
				else if (typeof val === "boolean") val = Number(val);
				if (start < 0 || this.length < start || this.length < end) throw new RangeError("Out of range index");
				if (end <= start) return this;
				start = start >>> 0;
				end = end === void 0 ? this.length : end >>> 0;
				if (!val) val = 0;
				let i;
				if (typeof val === "number") for (i = start; i < end; ++i) this[i] = val;
				else {
					const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);
					const len = bytes.length;
					if (len === 0) throw new TypeError("The value \"" + val + "\" is invalid for argument \"value\"");
					for (i = 0; i < end - start; ++i) this[i + start] = bytes[i % len];
				}
				return this;
			};
			const errors = {};
			function E(sym, getMessage, Base) {
				errors[sym] = class NodeError extends Base {
					constructor() {
						super();
						Object.defineProperty(this, "message", {
							value: getMessage.apply(this, arguments),
							writable: true,
							configurable: true
						});
						this.name = `${this.name} [${sym}]`;
						this.stack;
						delete this.name;
					}
					get code() {
						return sym;
					}
					set code(value) {
						Object.defineProperty(this, "code", {
							configurable: true,
							enumerable: true,
							value,
							writable: true
						});
					}
					toString() {
						return `${this.name} [${sym}]: ${this.message}`;
					}
				};
			}
			E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) {
				if (name) return `${name} is outside of buffer bounds`;
				return "Attempt to access memory outside buffer bounds";
			}, RangeError);
			E("ERR_INVALID_ARG_TYPE", function(name, actual) {
				return `The "${name}" argument must be of type number. Received type ${typeof actual}`;
			}, TypeError);
			E("ERR_OUT_OF_RANGE", function(str, range, input) {
				let msg = `The value of "${str}" is out of range.`;
				let received = input;
				if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) received = addNumericalSeparator(String(input));
				else if (typeof input === "bigint") {
					received = String(input);
					if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) received = addNumericalSeparator(received);
					received += "n";
				}
				msg += ` It must be ${range}. Received ${received}`;
				return msg;
			}, RangeError);
			function addNumericalSeparator(val) {
				let res = "";
				let i = val.length;
				const start = val[0] === "-" ? 1 : 0;
				for (; i >= start + 4; i -= 3) res = `_${val.slice(i - 3, i)}${res}`;
				return `${val.slice(0, i)}${res}`;
			}
			function checkBounds(buf, offset, byteLength) {
				validateNumber(offset, "offset");
				if (buf[offset] === void 0 || buf[offset + byteLength] === void 0) boundsError(offset, buf.length - (byteLength + 1));
			}
			function checkIntBI(value, min, max, buf, offset, byteLength) {
				if (value > max || value < min) {
					const n = typeof min === "bigint" ? "n" : "";
					let range;
					if (byteLength > 3) if (min === 0 || min === BigInt(0)) range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`;
					else range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength + 1) * 8 - 1}${n}`;
					else range = `>= ${min}${n} and <= ${max}${n}`;
					throw new errors.ERR_OUT_OF_RANGE("value", range, value);
				}
				checkBounds(buf, offset, byteLength);
			}
			function validateNumber(value, name) {
				if (typeof value !== "number") throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
			}
			function boundsError(value, length, type) {
				if (Math.floor(value) !== value) {
					validateNumber(value, type);
					throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);
				}
				if (length < 0) throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
				throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length}`, value);
			}
			const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
			function base64clean(str) {
				str = str.split("=")[0];
				str = str.trim().replace(INVALID_BASE64_RE, "");
				if (str.length < 2) return "";
				while (str.length % 4 !== 0) str = str + "=";
				return str;
			}
			function utf8ToBytes(string, units) {
				units = units || Infinity;
				let codePoint;
				const length = string.length;
				let leadSurrogate = null;
				const bytes = [];
				for (let i = 0; i < length; ++i) {
					codePoint = string.charCodeAt(i);
					if (codePoint > 55295 && codePoint < 57344) {
						if (!leadSurrogate) {
							if (codePoint > 56319) {
								if ((units -= 3) > -1) bytes.push(239, 191, 189);
								continue;
							} else if (i + 1 === length) {
								if ((units -= 3) > -1) bytes.push(239, 191, 189);
								continue;
							}
							leadSurrogate = codePoint;
							continue;
						}
						if (codePoint < 56320) {
							if ((units -= 3) > -1) bytes.push(239, 191, 189);
							leadSurrogate = codePoint;
							continue;
						}
						codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
					} else if (leadSurrogate) {
						if ((units -= 3) > -1) bytes.push(239, 191, 189);
					}
					leadSurrogate = null;
					if (codePoint < 128) {
						if ((units -= 1) < 0) break;
						bytes.push(codePoint);
					} else if (codePoint < 2048) {
						if ((units -= 2) < 0) break;
						bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);
					} else if (codePoint < 65536) {
						if ((units -= 3) < 0) break;
						bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
					} else if (codePoint < 1114112) {
						if ((units -= 4) < 0) break;
						bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
					} else throw new Error("Invalid code point");
				}
				return bytes;
			}
			function asciiToBytes(str) {
				const byteArray = [];
				for (let i = 0; i < str.length; ++i) byteArray.push(str.charCodeAt(i) & 255);
				return byteArray;
			}
			function utf16leToBytes(str, units) {
				let c, hi, lo;
				const byteArray = [];
				for (let i = 0; i < str.length; ++i) {
					if ((units -= 2) < 0) break;
					c = str.charCodeAt(i);
					hi = c >> 8;
					lo = c % 256;
					byteArray.push(lo);
					byteArray.push(hi);
				}
				return byteArray;
			}
			function base64ToBytes(str) {
				return base64.toByteArray(base64clean(str));
			}
			function blitBuffer(src, dst, offset, length) {
				let i;
				for (i = 0; i < length; ++i) {
					if (i + offset >= dst.length || i >= src.length) break;
					dst[i + offset] = src[i];
				}
				return i;
			}
			function isInstance(obj, type) {
				return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
			}
			function numberIsNaN(obj) {
				return obj !== obj;
			}
			const hexSliceLookupTable = (function() {
				const alphabet = "0123456789abcdef";
				const table = new Array(256);
				for (let i = 0; i < 16; ++i) {
					const i16 = i * 16;
					for (let j = 0; j < 16; ++j) table[i16 + j] = alphabet[i] + alphabet[j];
				}
				return table;
			})();
			function defineBigIntMethod(fn) {
				return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
			}
			function BufferBigIntNotDefined() {
				throw new Error("BigInt not supported");
			}
		})(buffer);
		Buffer$1 = buffer.Buffer;
		buffer.Blob;
		buffer.BlobOptions;
		buffer.Buffer;
		buffer.File;
		buffer.FileOptions;
		buffer.INSPECT_MAX_BYTES;
		buffer.SlowBuffer;
		buffer.TranscodeEncoding;
		buffer.atob;
		buffer.btoa;
		buffer.constants;
		buffer.isAscii;
		buffer.isUtf8;
		buffer.kMaxLength;
		buffer.kStringMaxLength;
		buffer.resolveObjectURL;
		buffer.transcode;
	}));
	//#endregion
	//#region ../../node_modules/path-browserify/index.js
	var require_path_browserify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		function assertPath(path) {
			if (typeof path !== "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
		}
		function normalizeStringPosix(path, allowAboveRoot) {
			var res = "";
			var lastSegmentLength = 0;
			var lastSlash = -1;
			var dots = 0;
			var code;
			for (var i = 0; i <= path.length; ++i) {
				if (i < path.length) code = path.charCodeAt(i);
				else if (code === 47) break;
				else code = 47;
				if (code === 47) {
					if (lastSlash === i - 1 || dots === 1) {} else if (lastSlash !== i - 1 && dots === 2) {
						if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
							if (res.length > 2) {
								var lastSlashIndex = res.lastIndexOf("/");
								if (lastSlashIndex !== res.length - 1) {
									if (lastSlashIndex === -1) {
										res = "";
										lastSegmentLength = 0;
									} else {
										res = res.slice(0, lastSlashIndex);
										lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
									}
									lastSlash = i;
									dots = 0;
									continue;
								}
							} else if (res.length === 2 || res.length === 1) {
								res = "";
								lastSegmentLength = 0;
								lastSlash = i;
								dots = 0;
								continue;
							}
						}
						if (allowAboveRoot) {
							if (res.length > 0) res += "/..";
							else res = "..";
							lastSegmentLength = 2;
						}
					} else {
						if (res.length > 0) res += "/" + path.slice(lastSlash + 1, i);
						else res = path.slice(lastSlash + 1, i);
						lastSegmentLength = i - lastSlash - 1;
					}
					lastSlash = i;
					dots = 0;
				} else if (code === 46 && dots !== -1) ++dots;
				else dots = -1;
			}
			return res;
		}
		function _format(sep, pathObject) {
			var dir = pathObject.dir || pathObject.root;
			var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
			if (!dir) return base;
			if (dir === pathObject.root) return dir + base;
			return dir + sep + base;
		}
		var posix = {
			resolve: function resolve() {
				var resolvedPath = "";
				var resolvedAbsolute = false;
				var cwd;
				for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
					var path;
					if (i >= 0) path = arguments[i];
					else {
						if (cwd === void 0) cwd = process$1.cwd();
						path = cwd;
					}
					assertPath(path);
					if (path.length === 0) continue;
					resolvedPath = path + "/" + resolvedPath;
					resolvedAbsolute = path.charCodeAt(0) === 47;
				}
				resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
				if (resolvedAbsolute) if (resolvedPath.length > 0) return "/" + resolvedPath;
				else return "/";
				else if (resolvedPath.length > 0) return resolvedPath;
				else return ".";
			},
			normalize: function normalize(path) {
				assertPath(path);
				if (path.length === 0) return ".";
				var isAbsolute = path.charCodeAt(0) === 47;
				var trailingSeparator = path.charCodeAt(path.length - 1) === 47;
				path = normalizeStringPosix(path, !isAbsolute);
				if (path.length === 0 && !isAbsolute) path = ".";
				if (path.length > 0 && trailingSeparator) path += "/";
				if (isAbsolute) return "/" + path;
				return path;
			},
			isAbsolute: function isAbsolute(path) {
				assertPath(path);
				return path.length > 0 && path.charCodeAt(0) === 47;
			},
			join: function join() {
				if (arguments.length === 0) return ".";
				var joined;
				for (var i = 0; i < arguments.length; ++i) {
					var arg = arguments[i];
					assertPath(arg);
					if (arg.length > 0) if (joined === void 0) joined = arg;
					else joined += "/" + arg;
				}
				if (joined === void 0) return ".";
				return posix.normalize(joined);
			},
			relative: function relative(from, to) {
				assertPath(from);
				assertPath(to);
				if (from === to) return "";
				from = posix.resolve(from);
				to = posix.resolve(to);
				if (from === to) return "";
				var fromStart = 1;
				for (; fromStart < from.length; ++fromStart) if (from.charCodeAt(fromStart) !== 47) break;
				var fromEnd = from.length;
				var fromLen = fromEnd - fromStart;
				var toStart = 1;
				for (; toStart < to.length; ++toStart) if (to.charCodeAt(toStart) !== 47) break;
				var toLen = to.length - toStart;
				var length = fromLen < toLen ? fromLen : toLen;
				var lastCommonSep = -1;
				var i = 0;
				for (; i <= length; ++i) {
					if (i === length) {
						if (toLen > length) {
							if (to.charCodeAt(toStart + i) === 47) return to.slice(toStart + i + 1);
							else if (i === 0) return to.slice(toStart + i);
						} else if (fromLen > length) {
							if (from.charCodeAt(fromStart + i) === 47) lastCommonSep = i;
							else if (i === 0) lastCommonSep = 0;
						}
						break;
					}
					var fromCode = from.charCodeAt(fromStart + i);
					if (fromCode !== to.charCodeAt(toStart + i)) break;
					else if (fromCode === 47) lastCommonSep = i;
				}
				var out = "";
				for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) if (i === fromEnd || from.charCodeAt(i) === 47) if (out.length === 0) out += "..";
				else out += "/..";
				if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
				else {
					toStart += lastCommonSep;
					if (to.charCodeAt(toStart) === 47) ++toStart;
					return to.slice(toStart);
				}
			},
			_makeLong: function _makeLong(path) {
				return path;
			},
			dirname: function dirname(path) {
				assertPath(path);
				if (path.length === 0) return ".";
				var code = path.charCodeAt(0);
				var hasRoot = code === 47;
				var end = -1;
				var matchedSlash = true;
				for (var i = path.length - 1; i >= 1; --i) {
					code = path.charCodeAt(i);
					if (code === 47) {
						if (!matchedSlash) {
							end = i;
							break;
						}
					} else matchedSlash = false;
				}
				if (end === -1) return hasRoot ? "/" : ".";
				if (hasRoot && end === 1) return "//";
				return path.slice(0, end);
			},
			basename: function basename(path, ext) {
				if (ext !== void 0 && typeof ext !== "string") throw new TypeError("\"ext\" argument must be a string");
				assertPath(path);
				var start = 0;
				var end = -1;
				var matchedSlash = true;
				var i;
				if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
					if (ext.length === path.length && ext === path) return "";
					var extIdx = ext.length - 1;
					var firstNonSlashEnd = -1;
					for (i = path.length - 1; i >= 0; --i) {
						var code = path.charCodeAt(i);
						if (code === 47) {
							if (!matchedSlash) {
								start = i + 1;
								break;
							}
						} else {
							if (firstNonSlashEnd === -1) {
								matchedSlash = false;
								firstNonSlashEnd = i + 1;
							}
							if (extIdx >= 0) if (code === ext.charCodeAt(extIdx)) {
								if (--extIdx === -1) end = i;
							} else {
								extIdx = -1;
								end = firstNonSlashEnd;
							}
						}
					}
					if (start === end) end = firstNonSlashEnd;
					else if (end === -1) end = path.length;
					return path.slice(start, end);
				} else {
					for (i = path.length - 1; i >= 0; --i) if (path.charCodeAt(i) === 47) {
						if (!matchedSlash) {
							start = i + 1;
							break;
						}
					} else if (end === -1) {
						matchedSlash = false;
						end = i + 1;
					}
					if (end === -1) return "";
					return path.slice(start, end);
				}
			},
			extname: function extname(path) {
				assertPath(path);
				var startDot = -1;
				var startPart = 0;
				var end = -1;
				var matchedSlash = true;
				var preDotState = 0;
				for (var i = path.length - 1; i >= 0; --i) {
					var code = path.charCodeAt(i);
					if (code === 47) {
						if (!matchedSlash) {
							startPart = i + 1;
							break;
						}
						continue;
					}
					if (end === -1) {
						matchedSlash = false;
						end = i + 1;
					}
					if (code === 46) {
						if (startDot === -1) startDot = i;
						else if (preDotState !== 1) preDotState = 1;
					} else if (startDot !== -1) preDotState = -1;
				}
				if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) return "";
				return path.slice(startDot, end);
			},
			format: function format(pathObject) {
				if (pathObject === null || typeof pathObject !== "object") throw new TypeError("The \"pathObject\" argument must be of type Object. Received type " + typeof pathObject);
				return _format("/", pathObject);
			},
			parse: function parse(path) {
				assertPath(path);
				var ret = {
					root: "",
					dir: "",
					base: "",
					ext: "",
					name: ""
				};
				if (path.length === 0) return ret;
				var code = path.charCodeAt(0);
				var isAbsolute = code === 47;
				var start;
				if (isAbsolute) {
					ret.root = "/";
					start = 1;
				} else start = 0;
				var startDot = -1;
				var startPart = 0;
				var end = -1;
				var matchedSlash = true;
				var i = path.length - 1;
				var preDotState = 0;
				for (; i >= start; --i) {
					code = path.charCodeAt(i);
					if (code === 47) {
						if (!matchedSlash) {
							startPart = i + 1;
							break;
						}
						continue;
					}
					if (end === -1) {
						matchedSlash = false;
						end = i + 1;
					}
					if (code === 46) {
						if (startDot === -1) startDot = i;
						else if (preDotState !== 1) preDotState = 1;
					} else if (startDot !== -1) preDotState = -1;
				}
				if (startDot === -1 || end === -1 || preDotState === 0 || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
					if (end !== -1) if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);
					else ret.base = ret.name = path.slice(startPart, end);
				} else {
					if (startPart === 0 && isAbsolute) {
						ret.name = path.slice(1, startDot);
						ret.base = path.slice(1, end);
					} else {
						ret.name = path.slice(startPart, startDot);
						ret.base = path.slice(startPart, end);
					}
					ret.ext = path.slice(startDot, end);
				}
				if (startPart > 0) ret.dir = path.slice(0, startPart - 1);
				else if (isAbsolute) ret.dir = "/";
				return ret;
			},
			sep: "/",
			delimiter: ":",
			win32: null,
			posix: null
		};
		posix.posix = posix;
		module.exports = posix;
	}));
	//#endregion
	//#region ../../node_modules/node-stdlib-browser/esm/mock/empty.js
	var empty_exports = /* @__PURE__ */ __exportAll({ default: () => null });
	var init_empty = __esmMin((() => {}));
	//#endregion
	//#region ../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.cjs
	var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
		Object.defineProperties(exports, {
			__esModule: { value: true },
			[Symbol.toStringTag]: { value: "Module" }
		});
		var buffer = {};
		var base64Js = {};
		base64Js.byteLength = byteLength;
		base64Js.toByteArray = toByteArray;
		base64Js.fromByteArray = fromByteArray;
		var lookup = [];
		var revLookup = [];
		var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
		var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
		for (var i = 0, len = code.length; i < len; ++i) {
			lookup[i] = code[i];
			revLookup[code.charCodeAt(i)] = i;
		}
		revLookup["-".charCodeAt(0)] = 62;
		revLookup["_".charCodeAt(0)] = 63;
		function getLens(b64) {
			var len = b64.length;
			if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
			var validLen = b64.indexOf("=");
			if (validLen === -1) validLen = len;
			var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
			return [validLen, placeHoldersLen];
		}
		function byteLength(b64) {
			var lens = getLens(b64);
			var validLen = lens[0];
			var placeHoldersLen = lens[1];
			return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
		}
		function _byteLength(b64, validLen, placeHoldersLen) {
			return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
		}
		function toByteArray(b64) {
			var tmp;
			var lens = getLens(b64);
			var validLen = lens[0];
			var placeHoldersLen = lens[1];
			var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
			var curByte = 0;
			var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
			var i;
			for (i = 0; i < len; i += 4) {
				tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
				arr[curByte++] = tmp >> 16 & 255;
				arr[curByte++] = tmp >> 8 & 255;
				arr[curByte++] = tmp & 255;
			}
			if (placeHoldersLen === 2) {
				tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
				arr[curByte++] = tmp & 255;
			}
			if (placeHoldersLen === 1) {
				tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
				arr[curByte++] = tmp >> 8 & 255;
				arr[curByte++] = tmp & 255;
			}
			return arr;
		}
		function tripletToBase64(num) {
			return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
		}
		function encodeChunk(uint8, start, end) {
			var tmp;
			var output = [];
			for (var i = start; i < end; i += 3) {
				tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
				output.push(tripletToBase64(tmp));
			}
			return output.join("");
		}
		function fromByteArray(uint8) {
			var tmp;
			var len = uint8.length;
			var extraBytes = len % 3;
			var parts = [];
			var maxChunkLength = 16383;
			for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
			if (extraBytes === 1) {
				tmp = uint8[len - 1];
				parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");
			} else if (extraBytes === 2) {
				tmp = (uint8[len - 2] << 8) + uint8[len - 1];
				parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
			}
			return parts.join("");
		}
		var ieee754 = {};
		/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
		ieee754.read = function(buffer, offset, isLE, mLen, nBytes) {
			var e, m;
			var eLen = nBytes * 8 - mLen - 1;
			var eMax = (1 << eLen) - 1;
			var eBias = eMax >> 1;
			var nBits = -7;
			var i = isLE ? nBytes - 1 : 0;
			var d = isLE ? -1 : 1;
			var s = buffer[offset + i];
			i += d;
			e = s & (1 << -nBits) - 1;
			s >>= -nBits;
			nBits += eLen;
			for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
			m = e & (1 << -nBits) - 1;
			e >>= -nBits;
			nBits += mLen;
			for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
			if (e === 0) e = 1 - eBias;
			else if (e === eMax) return m ? NaN : (s ? -1 : 1) * Infinity;
			else {
				m = m + Math.pow(2, mLen);
				e = e - eBias;
			}
			return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
		};
		ieee754.write = function(buffer, value, offset, isLE, mLen, nBytes) {
			var e, m, c;
			var eLen = nBytes * 8 - mLen - 1;
			var eMax = (1 << eLen) - 1;
			var eBias = eMax >> 1;
			var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
			var i = isLE ? 0 : nBytes - 1;
			var d = isLE ? 1 : -1;
			var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
			value = Math.abs(value);
			if (isNaN(value) || value === Infinity) {
				m = isNaN(value) ? 1 : 0;
				e = eMax;
			} else {
				e = Math.floor(Math.log(value) / Math.LN2);
				if (value * (c = Math.pow(2, -e)) < 1) {
					e--;
					c *= 2;
				}
				if (e + eBias >= 1) value += rt / c;
				else value += rt * Math.pow(2, 1 - eBias);
				if (value * c >= 2) {
					e++;
					c /= 2;
				}
				if (e + eBias >= eMax) {
					m = 0;
					e = eMax;
				} else if (e + eBias >= 1) {
					m = (value * c - 1) * Math.pow(2, mLen);
					e = e + eBias;
				} else {
					m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
					e = 0;
				}
			}
			for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8);
			e = e << mLen | m;
			eLen += mLen;
			for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8);
			buffer[offset + i - d] |= s * 128;
		};
		/*!
		* The buffer module from node.js, for the browser.
		*
		* @author   Feross Aboukhadijeh <https://feross.org>
		* @license  MIT
		*/
		(function(exports$4) {
			const base64 = base64Js;
			const ieee754$1 = ieee754;
			const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
			exports$4.Buffer = Buffer;
			exports$4.SlowBuffer = SlowBuffer;
			exports$4.INSPECT_MAX_BYTES = 50;
			const K_MAX_LENGTH = 2147483647;
			exports$4.kMaxLength = K_MAX_LENGTH;
			const { Uint8Array: GlobalUint8Array, ArrayBuffer: GlobalArrayBuffer, SharedArrayBuffer: GlobalSharedArrayBuffer } = globalThis;
			/**
			* If `Buffer.TYPED_ARRAY_SUPPORT`:
			*   === true    Use Uint8Array implementation (fastest)
			*   === false   Print warning and recommend using `buffer` v4.x which has an Object
			*               implementation (most compatible, even IE6)
			*
			* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
			* Opera 11.6+, iOS 4.2+.
			*
			* We report that the browser does not support typed arrays if the are not subclassable
			* using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`
			* (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support
			* for __proto__ and has a buggy typed array implementation.
			*/
			Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
			if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
			function typedArraySupport() {
				try {
					const arr = new GlobalUint8Array(1);
					const proto = { foo: function() {
						return 42;
					} };
					Object.setPrototypeOf(proto, GlobalUint8Array.prototype);
					Object.setPrototypeOf(arr, proto);
					return arr.foo() === 42;
				} catch (e) {
					return false;
				}
			}
			Object.defineProperty(Buffer.prototype, "parent", {
				enumerable: true,
				get: function() {
					if (!Buffer.isBuffer(this)) return void 0;
					return this.buffer;
				}
			});
			Object.defineProperty(Buffer.prototype, "offset", {
				enumerable: true,
				get: function() {
					if (!Buffer.isBuffer(this)) return void 0;
					return this.byteOffset;
				}
			});
			function createBuffer(length) {
				if (length > K_MAX_LENGTH) throw new RangeError("The value \"" + length + "\" is invalid for option \"size\"");
				const buf = new GlobalUint8Array(length);
				Object.setPrototypeOf(buf, Buffer.prototype);
				return buf;
			}
			/**
			* The Buffer constructor returns instances of `Uint8Array` that have their
			* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
			* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
			* and the `Uint8Array` methods. Square bracket notation works as expected -- it
			* returns a single octet.
			*
			* The `Uint8Array` prototype remains unmodified.
			*/
			function Buffer(arg, encodingOrOffset, length) {
				if (typeof arg === "number") {
					if (typeof encodingOrOffset === "string") throw new TypeError("The \"string\" argument must be of type string. Received type number");
					return allocUnsafe(arg);
				}
				return from(arg, encodingOrOffset, length);
			}
			Buffer.poolSize = 8192;
			function from(value, encodingOrOffset, length) {
				if (typeof value === "string") return fromString(value, encodingOrOffset);
				if (GlobalArrayBuffer.isView(value)) return fromArrayView(value);
				if (value == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
				if (isInstance(value, GlobalArrayBuffer) || value && isInstance(value.buffer, GlobalArrayBuffer)) return fromArrayBuffer(value, encodingOrOffset, length);
				if (typeof GlobalSharedArrayBuffer !== "undefined" && (isInstance(value, GlobalSharedArrayBuffer) || value && isInstance(value.buffer, GlobalSharedArrayBuffer))) return fromArrayBuffer(value, encodingOrOffset, length);
				if (typeof value === "number") throw new TypeError("The \"value\" argument must not be of type number. Received type number");
				const valueOf = value.valueOf && value.valueOf();
				if (valueOf != null && valueOf !== value) return Buffer.from(valueOf, encodingOrOffset, length);
				const b = fromObject(value);
				if (b) return b;
				if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") return Buffer.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
				throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
			}
			/**
			* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
			* if value is a number.
			* Buffer.from(str[, encoding])
			* Buffer.from(array)
			* Buffer.from(buffer)
			* Buffer.from(arrayBuffer[, byteOffset[, length]])
			**/
			Buffer.from = function(value, encodingOrOffset, length) {
				return from(value, encodingOrOffset, length);
			};
			Object.setPrototypeOf(Buffer.prototype, GlobalUint8Array.prototype);
			Object.setPrototypeOf(Buffer, GlobalUint8Array);
			function assertSize(size) {
				if (typeof size !== "number") throw new TypeError("\"size\" argument must be of type number");
				else if (size < 0) throw new RangeError("The value \"" + size + "\" is invalid for option \"size\"");
			}
			function alloc(size, fill, encoding) {
				assertSize(size);
				if (size <= 0) return createBuffer(size);
				if (fill !== void 0) return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
				return createBuffer(size);
			}
			/**
			* Creates a new filled Buffer instance.
			* alloc(size[, fill[, encoding]])
			**/
			Buffer.alloc = function(size, fill, encoding) {
				return alloc(size, fill, encoding);
			};
			function allocUnsafe(size) {
				assertSize(size);
				return createBuffer(size < 0 ? 0 : checked(size) | 0);
			}
			/**
			* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
			* */
			Buffer.allocUnsafe = function(size) {
				return allocUnsafe(size);
			};
			/**
			* Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
			*/
			Buffer.allocUnsafeSlow = function(size) {
				return allocUnsafe(size);
			};
			function fromString(string, encoding) {
				if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
				if (!Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
				const length = byteLength(string, encoding) | 0;
				let buf = createBuffer(length);
				const actual = buf.write(string, encoding);
				if (actual !== length) buf = buf.slice(0, actual);
				return buf;
			}
			function fromArrayLike(array) {
				const length = array.length < 0 ? 0 : checked(array.length) | 0;
				const buf = createBuffer(length);
				for (let i = 0; i < length; i += 1) buf[i] = array[i] & 255;
				return buf;
			}
			function fromArrayView(arrayView) {
				if (isInstance(arrayView, GlobalUint8Array)) {
					const copy = new GlobalUint8Array(arrayView);
					return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength);
				}
				return fromArrayLike(arrayView);
			}
			function fromArrayBuffer(array, byteOffset, length) {
				if (byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError("\"offset\" is outside of buffer bounds");
				if (array.byteLength < byteOffset + (length || 0)) throw new RangeError("\"length\" is outside of buffer bounds");
				let buf;
				if (byteOffset === void 0 && length === void 0) buf = new GlobalUint8Array(array);
				else if (length === void 0) buf = new GlobalUint8Array(array, byteOffset);
				else buf = new GlobalUint8Array(array, byteOffset, length);
				Object.setPrototypeOf(buf, Buffer.prototype);
				return buf;
			}
			function fromObject(obj) {
				if (Buffer.isBuffer(obj)) {
					const len = checked(obj.length) | 0;
					const buf = createBuffer(len);
					if (buf.length === 0) return buf;
					obj.copy(buf, 0, 0, len);
					return buf;
				}
				if (obj.length !== void 0) {
					if (typeof obj.length !== "number" || numberIsNaN(obj.length)) return createBuffer(0);
					return fromArrayLike(obj);
				}
				if (obj.type === "Buffer" && Array.isArray(obj.data)) return fromArrayLike(obj.data);
			}
			function checked(length) {
				if (length >= K_MAX_LENGTH) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
				return length | 0;
			}
			function SlowBuffer(length) {
				if (+length != length) length = 0;
				return Buffer.alloc(+length);
			}
			Buffer.isBuffer = function isBuffer(b) {
				return b != null && b._isBuffer === true && b !== Buffer.prototype;
			};
			Buffer.compare = function compare(a, b) {
				if (isInstance(a, GlobalUint8Array)) a = Buffer.from(a, a.offset, a.byteLength);
				if (isInstance(b, GlobalUint8Array)) b = Buffer.from(b, b.offset, b.byteLength);
				if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
				if (a === b) return 0;
				let x = a.length;
				let y = b.length;
				for (let i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) {
					x = a[i];
					y = b[i];
					break;
				}
				if (x < y) return -1;
				if (y < x) return 1;
				return 0;
			};
			Buffer.isEncoding = function isEncoding(encoding) {
				switch (String(encoding).toLowerCase()) {
					case "hex":
					case "utf8":
					case "utf-8":
					case "ascii":
					case "latin1":
					case "binary":
					case "base64":
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return true;
					default: return false;
				}
			};
			Buffer.concat = function concat(list, length) {
				if (!Array.isArray(list)) throw new TypeError("\"list\" argument must be an Array of Buffers");
				if (list.length === 0) return Buffer.alloc(0);
				let i;
				if (length === void 0) {
					length = 0;
					for (i = 0; i < list.length; ++i) length += list[i].length;
				}
				const buffer = Buffer.allocUnsafe(length);
				let pos = 0;
				for (i = 0; i < list.length; ++i) {
					let buf = list[i];
					if (isInstance(buf, GlobalUint8Array)) if (pos + buf.length > buffer.length) {
						if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
						buf.copy(buffer, pos);
					} else GlobalUint8Array.prototype.set.call(buffer, buf, pos);
					else if (!Buffer.isBuffer(buf)) throw new TypeError("\"list\" argument must be an Array of Buffers");
					else buf.copy(buffer, pos);
					pos += buf.length;
				}
				return buffer;
			};
			function byteLength(string, encoding) {
				if (Buffer.isBuffer(string)) return string.length;
				if (GlobalArrayBuffer.isView(string) || isInstance(string, GlobalArrayBuffer)) return string.byteLength;
				if (typeof string !== "string") throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string);
				const len = string.length;
				const mustMatch = arguments.length > 2 && arguments[2] === true;
				if (!mustMatch && len === 0) return 0;
				let loweredCase = false;
				for (;;) switch (encoding) {
					case "ascii":
					case "latin1":
					case "binary": return len;
					case "utf8":
					case "utf-8": return utf8ToBytes(string).length;
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return len * 2;
					case "hex": return len >>> 1;
					case "base64": return base64ToBytes(string).length;
					default:
						if (loweredCase) return mustMatch ? -1 : utf8ToBytes(string).length;
						encoding = ("" + encoding).toLowerCase();
						loweredCase = true;
				}
			}
			Buffer.byteLength = byteLength;
			function slowToString(encoding, start, end) {
				let loweredCase = false;
				if (start === void 0 || start < 0) start = 0;
				if (start > this.length) return "";
				if (end === void 0 || end > this.length) end = this.length;
				if (end <= 0) return "";
				end >>>= 0;
				start >>>= 0;
				if (end <= start) return "";
				if (!encoding) encoding = "utf8";
				while (true) switch (encoding) {
					case "hex": return hexSlice(this, start, end);
					case "utf8":
					case "utf-8": return utf8Slice(this, start, end);
					case "ascii": return asciiSlice(this, start, end);
					case "latin1":
					case "binary": return latin1Slice(this, start, end);
					case "base64": return base64Slice(this, start, end);
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return utf16leSlice(this, start, end);
					default:
						if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
						encoding = (encoding + "").toLowerCase();
						loweredCase = true;
				}
			}
			Buffer.prototype._isBuffer = true;
			function swap(b, n, m) {
				const i = b[n];
				b[n] = b[m];
				b[m] = i;
			}
			Buffer.prototype.swap16 = function swap16() {
				const len = this.length;
				if (len % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
				for (let i = 0; i < len; i += 2) swap(this, i, i + 1);
				return this;
			};
			Buffer.prototype.swap32 = function swap32() {
				const len = this.length;
				if (len % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
				for (let i = 0; i < len; i += 4) {
					swap(this, i, i + 3);
					swap(this, i + 1, i + 2);
				}
				return this;
			};
			Buffer.prototype.swap64 = function swap64() {
				const len = this.length;
				if (len % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
				for (let i = 0; i < len; i += 8) {
					swap(this, i, i + 7);
					swap(this, i + 1, i + 6);
					swap(this, i + 2, i + 5);
					swap(this, i + 3, i + 4);
				}
				return this;
			};
			Buffer.prototype.toString = function toString() {
				const length = this.length;
				if (length === 0) return "";
				if (arguments.length === 0) return utf8Slice(this, 0, length);
				return slowToString.apply(this, arguments);
			};
			Buffer.prototype.toLocaleString = Buffer.prototype.toString;
			Buffer.prototype.equals = function equals(b) {
				if (!Buffer.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
				if (this === b) return true;
				return Buffer.compare(this, b) === 0;
			};
			Buffer.prototype.inspect = function inspect() {
				let str = "";
				const max = exports$4.INSPECT_MAX_BYTES;
				str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
				if (this.length > max) str += " ... ";
				return "<Buffer " + str + ">";
			};
			if (customInspectSymbol) Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;
			Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
				if (isInstance(target, GlobalUint8Array)) target = Buffer.from(target, target.offset, target.byteLength);
				if (!Buffer.isBuffer(target)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof target);
				if (start === void 0) start = 0;
				if (end === void 0) end = target ? target.length : 0;
				if (thisStart === void 0) thisStart = 0;
				if (thisEnd === void 0) thisEnd = this.length;
				if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) throw new RangeError("out of range index");
				if (thisStart >= thisEnd && start >= end) return 0;
				if (thisStart >= thisEnd) return -1;
				if (start >= end) return 1;
				start >>>= 0;
				end >>>= 0;
				thisStart >>>= 0;
				thisEnd >>>= 0;
				if (this === target) return 0;
				let x = thisEnd - thisStart;
				let y = end - start;
				const len = Math.min(x, y);
				const thisCopy = this.slice(thisStart, thisEnd);
				const targetCopy = target.slice(start, end);
				for (let i = 0; i < len; ++i) if (thisCopy[i] !== targetCopy[i]) {
					x = thisCopy[i];
					y = targetCopy[i];
					break;
				}
				if (x < y) return -1;
				if (y < x) return 1;
				return 0;
			};
			function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
				if (buffer.length === 0) return -1;
				if (typeof byteOffset === "string") {
					encoding = byteOffset;
					byteOffset = 0;
				} else if (byteOffset > 2147483647) byteOffset = 2147483647;
				else if (byteOffset < -2147483648) byteOffset = -2147483648;
				byteOffset = +byteOffset;
				if (numberIsNaN(byteOffset)) byteOffset = dir ? 0 : buffer.length - 1;
				if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
				if (byteOffset >= buffer.length) if (dir) return -1;
				else byteOffset = buffer.length - 1;
				else if (byteOffset < 0) if (dir) byteOffset = 0;
				else return -1;
				if (typeof val === "string") val = Buffer.from(val, encoding);
				if (Buffer.isBuffer(val)) {
					if (val.length === 0) return -1;
					return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
				} else if (typeof val === "number") {
					val = val & 255;
					if (typeof GlobalUint8Array.prototype.indexOf === "function") if (dir) return GlobalUint8Array.prototype.indexOf.call(buffer, val, byteOffset);
					else return GlobalUint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
					return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
				}
				throw new TypeError("val must be string, number or Buffer");
			}
			function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
				let indexSize = 1;
				let arrLength = arr.length;
				let valLength = val.length;
				if (encoding !== void 0) {
					encoding = String(encoding).toLowerCase();
					if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
						if (arr.length < 2 || val.length < 2) return -1;
						indexSize = 2;
						arrLength /= 2;
						valLength /= 2;
						byteOffset /= 2;
					}
				}
				function read(buf, i) {
					if (indexSize === 1) return buf[i];
					else return buf.readUInt16BE(i * indexSize);
				}
				let i;
				if (dir) {
					let foundIndex = -1;
					for (i = byteOffset; i < arrLength; i++) if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
						if (foundIndex === -1) foundIndex = i;
						if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
					} else {
						if (foundIndex !== -1) i -= i - foundIndex;
						foundIndex = -1;
					}
				} else {
					if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
					for (i = byteOffset; i >= 0; i--) {
						let found = true;
						for (let j = 0; j < valLength; j++) if (read(arr, i + j) !== read(val, j)) {
							found = false;
							break;
						}
						if (found) return i;
					}
				}
				return -1;
			}
			Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
				return this.indexOf(val, byteOffset, encoding) !== -1;
			};
			Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
				return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
			};
			Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
				return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
			};
			function hexWrite(buf, string, offset, length) {
				offset = Number(offset) || 0;
				const remaining = buf.length - offset;
				if (!length) length = remaining;
				else {
					length = Number(length);
					if (length > remaining) length = remaining;
				}
				const strLen = string.length;
				if (length > strLen / 2) length = strLen / 2;
				let i;
				for (i = 0; i < length; ++i) {
					const parsed = parseInt(string.substr(i * 2, 2), 16);
					if (numberIsNaN(parsed)) return i;
					buf[offset + i] = parsed;
				}
				return i;
			}
			function utf8Write(buf, string, offset, length) {
				return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
			}
			function asciiWrite(buf, string, offset, length) {
				return blitBuffer(asciiToBytes(string), buf, offset, length);
			}
			function base64Write(buf, string, offset, length) {
				return blitBuffer(base64ToBytes(string), buf, offset, length);
			}
			function ucs2Write(buf, string, offset, length) {
				return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
			}
			Buffer.prototype.write = function write(string, offset, length, encoding) {
				if (offset === void 0) {
					encoding = "utf8";
					length = this.length;
					offset = 0;
				} else if (length === void 0 && typeof offset === "string") {
					encoding = offset;
					length = this.length;
					offset = 0;
				} else if (isFinite(offset)) {
					offset = offset >>> 0;
					if (isFinite(length)) {
						length = length >>> 0;
						if (encoding === void 0) encoding = "utf8";
					} else {
						encoding = length;
						length = void 0;
					}
				} else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
				const remaining = this.length - offset;
				if (length === void 0 || length > remaining) length = remaining;
				if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds");
				if (!encoding) encoding = "utf8";
				let loweredCase = false;
				for (;;) switch (encoding) {
					case "hex": return hexWrite(this, string, offset, length);
					case "utf8":
					case "utf-8": return utf8Write(this, string, offset, length);
					case "ascii":
					case "latin1":
					case "binary": return asciiWrite(this, string, offset, length);
					case "base64": return base64Write(this, string, offset, length);
					case "ucs2":
					case "ucs-2":
					case "utf16le":
					case "utf-16le": return ucs2Write(this, string, offset, length);
					default:
						if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
						encoding = ("" + encoding).toLowerCase();
						loweredCase = true;
				}
			};
			Buffer.prototype.toJSON = function toJSON() {
				return {
					type: "Buffer",
					data: Array.prototype.slice.call(this._arr || this, 0)
				};
			};
			function base64Slice(buf, start, end) {
				if (start === 0 && end === buf.length) return base64.fromByteArray(buf);
				else return base64.fromByteArray(buf.slice(start, end));
			}
			function utf8Slice(buf, start, end) {
				end = Math.min(buf.length, end);
				const res = [];
				let i = start;
				while (i < end) {
					const firstByte = buf[i];
					let codePoint = null;
					let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
					if (i + bytesPerSequence <= end) {
						let secondByte, thirdByte, fourthByte, tempCodePoint;
						switch (bytesPerSequence) {
							case 1:
								if (firstByte < 128) codePoint = firstByte;
								break;
							case 2:
								secondByte = buf[i + 1];
								if ((secondByte & 192) === 128) {
									tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
									if (tempCodePoint > 127) codePoint = tempCodePoint;
								}
								break;
							case 3:
								secondByte = buf[i + 1];
								thirdByte = buf[i + 2];
								if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
									tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
									if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) codePoint = tempCodePoint;
								}
								break;
							case 4:
								secondByte = buf[i + 1];
								thirdByte = buf[i + 2];
								fourthByte = buf[i + 3];
								if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
									tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
									if (tempCodePoint > 65535 && tempCodePoint < 1114112) codePoint = tempCodePoint;
								}
						}
					}
					if (codePoint === null) {
						codePoint = 65533;
						bytesPerSequence = 1;
					} else if (codePoint > 65535) {
						codePoint -= 65536;
						res.push(codePoint >>> 10 & 1023 | 55296);
						codePoint = 56320 | codePoint & 1023;
					}
					res.push(codePoint);
					i += bytesPerSequence;
				}
				return decodeCodePointsArray(res);
			}
			const MAX_ARGUMENTS_LENGTH = 4096;
			function decodeCodePointsArray(codePoints) {
				const len = codePoints.length;
				if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints);
				let res = "";
				let i = 0;
				while (i < len) res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
				return res;
			}
			function asciiSlice(buf, start, end) {
				let ret = "";
				end = Math.min(buf.length, end);
				for (let i = start; i < end; ++i) ret += String.fromCharCode(buf[i] & 127);
				return ret;
			}
			function latin1Slice(buf, start, end) {
				let ret = "";
				end = Math.min(buf.length, end);
				for (let i = start; i < end; ++i) ret += String.fromCharCode(buf[i]);
				return ret;
			}
			function hexSlice(buf, start, end) {
				const len = buf.length;
				if (!start || start < 0) start = 0;
				if (!end || end < 0 || end > len) end = len;
				let out = "";
				for (let i = start; i < end; ++i) out += hexSliceLookupTable[buf[i]];
				return out;
			}
			function utf16leSlice(buf, start, end) {
				const bytes = buf.slice(start, end);
				let res = "";
				for (let i = 0; i < bytes.length - 1; i += 2) res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
				return res;
			}
			Buffer.prototype.slice = function slice(start, end) {
				const len = this.length;
				start = ~~start;
				end = end === void 0 ? len : ~~end;
				if (start < 0) {
					start += len;
					if (start < 0) start = 0;
				} else if (start > len) start = len;
				if (end < 0) {
					end += len;
					if (end < 0) end = 0;
				} else if (end > len) end = len;
				if (end < start) end = start;
				const newBuf = this.subarray(start, end);
				Object.setPrototypeOf(newBuf, Buffer.prototype);
				return newBuf;
			};
			function checkOffset(offset, ext, length) {
				if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
				if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
			}
			Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let val = this[offset];
				let mul = 1;
				let i = 0;
				while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
				return val;
			};
			Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let val = this[offset + --byteLength];
				let mul = 1;
				while (byteLength > 0 && (mul *= 256)) val += this[offset + --byteLength] * mul;
				return val;
			};
			Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 1, this.length);
				return this[offset];
			};
			Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				return this[offset] | this[offset + 1] << 8;
			};
			Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				return this[offset] << 8 | this[offset + 1];
			};
			Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216;
			};
			Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
			};
			Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
				const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
				return BigInt(lo) + (BigInt(hi) << BigInt(32));
			});
			Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
				const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
				return (BigInt(hi) << BigInt(32)) + BigInt(lo);
			});
			Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let val = this[offset];
				let mul = 1;
				let i = 0;
				while (++i < byteLength && (mul *= 256)) val += this[offset + i] * mul;
				mul *= 128;
				if (val >= mul) val -= Math.pow(2, 8 * byteLength);
				return val;
			};
			Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) checkOffset(offset, byteLength, this.length);
				let i = byteLength;
				let mul = 1;
				let val = this[offset + --i];
				while (i > 0 && (mul *= 256)) val += this[offset + --i] * mul;
				mul *= 128;
				if (val >= mul) val -= Math.pow(2, 8 * byteLength);
				return val;
			};
			Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 1, this.length);
				if (!(this[offset] & 128)) return this[offset];
				return (255 - this[offset] + 1) * -1;
			};
			Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				const val = this[offset] | this[offset + 1] << 8;
				return val & 32768 ? val | 4294901760 : val;
			};
			Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 2, this.length);
				const val = this[offset + 1] | this[offset] << 8;
				return val & 32768 ? val | 4294901760 : val;
			};
			Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
			};
			Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
			};
			Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
				return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
			});
			Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) {
				offset = offset >>> 0;
				validateNumber(offset, "offset");
				const first = this[offset];
				const last = this[offset + 7];
				if (first === void 0 || last === void 0) boundsError(offset, this.length - 8);
				const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
				return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
			});
			Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return ieee754$1.read(this, offset, true, 23, 4);
			};
			Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 4, this.length);
				return ieee754$1.read(this, offset, false, 23, 4);
			};
			Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 8, this.length);
				return ieee754$1.read(this, offset, true, 52, 8);
			};
			Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
				offset = offset >>> 0;
				if (!noAssert) checkOffset(offset, 8, this.length);
				return ieee754$1.read(this, offset, false, 52, 8);
			};
			function checkInt(buf, value, offset, ext, max, min) {
				if (!Buffer.isBuffer(buf)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
				if (value > max || value < min) throw new RangeError("\"value\" argument is out of bounds");
				if (offset + ext > buf.length) throw new RangeError("Index out of range");
			}
			Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) {
					const maxBytes = Math.pow(2, 8 * byteLength) - 1;
					checkInt(this, value, offset, byteLength, maxBytes, 0);
				}
				let mul = 1;
				let i = 0;
				this[offset] = value & 255;
				while (++i < byteLength && (mul *= 256)) this[offset + i] = value / mul & 255;
				return offset + byteLength;
			};
			Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				byteLength = byteLength >>> 0;
				if (!noAssert) {
					const maxBytes = Math.pow(2, 8 * byteLength) - 1;
					checkInt(this, value, offset, byteLength, maxBytes, 0);
				}
				let i = byteLength - 1;
				let mul = 1;
				this[offset + i] = value & 255;
				while (--i >= 0 && (mul *= 256)) this[offset + i] = value / mul & 255;
				return offset + byteLength;
			};
			Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
				this[offset] = value & 255;
				return offset + 1;
			};
			Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
				this[offset] = value & 255;
				this[offset + 1] = value >>> 8;
				return offset + 2;
			};
			Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
				this[offset] = value >>> 8;
				this[offset + 1] = value & 255;
				return offset + 2;
			};
			Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
				this[offset + 3] = value >>> 24;
				this[offset + 2] = value >>> 16;
				this[offset + 1] = value >>> 8;
				this[offset] = value & 255;
				return offset + 4;
			};
			Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
				this[offset] = value >>> 24;
				this[offset + 1] = value >>> 16;
				this[offset + 2] = value >>> 8;
				this[offset + 3] = value & 255;
				return offset + 4;
			};
			function wrtBigUInt64LE(buf, value, offset, min, max) {
				checkIntBI(value, min, max, buf, offset, 7);
				let lo = Number(value & BigInt(4294967295));
				buf[offset++] = lo;
				lo = lo >> 8;
				buf[offset++] = lo;
				lo = lo >> 8;
				buf[offset++] = lo;
				lo = lo >> 8;
				buf[offset++] = lo;
				let hi = Number(value >> BigInt(32) & BigInt(4294967295));
				buf[offset++] = hi;
				hi = hi >> 8;
				buf[offset++] = hi;
				hi = hi >> 8;
				buf[offset++] = hi;
				hi = hi >> 8;
				buf[offset++] = hi;
				return offset;
			}
			function wrtBigUInt64BE(buf, value, offset, min, max) {
				checkIntBI(value, min, max, buf, offset, 7);
				let lo = Number(value & BigInt(4294967295));
				buf[offset + 7] = lo;
				lo = lo >> 8;
				buf[offset + 6] = lo;
				lo = lo >> 8;
				buf[offset + 5] = lo;
				lo = lo >> 8;
				buf[offset + 4] = lo;
				let hi = Number(value >> BigInt(32) & BigInt(4294967295));
				buf[offset + 3] = hi;
				hi = hi >> 8;
				buf[offset + 2] = hi;
				hi = hi >> 8;
				buf[offset + 1] = hi;
				hi = hi >> 8;
				buf[offset] = hi;
				return offset + 8;
			}
			Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) {
				return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
			});
			Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) {
				return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
			});
			Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) {
					const limit = Math.pow(2, 8 * byteLength - 1);
					checkInt(this, value, offset, byteLength, limit - 1, -limit);
				}
				let i = 0;
				let mul = 1;
				let sub = 0;
				this[offset] = value & 255;
				while (++i < byteLength && (mul *= 256)) {
					if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) sub = 1;
					this[offset + i] = (value / mul >> 0) - sub & 255;
				}
				return offset + byteLength;
			};
			Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) {
					const limit = Math.pow(2, 8 * byteLength - 1);
					checkInt(this, value, offset, byteLength, limit - 1, -limit);
				}
				let i = byteLength - 1;
				let mul = 1;
				let sub = 0;
				this[offset + i] = value & 255;
				while (--i >= 0 && (mul *= 256)) {
					if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) sub = 1;
					this[offset + i] = (value / mul >> 0) - sub & 255;
				}
				return offset + byteLength;
			};
			Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
				if (value < 0) value = 255 + value + 1;
				this[offset] = value & 255;
				return offset + 1;
			};
			Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
				this[offset] = value & 255;
				this[offset + 1] = value >>> 8;
				return offset + 2;
			};
			Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
				this[offset] = value >>> 8;
				this[offset + 1] = value & 255;
				return offset + 2;
			};
			Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
				this[offset] = value & 255;
				this[offset + 1] = value >>> 8;
				this[offset + 2] = value >>> 16;
				this[offset + 3] = value >>> 24;
				return offset + 4;
			};
			Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
				if (value < 0) value = 4294967295 + value + 1;
				this[offset] = value >>> 24;
				this[offset + 1] = value >>> 16;
				this[offset + 2] = value >>> 8;
				this[offset + 3] = value & 255;
				return offset + 4;
			};
			Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) {
				return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
			});
			Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) {
				return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
			});
			function checkIEEE754(buf, value, offset, ext, max, min) {
				if (offset + ext > buf.length) throw new RangeError("Index out of range");
				if (offset < 0) throw new RangeError("Index out of range");
			}
			function writeFloat(buf, value, offset, littleEndian, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkIEEE754(buf, value, offset, 4);
				ieee754$1.write(buf, value, offset, littleEndian, 23, 4);
				return offset + 4;
			}
			Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
				return writeFloat(this, value, offset, true, noAssert);
			};
			Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
				return writeFloat(this, value, offset, false, noAssert);
			};
			function writeDouble(buf, value, offset, littleEndian, noAssert) {
				value = +value;
				offset = offset >>> 0;
				if (!noAssert) checkIEEE754(buf, value, offset, 8);
				ieee754$1.write(buf, value, offset, littleEndian, 52, 8);
				return offset + 8;
			}
			Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
				return writeDouble(this, value, offset, true, noAssert);
			};
			Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
				return writeDouble(this, value, offset, false, noAssert);
			};
			Buffer.prototype.copy = function copy(target, targetStart, start, end) {
				if (!Buffer.isBuffer(target)) throw new TypeError("argument should be a Buffer");
				if (!start) start = 0;
				if (!end && end !== 0) end = this.length;
				if (targetStart >= target.length) targetStart = target.length;
				if (!targetStart) targetStart = 0;
				if (end > 0 && end < start) end = start;
				if (end === start) return 0;
				if (target.length === 0 || this.length === 0) return 0;
				if (targetStart < 0) throw new RangeError("targetStart out of bounds");
				if (start < 0 || start >= this.length) throw new RangeError("Index out of range");
				if (end < 0) throw new RangeError("sourceEnd out of bounds");
				if (end > this.length) end = this.length;
				if (target.length - targetStart < end - start) end = target.length - targetStart + start;
				const len = end - start;
				if (this === target && typeof GlobalUint8Array.prototype.copyWithin === "function") this.copyWithin(targetStart, start, end);
				else GlobalUint8Array.prototype.set.call(target, this.subarray(start, end), targetStart);
				return len;
			};
			Buffer.prototype.fill = function fill(val, start, end, encoding) {
				if (typeof val === "string") {
					if (typeof start === "string") {
						encoding = start;
						start = 0;
						end = this.length;
					} else if (typeof end === "string") {
						encoding = end;
						end = this.length;
					}
					if (encoding !== void 0 && typeof encoding !== "string") throw new TypeError("encoding must be a string");
					if (typeof encoding === "string" && !Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
					if (val.length === 1) {
						const code = val.charCodeAt(0);
						if (encoding === "utf8" && code < 128 || encoding === "latin1") val = code;
					}
				} else if (typeof val === "number") val = val & 255;
				else if (typeof val === "boolean") val = Number(val);
				if (start < 0 || this.length < start || this.length < end) throw new RangeError("Out of range index");
				if (end <= start) return this;
				start = start >>> 0;
				end = end === void 0 ? this.length : end >>> 0;
				if (!val) val = 0;
				let i;
				if (typeof val === "number") for (i = start; i < end; ++i) this[i] = val;
				else {
					const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);
					const len = bytes.length;
					if (len === 0) throw new TypeError("The value \"" + val + "\" is invalid for argument \"value\"");
					for (i = 0; i < end - start; ++i) this[i + start] = bytes[i % len];
				}
				return this;
			};
			const errors = {};
			function E(sym, getMessage, Base) {
				errors[sym] = class NodeError extends Base {
					constructor() {
						super();
						Object.defineProperty(this, "message", {
							value: getMessage.apply(this, arguments),
							writable: true,
							configurable: true
						});
						this.name = `${this.name} [${sym}]`;
						this.stack;
						delete this.name;
					}
					get code() {
						return sym;
					}
					set code(value) {
						Object.defineProperty(this, "code", {
							configurable: true,
							enumerable: true,
							value,
							writable: true
						});
					}
					toString() {
						return `${this.name} [${sym}]: ${this.message}`;
					}
				};
			}
			E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) {
				if (name) return `${name} is outside of buffer bounds`;
				return "Attempt to access memory outside buffer bounds";
			}, RangeError);
			E("ERR_INVALID_ARG_TYPE", function(name, actual) {
				return `The "${name}" argument must be of type number. Received type ${typeof actual}`;
			}, TypeError);
			E("ERR_OUT_OF_RANGE", function(str, range, input) {
				let msg = `The value of "${str}" is out of range.`;
				let received = input;
				if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) received = addNumericalSeparator(String(input));
				else if (typeof input === "bigint") {
					received = String(input);
					if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) received = addNumericalSeparator(received);
					received += "n";
				}
				msg += ` It must be ${range}. Received ${received}`;
				return msg;
			}, RangeError);
			function addNumericalSeparator(val) {
				let res = "";
				let i = val.length;
				const start = val[0] === "-" ? 1 : 0;
				for (; i >= start + 4; i -= 3) res = `_${val.slice(i - 3, i)}${res}`;
				return `${val.slice(0, i)}${res}`;
			}
			function checkBounds(buf, offset, byteLength) {
				validateNumber(offset, "offset");
				if (buf[offset] === void 0 || buf[offset + byteLength] === void 0) boundsError(offset, buf.length - (byteLength + 1));
			}
			function checkIntBI(value, min, max, buf, offset, byteLength) {
				if (value > max || value < min) {
					const n = typeof min === "bigint" ? "n" : "";
					let range;
					if (byteLength > 3) if (min === 0 || min === BigInt(0)) range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`;
					else range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength + 1) * 8 - 1}${n}`;
					else range = `>= ${min}${n} and <= ${max}${n}`;
					throw new errors.ERR_OUT_OF_RANGE("value", range, value);
				}
				checkBounds(buf, offset, byteLength);
			}
			function validateNumber(value, name) {
				if (typeof value !== "number") throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
			}
			function boundsError(value, length, type) {
				if (Math.floor(value) !== value) {
					validateNumber(value, type);
					throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);
				}
				if (length < 0) throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
				throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length}`, value);
			}
			const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
			function base64clean(str) {
				str = str.split("=")[0];
				str = str.trim().replace(INVALID_BASE64_RE, "");
				if (str.length < 2) return "";
				while (str.length % 4 !== 0) str = str + "=";
				return str;
			}
			function utf8ToBytes(string, units) {
				units = units || Infinity;
				let codePoint;
				const length = string.length;
				let leadSurrogate = null;
				const bytes = [];
				for (let i = 0; i < length; ++i) {
					codePoint = string.charCodeAt(i);
					if (codePoint > 55295 && codePoint < 57344) {
						if (!leadSurrogate) {
							if (codePoint > 56319) {
								if ((units -= 3) > -1) bytes.push(239, 191, 189);
								continue;
							} else if (i + 1 === length) {
								if ((units -= 3) > -1) bytes.push(239, 191, 189);
								continue;
							}
							leadSurrogate = codePoint;
							continue;
						}
						if (codePoint < 56320) {
							if ((units -= 3) > -1) bytes.push(239, 191, 189);
							leadSurrogate = codePoint;
							continue;
						}
						codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536;
					} else if (leadSurrogate) {
						if ((units -= 3) > -1) bytes.push(239, 191, 189);
					}
					leadSurrogate = null;
					if (codePoint < 128) {
						if ((units -= 1) < 0) break;
						bytes.push(codePoint);
					} else if (codePoint < 2048) {
						if ((units -= 2) < 0) break;
						bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128);
					} else if (codePoint < 65536) {
						if ((units -= 3) < 0) break;
						bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
					} else if (codePoint < 1114112) {
						if ((units -= 4) < 0) break;
						bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128);
					} else throw new Error("Invalid code point");
				}
				return bytes;
			}
			function asciiToBytes(str) {
				const byteArray = [];
				for (let i = 0; i < str.length; ++i) byteArray.push(str.charCodeAt(i) & 255);
				return byteArray;
			}
			function utf16leToBytes(str, units) {
				let c, hi, lo;
				const byteArray = [];
				for (let i = 0; i < str.length; ++i) {
					if ((units -= 2) < 0) break;
					c = str.charCodeAt(i);
					hi = c >> 8;
					lo = c % 256;
					byteArray.push(lo);
					byteArray.push(hi);
				}
				return byteArray;
			}
			function base64ToBytes(str) {
				return base64.toByteArray(base64clean(str));
			}
			function blitBuffer(src, dst, offset, length) {
				let i;
				for (i = 0; i < length; ++i) {
					if (i + offset >= dst.length || i >= src.length) break;
					dst[i + offset] = src[i];
				}
				return i;
			}
			function isInstance(obj, type) {
				return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
			}
			function numberIsNaN(obj) {
				return obj !== obj;
			}
			const hexSliceLookupTable = (function() {
				const alphabet = "0123456789abcdef";
				const table = new Array(256);
				for (let i = 0; i < 16; ++i) {
					const i16 = i * 16;
					for (let j = 0; j < 16; ++j) table[i16 + j] = alphabet[i] + alphabet[j];
				}
				return table;
			})();
			function defineBigIntMethod(fn) {
				return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
			}
			function BufferBigIntNotDefined() {
				throw new Error("BigInt not supported");
			}
		})(buffer);
		var Buffer = buffer.Buffer;
		exports.Blob = buffer.Blob;
		exports.BlobOptions = buffer.BlobOptions;
		exports.Buffer = buffer.Buffer;
		exports.File = buffer.File;
		exports.FileOptions = buffer.FileOptions;
		exports.INSPECT_MAX_BYTES = buffer.INSPECT_MAX_BYTES;
		exports.SlowBuffer = buffer.SlowBuffer;
		exports.TranscodeEncoding = buffer.TranscodeEncoding;
		exports.atob = buffer.atob;
		exports.btoa = buffer.btoa;
		exports.constants = buffer.constants;
		exports.default = Buffer;
		exports.isAscii = buffer.isAscii;
		exports.isUtf8 = buffer.isUtf8;
		exports.kMaxLength = buffer.kMaxLength;
		exports.kStringMaxLength = buffer.kStringMaxLength;
		exports.resolveObjectURL = buffer.resolveObjectURL;
		exports.transcode = buffer.transcode;
	}));
	//#endregion
	//#region ../../node_modules/safe-buffer/index.js
	var require_safe_buffer$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
		var buffer = require_dist();
		var Buffer = buffer.Buffer;
		function copyProps(src, dst) {
			for (var key in src) dst[key] = src[key];
		}
		if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
		else {
			copyProps(buffer, exports);
			exports.Buffer = SafeBuffer;
		}
		function SafeBuffer(arg, encodingOrOffset, length) {
			return Buffer(arg, encodingOrOffset, length);
		}
		SafeBuffer.prototype = Object.create(Buffer.prototype);
		copyProps(Buffer, SafeBuffer);
		SafeBuffer.from = function(arg, encodingOrOffset, length) {
			if (typeof arg === "number") throw new TypeError("Argument must not be a number");
			return Buffer(arg, encodingOrOffset, length);
		};
		SafeBuffer.alloc = function(size, fill, encoding) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			var buf = Buffer(size);
			if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
			else buf.fill(fill);
			else buf.fill(0);
			return buf;
		};
		SafeBuffer.allocUnsafe = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return Buffer(size);
		};
		SafeBuffer.allocUnsafeSlow = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return buffer.SlowBuffer(size);
		};
	}));
	//#endregion
	//#region ../../node_modules/randombytes/browser.js
	var require_browser$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		var MAX_BYTES = 65536;
		var MAX_UINT32 = 4294967295;
		function oldBrowser() {
			throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11");
		}
		var Buffer = require_safe_buffer$4().Buffer;
		var crypto = global.crypto || global.msCrypto;
		if (crypto && crypto.getRandomValues) module.exports = randomBytes;
		else module.exports = oldBrowser;
		function randomBytes(size, cb) {
			if (size > MAX_UINT32) throw new RangeError("requested too many random bytes");
			var bytes = Buffer.allocUnsafe(size);
			if (size > 0) if (size > MAX_BYTES) for (var generated = 0; generated < size; generated += MAX_BYTES) crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));
			else crypto.getRandomValues(bytes);
			if (typeof cb === "function") return process$1.nextTick(function() {
				cb(null, bytes);
			});
			return bytes;
		}
	}));
	//#endregion
	//#region ../../node_modules/inherits/inherits_browser.js
	var require_inherits_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		if (typeof Object.create === "function") module.exports = function inherits(ctor, superCtor) {
			if (superCtor) {
				ctor.super_ = superCtor;
				ctor.prototype = Object.create(superCtor.prototype, { constructor: {
					value: ctor,
					enumerable: false,
					writable: true,
					configurable: true
				} });
			}
		};
		else module.exports = function inherits(ctor, superCtor) {
			if (superCtor) {
				ctor.super_ = superCtor;
				var TempCtor = function() {};
				TempCtor.prototype = superCtor.prototype;
				ctor.prototype = new TempCtor();
				ctor.prototype.constructor = ctor;
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/isarray/index.js
	var require_isarray$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var toString = {}.toString;
		module.exports = Array.isArray || function(arr) {
			return toString.call(arr) == "[object Array]";
		};
	}));
	//#endregion
	//#region ../../node_modules/es-errors/type.js
	var require_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./type')} */
		module.exports = TypeError;
	}));
	//#endregion
	//#region ../../node_modules/es-object-atoms/index.js
	var require_es_object_atoms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('.')} */
		module.exports = Object;
	}));
	//#endregion
	//#region ../../node_modules/es-errors/index.js
	var require_es_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('.')} */
		module.exports = Error;
	}));
	//#endregion
	//#region ../../node_modules/es-errors/eval.js
	var require_eval = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./eval')} */
		module.exports = EvalError;
	}));
	//#endregion
	//#region ../../node_modules/es-errors/range.js
	var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./range')} */
		module.exports = RangeError;
	}));
	//#endregion
	//#region ../../node_modules/es-errors/ref.js
	var require_ref = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./ref')} */
		module.exports = ReferenceError;
	}));
	//#endregion
	//#region ../../node_modules/es-errors/syntax.js
	var require_syntax = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./syntax')} */
		module.exports = SyntaxError;
	}));
	//#endregion
	//#region ../../node_modules/es-errors/uri.js
	var require_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./uri')} */
		module.exports = URIError;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/abs.js
	var require_abs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./abs')} */
		module.exports = Math.abs;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/floor.js
	var require_floor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./floor')} */
		module.exports = Math.floor;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/max.js
	var require_max = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./max')} */
		module.exports = Math.max;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/min.js
	var require_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./min')} */
		module.exports = Math.min;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/pow.js
	var require_pow = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./pow')} */
		module.exports = Math.pow;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/round.js
	var require_round = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./round')} */
		module.exports = Math.round;
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/isNaN.js
	var require_isNaN = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./isNaN')} */
		module.exports = Number.isNaN || function isNaN(a) {
			return a !== a;
		};
	}));
	//#endregion
	//#region ../../node_modules/math-intrinsics/sign.js
	var require_sign$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var $isNaN = require_isNaN();
		/** @type {import('./sign')} */
		module.exports = function sign(number) {
			if ($isNaN(number) || number === 0) return number;
			return number < 0 ? -1 : 1;
		};
	}));
	//#endregion
	//#region ../../node_modules/gopd/gOPD.js
	var require_gOPD = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./gOPD')} */
		module.exports = Object.getOwnPropertyDescriptor;
	}));
	//#endregion
	//#region ../../node_modules/gopd/index.js
	var require_gopd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('.')} */
		var $gOPD = require_gOPD();
		if ($gOPD) try {
			$gOPD([], "length");
		} catch (e) {
			$gOPD = null;
		}
		module.exports = $gOPD;
	}));
	//#endregion
	//#region ../../node_modules/es-define-property/index.js
	var require_es_define_property = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('.')} */
		var $defineProperty = Object.defineProperty || false;
		if ($defineProperty) try {
			$defineProperty({}, "a", { value: 1 });
		} catch (e) {
			$defineProperty = false;
		}
		module.exports = $defineProperty;
	}));
	//#endregion
	//#region ../../node_modules/has-symbols/shams.js
	var require_shams$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./shams')} */
		module.exports = function hasSymbols() {
			if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") return false;
			if (typeof Symbol.iterator === "symbol") return true;
			/** @type {{ [k in symbol]?: unknown }} */
			var obj = {};
			var sym = Symbol("test");
			var symObj = Object(sym);
			if (typeof sym === "string") return false;
			if (Object.prototype.toString.call(sym) !== "[object Symbol]") return false;
			if (Object.prototype.toString.call(symObj) !== "[object Symbol]") return false;
			var symVal = 42;
			obj[sym] = symVal;
			for (var _ in obj) return false;
			if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) return false;
			if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) return false;
			var syms = Object.getOwnPropertySymbols(obj);
			if (syms.length !== 1 || syms[0] !== sym) return false;
			if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) return false;
			if (typeof Object.getOwnPropertyDescriptor === "function") {
				var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
				if (descriptor.value !== symVal || descriptor.enumerable !== true) return false;
			}
			return true;
		};
	}));
	//#endregion
	//#region ../../node_modules/has-symbols/index.js
	var require_has_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var origSymbol = typeof Symbol !== "undefined" && Symbol;
		var hasSymbolSham = require_shams$1();
		/** @type {import('.')} */
		module.exports = function hasNativeSymbols() {
			if (typeof origSymbol !== "function") return false;
			if (typeof Symbol !== "function") return false;
			if (typeof origSymbol("foo") !== "symbol") return false;
			if (typeof Symbol("bar") !== "symbol") return false;
			return hasSymbolSham();
		};
	}));
	//#endregion
	//#region ../../node_modules/get-proto/Reflect.getPrototypeOf.js
	var require_Reflect_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./Reflect.getPrototypeOf')} */
		module.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
	}));
	//#endregion
	//#region ../../node_modules/get-proto/Object.getPrototypeOf.js
	var require_Object_getPrototypeOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./Object.getPrototypeOf')} */
		module.exports = require_es_object_atoms().getPrototypeOf || null;
	}));
	//#endregion
	//#region ../../node_modules/function-bind/implementation.js
	var require_implementation$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
		var toStr = Object.prototype.toString;
		var max = Math.max;
		var funcType = "[object Function]";
		var concatty = function concatty(a, b) {
			var arr = [];
			for (var i = 0; i < a.length; i += 1) arr[i] = a[i];
			for (var j = 0; j < b.length; j += 1) arr[j + a.length] = b[j];
			return arr;
		};
		var slicy = function slicy(arrLike, offset) {
			var arr = [];
			for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) arr[j] = arrLike[i];
			return arr;
		};
		var joiny = function(arr, joiner) {
			var str = "";
			for (var i = 0; i < arr.length; i += 1) {
				str += arr[i];
				if (i + 1 < arr.length) str += joiner;
			}
			return str;
		};
		module.exports = function bind(that) {
			var target = this;
			if (typeof target !== "function" || toStr.apply(target) !== funcType) throw new TypeError(ERROR_MESSAGE + target);
			var args = slicy(arguments, 1);
			var bound;
			var binder = function() {
				if (this instanceof bound) {
					var result = target.apply(this, concatty(args, arguments));
					if (Object(result) === result) return result;
					return this;
				}
				return target.apply(that, concatty(args, arguments));
			};
			var boundLength = max(0, target.length - args.length);
			var boundArgs = [];
			for (var i = 0; i < boundLength; i++) boundArgs[i] = "$" + i;
			bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
			if (target.prototype) {
				var Empty = function Empty() {};
				Empty.prototype = target.prototype;
				bound.prototype = new Empty();
				Empty.prototype = null;
			}
			return bound;
		};
	}));
	//#endregion
	//#region ../../node_modules/function-bind/index.js
	var require_function_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var implementation = require_implementation$4();
		module.exports = Function.prototype.bind || implementation;
	}));
	//#endregion
	//#region ../../node_modules/call-bind-apply-helpers/functionCall.js
	var require_functionCall = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./functionCall')} */
		module.exports = Function.prototype.call;
	}));
	//#endregion
	//#region ../../node_modules/call-bind-apply-helpers/functionApply.js
	var require_functionApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./functionApply')} */
		module.exports = Function.prototype.apply;
	}));
	//#endregion
	//#region ../../node_modules/call-bind-apply-helpers/reflectApply.js
	var require_reflectApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('./reflectApply')} */
		module.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
	}));
	//#endregion
	//#region ../../node_modules/call-bind-apply-helpers/actualApply.js
	var require_actualApply = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var bind = require_function_bind();
		var $apply = require_functionApply();
		var $call = require_functionCall();
		/** @type {import('./actualApply')} */
		module.exports = require_reflectApply() || bind.call($call, $apply);
	}));
	//#endregion
	//#region ../../node_modules/call-bind-apply-helpers/index.js
	var require_call_bind_apply_helpers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var bind = require_function_bind();
		var $TypeError = require_type();
		var $call = require_functionCall();
		var $actualApply = require_actualApply();
		/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
		module.exports = function callBindBasic(args) {
			if (args.length < 1 || typeof args[0] !== "function") throw new $TypeError("a function is required");
			return $actualApply(bind, $call, args);
		};
	}));
	//#endregion
	//#region ../../node_modules/dunder-proto/get.js
	var require_get = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var callBind = require_call_bind_apply_helpers();
		var gOPD = require_gopd();
		var hasProtoAccessor;
		try {
			hasProtoAccessor = [].__proto__ === Array.prototype;
		} catch (e) {
			if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") throw e;
		}
		var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, "__proto__");
		var $Object = Object;
		var $getPrototypeOf = $Object.getPrototypeOf;
		/** @type {import('./get')} */
		module.exports = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? function getDunder(value) {
			return $getPrototypeOf(value == null ? value : $Object(value));
		} : false;
	}));
	//#endregion
	//#region ../../node_modules/get-proto/index.js
	var require_get_proto = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var reflectGetProto = require_Reflect_getPrototypeOf();
		var originalGetProto = require_Object_getPrototypeOf();
		var getDunderProto = require_get();
		/** @type {import('.')} */
		module.exports = reflectGetProto ? function getProto(O) {
			return reflectGetProto(O);
		} : originalGetProto ? function getProto(O) {
			if (!O || typeof O !== "object" && typeof O !== "function") throw new TypeError("getProto: not an object");
			return originalGetProto(O);
		} : getDunderProto ? function getProto(O) {
			return getDunderProto(O);
		} : null;
	}));
	//#endregion
	//#region ../../node_modules/async-function/index.js
	var require_async_function = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var cached = async function() {}.constructor;
		/** @type {import('.')} */
		module.exports = () => cached;
	}));
	//#endregion
	//#region ../../node_modules/generator-function/index.js
	var require_generator_function = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var cached = function* () {}.constructor;
		/** @type {import('.')} */
		module.exports = () => cached;
	}));
	//#endregion
	//#region ../../node_modules/async-generator-function/index.js
	var require_async_generator_function = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var cached = async function* () {}.constructor;
		/** @type {import('.')} */
		module.exports = () => cached;
	}));
	//#endregion
	//#region ../../node_modules/hasown/index.js
	var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var call = Function.prototype.call;
		var $hasOwn = Object.prototype.hasOwnProperty;
		/** @type {import('.')} */
		module.exports = require_function_bind().call(call, $hasOwn);
	}));
	//#endregion
	//#region ../../node_modules/get-intrinsic/index.js
	var require_get_intrinsic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var undefined;
		var $Object = require_es_object_atoms();
		var $Error = require_es_errors();
		var $EvalError = require_eval();
		var $RangeError = require_range();
		var $ReferenceError = require_ref();
		var $SyntaxError = require_syntax();
		var $TypeError = require_type();
		var $URIError = require_uri();
		var abs = require_abs();
		var floor = require_floor();
		var max = require_max();
		var min = require_min();
		var pow = require_pow();
		var round = require_round();
		var sign = require_sign$1();
		var $gOPD = require_gopd();
		var $defineProperty = require_es_define_property();
		var throwTypeError = function() {
			throw new $TypeError();
		};
		var ThrowTypeError = $gOPD ? function() {
			try {
				arguments.callee;
				return throwTypeError;
			} catch (calleeThrows) {
				try {
					return $gOPD(arguments, "callee").get;
				} catch (gOPDthrows) {
					return throwTypeError;
				}
			}
		}() : throwTypeError;
		var hasSymbols = require_has_symbols()();
		var getProto = require_get_proto();
		var $ObjectGPO = require_Object_getPrototypeOf();
		var $ReflectGPO = require_Reflect_getPrototypeOf();
		var $apply = require_functionApply();
		var $call = require_functionCall();
		var needsEval = {};
		var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined : getProto(Uint8Array);
		var INTRINSICS = {
			__proto__: null,
			"%AggregateError%": typeof AggregateError === "undefined" ? undefined : AggregateError,
			"%Array%": Array,
			"%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined : ArrayBuffer,
			"%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
			"%AsyncFromSyncIteratorPrototype%": undefined,
			"%AsyncFunction%": needsEval,
			"%AsyncGenerator%": needsEval,
			"%AsyncGeneratorFunction%": needsEval,
			"%AsyncIteratorPrototype%": needsEval,
			"%Atomics%": typeof Atomics === "undefined" ? undefined : Atomics,
			"%BigInt%": typeof BigInt === "undefined" ? undefined : BigInt,
			"%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined : BigInt64Array,
			"%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined : BigUint64Array,
			"%Boolean%": Boolean,
			"%DataView%": typeof DataView === "undefined" ? undefined : DataView,
			"%Date%": Date,
			"%decodeURI%": decodeURI,
			"%decodeURIComponent%": decodeURIComponent,
			"%encodeURI%": encodeURI,
			"%encodeURIComponent%": encodeURIComponent,
			"%Error%": $Error,
			"%eval%": eval,
			"%EvalError%": $EvalError,
			"%Float16Array%": typeof Float16Array === "undefined" ? undefined : Float16Array,
			"%Float32Array%": typeof Float32Array === "undefined" ? undefined : Float32Array,
			"%Float64Array%": typeof Float64Array === "undefined" ? undefined : Float64Array,
			"%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined : FinalizationRegistry,
			"%Function%": Function,
			"%GeneratorFunction%": needsEval,
			"%Int8Array%": typeof Int8Array === "undefined" ? undefined : Int8Array,
			"%Int16Array%": typeof Int16Array === "undefined" ? undefined : Int16Array,
			"%Int32Array%": typeof Int32Array === "undefined" ? undefined : Int32Array,
			"%isFinite%": isFinite,
			"%isNaN%": isNaN,
			"%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
			"%JSON%": typeof JSON === "object" ? JSON : undefined,
			"%Map%": typeof Map === "undefined" ? undefined : Map,
			"%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
			"%Math%": Math,
			"%Number%": Number,
			"%Object%": $Object,
			"%Object.getOwnPropertyDescriptor%": $gOPD,
			"%parseFloat%": parseFloat,
			"%parseInt%": parseInt,
			"%Promise%": typeof Promise === "undefined" ? undefined : Promise,
			"%Proxy%": typeof Proxy === "undefined" ? undefined : Proxy,
			"%RangeError%": $RangeError,
			"%ReferenceError%": $ReferenceError,
			"%Reflect%": typeof Reflect === "undefined" ? undefined : Reflect,
			"%RegExp%": RegExp,
			"%Set%": typeof Set === "undefined" ? undefined : Set,
			"%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
			"%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined : SharedArrayBuffer,
			"%String%": String,
			"%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined,
			"%Symbol%": hasSymbols ? Symbol : undefined,
			"%SyntaxError%": $SyntaxError,
			"%ThrowTypeError%": ThrowTypeError,
			"%TypedArray%": TypedArray,
			"%TypeError%": $TypeError,
			"%Uint8Array%": typeof Uint8Array === "undefined" ? undefined : Uint8Array,
			"%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined : Uint8ClampedArray,
			"%Uint16Array%": typeof Uint16Array === "undefined" ? undefined : Uint16Array,
			"%Uint32Array%": typeof Uint32Array === "undefined" ? undefined : Uint32Array,
			"%URIError%": $URIError,
			"%WeakMap%": typeof WeakMap === "undefined" ? undefined : WeakMap,
			"%WeakRef%": typeof WeakRef === "undefined" ? undefined : WeakRef,
			"%WeakSet%": typeof WeakSet === "undefined" ? undefined : WeakSet,
			"%Function.prototype.call%": $call,
			"%Function.prototype.apply%": $apply,
			"%Object.defineProperty%": $defineProperty,
			"%Object.getPrototypeOf%": $ObjectGPO,
			"%Math.abs%": abs,
			"%Math.floor%": floor,
			"%Math.max%": max,
			"%Math.min%": min,
			"%Math.pow%": pow,
			"%Math.round%": round,
			"%Math.sign%": sign,
			"%Reflect.getPrototypeOf%": $ReflectGPO
		};
		if (getProto) try {
			null.error;
		} catch (e) {
			INTRINSICS["%Error.prototype%"] = getProto(getProto(e));
		}
		var getAsyncFunction = require_async_function();
		var getGeneratorFunction = require_generator_function();
		var getAsyncGeneratorFunction = require_async_generator_function();
		var doEval = function doEval(name) {
			var value;
			if (name === "%AsyncFunction%") value = getAsyncFunction() || void 0;
			else if (name === "%GeneratorFunction%") value = getGeneratorFunction() || void 0;
			else if (name === "%AsyncGeneratorFunction%") value = getAsyncGeneratorFunction() || void 0;
			else if (name === "%AsyncGenerator%") {
				var fn = doEval("%AsyncGeneratorFunction%");
				if (fn) value = fn.prototype;
			} else if (name === "%AsyncIteratorPrototype%") {
				var gen = doEval("%AsyncGenerator%");
				if (gen && getProto) value = getProto(gen.prototype);
			}
			INTRINSICS[name] = value;
			return value;
		};
		var LEGACY_ALIASES = {
			__proto__: null,
			"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
			"%ArrayPrototype%": ["Array", "prototype"],
			"%ArrayProto_entries%": [
				"Array",
				"prototype",
				"entries"
			],
			"%ArrayProto_forEach%": [
				"Array",
				"prototype",
				"forEach"
			],
			"%ArrayProto_keys%": [
				"Array",
				"prototype",
				"keys"
			],
			"%ArrayProto_values%": [
				"Array",
				"prototype",
				"values"
			],
			"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
			"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
			"%AsyncGeneratorPrototype%": [
				"AsyncGeneratorFunction",
				"prototype",
				"prototype"
			],
			"%BooleanPrototype%": ["Boolean", "prototype"],
			"%DataViewPrototype%": ["DataView", "prototype"],
			"%DatePrototype%": ["Date", "prototype"],
			"%ErrorPrototype%": ["Error", "prototype"],
			"%EvalErrorPrototype%": ["EvalError", "prototype"],
			"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
			"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
			"%FunctionPrototype%": ["Function", "prototype"],
			"%Generator%": ["GeneratorFunction", "prototype"],
			"%GeneratorPrototype%": [
				"GeneratorFunction",
				"prototype",
				"prototype"
			],
			"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
			"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
			"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
			"%JSONParse%": ["JSON", "parse"],
			"%JSONStringify%": ["JSON", "stringify"],
			"%MapPrototype%": ["Map", "prototype"],
			"%NumberPrototype%": ["Number", "prototype"],
			"%ObjectPrototype%": ["Object", "prototype"],
			"%ObjProto_toString%": [
				"Object",
				"prototype",
				"toString"
			],
			"%ObjProto_valueOf%": [
				"Object",
				"prototype",
				"valueOf"
			],
			"%PromisePrototype%": ["Promise", "prototype"],
			"%PromiseProto_then%": [
				"Promise",
				"prototype",
				"then"
			],
			"%Promise_all%": ["Promise", "all"],
			"%Promise_reject%": ["Promise", "reject"],
			"%Promise_resolve%": ["Promise", "resolve"],
			"%RangeErrorPrototype%": ["RangeError", "prototype"],
			"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
			"%RegExpPrototype%": ["RegExp", "prototype"],
			"%SetPrototype%": ["Set", "prototype"],
			"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
			"%StringPrototype%": ["String", "prototype"],
			"%SymbolPrototype%": ["Symbol", "prototype"],
			"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
			"%TypedArrayPrototype%": ["TypedArray", "prototype"],
			"%TypeErrorPrototype%": ["TypeError", "prototype"],
			"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
			"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
			"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
			"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
			"%URIErrorPrototype%": ["URIError", "prototype"],
			"%WeakMapPrototype%": ["WeakMap", "prototype"],
			"%WeakSetPrototype%": ["WeakSet", "prototype"]
		};
		var bind = require_function_bind();
		var hasOwn = require_hasown();
		var $concat = bind.call($call, Array.prototype.concat);
		var $spliceApply = bind.call($apply, Array.prototype.splice);
		var $replace = bind.call($call, String.prototype.replace);
		var $strSlice = bind.call($call, String.prototype.slice);
		var $exec = bind.call($call, RegExp.prototype.exec);
		var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
		var reEscapeChar = /\\(\\)?/g;
		var stringToPath = function stringToPath(string) {
			var first = $strSlice(string, 0, 1);
			var last = $strSlice(string, -1);
			if (first === "%" && last !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
			else if (last === "%" && first !== "%") throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
			var result = [];
			$replace(string, rePropName, function(match, number, quote, subString) {
				result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match;
			});
			return result;
		};
		var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
			var intrinsicName = name;
			var alias;
			if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
				alias = LEGACY_ALIASES[intrinsicName];
				intrinsicName = "%" + alias[0] + "%";
			}
			if (hasOwn(INTRINSICS, intrinsicName)) {
				var value = INTRINSICS[intrinsicName];
				if (value === needsEval) value = doEval(intrinsicName);
				if (typeof value === "undefined" && !allowMissing) throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
				return {
					alias,
					name: intrinsicName,
					value
				};
			}
			throw new $SyntaxError("intrinsic " + name + " does not exist!");
		};
		module.exports = function GetIntrinsic(name, allowMissing) {
			if (typeof name !== "string" || name.length === 0) throw new $TypeError("intrinsic name must be a non-empty string");
			if (arguments.length > 1 && typeof allowMissing !== "boolean") throw new $TypeError("\"allowMissing\" argument must be a boolean");
			if ($exec(/^%?[^%]*%?$/, name) === null) throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
			var parts = stringToPath(name);
			var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
			var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
			var intrinsicRealName = intrinsic.name;
			var value = intrinsic.value;
			var skipFurtherCaching = false;
			var alias = intrinsic.alias;
			if (alias) {
				intrinsicBaseName = alias[0];
				$spliceApply(parts, $concat([0, 1], alias));
			}
			for (var i = 1, isOwn = true; i < parts.length; i += 1) {
				var part = parts[i];
				var first = $strSlice(part, 0, 1);
				var last = $strSlice(part, -1);
				if ((first === "\"" || first === "'" || first === "`" || last === "\"" || last === "'" || last === "`") && first !== last) throw new $SyntaxError("property names with quotes must have matching quotes");
				if (part === "constructor" || !isOwn) skipFurtherCaching = true;
				intrinsicBaseName += "." + part;
				intrinsicRealName = "%" + intrinsicBaseName + "%";
				if (hasOwn(INTRINSICS, intrinsicRealName)) value = INTRINSICS[intrinsicRealName];
				else if (value != null) {
					if (!(part in value)) {
						if (!allowMissing) throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
						return;
					}
					if ($gOPD && i + 1 >= parts.length) {
						var desc = $gOPD(value, part);
						isOwn = !!desc;
						if (isOwn && "get" in desc && !("originalValue" in desc.get)) value = desc.get;
						else value = value[part];
					} else {
						isOwn = hasOwn(value, part);
						value = value[part];
					}
					if (isOwn && !skipFurtherCaching) INTRINSICS[intrinsicRealName] = value;
				}
			}
			return value;
		};
	}));
	//#endregion
	//#region ../../node_modules/call-bound/index.js
	var require_call_bound = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var GetIntrinsic = require_get_intrinsic();
		var callBindBasic = require_call_bind_apply_helpers();
		/** @type {(thisArg: string, searchString: string, position?: number) => number} */
		var $indexOf = callBindBasic([GetIntrinsic("%String.prototype.indexOf%")]);
		/** @type {import('.')} */
		module.exports = function callBoundIntrinsic(name, allowMissing) {
			var intrinsic = GetIntrinsic(name, !!allowMissing);
			if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) return callBindBasic([intrinsic]);
			return intrinsic;
		};
	}));
	//#endregion
	//#region ../../node_modules/is-callable/index.js
	var require_is_callable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var fnToStr = Function.prototype.toString;
		var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply;
		var badArrayLike;
		var isCallableMarker;
		if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") try {
			badArrayLike = Object.defineProperty({}, "length", { get: function() {
				throw isCallableMarker;
			} });
			isCallableMarker = {};
			reflectApply(function() {
				throw 42;
			}, null, badArrayLike);
		} catch (_) {
			if (_ !== isCallableMarker) reflectApply = null;
		}
		else reflectApply = null;
		var constructorRegex = /^\s*class\b/;
		var isES6ClassFn = function isES6ClassFunction(value) {
			try {
				var fnStr = fnToStr.call(value);
				return constructorRegex.test(fnStr);
			} catch (e) {
				return false;
			}
		};
		var tryFunctionObject = function tryFunctionToStr(value) {
			try {
				if (isES6ClassFn(value)) return false;
				fnToStr.call(value);
				return true;
			} catch (e) {
				return false;
			}
		};
		var toStr = Object.prototype.toString;
		var objectClass = "[object Object]";
		var fnClass = "[object Function]";
		var genClass = "[object GeneratorFunction]";
		var ddaClass = "[object HTMLAllCollection]";
		var ddaClass2 = "[object HTML document.all class]";
		var ddaClass3 = "[object HTMLCollection]";
		var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag;
		var isIE68 = !(0 in [,]);
		var isDDA = function isDocumentDotAll() {
			return false;
		};
		if (typeof document === "object") {
			var all = document.all;
			if (toStr.call(all) === toStr.call(document.all)) isDDA = function isDocumentDotAll(value) {
				if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) try {
					var str = toStr.call(value);
					return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null;
				} catch (e) {}
				return false;
			};
		}
		module.exports = reflectApply ? function isCallable(value) {
			if (isDDA(value)) return true;
			if (!value) return false;
			if (typeof value !== "function" && typeof value !== "object") return false;
			try {
				reflectApply(value, null, badArrayLike);
			} catch (e) {
				if (e !== isCallableMarker) return false;
			}
			return !isES6ClassFn(value) && tryFunctionObject(value);
		} : function isCallable(value) {
			if (isDDA(value)) return true;
			if (!value) return false;
			if (typeof value !== "function" && typeof value !== "object") return false;
			if (hasToStringTag) return tryFunctionObject(value);
			if (isES6ClassFn(value)) return false;
			var strClass = toStr.call(value);
			if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) return false;
			return tryFunctionObject(value);
		};
	}));
	//#endregion
	//#region ../../node_modules/for-each/index.js
	var require_for_each = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isCallable = require_is_callable();
		var toStr = Object.prototype.toString;
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/** @type {<This, A extends readonly unknown[]>(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */
		var forEachArray = function forEachArray(array, iterator, receiver) {
			for (var i = 0, len = array.length; i < len; i++) if (hasOwnProperty.call(array, i)) if (receiver == null) iterator(array[i], i, array);
			else iterator.call(receiver, array[i], i, array);
		};
		/** @type {<This, S extends string>(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */
		var forEachString = function forEachString(string, iterator, receiver) {
			for (var i = 0, len = string.length; i < len; i++) if (receiver == null) iterator(string.charAt(i), i, string);
			else iterator.call(receiver, string.charAt(i), i, string);
		};
		/** @type {<This, O>(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */
		var forEachObject = function forEachObject(object, iterator, receiver) {
			for (var k in object) if (hasOwnProperty.call(object, k)) if (receiver == null) iterator(object[k], k, object);
			else iterator.call(receiver, object[k], k, object);
		};
		/** @type {(x: unknown) => x is readonly unknown[]} */
		function isArray(x) {
			return toStr.call(x) === "[object Array]";
		}
		/** @type {import('.')._internal} */
		module.exports = function forEach(list, iterator, thisArg) {
			if (!isCallable(iterator)) throw new TypeError("iterator must be a function");
			var receiver;
			if (arguments.length >= 3) receiver = thisArg;
			if (isArray(list)) forEachArray(list, iterator, receiver);
			else if (typeof list === "string") forEachString(list, iterator, receiver);
			else forEachObject(list, iterator, receiver);
		};
	}));
	//#endregion
	//#region ../../node_modules/possible-typed-array-names/index.js
	var require_possible_typed_array_names = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** @type {import('.')} */
		module.exports = [
			"Float16Array",
			"Float32Array",
			"Float64Array",
			"Int8Array",
			"Int16Array",
			"Int32Array",
			"Uint8Array",
			"Uint8ClampedArray",
			"Uint16Array",
			"Uint32Array",
			"BigInt64Array",
			"BigUint64Array"
		];
	}));
	//#endregion
	//#region ../../node_modules/available-typed-arrays/index.js
	var require_available_typed_arrays = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		var possibleNames = require_possible_typed_array_names();
		var g = typeof globalThis === "undefined" ? global : globalThis;
		/** @type {import('.')} */
		module.exports = function availableTypedArrays() {
			var out = [];
			for (var i = 0; i < possibleNames.length; i++) if (typeof g[possibleNames[i]] === "function") out[out.length] = possibleNames[i];
			return out;
		};
	}));
	//#endregion
	//#region ../../node_modules/define-data-property/index.js
	var require_define_data_property = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var $defineProperty = require_es_define_property();
		var $SyntaxError = require_syntax();
		var $TypeError = require_type();
		var gopd = require_gopd();
		/** @type {import('.')} */
		module.exports = function defineDataProperty(obj, property, value) {
			if (!obj || typeof obj !== "object" && typeof obj !== "function") throw new $TypeError("`obj` must be an object or a function`");
			if (typeof property !== "string" && typeof property !== "symbol") throw new $TypeError("`property` must be a string or a symbol`");
			if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
			if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
			if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
			if (arguments.length > 6 && typeof arguments[6] !== "boolean") throw new $TypeError("`loose`, if provided, must be a boolean");
			var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
			var nonWritable = arguments.length > 4 ? arguments[4] : null;
			var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
			var loose = arguments.length > 6 ? arguments[6] : false;
			var desc = !!gopd && gopd(obj, property);
			if ($defineProperty) $defineProperty(obj, property, {
				configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
				enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
				value,
				writable: nonWritable === null && desc ? desc.writable : !nonWritable
			});
			else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) obj[property] = value;
			else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
		};
	}));
	//#endregion
	//#region ../../node_modules/has-property-descriptors/index.js
	var require_has_property_descriptors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var $defineProperty = require_es_define_property();
		var hasPropertyDescriptors = function hasPropertyDescriptors() {
			return !!$defineProperty;
		};
		hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
			if (!$defineProperty) return null;
			try {
				return $defineProperty([], "length", { value: 1 }).length !== 1;
			} catch (e) {
				return true;
			}
		};
		module.exports = hasPropertyDescriptors;
	}));
	//#endregion
	//#region ../../node_modules/set-function-length/index.js
	var require_set_function_length = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var GetIntrinsic = require_get_intrinsic();
		var define = require_define_data_property();
		var hasDescriptors = require_has_property_descriptors()();
		var gOPD = require_gopd();
		var $TypeError = require_type();
		var $floor = GetIntrinsic("%Math.floor%");
		/** @type {import('.')} */
		module.exports = function setFunctionLength(fn, length) {
			if (typeof fn !== "function") throw new $TypeError("`fn` is not a function");
			if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) throw new $TypeError("`length` must be a positive 32-bit integer");
			var loose = arguments.length > 2 && !!arguments[2];
			var functionLengthIsConfigurable = true;
			var functionLengthIsWritable = true;
			if ("length" in fn && gOPD) {
				var desc = gOPD(fn, "length");
				if (desc && !desc.configurable) functionLengthIsConfigurable = false;
				if (desc && !desc.writable) functionLengthIsWritable = false;
			}
			if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) if (hasDescriptors) define(fn, "length", length, true, true);
			else define(fn, "length", length);
			return fn;
		};
	}));
	//#endregion
	//#region ../../node_modules/call-bind-apply-helpers/applyBind.js
	var require_applyBind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var bind = require_function_bind();
		var $apply = require_functionApply();
		var actualApply = require_actualApply();
		/** @type {import('./applyBind')} */
		module.exports = function applyBind() {
			return actualApply(bind, $apply, arguments);
		};
	}));
	//#endregion
	//#region ../../node_modules/call-bind/index.js
	var require_call_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var setFunctionLength = require_set_function_length();
		var $defineProperty = require_es_define_property();
		var callBindBasic = require_call_bind_apply_helpers();
		var applyBind = require_applyBind();
		module.exports = function callBind(originalFunction) {
			var func = callBindBasic(arguments);
			var adjustedLength = originalFunction.length - (arguments.length - 1);
			return setFunctionLength(func, 1 + (adjustedLength > 0 ? adjustedLength : 0), true);
		};
		if ($defineProperty) $defineProperty(module.exports, "apply", { value: applyBind });
		else module.exports.apply = applyBind;
	}));
	//#endregion
	//#region ../../node_modules/has-tostringtag/shams.js
	var require_shams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var hasSymbols = require_shams$1();
		/** @type {import('.')} */
		module.exports = function hasToStringTagShams() {
			return hasSymbols() && !!Symbol.toStringTag;
		};
	}));
	//#endregion
	//#region ../../node_modules/which-typed-array/index.js
	var require_which_typed_array = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		var forEach = require_for_each();
		var availableTypedArrays = require_available_typed_arrays();
		var callBind = require_call_bind();
		var callBound = require_call_bound();
		var gOPD = require_gopd();
		var getProto = require_get_proto();
		var $toString = callBound("Object.prototype.toString");
		var hasToStringTag = require_shams()();
		var g = typeof globalThis === "undefined" ? global : globalThis;
		var typedArrays = availableTypedArrays();
		var $slice = callBound("String.prototype.slice");
		/** @type {<T = unknown>(array: readonly T[], value: unknown) => number} */
		var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) {
			for (var i = 0; i < array.length; i += 1) if (array[i] === value) return i;
			return -1;
		};
		/** @typedef {import('./types').Getter} Getter */
		/** @type {import('./types').Cache} */
		var cache = { __proto__: null };
		if (hasToStringTag && gOPD && getProto) forEach(typedArrays, function(typedArray) {
			var arr = new g[typedArray]();
			if (Symbol.toStringTag in arr && getProto) {
				var proto = getProto(arr);
				var descriptor = gOPD(proto, Symbol.toStringTag);
				if (!descriptor && proto) descriptor = gOPD(getProto(proto), Symbol.toStringTag);
				cache["$" + typedArray] = callBind(descriptor.get);
			}
		});
		else forEach(typedArrays, function(typedArray) {
			var arr = new g[typedArray]();
			var fn = arr.slice || arr.set;
			if (fn) cache["$" + typedArray] = callBind(fn);
		});
		/** @type {(value: object) => false | import('.').TypedArrayName} */
		var tryTypedArrays = function tryAllTypedArrays(value) {
			/** @type {ReturnType<typeof tryAllTypedArrays>} */ var found = false;
			forEach(
				cache,
				/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
				function(getter, typedArray) {
					if (!found) try {
						if ("$" + getter(value) === typedArray) found = $slice(typedArray, 1);
					} catch (e) {}
				}
			);
			return found;
		};
		/** @type {(value: object) => false | import('.').TypedArrayName} */
		var trySlices = function tryAllSlices(value) {
			/** @type {ReturnType<typeof tryAllSlices>} */ var found = false;
			forEach(
				cache,
				/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
				function(getter, name) {
					if (!found) try {
						getter(value);
						found = $slice(name, 1);
					} catch (e) {}
				}
			);
			return found;
		};
		/** @type {import('.')} */
		module.exports = function whichTypedArray(value) {
			if (!value || typeof value !== "object") return false;
			if (!hasToStringTag) {
				/** @type {string} */
				var tag = $slice($toString(value), 8, -1);
				if ($indexOf(typedArrays, tag) > -1) return tag;
				if (tag !== "Object") return false;
				return trySlices(value);
			}
			if (!gOPD) return null;
			return tryTypedArrays(value);
		};
	}));
	//#endregion
	//#region ../../node_modules/is-typed-array/index.js
	var require_is_typed_array = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var whichTypedArray = require_which_typed_array();
		/** @type {import('.')} */
		module.exports = function isTypedArray(value) {
			return !!whichTypedArray(value);
		};
	}));
	//#endregion
	//#region ../../node_modules/typed-array-buffer/index.js
	var require_typed_array_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var $TypeError = require_type();
		/** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer<ArrayBufferLike>)} */
		var $typedArrayBuffer = require_call_bound()("TypedArray.prototype.buffer", true);
		var isTypedArray = require_is_typed_array();
		/** @type {import('.')} */
		module.exports = $typedArrayBuffer || function typedArrayBuffer(x) {
			if (!isTypedArray(x)) throw new $TypeError("Not a Typed Array");
			return x.buffer;
		};
	}));
	//#endregion
	//#region ../../node_modules/to-buffer/index.js
	var require_to_buffer$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var isArray = require_isarray$2();
		var typedArrayBuffer = require_typed_array_buffer();
		var isView = ArrayBuffer.isView || function isView(obj) {
			try {
				typedArrayBuffer(obj);
				return true;
			} catch (e) {
				return false;
			}
		};
		var useUint8Array = typeof Uint8Array !== "undefined";
		var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
		var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
		module.exports = function toBuffer(data, encoding) {
			if (Buffer.isBuffer(data)) {
				if (data.constructor && !("isBuffer" in data)) return Buffer.from(data);
				return data;
			}
			if (typeof data === "string") return Buffer.from(data, encoding);
			if (useArrayBuffer && isView(data)) {
				if (data.byteLength === 0) return Buffer.alloc(0);
				if (useFromArrayBuffer) {
					var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
					if (res.byteLength === data.byteLength) return res;
				}
				var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
				var result = Buffer.from(uint8);
				if (result.length === data.byteLength) return result;
			}
			if (useUint8Array && data instanceof Uint8Array) return Buffer.from(data);
			var isArr = isArray(data);
			if (isArr) for (var i = 0; i < data.length; i += 1) {
				var x = data[i];
				if (typeof x !== "number" || x < 0 || x > 255 || ~~x !== x) throw new RangeError("Array items must be numbers in the range 0-255.");
			}
			if (isArr || Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) return Buffer.from(data);
			throw new TypeError("The \"data\" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.");
		};
	}));
	//#endregion
	//#region ../../node_modules/hash-base/to-buffer.js
	var require_to_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var toBuffer = require_to_buffer$2();
		var useUint8Array = typeof Uint8Array !== "undefined";
		var isView = useUint8Array && typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView;
		module.exports = function(thing, encoding) {
			if (typeof thing === "string" || Buffer.isBuffer(thing) || useUint8Array && thing instanceof Uint8Array || isView && isView(thing)) return toBuffer(thing, encoding);
			throw new TypeError("The \"data\" argument must be a string, a Buffer, a Uint8Array, or a DataView");
		};
	}));
	//#endregion
	//#region ../../node_modules/process-nextick-args/index.js
	var require_process_nextick_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		if (typeof process$1 === "undefined" || !process$1.version || process$1.version.indexOf("v0.") === 0 || process$1.version.indexOf("v1.") === 0 && process$1.version.indexOf("v1.8.") !== 0) module.exports = { nextTick };
		else module.exports = process$1;
		function nextTick(fn, arg1, arg2, arg3) {
			if (typeof fn !== "function") throw new TypeError("\"callback\" argument must be a function");
			var len = arguments.length;
			var args, i;
			switch (len) {
				case 0:
				case 1: return process$1.nextTick(fn);
				case 2: return process$1.nextTick(function afterTickOne() {
					fn.call(null, arg1);
				});
				case 3: return process$1.nextTick(function afterTickTwo() {
					fn.call(null, arg1, arg2);
				});
				case 4: return process$1.nextTick(function afterTickThree() {
					fn.call(null, arg1, arg2, arg3);
				});
				default:
					args = new Array(len - 1);
					i = 0;
					while (i < args.length) args[i++] = arguments[i];
					return process$1.nextTick(function afterTick() {
						fn.apply(null, args);
					});
			}
		}
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/isarray/index.js
	var require_isarray$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var toString = {}.toString;
		module.exports = Array.isArray || function(arr) {
			return toString.call(arr) == "[object Array]";
		};
	}));
	//#endregion
	//#region ../../node_modules/events/events.js
	var require_events = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var R = typeof Reflect === "object" ? Reflect : null;
		var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply(target, receiver, args) {
			return Function.prototype.apply.call(target, receiver, args);
		};
		var ReflectOwnKeys;
		if (R && typeof R.ownKeys === "function") ReflectOwnKeys = R.ownKeys;
		else if (Object.getOwnPropertySymbols) ReflectOwnKeys = function ReflectOwnKeys(target) {
			return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
		};
		else ReflectOwnKeys = function ReflectOwnKeys(target) {
			return Object.getOwnPropertyNames(target);
		};
		function ProcessEmitWarning(warning) {
			if (console && console.warn) console.warn(warning);
		}
		var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
			return value !== value;
		};
		function EventEmitter() {
			EventEmitter.init.call(this);
		}
		module.exports = EventEmitter;
		module.exports.once = once;
		EventEmitter.EventEmitter = EventEmitter;
		EventEmitter.prototype._events = void 0;
		EventEmitter.prototype._eventsCount = 0;
		EventEmitter.prototype._maxListeners = void 0;
		var defaultMaxListeners = 10;
		function checkListener(listener) {
			if (typeof listener !== "function") throw new TypeError("The \"listener\" argument must be of type Function. Received type " + typeof listener);
		}
		Object.defineProperty(EventEmitter, "defaultMaxListeners", {
			enumerable: true,
			get: function() {
				return defaultMaxListeners;
			},
			set: function(arg) {
				if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) throw new RangeError("The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received " + arg + ".");
				defaultMaxListeners = arg;
			}
		});
		EventEmitter.init = function() {
			if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
				this._events = Object.create(null);
				this._eventsCount = 0;
			}
			this._maxListeners = this._maxListeners || void 0;
		};
		EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
			if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) throw new RangeError("The value of \"n\" is out of range. It must be a non-negative number. Received " + n + ".");
			this._maxListeners = n;
			return this;
		};
		function _getMaxListeners(that) {
			if (that._maxListeners === void 0) return EventEmitter.defaultMaxListeners;
			return that._maxListeners;
		}
		EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
			return _getMaxListeners(this);
		};
		EventEmitter.prototype.emit = function emit(type) {
			var args = [];
			for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
			var doError = type === "error";
			var events = this._events;
			if (events !== void 0) doError = doError && events.error === void 0;
			else if (!doError) return false;
			if (doError) {
				var er;
				if (args.length > 0) er = args[0];
				if (er instanceof Error) throw er;
				var err = /* @__PURE__ */ new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
				err.context = er;
				throw err;
			}
			var handler = events[type];
			if (handler === void 0) return false;
			if (typeof handler === "function") ReflectApply(handler, this, args);
			else {
				var len = handler.length;
				var listeners = arrayClone(handler, len);
				for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args);
			}
			return true;
		};
		function _addListener(target, type, listener, prepend) {
			var m;
			var events;
			var existing;
			checkListener(listener);
			events = target._events;
			if (events === void 0) {
				events = target._events = Object.create(null);
				target._eventsCount = 0;
			} else {
				if (events.newListener !== void 0) {
					target.emit("newListener", type, listener.listener ? listener.listener : listener);
					events = target._events;
				}
				existing = events[type];
			}
			if (existing === void 0) {
				existing = events[type] = listener;
				++target._eventsCount;
			} else {
				if (typeof existing === "function") existing = events[type] = prepend ? [listener, existing] : [existing, listener];
				else if (prepend) existing.unshift(listener);
				else existing.push(listener);
				m = _getMaxListeners(target);
				if (m > 0 && existing.length > m && !existing.warned) {
					existing.warned = true;
					var w = /* @__PURE__ */ new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
					w.name = "MaxListenersExceededWarning";
					w.emitter = target;
					w.type = type;
					w.count = existing.length;
					ProcessEmitWarning(w);
				}
			}
			return target;
		}
		EventEmitter.prototype.addListener = function addListener(type, listener) {
			return _addListener(this, type, listener, false);
		};
		EventEmitter.prototype.on = EventEmitter.prototype.addListener;
		EventEmitter.prototype.prependListener = function prependListener(type, listener) {
			return _addListener(this, type, listener, true);
		};
		function onceWrapper() {
			if (!this.fired) {
				this.target.removeListener(this.type, this.wrapFn);
				this.fired = true;
				if (arguments.length === 0) return this.listener.call(this.target);
				return this.listener.apply(this.target, arguments);
			}
		}
		function _onceWrap(target, type, listener) {
			var state = {
				fired: false,
				wrapFn: void 0,
				target,
				type,
				listener
			};
			var wrapped = onceWrapper.bind(state);
			wrapped.listener = listener;
			state.wrapFn = wrapped;
			return wrapped;
		}
		EventEmitter.prototype.once = function once(type, listener) {
			checkListener(listener);
			this.on(type, _onceWrap(this, type, listener));
			return this;
		};
		EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
			checkListener(listener);
			this.prependListener(type, _onceWrap(this, type, listener));
			return this;
		};
		EventEmitter.prototype.removeListener = function removeListener(type, listener) {
			var list, events, position, i, originalListener;
			checkListener(listener);
			events = this._events;
			if (events === void 0) return this;
			list = events[type];
			if (list === void 0) return this;
			if (list === listener || list.listener === listener) if (--this._eventsCount === 0) this._events = Object.create(null);
			else {
				delete events[type];
				if (events.removeListener) this.emit("removeListener", type, list.listener || listener);
			}
			else if (typeof list !== "function") {
				position = -1;
				for (i = list.length - 1; i >= 0; i--) if (list[i] === listener || list[i].listener === listener) {
					originalListener = list[i].listener;
					position = i;
					break;
				}
				if (position < 0) return this;
				if (position === 0) list.shift();
				else spliceOne(list, position);
				if (list.length === 1) events[type] = list[0];
				if (events.removeListener !== void 0) this.emit("removeListener", type, originalListener || listener);
			}
			return this;
		};
		EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
		EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
			var listeners, events = this._events, i;
			if (events === void 0) return this;
			if (events.removeListener === void 0) {
				if (arguments.length === 0) {
					this._events = Object.create(null);
					this._eventsCount = 0;
				} else if (events[type] !== void 0) if (--this._eventsCount === 0) this._events = Object.create(null);
				else delete events[type];
				return this;
			}
			if (arguments.length === 0) {
				var keys = Object.keys(events);
				var key;
				for (i = 0; i < keys.length; ++i) {
					key = keys[i];
					if (key === "removeListener") continue;
					this.removeAllListeners(key);
				}
				this.removeAllListeners("removeListener");
				this._events = Object.create(null);
				this._eventsCount = 0;
				return this;
			}
			listeners = events[type];
			if (typeof listeners === "function") this.removeListener(type, listeners);
			else if (listeners !== void 0) for (i = listeners.length - 1; i >= 0; i--) this.removeListener(type, listeners[i]);
			return this;
		};
		function _listeners(target, type, unwrap) {
			var events = target._events;
			if (events === void 0) return [];
			var evlistener = events[type];
			if (evlistener === void 0) return [];
			if (typeof evlistener === "function") return unwrap ? [evlistener.listener || evlistener] : [evlistener];
			return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
		}
		EventEmitter.prototype.listeners = function listeners(type) {
			return _listeners(this, type, true);
		};
		EventEmitter.prototype.rawListeners = function rawListeners(type) {
			return _listeners(this, type, false);
		};
		EventEmitter.listenerCount = function(emitter, type) {
			if (typeof emitter.listenerCount === "function") return emitter.listenerCount(type);
			else return listenerCount.call(emitter, type);
		};
		EventEmitter.prototype.listenerCount = listenerCount;
		function listenerCount(type) {
			var events = this._events;
			if (events !== void 0) {
				var evlistener = events[type];
				if (typeof evlistener === "function") return 1;
				else if (evlistener !== void 0) return evlistener.length;
			}
			return 0;
		}
		EventEmitter.prototype.eventNames = function eventNames() {
			return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
		};
		function arrayClone(arr, n) {
			var copy = new Array(n);
			for (var i = 0; i < n; ++i) copy[i] = arr[i];
			return copy;
		}
		function spliceOne(list, index) {
			for (; index + 1 < list.length; index++) list[index] = list[index + 1];
			list.pop();
		}
		function unwrapListeners(arr) {
			var ret = new Array(arr.length);
			for (var i = 0; i < ret.length; ++i) ret[i] = arr[i].listener || arr[i];
			return ret;
		}
		function once(emitter, name) {
			return new Promise(function(resolve, reject) {
				function errorListener(err) {
					emitter.removeListener(name, resolver);
					reject(err);
				}
				function resolver() {
					if (typeof emitter.removeListener === "function") emitter.removeListener("error", errorListener);
					resolve([].slice.call(arguments));
				}
				eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
				if (name !== "error") addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
			});
		}
		function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
			if (typeof emitter.on === "function") eventTargetAgnosticAddListener(emitter, "error", handler, flags);
		}
		function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
			if (typeof emitter.on === "function") if (flags.once) emitter.once(name, listener);
			else emitter.on(name, listener);
			else if (typeof emitter.addEventListener === "function") emitter.addEventListener(name, function wrapListener(arg) {
				if (flags.once) emitter.removeEventListener(name, wrapListener);
				listener(arg);
			});
			else throw new TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof emitter);
		}
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/stream-browser.js
	var require_stream_browser$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_events().EventEmitter;
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/node_modules/safe-buffer/index.js
	var require_safe_buffer$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var buffer = require_dist();
		var Buffer = buffer.Buffer;
		function copyProps(src, dst) {
			for (var key in src) dst[key] = src[key];
		}
		if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
		else {
			copyProps(buffer, exports);
			exports.Buffer = SafeBuffer;
		}
		function SafeBuffer(arg, encodingOrOffset, length) {
			return Buffer(arg, encodingOrOffset, length);
		}
		copyProps(Buffer, SafeBuffer);
		SafeBuffer.from = function(arg, encodingOrOffset, length) {
			if (typeof arg === "number") throw new TypeError("Argument must not be a number");
			return Buffer(arg, encodingOrOffset, length);
		};
		SafeBuffer.alloc = function(size, fill, encoding) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			var buf = Buffer(size);
			if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
			else buf.fill(fill);
			else buf.fill(0);
			return buf;
		};
		SafeBuffer.allocUnsafe = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return Buffer(size);
		};
		SafeBuffer.allocUnsafeSlow = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return buffer.SlowBuffer(size);
		};
	}));
	//#endregion
	//#region ../../node_modules/core-util-is/lib/util.js
	var require_util$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
		function isArray(arg) {
			if (Array.isArray) return Array.isArray(arg);
			return objectToString(arg) === "[object Array]";
		}
		exports.isArray = isArray;
		function isBoolean(arg) {
			return typeof arg === "boolean";
		}
		exports.isBoolean = isBoolean;
		function isNull(arg) {
			return arg === null;
		}
		exports.isNull = isNull;
		function isNullOrUndefined(arg) {
			return arg == null;
		}
		exports.isNullOrUndefined = isNullOrUndefined;
		function isNumber(arg) {
			return typeof arg === "number";
		}
		exports.isNumber = isNumber;
		function isString(arg) {
			return typeof arg === "string";
		}
		exports.isString = isString;
		function isSymbol(arg) {
			return typeof arg === "symbol";
		}
		exports.isSymbol = isSymbol;
		function isUndefined(arg) {
			return arg === void 0;
		}
		exports.isUndefined = isUndefined;
		function isRegExp(re) {
			return objectToString(re) === "[object RegExp]";
		}
		exports.isRegExp = isRegExp;
		function isObject(arg) {
			return typeof arg === "object" && arg !== null;
		}
		exports.isObject = isObject;
		function isDate(d) {
			return objectToString(d) === "[object Date]";
		}
		exports.isDate = isDate;
		function isError(e) {
			return objectToString(e) === "[object Error]" || e instanceof Error;
		}
		exports.isError = isError;
		function isFunction(arg) {
			return typeof arg === "function";
		}
		exports.isFunction = isFunction;
		function isPrimitive(arg) {
			return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
		}
		exports.isPrimitive = isPrimitive;
		exports.isBuffer = require_dist().Buffer.isBuffer;
		function objectToString(o) {
			return Object.prototype.toString.call(o);
		}
	}));
	//#endregion
	//#region ../../node_modules/is-arguments/index.js
	var require_is_arguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var hasToStringTag = require_shams()();
		var $toString = require_call_bound()("Object.prototype.toString");
		/** @type {import('.')} */
		var isStandardArguments = function isArguments(value) {
			if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) return false;
			return $toString(value) === "[object Arguments]";
		};
		/** @type {import('.')} */
		var isLegacyArguments = function isArguments(value) {
			if (isStandardArguments(value)) return true;
			return value !== null && typeof value === "object" && "length" in value && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && "callee" in value && $toString(value.callee) === "[object Function]";
		};
		var supportsStandardArguments = function() {
			return isStandardArguments(arguments);
		}();
		isStandardArguments.isLegacyArguments = isLegacyArguments;
		/** @type {import('.')} */
		module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;
	}));
	//#endregion
	//#region ../../node_modules/is-regex/index.js
	var require_is_regex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var callBound = require_call_bound();
		var hasToStringTag = require_shams()();
		var hasOwn = require_hasown();
		var gOPD = require_gopd();
		/** @type {import('.')} */
		var fn;
		if (hasToStringTag) {
			/** @type {(receiver: ThisParameterType<typeof RegExp.prototype.exec>, ...args: Parameters<typeof RegExp.prototype.exec>) => ReturnType<typeof RegExp.prototype.exec>} */
			var $exec = callBound("RegExp.prototype.exec");
			/** @type {object} */
			var isRegexMarker = {};
			var throwRegexMarker = function() {
				throw isRegexMarker;
			};
			/** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */
			var badStringifier = {
				toString: throwRegexMarker,
				valueOf: throwRegexMarker
			};
			if (typeof Symbol.toPrimitive === "symbol") badStringifier[Symbol.toPrimitive] = throwRegexMarker;
			/** @type {import('.')} */
			fn = function isRegex(value) {
				if (!value || typeof value !== "object") return false;
				var descriptor = gOPD(value, "lastIndex");
				if (!(descriptor && hasOwn(descriptor, "value"))) return false;
				try {
					$exec(value, badStringifier);
				} catch (e) {
					return e === isRegexMarker;
				}
			};
		} else {
			/** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
			var $toString = callBound("Object.prototype.toString");
			/** @const @type {'[object RegExp]'} */
			var regexClass = "[object RegExp]";
			/** @type {import('.')} */
			fn = function isRegex(value) {
				if (!value || typeof value !== "object" && typeof value !== "function") return false;
				return $toString(value) === regexClass;
			};
		}
		module.exports = fn;
	}));
	//#endregion
	//#region ../../node_modules/safe-regex-test/index.js
	var require_safe_regex_test = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var callBound = require_call_bound();
		var isRegex = require_is_regex();
		var $exec = callBound("RegExp.prototype.exec");
		var $TypeError = require_type();
		/** @type {import('.')} */
		module.exports = function regexTester(regex) {
			if (!isRegex(regex)) throw new $TypeError("`regex` must be a RegExp");
			return function test(s) {
				return $exec(regex, s) !== null;
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/is-generator-function/index.js
	var require_is_generator_function = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var callBound = require_call_bound();
		var isFnRegex = require_safe_regex_test()(/^\s*(?:function)?\*/);
		var hasToStringTag = require_shams()();
		var getProto = require_get_proto();
		var toStr = callBound("Object.prototype.toString");
		var fnToStr = callBound("Function.prototype.toString");
		var getGeneratorFunction = require_generator_function();
		/** @type {import('.')} */
		module.exports = function isGeneratorFunction(fn) {
			if (typeof fn !== "function") return false;
			if (isFnRegex(fnToStr(fn))) return true;
			if (!hasToStringTag) return toStr(fn) === "[object GeneratorFunction]";
			if (!getProto) return false;
			var GeneratorFunction = getGeneratorFunction();
			return GeneratorFunction && getProto(fn) === GeneratorFunction.prototype;
		};
	}));
	//#endregion
	//#region ../../node_modules/util/support/types.js
	var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
		var isArgumentsObject = require_is_arguments();
		var isGeneratorFunction = require_is_generator_function();
		var whichTypedArray = require_which_typed_array();
		var isTypedArray = require_is_typed_array();
		function uncurryThis(f) {
			return f.call.bind(f);
		}
		var BigIntSupported = typeof BigInt !== "undefined";
		var SymbolSupported = typeof Symbol !== "undefined";
		var ObjectToString = uncurryThis(Object.prototype.toString);
		var numberValue = uncurryThis(Number.prototype.valueOf);
		var stringValue = uncurryThis(String.prototype.valueOf);
		var booleanValue = uncurryThis(Boolean.prototype.valueOf);
		if (BigIntSupported) var bigIntValue = uncurryThis(BigInt.prototype.valueOf);
		if (SymbolSupported) var symbolValue = uncurryThis(Symbol.prototype.valueOf);
		function checkBoxedPrimitive(value, prototypeValueOf) {
			if (typeof value !== "object") return false;
			try {
				prototypeValueOf(value);
				return true;
			} catch (e) {
				return false;
			}
		}
		exports.isArgumentsObject = isArgumentsObject;
		exports.isGeneratorFunction = isGeneratorFunction;
		exports.isTypedArray = isTypedArray;
		function isPromise(input) {
			return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function";
		}
		exports.isPromise = isPromise;
		function isArrayBufferView(value) {
			if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) return ArrayBuffer.isView(value);
			return isTypedArray(value) || isDataView(value);
		}
		exports.isArrayBufferView = isArrayBufferView;
		function isUint8Array(value) {
			return whichTypedArray(value) === "Uint8Array";
		}
		exports.isUint8Array = isUint8Array;
		function isUint8ClampedArray(value) {
			return whichTypedArray(value) === "Uint8ClampedArray";
		}
		exports.isUint8ClampedArray = isUint8ClampedArray;
		function isUint16Array(value) {
			return whichTypedArray(value) === "Uint16Array";
		}
		exports.isUint16Array = isUint16Array;
		function isUint32Array(value) {
			return whichTypedArray(value) === "Uint32Array";
		}
		exports.isUint32Array = isUint32Array;
		function isInt8Array(value) {
			return whichTypedArray(value) === "Int8Array";
		}
		exports.isInt8Array = isInt8Array;
		function isInt16Array(value) {
			return whichTypedArray(value) === "Int16Array";
		}
		exports.isInt16Array = isInt16Array;
		function isInt32Array(value) {
			return whichTypedArray(value) === "Int32Array";
		}
		exports.isInt32Array = isInt32Array;
		function isFloat32Array(value) {
			return whichTypedArray(value) === "Float32Array";
		}
		exports.isFloat32Array = isFloat32Array;
		function isFloat64Array(value) {
			return whichTypedArray(value) === "Float64Array";
		}
		exports.isFloat64Array = isFloat64Array;
		function isBigInt64Array(value) {
			return whichTypedArray(value) === "BigInt64Array";
		}
		exports.isBigInt64Array = isBigInt64Array;
		function isBigUint64Array(value) {
			return whichTypedArray(value) === "BigUint64Array";
		}
		exports.isBigUint64Array = isBigUint64Array;
		function isMapToString(value) {
			return ObjectToString(value) === "[object Map]";
		}
		isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map());
		function isMap(value) {
			if (typeof Map === "undefined") return false;
			return isMapToString.working ? isMapToString(value) : value instanceof Map;
		}
		exports.isMap = isMap;
		function isSetToString(value) {
			return ObjectToString(value) === "[object Set]";
		}
		isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set());
		function isSet(value) {
			if (typeof Set === "undefined") return false;
			return isSetToString.working ? isSetToString(value) : value instanceof Set;
		}
		exports.isSet = isSet;
		function isWeakMapToString(value) {
			return ObjectToString(value) === "[object WeakMap]";
		}
		isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap());
		function isWeakMap(value) {
			if (typeof WeakMap === "undefined") return false;
			return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
		}
		exports.isWeakMap = isWeakMap;
		function isWeakSetToString(value) {
			return ObjectToString(value) === "[object WeakSet]";
		}
		isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet());
		function isWeakSet(value) {
			return isWeakSetToString(value);
		}
		exports.isWeakSet = isWeakSet;
		function isArrayBufferToString(value) {
			return ObjectToString(value) === "[object ArrayBuffer]";
		}
		isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(/* @__PURE__ */ new ArrayBuffer());
		function isArrayBuffer(value) {
			if (typeof ArrayBuffer === "undefined") return false;
			return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
		}
		exports.isArrayBuffer = isArrayBuffer;
		function isDataViewToString(value) {
			return ObjectToString(value) === "[object DataView]";
		}
		isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(/* @__PURE__ */ new ArrayBuffer(1), 0, 1));
		function isDataView(value) {
			if (typeof DataView === "undefined") return false;
			return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
		}
		exports.isDataView = isDataView;
		var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
		function isSharedArrayBufferToString(value) {
			return ObjectToString(value) === "[object SharedArrayBuffer]";
		}
		function isSharedArrayBuffer(value) {
			if (typeof SharedArrayBufferCopy === "undefined") return false;
			if (typeof isSharedArrayBufferToString.working === "undefined") isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());
			return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy;
		}
		exports.isSharedArrayBuffer = isSharedArrayBuffer;
		function isAsyncFunction(value) {
			return ObjectToString(value) === "[object AsyncFunction]";
		}
		exports.isAsyncFunction = isAsyncFunction;
		function isMapIterator(value) {
			return ObjectToString(value) === "[object Map Iterator]";
		}
		exports.isMapIterator = isMapIterator;
		function isSetIterator(value) {
			return ObjectToString(value) === "[object Set Iterator]";
		}
		exports.isSetIterator = isSetIterator;
		function isGeneratorObject(value) {
			return ObjectToString(value) === "[object Generator]";
		}
		exports.isGeneratorObject = isGeneratorObject;
		function isWebAssemblyCompiledModule(value) {
			return ObjectToString(value) === "[object WebAssembly.Module]";
		}
		exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
		function isNumberObject(value) {
			return checkBoxedPrimitive(value, numberValue);
		}
		exports.isNumberObject = isNumberObject;
		function isStringObject(value) {
			return checkBoxedPrimitive(value, stringValue);
		}
		exports.isStringObject = isStringObject;
		function isBooleanObject(value) {
			return checkBoxedPrimitive(value, booleanValue);
		}
		exports.isBooleanObject = isBooleanObject;
		function isBigIntObject(value) {
			return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
		}
		exports.isBigIntObject = isBigIntObject;
		function isSymbolObject(value) {
			return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
		}
		exports.isSymbolObject = isSymbolObject;
		function isBoxedPrimitive(value) {
			return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value);
		}
		exports.isBoxedPrimitive = isBoxedPrimitive;
		function isAnyArrayBuffer(value) {
			return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
		}
		exports.isAnyArrayBuffer = isAnyArrayBuffer;
		[
			"isProxy",
			"isExternal",
			"isModuleNamespaceObject"
		].forEach(function(method) {
			Object.defineProperty(exports, method, {
				enumerable: false,
				value: function() {
					throw new Error(method + " is not supported in userland");
				}
			});
		});
	}));
	//#endregion
	//#region ../../node_modules/util/support/isBufferBrowser.js
	var require_isBufferBrowser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = function isBuffer(arg) {
			return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function";
		};
	}));
	//#endregion
	//#region ../../node_modules/util/util.js
	var require_util$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist$1();
		var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) {
			var keys = Object.keys(obj);
			var descriptors = {};
			for (var i = 0; i < keys.length; i++) descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);
			return descriptors;
		};
		var formatRegExp = /%[sdj%]/g;
		exports.format = function(f) {
			if (!isString(f)) {
				var objects = [];
				for (var i = 0; i < arguments.length; i++) objects.push(inspect(arguments[i]));
				return objects.join(" ");
			}
			var i = 1;
			var args = arguments;
			var len = args.length;
			var str = String(f).replace(formatRegExp, function(x) {
				if (x === "%%") return "%";
				if (i >= len) return x;
				switch (x) {
					case "%s": return String(args[i++]);
					case "%d": return Number(args[i++]);
					case "%j": try {
						return JSON.stringify(args[i++]);
					} catch (_) {
						return "[Circular]";
					}
					default: return x;
				}
			});
			for (var x = args[i]; i < len; x = args[++i]) if (isNull(x) || !isObject(x)) str += " " + x;
			else str += " " + inspect(x);
			return str;
		};
		exports.deprecate = function(fn, msg) {
			if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) return fn;
			if (typeof process$1 === "undefined") return function() {
				return exports.deprecate(fn, msg).apply(this, arguments);
			};
			var warned = false;
			function deprecated() {
				if (!warned) {
					if (process$1.throwDeprecation) throw new Error(msg);
					else if (process$1.traceDeprecation) console.trace(msg);
					else console.error(msg);
					warned = true;
				}
				return fn.apply(this, arguments);
			}
			return deprecated;
		};
		var debugs = {};
		var debugEnvRegex = /^$/;
		if ({}.NODE_DEBUG) {
			var debugEnv = {}.NODE_DEBUG;
			debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase();
			debugEnvRegex = new RegExp("^" + debugEnv + "$", "i");
		}
		exports.debuglog = function(set) {
			set = set.toUpperCase();
			if (!debugs[set]) if (debugEnvRegex.test(set)) {
				var pid = process$1.pid;
				debugs[set] = function() {
					var msg = exports.format.apply(exports, arguments);
					console.error("%s %d: %s", set, pid, msg);
				};
			} else debugs[set] = function() {};
			return debugs[set];
		};
		/**
		* Echos the value of a value. Trys to print the value out
		* in the best way possible given the different types.
		*
		* @param {Object} obj The object to print out.
		* @param {Object} opts Optional options object that alters the output.
		*/
		function inspect(obj, opts) {
			var ctx = {
				seen: [],
				stylize: stylizeNoColor
			};
			if (arguments.length >= 3) ctx.depth = arguments[2];
			if (arguments.length >= 4) ctx.colors = arguments[3];
			if (isBoolean(opts)) ctx.showHidden = opts;
			else if (opts) exports._extend(ctx, opts);
			if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
			if (isUndefined(ctx.depth)) ctx.depth = 2;
			if (isUndefined(ctx.colors)) ctx.colors = false;
			if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
			if (ctx.colors) ctx.stylize = stylizeWithColor;
			return formatValue(ctx, obj, ctx.depth);
		}
		exports.inspect = inspect;
		inspect.colors = {
			"bold": [1, 22],
			"italic": [3, 23],
			"underline": [4, 24],
			"inverse": [7, 27],
			"white": [37, 39],
			"grey": [90, 39],
			"black": [30, 39],
			"blue": [34, 39],
			"cyan": [36, 39],
			"green": [32, 39],
			"magenta": [35, 39],
			"red": [31, 39],
			"yellow": [33, 39]
		};
		inspect.styles = {
			"special": "cyan",
			"number": "yellow",
			"boolean": "yellow",
			"undefined": "grey",
			"null": "bold",
			"string": "green",
			"date": "magenta",
			"regexp": "red"
		};
		function stylizeWithColor(str, styleType) {
			var style = inspect.styles[styleType];
			if (style) return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
			else return str;
		}
		function stylizeNoColor(str, styleType) {
			return str;
		}
		function arrayToHash(array) {
			var hash = {};
			array.forEach(function(val, idx) {
				hash[val] = true;
			});
			return hash;
		}
		function formatValue(ctx, value, recurseTimes) {
			if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== exports.inspect && !(value.constructor && value.constructor.prototype === value)) {
				var ret = value.inspect(recurseTimes, ctx);
				if (!isString(ret)) ret = formatValue(ctx, ret, recurseTimes);
				return ret;
			}
			var primitive = formatPrimitive(ctx, value);
			if (primitive) return primitive;
			var keys = Object.keys(value);
			var visibleKeys = arrayToHash(keys);
			if (ctx.showHidden) keys = Object.getOwnPropertyNames(value);
			if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) return formatError(value);
			if (keys.length === 0) {
				if (isFunction(value)) {
					var name = value.name ? ": " + value.name : "";
					return ctx.stylize("[Function" + name + "]", "special");
				}
				if (isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
				if (isDate(value)) return ctx.stylize(Date.prototype.toString.call(value), "date");
				if (isError(value)) return formatError(value);
			}
			var base = "", array = false, braces = ["{", "}"];
			if (isArray(value)) {
				array = true;
				braces = ["[", "]"];
			}
			if (isFunction(value)) base = " [Function" + (value.name ? ": " + value.name : "") + "]";
			if (isRegExp(value)) base = " " + RegExp.prototype.toString.call(value);
			if (isDate(value)) base = " " + Date.prototype.toUTCString.call(value);
			if (isError(value)) base = " " + formatError(value);
			if (keys.length === 0 && (!array || value.length == 0)) return braces[0] + base + braces[1];
			if (recurseTimes < 0) if (isRegExp(value)) return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
			else return ctx.stylize("[Object]", "special");
			ctx.seen.push(value);
			var output;
			if (array) output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
			else output = keys.map(function(key) {
				return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
			});
			ctx.seen.pop();
			return reduceToSingleString(output, base, braces);
		}
		function formatPrimitive(ctx, value) {
			if (isUndefined(value)) return ctx.stylize("undefined", "undefined");
			if (isString(value)) {
				var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, "\"") + "'";
				return ctx.stylize(simple, "string");
			}
			if (isNumber(value)) return ctx.stylize("" + value, "number");
			if (isBoolean(value)) return ctx.stylize("" + value, "boolean");
			if (isNull(value)) return ctx.stylize("null", "null");
		}
		function formatError(value) {
			return "[" + Error.prototype.toString.call(value) + "]";
		}
		function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
			var output = [];
			for (var i = 0, l = value.length; i < l; ++i) if (hasOwnProperty(value, String(i))) output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
			else output.push("");
			keys.forEach(function(key) {
				if (!key.match(/^\d+$/)) output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
			});
			return output;
		}
		function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
			var name, str, desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
			if (desc.get) if (desc.set) str = ctx.stylize("[Getter/Setter]", "special");
			else str = ctx.stylize("[Getter]", "special");
			else if (desc.set) str = ctx.stylize("[Setter]", "special");
			if (!hasOwnProperty(visibleKeys, key)) name = "[" + key + "]";
			if (!str) if (ctx.seen.indexOf(desc.value) < 0) {
				if (isNull(recurseTimes)) str = formatValue(ctx, desc.value, null);
				else str = formatValue(ctx, desc.value, recurseTimes - 1);
				if (str.indexOf("\n") > -1) if (array) str = str.split("\n").map(function(line) {
					return "  " + line;
				}).join("\n").slice(2);
				else str = "\n" + str.split("\n").map(function(line) {
					return "   " + line;
				}).join("\n");
			} else str = ctx.stylize("[Circular]", "special");
			if (isUndefined(name)) {
				if (array && key.match(/^\d+$/)) return str;
				name = JSON.stringify("" + key);
				if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
					name = name.slice(1, -1);
					name = ctx.stylize(name, "name");
				} else {
					name = name.replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'");
					name = ctx.stylize(name, "string");
				}
			}
			return name + ": " + str;
		}
		function reduceToSingleString(output, base, braces) {
			var numLinesEst = 0;
			if (output.reduce(function(prev, cur) {
				numLinesEst++;
				if (cur.indexOf("\n") >= 0) numLinesEst++;
				return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
			}, 0) > 60) return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n  ") + " " + braces[1];
			return braces[0] + base + " " + output.join(", ") + " " + braces[1];
		}
		exports.types = require_types();
		function isArray(ar) {
			return Array.isArray(ar);
		}
		exports.isArray = isArray;
		function isBoolean(arg) {
			return typeof arg === "boolean";
		}
		exports.isBoolean = isBoolean;
		function isNull(arg) {
			return arg === null;
		}
		exports.isNull = isNull;
		function isNullOrUndefined(arg) {
			return arg == null;
		}
		exports.isNullOrUndefined = isNullOrUndefined;
		function isNumber(arg) {
			return typeof arg === "number";
		}
		exports.isNumber = isNumber;
		function isString(arg) {
			return typeof arg === "string";
		}
		exports.isString = isString;
		function isSymbol(arg) {
			return typeof arg === "symbol";
		}
		exports.isSymbol = isSymbol;
		function isUndefined(arg) {
			return arg === void 0;
		}
		exports.isUndefined = isUndefined;
		function isRegExp(re) {
			return isObject(re) && objectToString(re) === "[object RegExp]";
		}
		exports.isRegExp = isRegExp;
		exports.types.isRegExp = isRegExp;
		function isObject(arg) {
			return typeof arg === "object" && arg !== null;
		}
		exports.isObject = isObject;
		function isDate(d) {
			return isObject(d) && objectToString(d) === "[object Date]";
		}
		exports.isDate = isDate;
		exports.types.isDate = isDate;
		function isError(e) {
			return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
		}
		exports.isError = isError;
		exports.types.isNativeError = isError;
		function isFunction(arg) {
			return typeof arg === "function";
		}
		exports.isFunction = isFunction;
		function isPrimitive(arg) {
			return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
		}
		exports.isPrimitive = isPrimitive;
		exports.isBuffer = require_isBufferBrowser();
		function objectToString(o) {
			return Object.prototype.toString.call(o);
		}
		function pad(n) {
			return n < 10 ? "0" + n.toString(10) : n.toString(10);
		}
		var months = [
			"Jan",
			"Feb",
			"Mar",
			"Apr",
			"May",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Oct",
			"Nov",
			"Dec"
		];
		function timestamp() {
			var d = /* @__PURE__ */ new Date();
			var time = [
				pad(d.getHours()),
				pad(d.getMinutes()),
				pad(d.getSeconds())
			].join(":");
			return [
				d.getDate(),
				months[d.getMonth()],
				time
			].join(" ");
		}
		exports.log = function() {
			console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments));
		};
		/**
		* Inherit the prototype methods from one constructor into another.
		*
		* The Function.prototype.inherits from lang.js rewritten as a standalone
		* function (not on Function.prototype). NOTE: If this file is to be loaded
		* during bootstrapping this function needs to be rewritten using some native
		* functions as prototype setup using normal JavaScript does not work as
		* expected during bootstrapping (see mirror.js in r114903).
		*
		* @param {function} ctor Constructor function which needs to inherit the
		*     prototype.
		* @param {function} superCtor Constructor function to inherit prototype from.
		*/
		exports.inherits = require_inherits_browser();
		exports._extend = function(origin, add) {
			if (!add || !isObject(add)) return origin;
			var keys = Object.keys(add);
			var i = keys.length;
			while (i--) origin[keys[i]] = add[keys[i]];
			return origin;
		};
		function hasOwnProperty(obj, prop) {
			return Object.prototype.hasOwnProperty.call(obj, prop);
		}
		var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0;
		exports.promisify = function promisify(original) {
			if (typeof original !== "function") throw new TypeError("The \"original\" argument must be of type Function");
			if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
				var fn = original[kCustomPromisifiedSymbol];
				if (typeof fn !== "function") throw new TypeError("The \"util.promisify.custom\" argument must be of type Function");
				Object.defineProperty(fn, kCustomPromisifiedSymbol, {
					value: fn,
					enumerable: false,
					writable: false,
					configurable: true
				});
				return fn;
			}
			function fn() {
				var promiseResolve, promiseReject;
				var promise = new Promise(function(resolve, reject) {
					promiseResolve = resolve;
					promiseReject = reject;
				});
				var args = [];
				for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);
				args.push(function(err, value) {
					if (err) promiseReject(err);
					else promiseResolve(value);
				});
				try {
					original.apply(this, args);
				} catch (err) {
					promiseReject(err);
				}
				return promise;
			}
			Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
			if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {
				value: fn,
				enumerable: false,
				writable: false,
				configurable: true
			});
			return Object.defineProperties(fn, getOwnPropertyDescriptors(original));
		};
		exports.promisify.custom = kCustomPromisifiedSymbol;
		function callbackifyOnRejected(reason, cb) {
			if (!reason) {
				var newReason = /* @__PURE__ */ new Error("Promise was rejected with a falsy value");
				newReason.reason = reason;
				reason = newReason;
			}
			return cb(reason);
		}
		function callbackify(original) {
			if (typeof original !== "function") throw new TypeError("The \"original\" argument must be of type Function");
			function callbackified() {
				var args = [];
				for (var i = 0; i < arguments.length; i++) args.push(arguments[i]);
				var maybeCb = args.pop();
				if (typeof maybeCb !== "function") throw new TypeError("The last argument must be of type Function");
				var self = this;
				var cb = function() {
					return maybeCb.apply(self, arguments);
				};
				original.apply(this, args).then(function(ret) {
					process$1.nextTick(cb.bind(null, null, ret));
				}, function(rej) {
					process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb));
				});
			}
			Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
			Object.defineProperties(callbackified, getOwnPropertyDescriptors(original));
			return callbackified;
		}
		exports.callbackify = callbackify;
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/BufferList.js
	var require_BufferList$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function _classCallCheck(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		var Buffer = require_safe_buffer$3().Buffer;
		var util = require_util$2();
		function copyBuffer(src, target, offset) {
			src.copy(target, offset);
		}
		module.exports = function() {
			function BufferList() {
				_classCallCheck(this, BufferList);
				this.head = null;
				this.tail = null;
				this.length = 0;
			}
			BufferList.prototype.push = function push(v) {
				var entry = {
					data: v,
					next: null
				};
				if (this.length > 0) this.tail.next = entry;
				else this.head = entry;
				this.tail = entry;
				++this.length;
			};
			BufferList.prototype.unshift = function unshift(v) {
				var entry = {
					data: v,
					next: this.head
				};
				if (this.length === 0) this.tail = entry;
				this.head = entry;
				++this.length;
			};
			BufferList.prototype.shift = function shift() {
				if (this.length === 0) return;
				var ret = this.head.data;
				if (this.length === 1) this.head = this.tail = null;
				else this.head = this.head.next;
				--this.length;
				return ret;
			};
			BufferList.prototype.clear = function clear() {
				this.head = this.tail = null;
				this.length = 0;
			};
			BufferList.prototype.join = function join(s) {
				if (this.length === 0) return "";
				var p = this.head;
				var ret = "" + p.data;
				while (p = p.next) ret += s + p.data;
				return ret;
			};
			BufferList.prototype.concat = function concat(n) {
				if (this.length === 0) return Buffer.alloc(0);
				var ret = Buffer.allocUnsafe(n >>> 0);
				var p = this.head;
				var i = 0;
				while (p) {
					copyBuffer(p.data, ret, i);
					i += p.data.length;
					p = p.next;
				}
				return ret;
			};
			return BufferList;
		}();
		if (util && util.inspect && util.inspect.custom) module.exports.prototype[util.inspect.custom] = function() {
			var obj = util.inspect({ length: this.length });
			return this.constructor.name + " " + obj;
		};
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/internal/streams/destroy.js
	var require_destroy$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var pna = require_process_nextick_args();
		function destroy(err, cb) {
			var _this = this;
			var readableDestroyed = this._readableState && this._readableState.destroyed;
			var writableDestroyed = this._writableState && this._writableState.destroyed;
			if (readableDestroyed || writableDestroyed) {
				if (cb) cb(err);
				else if (err) {
					if (!this._writableState) pna.nextTick(emitErrorNT, this, err);
					else if (!this._writableState.errorEmitted) {
						this._writableState.errorEmitted = true;
						pna.nextTick(emitErrorNT, this, err);
					}
				}
				return this;
			}
			if (this._readableState) this._readableState.destroyed = true;
			if (this._writableState) this._writableState.destroyed = true;
			this._destroy(err || null, function(err) {
				if (!cb && err) {
					if (!_this._writableState) pna.nextTick(emitErrorNT, _this, err);
					else if (!_this._writableState.errorEmitted) {
						_this._writableState.errorEmitted = true;
						pna.nextTick(emitErrorNT, _this, err);
					}
				} else if (cb) cb(err);
			});
			return this;
		}
		function undestroy() {
			if (this._readableState) {
				this._readableState.destroyed = false;
				this._readableState.reading = false;
				this._readableState.ended = false;
				this._readableState.endEmitted = false;
			}
			if (this._writableState) {
				this._writableState.destroyed = false;
				this._writableState.ended = false;
				this._writableState.ending = false;
				this._writableState.finalCalled = false;
				this._writableState.prefinished = false;
				this._writableState.finished = false;
				this._writableState.errorEmitted = false;
			}
		}
		function emitErrorNT(self, err) {
			self.emit("error", err);
		}
		module.exports = {
			destroy,
			undestroy
		};
	}));
	//#endregion
	//#region ../../node_modules/util-deprecate/browser.js
	var require_browser$10 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		/**
		* Module exports.
		*/
		module.exports = deprecate;
		/**
		* Mark that a method should not be used.
		* Returns a modified function which warns once by default.
		*
		* If `localStorage.noDeprecation = true` is set, then it is a no-op.
		*
		* If `localStorage.throwDeprecation = true` is set, then deprecated functions
		* will throw an Error when invoked.
		*
		* If `localStorage.traceDeprecation = true` is set, then deprecated functions
		* will invoke `console.trace()` instead of `console.error()`.
		*
		* @param {Function} fn - the function to deprecate
		* @param {String} msg - the string to print to the console when `fn` is invoked
		* @returns {Function} a new "deprecated" version of `fn`
		* @api public
		*/
		function deprecate(fn, msg) {
			if (config("noDeprecation")) return fn;
			var warned = false;
			function deprecated() {
				if (!warned) {
					if (config("throwDeprecation")) throw new Error(msg);
					else if (config("traceDeprecation")) console.trace(msg);
					else console.warn(msg);
					warned = true;
				}
				return fn.apply(this, arguments);
			}
			return deprecated;
		}
		/**
		* Checks `localStorage` for boolean values for the given `name`.
		*
		* @param {String} name
		* @returns {Boolean}
		* @api private
		*/
		function config(name) {
			try {
				if (!global.localStorage) return false;
			} catch (_) {
				return false;
			}
			var val = global.localStorage[name];
			if (null == val) return false;
			return String(val).toLowerCase() === "true";
		}
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/_stream_writable.js
	var require__stream_writable$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		var pna = require_process_nextick_args();
		module.exports = Writable;
		function CorkedRequest(state) {
			var _this = this;
			this.next = null;
			this.entry = null;
			this.finish = function() {
				onCorkedFinish(_this, state);
			};
		}
		var asyncWrite = !process$1.browser && ["v0.10", "v0.9."].indexOf(process$1.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
		var Duplex;
		Writable.WritableState = WritableState;
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		var internalUtil = { deprecate: require_browser$10() };
		var Stream = require_stream_browser$2();
		var Buffer = require_safe_buffer$3().Buffer;
		var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
		function _uint8ArrayToBuffer(chunk) {
			return Buffer.from(chunk);
		}
		function _isUint8Array(obj) {
			return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
		}
		var destroyImpl = require_destroy$2();
		util.inherits(Writable, Stream);
		function nop() {}
		function WritableState(options, stream) {
			Duplex = Duplex || require__stream_duplex$2();
			options = options || {};
			var isDuplex = stream instanceof Duplex;
			this.objectMode = !!options.objectMode;
			if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
			var hwm = options.highWaterMark;
			var writableHwm = options.writableHighWaterMark;
			var defaultHwm = this.objectMode ? 16 : 16 * 1024;
			if (hwm || hwm === 0) this.highWaterMark = hwm;
			else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;
			else this.highWaterMark = defaultHwm;
			this.highWaterMark = Math.floor(this.highWaterMark);
			this.finalCalled = false;
			this.needDrain = false;
			this.ending = false;
			this.ended = false;
			this.finished = false;
			this.destroyed = false;
			this.decodeStrings = !(options.decodeStrings === false);
			this.defaultEncoding = options.defaultEncoding || "utf8";
			this.length = 0;
			this.writing = false;
			this.corked = 0;
			this.sync = true;
			this.bufferProcessing = false;
			this.onwrite = function(er) {
				onwrite(stream, er);
			};
			this.writecb = null;
			this.writelen = 0;
			this.bufferedRequest = null;
			this.lastBufferedRequest = null;
			this.pendingcb = 0;
			this.prefinished = false;
			this.errorEmitted = false;
			this.bufferedRequestCount = 0;
			this.corkedRequestsFree = new CorkedRequest(this);
		}
		WritableState.prototype.getBuffer = function getBuffer() {
			var current = this.bufferedRequest;
			var out = [];
			while (current) {
				out.push(current);
				current = current.next;
			}
			return out;
		};
		(function() {
			try {
				Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function() {
					return this.getBuffer();
				}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") });
			} catch (_) {}
		})();
		var realHasInstance;
		if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
			realHasInstance = Function.prototype[Symbol.hasInstance];
			Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) {
				if (realHasInstance.call(this, object)) return true;
				if (this !== Writable) return false;
				return object && object._writableState instanceof WritableState;
			} });
		} else realHasInstance = function(object) {
			return object instanceof this;
		};
		function Writable(options) {
			Duplex = Duplex || require__stream_duplex$2();
			if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) return new Writable(options);
			this._writableState = new WritableState(options, this);
			this.writable = true;
			if (options) {
				if (typeof options.write === "function") this._write = options.write;
				if (typeof options.writev === "function") this._writev = options.writev;
				if (typeof options.destroy === "function") this._destroy = options.destroy;
				if (typeof options.final === "function") this._final = options.final;
			}
			Stream.call(this);
		}
		Writable.prototype.pipe = function() {
			this.emit("error", /* @__PURE__ */ new Error("Cannot pipe, not readable"));
		};
		function writeAfterEnd(stream, cb) {
			var er = /* @__PURE__ */ new Error("write after end");
			stream.emit("error", er);
			pna.nextTick(cb, er);
		}
		function validChunk(stream, state, chunk, cb) {
			var valid = true;
			var er = false;
			if (chunk === null) er = /* @__PURE__ */ new TypeError("May not write null values to stream");
			else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk");
			if (er) {
				stream.emit("error", er);
				pna.nextTick(cb, er);
				valid = false;
			}
			return valid;
		}
		Writable.prototype.write = function(chunk, encoding, cb) {
			var state = this._writableState;
			var ret = false;
			var isBuf = !state.objectMode && _isUint8Array(chunk);
			if (isBuf && !Buffer.isBuffer(chunk)) chunk = _uint8ArrayToBuffer(chunk);
			if (typeof encoding === "function") {
				cb = encoding;
				encoding = null;
			}
			if (isBuf) encoding = "buffer";
			else if (!encoding) encoding = state.defaultEncoding;
			if (typeof cb !== "function") cb = nop;
			if (state.ended) writeAfterEnd(this, cb);
			else if (isBuf || validChunk(this, state, chunk, cb)) {
				state.pendingcb++;
				ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
			}
			return ret;
		};
		Writable.prototype.cork = function() {
			var state = this._writableState;
			state.corked++;
		};
		Writable.prototype.uncork = function() {
			var state = this._writableState;
			if (state.corked) {
				state.corked--;
				if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
			}
		};
		Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
			if (typeof encoding === "string") encoding = encoding.toLowerCase();
			if (!([
				"hex",
				"utf8",
				"utf-8",
				"ascii",
				"binary",
				"base64",
				"ucs2",
				"ucs-2",
				"utf16le",
				"utf-16le",
				"raw"
			].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding);
			this._writableState.defaultEncoding = encoding;
			return this;
		};
		function decodeChunk(state, chunk, encoding) {
			if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer.from(chunk, encoding);
			return chunk;
		}
		Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
			enumerable: false,
			get: function() {
				return this._writableState.highWaterMark;
			}
		});
		function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
			if (!isBuf) {
				var newChunk = decodeChunk(state, chunk, encoding);
				if (chunk !== newChunk) {
					isBuf = true;
					encoding = "buffer";
					chunk = newChunk;
				}
			}
			var len = state.objectMode ? 1 : chunk.length;
			state.length += len;
			var ret = state.length < state.highWaterMark;
			if (!ret) state.needDrain = true;
			if (state.writing || state.corked) {
				var last = state.lastBufferedRequest;
				state.lastBufferedRequest = {
					chunk,
					encoding,
					isBuf,
					callback: cb,
					next: null
				};
				if (last) last.next = state.lastBufferedRequest;
				else state.bufferedRequest = state.lastBufferedRequest;
				state.bufferedRequestCount += 1;
			} else doWrite(stream, state, false, len, chunk, encoding, cb);
			return ret;
		}
		function doWrite(stream, state, writev, len, chunk, encoding, cb) {
			state.writelen = len;
			state.writecb = cb;
			state.writing = true;
			state.sync = true;
			if (writev) stream._writev(chunk, state.onwrite);
			else stream._write(chunk, encoding, state.onwrite);
			state.sync = false;
		}
		function onwriteError(stream, state, sync, er, cb) {
			--state.pendingcb;
			if (sync) {
				pna.nextTick(cb, er);
				pna.nextTick(finishMaybe, stream, state);
				stream._writableState.errorEmitted = true;
				stream.emit("error", er);
			} else {
				cb(er);
				stream._writableState.errorEmitted = true;
				stream.emit("error", er);
				finishMaybe(stream, state);
			}
		}
		function onwriteStateUpdate(state) {
			state.writing = false;
			state.writecb = null;
			state.length -= state.writelen;
			state.writelen = 0;
		}
		function onwrite(stream, er) {
			var state = stream._writableState;
			var sync = state.sync;
			var cb = state.writecb;
			onwriteStateUpdate(state);
			if (er) onwriteError(stream, state, sync, er, cb);
			else {
				var finished = needFinish(state);
				if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state);
				if (sync) asyncWrite(afterWrite, stream, state, finished, cb);
				else afterWrite(stream, state, finished, cb);
			}
		}
		function afterWrite(stream, state, finished, cb) {
			if (!finished) onwriteDrain(stream, state);
			state.pendingcb--;
			cb();
			finishMaybe(stream, state);
		}
		function onwriteDrain(stream, state) {
			if (state.length === 0 && state.needDrain) {
				state.needDrain = false;
				stream.emit("drain");
			}
		}
		function clearBuffer(stream, state) {
			state.bufferProcessing = true;
			var entry = state.bufferedRequest;
			if (stream._writev && entry && entry.next) {
				var l = state.bufferedRequestCount;
				var buffer = new Array(l);
				var holder = state.corkedRequestsFree;
				holder.entry = entry;
				var count = 0;
				var allBuffers = true;
				while (entry) {
					buffer[count] = entry;
					if (!entry.isBuf) allBuffers = false;
					entry = entry.next;
					count += 1;
				}
				buffer.allBuffers = allBuffers;
				doWrite(stream, state, true, state.length, buffer, "", holder.finish);
				state.pendingcb++;
				state.lastBufferedRequest = null;
				if (holder.next) {
					state.corkedRequestsFree = holder.next;
					holder.next = null;
				} else state.corkedRequestsFree = new CorkedRequest(state);
				state.bufferedRequestCount = 0;
			} else {
				while (entry) {
					var chunk = entry.chunk;
					var encoding = entry.encoding;
					var cb = entry.callback;
					doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb);
					entry = entry.next;
					state.bufferedRequestCount--;
					if (state.writing) break;
				}
				if (entry === null) state.lastBufferedRequest = null;
			}
			state.bufferedRequest = entry;
			state.bufferProcessing = false;
		}
		Writable.prototype._write = function(chunk, encoding, cb) {
			cb(/* @__PURE__ */ new Error("_write() is not implemented"));
		};
		Writable.prototype._writev = null;
		Writable.prototype.end = function(chunk, encoding, cb) {
			var state = this._writableState;
			if (typeof chunk === "function") {
				cb = chunk;
				chunk = null;
				encoding = null;
			} else if (typeof encoding === "function") {
				cb = encoding;
				encoding = null;
			}
			if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
			if (state.corked) {
				state.corked = 1;
				this.uncork();
			}
			if (!state.ending) endWritable(this, state, cb);
		};
		function needFinish(state) {
			return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
		}
		function callFinal(stream, state) {
			stream._final(function(err) {
				state.pendingcb--;
				if (err) stream.emit("error", err);
				state.prefinished = true;
				stream.emit("prefinish");
				finishMaybe(stream, state);
			});
		}
		function prefinish(stream, state) {
			if (!state.prefinished && !state.finalCalled) if (typeof stream._final === "function") {
				state.pendingcb++;
				state.finalCalled = true;
				pna.nextTick(callFinal, stream, state);
			} else {
				state.prefinished = true;
				stream.emit("prefinish");
			}
		}
		function finishMaybe(stream, state) {
			var need = needFinish(state);
			if (need) {
				prefinish(stream, state);
				if (state.pendingcb === 0) {
					state.finished = true;
					stream.emit("finish");
				}
			}
			return need;
		}
		function endWritable(stream, state, cb) {
			state.ending = true;
			finishMaybe(stream, state);
			if (cb) if (state.finished) pna.nextTick(cb);
			else stream.once("finish", cb);
			state.ended = true;
			stream.writable = false;
		}
		function onCorkedFinish(corkReq, state, err) {
			var entry = corkReq.entry;
			corkReq.entry = null;
			while (entry) {
				var cb = entry.callback;
				state.pendingcb--;
				cb(err);
				entry = entry.next;
			}
			state.corkedRequestsFree.next = corkReq;
		}
		Object.defineProperty(Writable.prototype, "destroyed", {
			get: function() {
				if (this._writableState === void 0) return false;
				return this._writableState.destroyed;
			},
			set: function(value) {
				if (!this._writableState) return;
				this._writableState.destroyed = value;
			}
		});
		Writable.prototype.destroy = destroyImpl.destroy;
		Writable.prototype._undestroy = destroyImpl.undestroy;
		Writable.prototype._destroy = function(err, cb) {
			this.end();
			cb(err);
		};
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/_stream_duplex.js
	var require__stream_duplex$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var pna = require_process_nextick_args();
		var objectKeys = Object.keys || function(obj) {
			var keys = [];
			for (var key in obj) keys.push(key);
			return keys;
		};
		module.exports = Duplex;
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		var Readable = require__stream_readable$2();
		var Writable = require__stream_writable$2();
		util.inherits(Duplex, Readable);
		var keys = objectKeys(Writable.prototype);
		for (var v = 0; v < keys.length; v++) {
			var method = keys[v];
			if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
		}
		function Duplex(options) {
			if (!(this instanceof Duplex)) return new Duplex(options);
			Readable.call(this, options);
			Writable.call(this, options);
			if (options && options.readable === false) this.readable = false;
			if (options && options.writable === false) this.writable = false;
			this.allowHalfOpen = true;
			if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
			this.once("end", onend);
		}
		Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
			enumerable: false,
			get: function() {
				return this._writableState.highWaterMark;
			}
		});
		function onend() {
			if (this.allowHalfOpen || this._writableState.ended) return;
			pna.nextTick(onEndNT, this);
		}
		function onEndNT(self) {
			self.end();
		}
		Object.defineProperty(Duplex.prototype, "destroyed", {
			get: function() {
				if (this._readableState === void 0 || this._writableState === void 0) return false;
				return this._readableState.destroyed && this._writableState.destroyed;
			},
			set: function(value) {
				if (this._readableState === void 0 || this._writableState === void 0) return;
				this._readableState.destroyed = value;
				this._writableState.destroyed = value;
			}
		});
		Duplex.prototype._destroy = function(err, cb) {
			this.push(null);
			this.end();
			pna.nextTick(cb, err);
		};
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/string_decoder/node_modules/safe-buffer/index.js
	var require_safe_buffer$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var buffer = require_dist();
		var Buffer = buffer.Buffer;
		function copyProps(src, dst) {
			for (var key in src) dst[key] = src[key];
		}
		if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
		else {
			copyProps(buffer, exports);
			exports.Buffer = SafeBuffer;
		}
		function SafeBuffer(arg, encodingOrOffset, length) {
			return Buffer(arg, encodingOrOffset, length);
		}
		copyProps(Buffer, SafeBuffer);
		SafeBuffer.from = function(arg, encodingOrOffset, length) {
			if (typeof arg === "number") throw new TypeError("Argument must not be a number");
			return Buffer(arg, encodingOrOffset, length);
		};
		SafeBuffer.alloc = function(size, fill, encoding) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			var buf = Buffer(size);
			if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
			else buf.fill(fill);
			else buf.fill(0);
			return buf;
		};
		SafeBuffer.allocUnsafe = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return Buffer(size);
		};
		SafeBuffer.allocUnsafeSlow = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return buffer.SlowBuffer(size);
		};
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/string_decoder/lib/string_decoder.js
	var require_string_decoder$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var Buffer = require_safe_buffer$2().Buffer;
		var isEncoding = Buffer.isEncoding || function(encoding) {
			encoding = "" + encoding;
			switch (encoding && encoding.toLowerCase()) {
				case "hex":
				case "utf8":
				case "utf-8":
				case "ascii":
				case "binary":
				case "base64":
				case "ucs2":
				case "ucs-2":
				case "utf16le":
				case "utf-16le":
				case "raw": return true;
				default: return false;
			}
		};
		function _normalizeEncoding(enc) {
			if (!enc) return "utf8";
			var retried;
			while (true) switch (enc) {
				case "utf8":
				case "utf-8": return "utf8";
				case "ucs2":
				case "ucs-2":
				case "utf16le":
				case "utf-16le": return "utf16le";
				case "latin1":
				case "binary": return "latin1";
				case "base64":
				case "ascii":
				case "hex": return enc;
				default:
					if (retried) return;
					enc = ("" + enc).toLowerCase();
					retried = true;
			}
		}
		function normalizeEncoding(enc) {
			var nenc = _normalizeEncoding(enc);
			if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
			return nenc || enc;
		}
		exports.StringDecoder = StringDecoder;
		function StringDecoder(encoding) {
			this.encoding = normalizeEncoding(encoding);
			var nb;
			switch (this.encoding) {
				case "utf16le":
					this.text = utf16Text;
					this.end = utf16End;
					nb = 4;
					break;
				case "utf8":
					this.fillLast = utf8FillLast;
					nb = 4;
					break;
				case "base64":
					this.text = base64Text;
					this.end = base64End;
					nb = 3;
					break;
				default:
					this.write = simpleWrite;
					this.end = simpleEnd;
					return;
			}
			this.lastNeed = 0;
			this.lastTotal = 0;
			this.lastChar = Buffer.allocUnsafe(nb);
		}
		StringDecoder.prototype.write = function(buf) {
			if (buf.length === 0) return "";
			var r;
			var i;
			if (this.lastNeed) {
				r = this.fillLast(buf);
				if (r === void 0) return "";
				i = this.lastNeed;
				this.lastNeed = 0;
			} else i = 0;
			if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
			return r || "";
		};
		StringDecoder.prototype.end = utf8End;
		StringDecoder.prototype.text = utf8Text;
		StringDecoder.prototype.fillLast = function(buf) {
			if (this.lastNeed <= buf.length) {
				buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
				return this.lastChar.toString(this.encoding, 0, this.lastTotal);
			}
			buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
			this.lastNeed -= buf.length;
		};
		function utf8CheckByte(byte) {
			if (byte <= 127) return 0;
			else if (byte >> 5 === 6) return 2;
			else if (byte >> 4 === 14) return 3;
			else if (byte >> 3 === 30) return 4;
			return byte >> 6 === 2 ? -1 : -2;
		}
		function utf8CheckIncomplete(self, buf, i) {
			var j = buf.length - 1;
			if (j < i) return 0;
			var nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) self.lastNeed = nb - 1;
				return nb;
			}
			if (--j < i || nb === -2) return 0;
			nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) self.lastNeed = nb - 2;
				return nb;
			}
			if (--j < i || nb === -2) return 0;
			nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) if (nb === 2) nb = 0;
				else self.lastNeed = nb - 3;
				return nb;
			}
			return 0;
		}
		function utf8CheckExtraBytes(self, buf, p) {
			if ((buf[0] & 192) !== 128) {
				self.lastNeed = 0;
				return "�";
			}
			if (self.lastNeed > 1 && buf.length > 1) {
				if ((buf[1] & 192) !== 128) {
					self.lastNeed = 1;
					return "�";
				}
				if (self.lastNeed > 2 && buf.length > 2) {
					if ((buf[2] & 192) !== 128) {
						self.lastNeed = 2;
						return "�";
					}
				}
			}
		}
		function utf8FillLast(buf) {
			var p = this.lastTotal - this.lastNeed;
			var r = utf8CheckExtraBytes(this, buf, p);
			if (r !== void 0) return r;
			if (this.lastNeed <= buf.length) {
				buf.copy(this.lastChar, p, 0, this.lastNeed);
				return this.lastChar.toString(this.encoding, 0, this.lastTotal);
			}
			buf.copy(this.lastChar, p, 0, buf.length);
			this.lastNeed -= buf.length;
		}
		function utf8Text(buf, i) {
			var total = utf8CheckIncomplete(this, buf, i);
			if (!this.lastNeed) return buf.toString("utf8", i);
			this.lastTotal = total;
			var end = buf.length - (total - this.lastNeed);
			buf.copy(this.lastChar, 0, end);
			return buf.toString("utf8", i, end);
		}
		function utf8End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) return r + "�";
			return r;
		}
		function utf16Text(buf, i) {
			if ((buf.length - i) % 2 === 0) {
				var r = buf.toString("utf16le", i);
				if (r) {
					var c = r.charCodeAt(r.length - 1);
					if (c >= 55296 && c <= 56319) {
						this.lastNeed = 2;
						this.lastTotal = 4;
						this.lastChar[0] = buf[buf.length - 2];
						this.lastChar[1] = buf[buf.length - 1];
						return r.slice(0, -1);
					}
				}
				return r;
			}
			this.lastNeed = 1;
			this.lastTotal = 2;
			this.lastChar[0] = buf[buf.length - 1];
			return buf.toString("utf16le", i, buf.length - 1);
		}
		function utf16End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) {
				var end = this.lastTotal - this.lastNeed;
				return r + this.lastChar.toString("utf16le", 0, end);
			}
			return r;
		}
		function base64Text(buf, i) {
			var n = (buf.length - i) % 3;
			if (n === 0) return buf.toString("base64", i);
			this.lastNeed = 3 - n;
			this.lastTotal = 3;
			if (n === 1) this.lastChar[0] = buf[buf.length - 1];
			else {
				this.lastChar[0] = buf[buf.length - 2];
				this.lastChar[1] = buf[buf.length - 1];
			}
			return buf.toString("base64", i, buf.length - n);
		}
		function base64End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
			return r;
		}
		function simpleWrite(buf) {
			return buf.toString(this.encoding);
		}
		function simpleEnd(buf) {
			return buf && buf.length ? this.write(buf) : "";
		}
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/_stream_readable.js
	var require__stream_readable$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		var pna = require_process_nextick_args();
		module.exports = Readable;
		var isArray = require_isarray$1();
		var Duplex;
		Readable.ReadableState = ReadableState;
		require_events().EventEmitter;
		var EElistenerCount = function(emitter, type) {
			return emitter.listeners(type).length;
		};
		var Stream = require_stream_browser$2();
		var Buffer = require_safe_buffer$3().Buffer;
		var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
		function _uint8ArrayToBuffer(chunk) {
			return Buffer.from(chunk);
		}
		function _isUint8Array(obj) {
			return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
		}
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		var debugUtil = require_util$2();
		var debug = void 0;
		if (debugUtil && debugUtil.debuglog) debug = debugUtil.debuglog("stream");
		else debug = function() {};
		var BufferList = require_BufferList$1();
		var destroyImpl = require_destroy$2();
		var StringDecoder;
		util.inherits(Readable, Stream);
		var kProxyEvents = [
			"error",
			"close",
			"destroy",
			"pause",
			"resume"
		];
		function prependListener(emitter, event, fn) {
			if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
			if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
			else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);
			else emitter._events[event] = [fn, emitter._events[event]];
		}
		function ReadableState(options, stream) {
			Duplex = Duplex || require__stream_duplex$2();
			options = options || {};
			var isDuplex = stream instanceof Duplex;
			this.objectMode = !!options.objectMode;
			if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
			var hwm = options.highWaterMark;
			var readableHwm = options.readableHighWaterMark;
			var defaultHwm = this.objectMode ? 16 : 16 * 1024;
			if (hwm || hwm === 0) this.highWaterMark = hwm;
			else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;
			else this.highWaterMark = defaultHwm;
			this.highWaterMark = Math.floor(this.highWaterMark);
			this.buffer = new BufferList();
			this.length = 0;
			this.pipes = null;
			this.pipesCount = 0;
			this.flowing = null;
			this.ended = false;
			this.endEmitted = false;
			this.reading = false;
			this.sync = true;
			this.needReadable = false;
			this.emittedReadable = false;
			this.readableListening = false;
			this.resumeScheduled = false;
			this.destroyed = false;
			this.defaultEncoding = options.defaultEncoding || "utf8";
			this.awaitDrain = 0;
			this.readingMore = false;
			this.decoder = null;
			this.encoding = null;
			if (options.encoding) {
				if (!StringDecoder) StringDecoder = require_string_decoder$2().StringDecoder;
				this.decoder = new StringDecoder(options.encoding);
				this.encoding = options.encoding;
			}
		}
		function Readable(options) {
			Duplex = Duplex || require__stream_duplex$2();
			if (!(this instanceof Readable)) return new Readable(options);
			this._readableState = new ReadableState(options, this);
			this.readable = true;
			if (options) {
				if (typeof options.read === "function") this._read = options.read;
				if (typeof options.destroy === "function") this._destroy = options.destroy;
			}
			Stream.call(this);
		}
		Object.defineProperty(Readable.prototype, "destroyed", {
			get: function() {
				if (this._readableState === void 0) return false;
				return this._readableState.destroyed;
			},
			set: function(value) {
				if (!this._readableState) return;
				this._readableState.destroyed = value;
			}
		});
		Readable.prototype.destroy = destroyImpl.destroy;
		Readable.prototype._undestroy = destroyImpl.undestroy;
		Readable.prototype._destroy = function(err, cb) {
			this.push(null);
			cb(err);
		};
		Readable.prototype.push = function(chunk, encoding) {
			var state = this._readableState;
			var skipChunkCheck;
			if (!state.objectMode) {
				if (typeof chunk === "string") {
					encoding = encoding || state.defaultEncoding;
					if (encoding !== state.encoding) {
						chunk = Buffer.from(chunk, encoding);
						encoding = "";
					}
					skipChunkCheck = true;
				}
			} else skipChunkCheck = true;
			return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
		};
		Readable.prototype.unshift = function(chunk) {
			return readableAddChunk(this, chunk, null, true, false);
		};
		function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
			var state = stream._readableState;
			if (chunk === null) {
				state.reading = false;
				onEofChunk(stream, state);
			} else {
				var er;
				if (!skipChunkCheck) er = chunkInvalid(state, chunk);
				if (er) stream.emit("error", er);
				else if (state.objectMode || chunk && chunk.length > 0) {
					if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) chunk = _uint8ArrayToBuffer(chunk);
					if (addToFront) if (state.endEmitted) stream.emit("error", /* @__PURE__ */ new Error("stream.unshift() after end event"));
					else addChunk(stream, state, chunk, true);
					else if (state.ended) stream.emit("error", /* @__PURE__ */ new Error("stream.push() after EOF"));
					else {
						state.reading = false;
						if (state.decoder && !encoding) {
							chunk = state.decoder.write(chunk);
							if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
							else maybeReadMore(stream, state);
						} else addChunk(stream, state, chunk, false);
					}
				} else if (!addToFront) state.reading = false;
			}
			return needMoreData(state);
		}
		function addChunk(stream, state, chunk, addToFront) {
			if (state.flowing && state.length === 0 && !state.sync) {
				stream.emit("data", chunk);
				stream.read(0);
			} else {
				state.length += state.objectMode ? 1 : chunk.length;
				if (addToFront) state.buffer.unshift(chunk);
				else state.buffer.push(chunk);
				if (state.needReadable) emitReadable(stream);
			}
			maybeReadMore(stream, state);
		}
		function chunkInvalid(state, chunk) {
			var er;
			if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk");
			return er;
		}
		function needMoreData(state) {
			return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
		}
		Readable.prototype.isPaused = function() {
			return this._readableState.flowing === false;
		};
		Readable.prototype.setEncoding = function(enc) {
			if (!StringDecoder) StringDecoder = require_string_decoder$2().StringDecoder;
			this._readableState.decoder = new StringDecoder(enc);
			this._readableState.encoding = enc;
			return this;
		};
		var MAX_HWM = 8388608;
		function computeNewHighWaterMark(n) {
			if (n >= MAX_HWM) n = MAX_HWM;
			else {
				n--;
				n |= n >>> 1;
				n |= n >>> 2;
				n |= n >>> 4;
				n |= n >>> 8;
				n |= n >>> 16;
				n++;
			}
			return n;
		}
		function howMuchToRead(n, state) {
			if (n <= 0 || state.length === 0 && state.ended) return 0;
			if (state.objectMode) return 1;
			if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length;
			else return state.length;
			if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
			if (n <= state.length) return n;
			if (!state.ended) {
				state.needReadable = true;
				return 0;
			}
			return state.length;
		}
		Readable.prototype.read = function(n) {
			debug("read", n);
			n = parseInt(n, 10);
			var state = this._readableState;
			var nOrig = n;
			if (n !== 0) state.emittedReadable = false;
			if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
				debug("read: emitReadable", state.length, state.ended);
				if (state.length === 0 && state.ended) endReadable(this);
				else emitReadable(this);
				return null;
			}
			n = howMuchToRead(n, state);
			if (n === 0 && state.ended) {
				if (state.length === 0) endReadable(this);
				return null;
			}
			var doRead = state.needReadable;
			debug("need readable", doRead);
			if (state.length === 0 || state.length - n < state.highWaterMark) {
				doRead = true;
				debug("length less than watermark", doRead);
			}
			if (state.ended || state.reading) {
				doRead = false;
				debug("reading or ended", doRead);
			} else if (doRead) {
				debug("do read");
				state.reading = true;
				state.sync = true;
				if (state.length === 0) state.needReadable = true;
				this._read(state.highWaterMark);
				state.sync = false;
				if (!state.reading) n = howMuchToRead(nOrig, state);
			}
			var ret;
			if (n > 0) ret = fromList(n, state);
			else ret = null;
			if (ret === null) {
				state.needReadable = true;
				n = 0;
			} else state.length -= n;
			if (state.length === 0) {
				if (!state.ended) state.needReadable = true;
				if (nOrig !== n && state.ended) endReadable(this);
			}
			if (ret !== null) this.emit("data", ret);
			return ret;
		};
		function onEofChunk(stream, state) {
			if (state.ended) return;
			if (state.decoder) {
				var chunk = state.decoder.end();
				if (chunk && chunk.length) {
					state.buffer.push(chunk);
					state.length += state.objectMode ? 1 : chunk.length;
				}
			}
			state.ended = true;
			emitReadable(stream);
		}
		function emitReadable(stream) {
			var state = stream._readableState;
			state.needReadable = false;
			if (!state.emittedReadable) {
				debug("emitReadable", state.flowing);
				state.emittedReadable = true;
				if (state.sync) pna.nextTick(emitReadable_, stream);
				else emitReadable_(stream);
			}
		}
		function emitReadable_(stream) {
			debug("emit readable");
			stream.emit("readable");
			flow(stream);
		}
		function maybeReadMore(stream, state) {
			if (!state.readingMore) {
				state.readingMore = true;
				pna.nextTick(maybeReadMore_, stream, state);
			}
		}
		function maybeReadMore_(stream, state) {
			var len = state.length;
			while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
				debug("maybeReadMore read 0");
				stream.read(0);
				if (len === state.length) break;
				else len = state.length;
			}
			state.readingMore = false;
		}
		Readable.prototype._read = function(n) {
			this.emit("error", /* @__PURE__ */ new Error("_read() is not implemented"));
		};
		Readable.prototype.pipe = function(dest, pipeOpts) {
			var src = this;
			var state = this._readableState;
			switch (state.pipesCount) {
				case 0:
					state.pipes = dest;
					break;
				case 1:
					state.pipes = [state.pipes, dest];
					break;
				default:
					state.pipes.push(dest);
					break;
			}
			state.pipesCount += 1;
			debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
			var endFn = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr ? onend : unpipe;
			if (state.endEmitted) pna.nextTick(endFn);
			else src.once("end", endFn);
			dest.on("unpipe", onunpipe);
			function onunpipe(readable, unpipeInfo) {
				debug("onunpipe");
				if (readable === src) {
					if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
						unpipeInfo.hasUnpiped = true;
						cleanup();
					}
				}
			}
			function onend() {
				debug("onend");
				dest.end();
			}
			var ondrain = pipeOnDrain(src);
			dest.on("drain", ondrain);
			var cleanedUp = false;
			function cleanup() {
				debug("cleanup");
				dest.removeListener("close", onclose);
				dest.removeListener("finish", onfinish);
				dest.removeListener("drain", ondrain);
				dest.removeListener("error", onerror);
				dest.removeListener("unpipe", onunpipe);
				src.removeListener("end", onend);
				src.removeListener("end", unpipe);
				src.removeListener("data", ondata);
				cleanedUp = true;
				if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
			}
			var increasedAwaitDrain = false;
			src.on("data", ondata);
			function ondata(chunk) {
				debug("ondata");
				increasedAwaitDrain = false;
				if (false === dest.write(chunk) && !increasedAwaitDrain) {
					if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
						debug("false write response, pause", state.awaitDrain);
						state.awaitDrain++;
						increasedAwaitDrain = true;
					}
					src.pause();
				}
			}
			function onerror(er) {
				debug("onerror", er);
				unpipe();
				dest.removeListener("error", onerror);
				if (EElistenerCount(dest, "error") === 0) dest.emit("error", er);
			}
			prependListener(dest, "error", onerror);
			function onclose() {
				dest.removeListener("finish", onfinish);
				unpipe();
			}
			dest.once("close", onclose);
			function onfinish() {
				debug("onfinish");
				dest.removeListener("close", onclose);
				unpipe();
			}
			dest.once("finish", onfinish);
			function unpipe() {
				debug("unpipe");
				src.unpipe(dest);
			}
			dest.emit("pipe", src);
			if (!state.flowing) {
				debug("pipe resume");
				src.resume();
			}
			return dest;
		};
		function pipeOnDrain(src) {
			return function() {
				var state = src._readableState;
				debug("pipeOnDrain", state.awaitDrain);
				if (state.awaitDrain) state.awaitDrain--;
				if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
					state.flowing = true;
					flow(src);
				}
			};
		}
		Readable.prototype.unpipe = function(dest) {
			var state = this._readableState;
			var unpipeInfo = { hasUnpiped: false };
			if (state.pipesCount === 0) return this;
			if (state.pipesCount === 1) {
				if (dest && dest !== state.pipes) return this;
				if (!dest) dest = state.pipes;
				state.pipes = null;
				state.pipesCount = 0;
				state.flowing = false;
				if (dest) dest.emit("unpipe", this, unpipeInfo);
				return this;
			}
			if (!dest) {
				var dests = state.pipes;
				var len = state.pipesCount;
				state.pipes = null;
				state.pipesCount = 0;
				state.flowing = false;
				for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false });
				return this;
			}
			var index = indexOf(state.pipes, dest);
			if (index === -1) return this;
			state.pipes.splice(index, 1);
			state.pipesCount -= 1;
			if (state.pipesCount === 1) state.pipes = state.pipes[0];
			dest.emit("unpipe", this, unpipeInfo);
			return this;
		};
		Readable.prototype.on = function(ev, fn) {
			var res = Stream.prototype.on.call(this, ev, fn);
			if (ev === "data") {
				if (this._readableState.flowing !== false) this.resume();
			} else if (ev === "readable") {
				var state = this._readableState;
				if (!state.endEmitted && !state.readableListening) {
					state.readableListening = state.needReadable = true;
					state.emittedReadable = false;
					if (!state.reading) pna.nextTick(nReadingNextTick, this);
					else if (state.length) emitReadable(this);
				}
			}
			return res;
		};
		Readable.prototype.addListener = Readable.prototype.on;
		function nReadingNextTick(self) {
			debug("readable nexttick read 0");
			self.read(0);
		}
		Readable.prototype.resume = function() {
			var state = this._readableState;
			if (!state.flowing) {
				debug("resume");
				state.flowing = true;
				resume(this, state);
			}
			return this;
		};
		function resume(stream, state) {
			if (!state.resumeScheduled) {
				state.resumeScheduled = true;
				pna.nextTick(resume_, stream, state);
			}
		}
		function resume_(stream, state) {
			if (!state.reading) {
				debug("resume read 0");
				stream.read(0);
			}
			state.resumeScheduled = false;
			state.awaitDrain = 0;
			stream.emit("resume");
			flow(stream);
			if (state.flowing && !state.reading) stream.read(0);
		}
		Readable.prototype.pause = function() {
			debug("call pause flowing=%j", this._readableState.flowing);
			if (false !== this._readableState.flowing) {
				debug("pause");
				this._readableState.flowing = false;
				this.emit("pause");
			}
			return this;
		};
		function flow(stream) {
			var state = stream._readableState;
			debug("flow", state.flowing);
			while (state.flowing && stream.read() !== null);
		}
		Readable.prototype.wrap = function(stream) {
			var _this = this;
			var state = this._readableState;
			var paused = false;
			stream.on("end", function() {
				debug("wrapped end");
				if (state.decoder && !state.ended) {
					var chunk = state.decoder.end();
					if (chunk && chunk.length) _this.push(chunk);
				}
				_this.push(null);
			});
			stream.on("data", function(chunk) {
				debug("wrapped data");
				if (state.decoder) chunk = state.decoder.write(chunk);
				if (state.objectMode && (chunk === null || chunk === void 0)) return;
				else if (!state.objectMode && (!chunk || !chunk.length)) return;
				if (!_this.push(chunk)) {
					paused = true;
					stream.pause();
				}
			});
			for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function(method) {
				return function() {
					return stream[method].apply(stream, arguments);
				};
			}(i);
			for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
			this._read = function(n) {
				debug("wrapped _read", n);
				if (paused) {
					paused = false;
					stream.resume();
				}
			};
			return this;
		};
		Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
			enumerable: false,
			get: function() {
				return this._readableState.highWaterMark;
			}
		});
		Readable._fromList = fromList;
		function fromList(n, state) {
			if (state.length === 0) return null;
			var ret;
			if (state.objectMode) ret = state.buffer.shift();
			else if (!n || n >= state.length) {
				if (state.decoder) ret = state.buffer.join("");
				else if (state.buffer.length === 1) ret = state.buffer.head.data;
				else ret = state.buffer.concat(state.length);
				state.buffer.clear();
			} else ret = fromListPartial(n, state.buffer, state.decoder);
			return ret;
		}
		function fromListPartial(n, list, hasStrings) {
			var ret;
			if (n < list.head.data.length) {
				ret = list.head.data.slice(0, n);
				list.head.data = list.head.data.slice(n);
			} else if (n === list.head.data.length) ret = list.shift();
			else ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
			return ret;
		}
		function copyFromBufferString(n, list) {
			var p = list.head;
			var c = 1;
			var ret = p.data;
			n -= ret.length;
			while (p = p.next) {
				var str = p.data;
				var nb = n > str.length ? str.length : n;
				if (nb === str.length) ret += str;
				else ret += str.slice(0, n);
				n -= nb;
				if (n === 0) {
					if (nb === str.length) {
						++c;
						if (p.next) list.head = p.next;
						else list.head = list.tail = null;
					} else {
						list.head = p;
						p.data = str.slice(nb);
					}
					break;
				}
				++c;
			}
			list.length -= c;
			return ret;
		}
		function copyFromBuffer(n, list) {
			var ret = Buffer.allocUnsafe(n);
			var p = list.head;
			var c = 1;
			p.data.copy(ret);
			n -= p.data.length;
			while (p = p.next) {
				var buf = p.data;
				var nb = n > buf.length ? buf.length : n;
				buf.copy(ret, ret.length - n, 0, nb);
				n -= nb;
				if (n === 0) {
					if (nb === buf.length) {
						++c;
						if (p.next) list.head = p.next;
						else list.head = list.tail = null;
					} else {
						list.head = p;
						p.data = buf.slice(nb);
					}
					break;
				}
				++c;
			}
			list.length -= c;
			return ret;
		}
		function endReadable(stream) {
			var state = stream._readableState;
			if (state.length > 0) throw new Error("\"endReadable()\" called on non-empty stream");
			if (!state.endEmitted) {
				state.ended = true;
				pna.nextTick(endReadableNT, state, stream);
			}
		}
		function endReadableNT(state, stream) {
			if (!state.endEmitted && state.length === 0) {
				state.endEmitted = true;
				stream.readable = false;
				stream.emit("end");
			}
		}
		function indexOf(xs, x) {
			for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i;
			return -1;
		}
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/_stream_transform.js
	var require__stream_transform$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = Transform;
		var Duplex = require__stream_duplex$2();
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		util.inherits(Transform, Duplex);
		function afterTransform(er, data) {
			var ts = this._transformState;
			ts.transforming = false;
			var cb = ts.writecb;
			if (!cb) return this.emit("error", /* @__PURE__ */ new Error("write callback called multiple times"));
			ts.writechunk = null;
			ts.writecb = null;
			if (data != null) this.push(data);
			cb(er);
			var rs = this._readableState;
			rs.reading = false;
			if (rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
		}
		function Transform(options) {
			if (!(this instanceof Transform)) return new Transform(options);
			Duplex.call(this, options);
			this._transformState = {
				afterTransform: afterTransform.bind(this),
				needTransform: false,
				transforming: false,
				writecb: null,
				writechunk: null,
				writeencoding: null
			};
			this._readableState.needReadable = true;
			this._readableState.sync = false;
			if (options) {
				if (typeof options.transform === "function") this._transform = options.transform;
				if (typeof options.flush === "function") this._flush = options.flush;
			}
			this.on("prefinish", prefinish);
		}
		function prefinish() {
			var _this = this;
			if (typeof this._flush === "function") this._flush(function(er, data) {
				done(_this, er, data);
			});
			else done(this, null, null);
		}
		Transform.prototype.push = function(chunk, encoding) {
			this._transformState.needTransform = false;
			return Duplex.prototype.push.call(this, chunk, encoding);
		};
		Transform.prototype._transform = function(chunk, encoding, cb) {
			throw new Error("_transform() is not implemented");
		};
		Transform.prototype._write = function(chunk, encoding, cb) {
			var ts = this._transformState;
			ts.writecb = cb;
			ts.writechunk = chunk;
			ts.writeencoding = encoding;
			if (!ts.transforming) {
				var rs = this._readableState;
				if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
			}
		};
		Transform.prototype._read = function(n) {
			var ts = this._transformState;
			if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
				ts.transforming = true;
				this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
			} else ts.needTransform = true;
		};
		Transform.prototype._destroy = function(err, cb) {
			var _this2 = this;
			Duplex.prototype._destroy.call(this, err, function(err2) {
				cb(err2);
				_this2.emit("close");
			});
		};
		function done(stream, er, data) {
			if (er) return stream.emit("error", er);
			if (data != null) stream.push(data);
			if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0");
			if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming");
			return stream.push(null);
		}
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/lib/_stream_passthrough.js
	var require__stream_passthrough$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = PassThrough;
		var Transform = require__stream_transform$2();
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		util.inherits(PassThrough, Transform);
		function PassThrough(options) {
			if (!(this instanceof PassThrough)) return new PassThrough(options);
			Transform.call(this, options);
		}
		PassThrough.prototype._transform = function(chunk, encoding, cb) {
			cb(null, chunk);
		};
	}));
	//#endregion
	//#region ../../node_modules/hash-base/node_modules/readable-stream/readable-browser.js
	var require_readable_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports = module.exports = require__stream_readable$2();
		exports.Stream = exports;
		exports.Readable = exports;
		exports.Writable = require__stream_writable$2();
		exports.Duplex = require__stream_duplex$2();
		exports.Transform = require__stream_transform$2();
		exports.PassThrough = require__stream_passthrough$2();
	}));
	//#endregion
	//#region ../../node_modules/hash-base/index.js
	var require_hash_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var toBuffer = require_to_buffer$1();
		var Transform = require_readable_browser$1().Transform;
		var inherits = require_inherits_browser();
		function HashBase(blockSize) {
			Transform.call(this);
			this._block = Buffer.allocUnsafe(blockSize);
			this._blockSize = blockSize;
			this._blockOffset = 0;
			this._length = [
				0,
				0,
				0,
				0
			];
			this._finalized = false;
		}
		inherits(HashBase, Transform);
		HashBase.prototype._transform = function(chunk, encoding, callback) {
			var error = null;
			try {
				this.update(chunk, encoding);
			} catch (err) {
				error = err;
			}
			callback(error);
		};
		HashBase.prototype._flush = function(callback) {
			var error = null;
			try {
				this.push(this.digest());
			} catch (err) {
				error = err;
			}
			callback(error);
		};
		HashBase.prototype.update = function(data, encoding) {
			if (this._finalized) throw new Error("Digest already called");
			var dataBuffer = toBuffer(data, encoding);
			var block = this._block;
			var offset = 0;
			while (this._blockOffset + dataBuffer.length - offset >= this._blockSize) {
				for (var i = this._blockOffset; i < this._blockSize;) {
					block[i] = dataBuffer[offset];
					i += 1;
					offset += 1;
				}
				this._update();
				this._blockOffset = 0;
			}
			while (offset < dataBuffer.length) {
				block[this._blockOffset] = dataBuffer[offset];
				this._blockOffset += 1;
				offset += 1;
			}
			for (var j = 0, carry = dataBuffer.length * 8; carry > 0; ++j) {
				this._length[j] += carry;
				carry = this._length[j] / 4294967296 | 0;
				if (carry > 0) this._length[j] -= 4294967296 * carry;
			}
			return this;
		};
		HashBase.prototype._update = function() {
			throw new Error("_update is not implemented");
		};
		HashBase.prototype.digest = function(encoding) {
			if (this._finalized) throw new Error("Digest already called");
			this._finalized = true;
			var digest = this._digest();
			if (encoding !== void 0) digest = digest.toString(encoding);
			this._block.fill(0);
			this._blockOffset = 0;
			for (var i = 0; i < 4; ++i) this._length[i] = 0;
			return digest;
		};
		HashBase.prototype._digest = function() {
			throw new Error("_digest is not implemented");
		};
		module.exports = HashBase;
	}));
	//#endregion
	//#region ../../node_modules/md5.js/index.js
	var require_md5_js = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var HashBase = require_hash_base();
		var Buffer = require_safe_buffer$4().Buffer;
		var ARRAY16 = new Array(16);
		function MD5() {
			HashBase.call(this, 64);
			this._a = 1732584193;
			this._b = 4023233417;
			this._c = 2562383102;
			this._d = 271733878;
		}
		inherits(MD5, HashBase);
		MD5.prototype._update = function() {
			var M = ARRAY16;
			for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4);
			var a = this._a;
			var b = this._b;
			var c = this._c;
			var d = this._d;
			a = fnF(a, b, c, d, M[0], 3614090360, 7);
			d = fnF(d, a, b, c, M[1], 3905402710, 12);
			c = fnF(c, d, a, b, M[2], 606105819, 17);
			b = fnF(b, c, d, a, M[3], 3250441966, 22);
			a = fnF(a, b, c, d, M[4], 4118548399, 7);
			d = fnF(d, a, b, c, M[5], 1200080426, 12);
			c = fnF(c, d, a, b, M[6], 2821735955, 17);
			b = fnF(b, c, d, a, M[7], 4249261313, 22);
			a = fnF(a, b, c, d, M[8], 1770035416, 7);
			d = fnF(d, a, b, c, M[9], 2336552879, 12);
			c = fnF(c, d, a, b, M[10], 4294925233, 17);
			b = fnF(b, c, d, a, M[11], 2304563134, 22);
			a = fnF(a, b, c, d, M[12], 1804603682, 7);
			d = fnF(d, a, b, c, M[13], 4254626195, 12);
			c = fnF(c, d, a, b, M[14], 2792965006, 17);
			b = fnF(b, c, d, a, M[15], 1236535329, 22);
			a = fnG(a, b, c, d, M[1], 4129170786, 5);
			d = fnG(d, a, b, c, M[6], 3225465664, 9);
			c = fnG(c, d, a, b, M[11], 643717713, 14);
			b = fnG(b, c, d, a, M[0], 3921069994, 20);
			a = fnG(a, b, c, d, M[5], 3593408605, 5);
			d = fnG(d, a, b, c, M[10], 38016083, 9);
			c = fnG(c, d, a, b, M[15], 3634488961, 14);
			b = fnG(b, c, d, a, M[4], 3889429448, 20);
			a = fnG(a, b, c, d, M[9], 568446438, 5);
			d = fnG(d, a, b, c, M[14], 3275163606, 9);
			c = fnG(c, d, a, b, M[3], 4107603335, 14);
			b = fnG(b, c, d, a, M[8], 1163531501, 20);
			a = fnG(a, b, c, d, M[13], 2850285829, 5);
			d = fnG(d, a, b, c, M[2], 4243563512, 9);
			c = fnG(c, d, a, b, M[7], 1735328473, 14);
			b = fnG(b, c, d, a, M[12], 2368359562, 20);
			a = fnH(a, b, c, d, M[5], 4294588738, 4);
			d = fnH(d, a, b, c, M[8], 2272392833, 11);
			c = fnH(c, d, a, b, M[11], 1839030562, 16);
			b = fnH(b, c, d, a, M[14], 4259657740, 23);
			a = fnH(a, b, c, d, M[1], 2763975236, 4);
			d = fnH(d, a, b, c, M[4], 1272893353, 11);
			c = fnH(c, d, a, b, M[7], 4139469664, 16);
			b = fnH(b, c, d, a, M[10], 3200236656, 23);
			a = fnH(a, b, c, d, M[13], 681279174, 4);
			d = fnH(d, a, b, c, M[0], 3936430074, 11);
			c = fnH(c, d, a, b, M[3], 3572445317, 16);
			b = fnH(b, c, d, a, M[6], 76029189, 23);
			a = fnH(a, b, c, d, M[9], 3654602809, 4);
			d = fnH(d, a, b, c, M[12], 3873151461, 11);
			c = fnH(c, d, a, b, M[15], 530742520, 16);
			b = fnH(b, c, d, a, M[2], 3299628645, 23);
			a = fnI(a, b, c, d, M[0], 4096336452, 6);
			d = fnI(d, a, b, c, M[7], 1126891415, 10);
			c = fnI(c, d, a, b, M[14], 2878612391, 15);
			b = fnI(b, c, d, a, M[5], 4237533241, 21);
			a = fnI(a, b, c, d, M[12], 1700485571, 6);
			d = fnI(d, a, b, c, M[3], 2399980690, 10);
			c = fnI(c, d, a, b, M[10], 4293915773, 15);
			b = fnI(b, c, d, a, M[1], 2240044497, 21);
			a = fnI(a, b, c, d, M[8], 1873313359, 6);
			d = fnI(d, a, b, c, M[15], 4264355552, 10);
			c = fnI(c, d, a, b, M[6], 2734768916, 15);
			b = fnI(b, c, d, a, M[13], 1309151649, 21);
			a = fnI(a, b, c, d, M[4], 4149444226, 6);
			d = fnI(d, a, b, c, M[11], 3174756917, 10);
			c = fnI(c, d, a, b, M[2], 718787259, 15);
			b = fnI(b, c, d, a, M[9], 3951481745, 21);
			this._a = this._a + a | 0;
			this._b = this._b + b | 0;
			this._c = this._c + c | 0;
			this._d = this._d + d | 0;
		};
		MD5.prototype._digest = function() {
			this._block[this._blockOffset++] = 128;
			if (this._blockOffset > 56) {
				this._block.fill(0, this._blockOffset, 64);
				this._update();
				this._blockOffset = 0;
			}
			this._block.fill(0, this._blockOffset, 56);
			this._block.writeUInt32LE(this._length[0], 56);
			this._block.writeUInt32LE(this._length[1], 60);
			this._update();
			var buffer = Buffer.allocUnsafe(16);
			buffer.writeInt32LE(this._a, 0);
			buffer.writeInt32LE(this._b, 4);
			buffer.writeInt32LE(this._c, 8);
			buffer.writeInt32LE(this._d, 12);
			return buffer;
		};
		function rotl(x, n) {
			return x << n | x >>> 32 - n;
		}
		function fnF(a, b, c, d, m, k, s) {
			return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;
		}
		function fnG(a, b, c, d, m, k, s) {
			return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;
		}
		function fnH(a, b, c, d, m, k, s) {
			return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;
		}
		function fnI(a, b, c, d, m, k, s) {
			return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;
		}
		module.exports = MD5;
	}));
	//#endregion
	//#region ../../node_modules/ripemd160/index.js
	var require_ripemd160 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_dist().Buffer;
		var inherits = require_inherits_browser();
		var HashBase = require_hash_base();
		var ARRAY16 = new Array(16);
		var zl = [
			0,
			1,
			2,
			3,
			4,
			5,
			6,
			7,
			8,
			9,
			10,
			11,
			12,
			13,
			14,
			15,
			7,
			4,
			13,
			1,
			10,
			6,
			15,
			3,
			12,
			0,
			9,
			5,
			2,
			14,
			11,
			8,
			3,
			10,
			14,
			4,
			9,
			15,
			8,
			1,
			2,
			7,
			0,
			6,
			13,
			11,
			5,
			12,
			1,
			9,
			11,
			10,
			0,
			8,
			12,
			4,
			13,
			3,
			7,
			15,
			14,
			5,
			6,
			2,
			4,
			0,
			5,
			9,
			7,
			12,
			2,
			10,
			14,
			1,
			3,
			8,
			11,
			6,
			15,
			13
		];
		var zr = [
			5,
			14,
			7,
			0,
			9,
			2,
			11,
			4,
			13,
			6,
			15,
			8,
			1,
			10,
			3,
			12,
			6,
			11,
			3,
			7,
			0,
			13,
			5,
			10,
			14,
			15,
			8,
			12,
			4,
			9,
			1,
			2,
			15,
			5,
			1,
			3,
			7,
			14,
			6,
			9,
			11,
			8,
			12,
			2,
			10,
			0,
			4,
			13,
			8,
			6,
			4,
			1,
			3,
			11,
			15,
			0,
			5,
			12,
			2,
			13,
			9,
			7,
			10,
			14,
			12,
			15,
			10,
			4,
			1,
			5,
			8,
			7,
			6,
			2,
			13,
			14,
			0,
			3,
			9,
			11
		];
		var sl = [
			11,
			14,
			15,
			12,
			5,
			8,
			7,
			9,
			11,
			13,
			14,
			15,
			6,
			7,
			9,
			8,
			7,
			6,
			8,
			13,
			11,
			9,
			7,
			15,
			7,
			12,
			15,
			9,
			11,
			7,
			13,
			12,
			11,
			13,
			6,
			7,
			14,
			9,
			13,
			15,
			14,
			8,
			13,
			6,
			5,
			12,
			7,
			5,
			11,
			12,
			14,
			15,
			14,
			15,
			9,
			8,
			9,
			14,
			5,
			6,
			8,
			6,
			5,
			12,
			9,
			15,
			5,
			11,
			6,
			8,
			13,
			12,
			5,
			12,
			13,
			14,
			11,
			8,
			5,
			6
		];
		var sr = [
			8,
			9,
			9,
			11,
			13,
			15,
			15,
			5,
			7,
			7,
			8,
			11,
			14,
			14,
			12,
			6,
			9,
			13,
			15,
			7,
			12,
			8,
			9,
			11,
			7,
			7,
			12,
			7,
			6,
			15,
			13,
			11,
			9,
			7,
			15,
			11,
			8,
			6,
			6,
			14,
			12,
			13,
			5,
			14,
			13,
			13,
			7,
			5,
			15,
			5,
			8,
			11,
			14,
			14,
			6,
			14,
			6,
			9,
			12,
			9,
			12,
			5,
			15,
			8,
			8,
			5,
			12,
			9,
			12,
			5,
			14,
			6,
			8,
			13,
			6,
			5,
			15,
			13,
			11,
			11
		];
		var hl = [
			0,
			1518500249,
			1859775393,
			2400959708,
			2840853838
		];
		var hr = [
			1352829926,
			1548603684,
			1836072691,
			2053994217,
			0
		];
		function rotl(x, n) {
			return x << n | x >>> 32 - n;
		}
		function fn1(a, b, c, d, e, m, k, s) {
			return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;
		}
		function fn2(a, b, c, d, e, m, k, s) {
			return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;
		}
		function fn3(a, b, c, d, e, m, k, s) {
			return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;
		}
		function fn4(a, b, c, d, e, m, k, s) {
			return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;
		}
		function fn5(a, b, c, d, e, m, k, s) {
			return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;
		}
		function RIPEMD160() {
			HashBase.call(this, 64);
			this._a = 1732584193;
			this._b = 4023233417;
			this._c = 2562383102;
			this._d = 271733878;
			this._e = 3285377520;
		}
		inherits(RIPEMD160, HashBase);
		RIPEMD160.prototype._update = function() {
			var words = ARRAY16;
			for (var j = 0; j < 16; ++j) words[j] = this._block.readInt32LE(j * 4);
			var al = this._a | 0;
			var bl = this._b | 0;
			var cl = this._c | 0;
			var dl = this._d | 0;
			var el = this._e | 0;
			var ar = this._a | 0;
			var br = this._b | 0;
			var cr = this._c | 0;
			var dr = this._d | 0;
			var er = this._e | 0;
			for (var i = 0; i < 80; i += 1) {
				var tl;
				var tr;
				if (i < 16) {
					tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]);
					tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i]);
				} else if (i < 32) {
					tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]);
					tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i]);
				} else if (i < 48) {
					tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]);
					tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i]);
				} else if (i < 64) {
					tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]);
					tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i]);
				} else {
					tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]);
					tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i]);
				}
				al = el;
				el = dl;
				dl = rotl(cl, 10);
				cl = bl;
				bl = tl;
				ar = er;
				er = dr;
				dr = rotl(cr, 10);
				cr = br;
				br = tr;
			}
			var t = this._b + cl + dr | 0;
			this._b = this._c + dl + er | 0;
			this._c = this._d + el + ar | 0;
			this._d = this._e + al + br | 0;
			this._e = this._a + bl + cr | 0;
			this._a = t;
		};
		RIPEMD160.prototype._digest = function() {
			this._block[this._blockOffset] = 128;
			this._blockOffset += 1;
			if (this._blockOffset > 56) {
				this._block.fill(0, this._blockOffset, 64);
				this._update();
				this._blockOffset = 0;
			}
			this._block.fill(0, this._blockOffset, 56);
			this._block.writeUInt32LE(this._length[0], 56);
			this._block.writeUInt32LE(this._length[1], 60);
			this._update();
			var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20);
			buffer.writeInt32LE(this._a, 0);
			buffer.writeInt32LE(this._b, 4);
			buffer.writeInt32LE(this._c, 8);
			buffer.writeInt32LE(this._d, 12);
			buffer.writeInt32LE(this._e, 16);
			return buffer;
		};
		module.exports = RIPEMD160;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/hash.js
	var require_hash$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var toBuffer = require_to_buffer$2();
		function Hash(blockSize, finalSize) {
			this._block = Buffer.alloc(blockSize);
			this._finalSize = finalSize;
			this._blockSize = blockSize;
			this._len = 0;
		}
		Hash.prototype.update = function(data, enc) {
			data = toBuffer(data, enc || "utf8");
			var block = this._block;
			var blockSize = this._blockSize;
			var length = data.length;
			var accum = this._len;
			for (var offset = 0; offset < length;) {
				var assigned = accum % blockSize;
				var remainder = Math.min(length - offset, blockSize - assigned);
				for (var i = 0; i < remainder; i++) block[assigned + i] = data[offset + i];
				accum += remainder;
				offset += remainder;
				if (accum % blockSize === 0) this._update(block);
			}
			this._len += length;
			return this;
		};
		Hash.prototype.digest = function(enc) {
			var rem = this._len % this._blockSize;
			this._block[rem] = 128;
			this._block.fill(0, rem + 1);
			if (rem >= this._finalSize) {
				this._update(this._block);
				this._block.fill(0);
			}
			var bits = this._len * 8;
			if (bits <= 4294967295) this._block.writeUInt32BE(bits, this._blockSize - 4);
			else {
				var lowBits = (bits & 4294967295) >>> 0;
				var highBits = (bits - lowBits) / 4294967296;
				this._block.writeUInt32BE(highBits, this._blockSize - 8);
				this._block.writeUInt32BE(lowBits, this._blockSize - 4);
			}
			this._update(this._block);
			var hash = this._hash();
			return enc ? hash.toString(enc) : hash;
		};
		Hash.prototype._update = function() {
			throw new Error("_update must be implemented by subclass");
		};
		module.exports = Hash;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/sha.js
	var require_sha$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Hash = require_hash$1();
		var Buffer = require_safe_buffer$4().Buffer;
		var K = [
			1518500249,
			1859775393,
			-1894007588,
			-899497514
		];
		var W = new Array(80);
		function Sha() {
			this.init();
			this._w = W;
			Hash.call(this, 64, 56);
		}
		inherits(Sha, Hash);
		Sha.prototype.init = function() {
			this._a = 1732584193;
			this._b = 4023233417;
			this._c = 2562383102;
			this._d = 271733878;
			this._e = 3285377520;
			return this;
		};
		function rotl5(num) {
			return num << 5 | num >>> 27;
		}
		function rotl30(num) {
			return num << 30 | num >>> 2;
		}
		function ft(s, b, c, d) {
			if (s === 0) return b & c | ~b & d;
			if (s === 2) return b & c | b & d | c & d;
			return b ^ c ^ d;
		}
		Sha.prototype._update = function(M) {
			var w = this._w;
			var a = this._a | 0;
			var b = this._b | 0;
			var c = this._c | 0;
			var d = this._d | 0;
			var e = this._e | 0;
			for (var i = 0; i < 16; ++i) w[i] = M.readInt32BE(i * 4);
			for (; i < 80; ++i) w[i] = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
			for (var j = 0; j < 80; ++j) {
				var s = ~~(j / 20);
				var t = rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s] | 0;
				e = d;
				d = c;
				c = rotl30(b);
				b = a;
				a = t;
			}
			this._a = a + this._a | 0;
			this._b = b + this._b | 0;
			this._c = c + this._c | 0;
			this._d = d + this._d | 0;
			this._e = e + this._e | 0;
		};
		Sha.prototype._hash = function() {
			var H = Buffer.allocUnsafe(20);
			H.writeInt32BE(this._a | 0, 0);
			H.writeInt32BE(this._b | 0, 4);
			H.writeInt32BE(this._c | 0, 8);
			H.writeInt32BE(this._d | 0, 12);
			H.writeInt32BE(this._e | 0, 16);
			return H;
		};
		module.exports = Sha;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/sha1.js
	var require_sha1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Hash = require_hash$1();
		var Buffer = require_safe_buffer$4().Buffer;
		var K = [
			1518500249,
			1859775393,
			-1894007588,
			-899497514
		];
		var W = new Array(80);
		function Sha1() {
			this.init();
			this._w = W;
			Hash.call(this, 64, 56);
		}
		inherits(Sha1, Hash);
		Sha1.prototype.init = function() {
			this._a = 1732584193;
			this._b = 4023233417;
			this._c = 2562383102;
			this._d = 271733878;
			this._e = 3285377520;
			return this;
		};
		function rotl1(num) {
			return num << 1 | num >>> 31;
		}
		function rotl5(num) {
			return num << 5 | num >>> 27;
		}
		function rotl30(num) {
			return num << 30 | num >>> 2;
		}
		function ft(s, b, c, d) {
			if (s === 0) return b & c | ~b & d;
			if (s === 2) return b & c | b & d | c & d;
			return b ^ c ^ d;
		}
		Sha1.prototype._update = function(M) {
			var w = this._w;
			var a = this._a | 0;
			var b = this._b | 0;
			var c = this._c | 0;
			var d = this._d | 0;
			var e = this._e | 0;
			for (var i = 0; i < 16; ++i) w[i] = M.readInt32BE(i * 4);
			for (; i < 80; ++i) w[i] = rotl1(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);
			for (var j = 0; j < 80; ++j) {
				var s = ~~(j / 20);
				var t = rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s] | 0;
				e = d;
				d = c;
				c = rotl30(b);
				b = a;
				a = t;
			}
			this._a = a + this._a | 0;
			this._b = b + this._b | 0;
			this._c = c + this._c | 0;
			this._d = d + this._d | 0;
			this._e = e + this._e | 0;
		};
		Sha1.prototype._hash = function() {
			var H = Buffer.allocUnsafe(20);
			H.writeInt32BE(this._a | 0, 0);
			H.writeInt32BE(this._b | 0, 4);
			H.writeInt32BE(this._c | 0, 8);
			H.writeInt32BE(this._d | 0, 12);
			H.writeInt32BE(this._e | 0, 16);
			return H;
		};
		module.exports = Sha1;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/sha256.js
	var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
		* in FIPS 180-2
		* Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
		* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
		*
		*/
		var inherits = require_inherits_browser();
		var Hash = require_hash$1();
		var Buffer = require_safe_buffer$4().Buffer;
		var K = [
			1116352408,
			1899447441,
			3049323471,
			3921009573,
			961987163,
			1508970993,
			2453635748,
			2870763221,
			3624381080,
			310598401,
			607225278,
			1426881987,
			1925078388,
			2162078206,
			2614888103,
			3248222580,
			3835390401,
			4022224774,
			264347078,
			604807628,
			770255983,
			1249150122,
			1555081692,
			1996064986,
			2554220882,
			2821834349,
			2952996808,
			3210313671,
			3336571891,
			3584528711,
			113926993,
			338241895,
			666307205,
			773529912,
			1294757372,
			1396182291,
			1695183700,
			1986661051,
			2177026350,
			2456956037,
			2730485921,
			2820302411,
			3259730800,
			3345764771,
			3516065817,
			3600352804,
			4094571909,
			275423344,
			430227734,
			506948616,
			659060556,
			883997877,
			958139571,
			1322822218,
			1537002063,
			1747873779,
			1955562222,
			2024104815,
			2227730452,
			2361852424,
			2428436474,
			2756734187,
			3204031479,
			3329325298
		];
		var W = new Array(64);
		function Sha256() {
			this.init();
			this._w = W;
			Hash.call(this, 64, 56);
		}
		inherits(Sha256, Hash);
		Sha256.prototype.init = function() {
			this._a = 1779033703;
			this._b = 3144134277;
			this._c = 1013904242;
			this._d = 2773480762;
			this._e = 1359893119;
			this._f = 2600822924;
			this._g = 528734635;
			this._h = 1541459225;
			return this;
		};
		function ch(x, y, z) {
			return z ^ x & (y ^ z);
		}
		function maj(x, y, z) {
			return x & y | z & (x | y);
		}
		function sigma0(x) {
			return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);
		}
		function sigma1(x) {
			return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);
		}
		function gamma0(x) {
			return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;
		}
		function gamma1(x) {
			return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;
		}
		Sha256.prototype._update = function(M) {
			var w = this._w;
			var a = this._a | 0;
			var b = this._b | 0;
			var c = this._c | 0;
			var d = this._d | 0;
			var e = this._e | 0;
			var f = this._f | 0;
			var g = this._g | 0;
			var h = this._h | 0;
			for (var i = 0; i < 16; ++i) w[i] = M.readInt32BE(i * 4);
			for (; i < 64; ++i) w[i] = gamma1(w[i - 2]) + w[i - 7] + gamma0(w[i - 15]) + w[i - 16] | 0;
			for (var j = 0; j < 64; ++j) {
				var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + w[j] | 0;
				var T2 = sigma0(a) + maj(a, b, c) | 0;
				h = g;
				g = f;
				f = e;
				e = d + T1 | 0;
				d = c;
				c = b;
				b = a;
				a = T1 + T2 | 0;
			}
			this._a = a + this._a | 0;
			this._b = b + this._b | 0;
			this._c = c + this._c | 0;
			this._d = d + this._d | 0;
			this._e = e + this._e | 0;
			this._f = f + this._f | 0;
			this._g = g + this._g | 0;
			this._h = h + this._h | 0;
		};
		Sha256.prototype._hash = function() {
			var H = Buffer.allocUnsafe(32);
			H.writeInt32BE(this._a, 0);
			H.writeInt32BE(this._b, 4);
			H.writeInt32BE(this._c, 8);
			H.writeInt32BE(this._d, 12);
			H.writeInt32BE(this._e, 16);
			H.writeInt32BE(this._f, 20);
			H.writeInt32BE(this._g, 24);
			H.writeInt32BE(this._h, 28);
			return H;
		};
		module.exports = Sha256;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/sha224.js
	var require_sha224 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
		* in FIPS 180-2
		* Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
		* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
		*
		*/
		var inherits = require_inherits_browser();
		var Sha256 = require_sha256();
		var Hash = require_hash$1();
		var Buffer = require_safe_buffer$4().Buffer;
		var W = new Array(64);
		function Sha224() {
			this.init();
			this._w = W;
			Hash.call(this, 64, 56);
		}
		inherits(Sha224, Sha256);
		Sha224.prototype.init = function() {
			this._a = 3238371032;
			this._b = 914150663;
			this._c = 812702999;
			this._d = 4144912697;
			this._e = 4290775857;
			this._f = 1750603025;
			this._g = 1694076839;
			this._h = 3204075428;
			return this;
		};
		Sha224.prototype._hash = function() {
			var H = Buffer.allocUnsafe(28);
			H.writeInt32BE(this._a, 0);
			H.writeInt32BE(this._b, 4);
			H.writeInt32BE(this._c, 8);
			H.writeInt32BE(this._d, 12);
			H.writeInt32BE(this._e, 16);
			H.writeInt32BE(this._f, 20);
			H.writeInt32BE(this._g, 24);
			return H;
		};
		module.exports = Sha224;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/sha512.js
	var require_sha512 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Hash = require_hash$1();
		var Buffer = require_safe_buffer$4().Buffer;
		var K = [
			1116352408,
			3609767458,
			1899447441,
			602891725,
			3049323471,
			3964484399,
			3921009573,
			2173295548,
			961987163,
			4081628472,
			1508970993,
			3053834265,
			2453635748,
			2937671579,
			2870763221,
			3664609560,
			3624381080,
			2734883394,
			310598401,
			1164996542,
			607225278,
			1323610764,
			1426881987,
			3590304994,
			1925078388,
			4068182383,
			2162078206,
			991336113,
			2614888103,
			633803317,
			3248222580,
			3479774868,
			3835390401,
			2666613458,
			4022224774,
			944711139,
			264347078,
			2341262773,
			604807628,
			2007800933,
			770255983,
			1495990901,
			1249150122,
			1856431235,
			1555081692,
			3175218132,
			1996064986,
			2198950837,
			2554220882,
			3999719339,
			2821834349,
			766784016,
			2952996808,
			2566594879,
			3210313671,
			3203337956,
			3336571891,
			1034457026,
			3584528711,
			2466948901,
			113926993,
			3758326383,
			338241895,
			168717936,
			666307205,
			1188179964,
			773529912,
			1546045734,
			1294757372,
			1522805485,
			1396182291,
			2643833823,
			1695183700,
			2343527390,
			1986661051,
			1014477480,
			2177026350,
			1206759142,
			2456956037,
			344077627,
			2730485921,
			1290863460,
			2820302411,
			3158454273,
			3259730800,
			3505952657,
			3345764771,
			106217008,
			3516065817,
			3606008344,
			3600352804,
			1432725776,
			4094571909,
			1467031594,
			275423344,
			851169720,
			430227734,
			3100823752,
			506948616,
			1363258195,
			659060556,
			3750685593,
			883997877,
			3785050280,
			958139571,
			3318307427,
			1322822218,
			3812723403,
			1537002063,
			2003034995,
			1747873779,
			3602036899,
			1955562222,
			1575990012,
			2024104815,
			1125592928,
			2227730452,
			2716904306,
			2361852424,
			442776044,
			2428436474,
			593698344,
			2756734187,
			3733110249,
			3204031479,
			2999351573,
			3329325298,
			3815920427,
			3391569614,
			3928383900,
			3515267271,
			566280711,
			3940187606,
			3454069534,
			4118630271,
			4000239992,
			116418474,
			1914138554,
			174292421,
			2731055270,
			289380356,
			3203993006,
			460393269,
			320620315,
			685471733,
			587496836,
			852142971,
			1086792851,
			1017036298,
			365543100,
			1126000580,
			2618297676,
			1288033470,
			3409855158,
			1501505948,
			4234509866,
			1607167915,
			987167468,
			1816402316,
			1246189591
		];
		var W = new Array(160);
		function Sha512() {
			this.init();
			this._w = W;
			Hash.call(this, 128, 112);
		}
		inherits(Sha512, Hash);
		Sha512.prototype.init = function() {
			this._ah = 1779033703;
			this._bh = 3144134277;
			this._ch = 1013904242;
			this._dh = 2773480762;
			this._eh = 1359893119;
			this._fh = 2600822924;
			this._gh = 528734635;
			this._hh = 1541459225;
			this._al = 4089235720;
			this._bl = 2227873595;
			this._cl = 4271175723;
			this._dl = 1595750129;
			this._el = 2917565137;
			this._fl = 725511199;
			this._gl = 4215389547;
			this._hl = 327033209;
			return this;
		};
		function Ch(x, y, z) {
			return z ^ x & (y ^ z);
		}
		function maj(x, y, z) {
			return x & y | z & (x | y);
		}
		function sigma0(x, xl) {
			return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);
		}
		function sigma1(x, xl) {
			return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);
		}
		function Gamma0(x, xl) {
			return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;
		}
		function Gamma0l(x, xl) {
			return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);
		}
		function Gamma1(x, xl) {
			return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;
		}
		function Gamma1l(x, xl) {
			return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);
		}
		function getCarry(a, b) {
			return a >>> 0 < b >>> 0 ? 1 : 0;
		}
		Sha512.prototype._update = function(M) {
			var w = this._w;
			var ah = this._ah | 0;
			var bh = this._bh | 0;
			var ch = this._ch | 0;
			var dh = this._dh | 0;
			var eh = this._eh | 0;
			var fh = this._fh | 0;
			var gh = this._gh | 0;
			var hh = this._hh | 0;
			var al = this._al | 0;
			var bl = this._bl | 0;
			var cl = this._cl | 0;
			var dl = this._dl | 0;
			var el = this._el | 0;
			var fl = this._fl | 0;
			var gl = this._gl | 0;
			var hl = this._hl | 0;
			for (var i = 0; i < 32; i += 2) {
				w[i] = M.readInt32BE(i * 4);
				w[i + 1] = M.readInt32BE(i * 4 + 4);
			}
			for (; i < 160; i += 2) {
				var xh = w[i - 30];
				var xl = w[i - 30 + 1];
				var gamma0 = Gamma0(xh, xl);
				var gamma0l = Gamma0l(xl, xh);
				xh = w[i - 4];
				xl = w[i - 4 + 1];
				var gamma1 = Gamma1(xh, xl);
				var gamma1l = Gamma1l(xl, xh);
				var Wi7h = w[i - 14];
				var Wi7l = w[i - 14 + 1];
				var Wi16h = w[i - 32];
				var Wi16l = w[i - 32 + 1];
				var Wil = gamma0l + Wi7l | 0;
				var Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;
				Wil = Wil + gamma1l | 0;
				Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0;
				Wil = Wil + Wi16l | 0;
				Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0;
				w[i] = Wih;
				w[i + 1] = Wil;
			}
			for (var j = 0; j < 160; j += 2) {
				Wih = w[j];
				Wil = w[j + 1];
				var majh = maj(ah, bh, ch);
				var majl = maj(al, bl, cl);
				var sigma0h = sigma0(ah, al);
				var sigma0l = sigma0(al, ah);
				var sigma1h = sigma1(eh, el);
				var sigma1l = sigma1(el, eh);
				var Kih = K[j];
				var Kil = K[j + 1];
				var chh = Ch(eh, fh, gh);
				var chl = Ch(el, fl, gl);
				var t1l = hl + sigma1l | 0;
				var t1h = hh + sigma1h + getCarry(t1l, hl) | 0;
				t1l = t1l + chl | 0;
				t1h = t1h + chh + getCarry(t1l, chl) | 0;
				t1l = t1l + Kil | 0;
				t1h = t1h + Kih + getCarry(t1l, Kil) | 0;
				t1l = t1l + Wil | 0;
				t1h = t1h + Wih + getCarry(t1l, Wil) | 0;
				var t2l = sigma0l + majl | 0;
				var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;
				hh = gh;
				hl = gl;
				gh = fh;
				gl = fl;
				fh = eh;
				fl = el;
				el = dl + t1l | 0;
				eh = dh + t1h + getCarry(el, dl) | 0;
				dh = ch;
				dl = cl;
				ch = bh;
				cl = bl;
				bh = ah;
				bl = al;
				al = t1l + t2l | 0;
				ah = t1h + t2h + getCarry(al, t1l) | 0;
			}
			this._al = this._al + al | 0;
			this._bl = this._bl + bl | 0;
			this._cl = this._cl + cl | 0;
			this._dl = this._dl + dl | 0;
			this._el = this._el + el | 0;
			this._fl = this._fl + fl | 0;
			this._gl = this._gl + gl | 0;
			this._hl = this._hl + hl | 0;
			this._ah = this._ah + ah + getCarry(this._al, al) | 0;
			this._bh = this._bh + bh + getCarry(this._bl, bl) | 0;
			this._ch = this._ch + ch + getCarry(this._cl, cl) | 0;
			this._dh = this._dh + dh + getCarry(this._dl, dl) | 0;
			this._eh = this._eh + eh + getCarry(this._el, el) | 0;
			this._fh = this._fh + fh + getCarry(this._fl, fl) | 0;
			this._gh = this._gh + gh + getCarry(this._gl, gl) | 0;
			this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;
		};
		Sha512.prototype._hash = function() {
			var H = Buffer.allocUnsafe(64);
			function writeInt64BE(h, l, offset) {
				H.writeInt32BE(h, offset);
				H.writeInt32BE(l, offset + 4);
			}
			writeInt64BE(this._ah, this._al, 0);
			writeInt64BE(this._bh, this._bl, 8);
			writeInt64BE(this._ch, this._cl, 16);
			writeInt64BE(this._dh, this._dl, 24);
			writeInt64BE(this._eh, this._el, 32);
			writeInt64BE(this._fh, this._fl, 40);
			writeInt64BE(this._gh, this._gl, 48);
			writeInt64BE(this._hh, this._hl, 56);
			return H;
		};
		module.exports = Sha512;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/sha384.js
	var require_sha384 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var SHA512 = require_sha512();
		var Hash = require_hash$1();
		var Buffer = require_safe_buffer$4().Buffer;
		var W = new Array(160);
		function Sha384() {
			this.init();
			this._w = W;
			Hash.call(this, 128, 112);
		}
		inherits(Sha384, SHA512);
		Sha384.prototype.init = function() {
			this._ah = 3418070365;
			this._bh = 1654270250;
			this._ch = 2438529370;
			this._dh = 355462360;
			this._eh = 1731405415;
			this._fh = 2394180231;
			this._gh = 3675008525;
			this._hh = 1203062813;
			this._al = 3238371032;
			this._bl = 914150663;
			this._cl = 812702999;
			this._dl = 4144912697;
			this._el = 4290775857;
			this._fl = 1750603025;
			this._gl = 1694076839;
			this._hl = 3204075428;
			return this;
		};
		Sha384.prototype._hash = function() {
			var H = Buffer.allocUnsafe(48);
			function writeInt64BE(h, l, offset) {
				H.writeInt32BE(h, offset);
				H.writeInt32BE(l, offset + 4);
			}
			writeInt64BE(this._ah, this._al, 0);
			writeInt64BE(this._bh, this._bl, 8);
			writeInt64BE(this._ch, this._cl, 16);
			writeInt64BE(this._dh, this._dl, 24);
			writeInt64BE(this._eh, this._el, 32);
			writeInt64BE(this._fh, this._fl, 40);
			return H;
		};
		module.exports = Sha384;
	}));
	//#endregion
	//#region ../../node_modules/sha.js/index.js
	var require_sha_js = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = function SHA(algorithm) {
			var alg = algorithm.toLowerCase();
			var Algorithm = module.exports[alg];
			if (!Algorithm) throw new Error(alg + " is not supported (we accept pull requests)");
			return new Algorithm();
		};
		module.exports.sha = require_sha$1();
		module.exports.sha1 = require_sha1();
		module.exports.sha224 = require_sha224();
		module.exports.sha256 = require_sha256();
		module.exports.sha384 = require_sha384();
		module.exports.sha512 = require_sha512();
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/stream-browser.js
	var require_stream_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_events().EventEmitter;
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/buffer_list.js
	var require_buffer_list = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function ownKeys(object, enumerableOnly) {
			var keys = Object.keys(object);
			if (Object.getOwnPropertySymbols) {
				var symbols = Object.getOwnPropertySymbols(object);
				enumerableOnly && (symbols = symbols.filter(function(sym) {
					return Object.getOwnPropertyDescriptor(object, sym).enumerable;
				})), keys.push.apply(keys, symbols);
			}
			return keys;
		}
		function _objectSpread(target) {
			for (var i = 1; i < arguments.length; i++) {
				var source = null != arguments[i] ? arguments[i] : {};
				i % 2 ? ownKeys(Object(source), !0).forEach(function(key) {
					_defineProperty(target, key, source[key]);
				}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
					Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
				});
			}
			return target;
		}
		function _defineProperty(obj, key, value) {
			key = _toPropertyKey(key);
			if (key in obj) Object.defineProperty(obj, key, {
				value,
				enumerable: true,
				configurable: true,
				writable: true
			});
			else obj[key] = value;
			return obj;
		}
		function _classCallCheck(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		function _defineProperties(target, props) {
			for (var i = 0; i < props.length; i++) {
				var descriptor = props[i];
				descriptor.enumerable = descriptor.enumerable || false;
				descriptor.configurable = true;
				if ("value" in descriptor) descriptor.writable = true;
				Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
			}
		}
		function _createClass(Constructor, protoProps, staticProps) {
			if (protoProps) _defineProperties(Constructor.prototype, protoProps);
			if (staticProps) _defineProperties(Constructor, staticProps);
			Object.defineProperty(Constructor, "prototype", { writable: false });
			return Constructor;
		}
		function _toPropertyKey(arg) {
			var key = _toPrimitive(arg, "string");
			return typeof key === "symbol" ? key : String(key);
		}
		function _toPrimitive(input, hint) {
			if (typeof input !== "object" || input === null) return input;
			var prim = input[Symbol.toPrimitive];
			if (prim !== void 0) {
				var res = prim.call(input, hint || "default");
				if (typeof res !== "object") return res;
				throw new TypeError("@@toPrimitive must return a primitive value.");
			}
			return (hint === "string" ? String : Number)(input);
		}
		var Buffer = require_dist().Buffer;
		var inspect = require_util$2().inspect;
		var custom = inspect && inspect.custom || "inspect";
		function copyBuffer(src, target, offset) {
			Buffer.prototype.copy.call(src, target, offset);
		}
		module.exports = /* @__PURE__ */ function() {
			function BufferList() {
				_classCallCheck(this, BufferList);
				this.head = null;
				this.tail = null;
				this.length = 0;
			}
			_createClass(BufferList, [
				{
					key: "push",
					value: function push(v) {
						var entry = {
							data: v,
							next: null
						};
						if (this.length > 0) this.tail.next = entry;
						else this.head = entry;
						this.tail = entry;
						++this.length;
					}
				},
				{
					key: "unshift",
					value: function unshift(v) {
						var entry = {
							data: v,
							next: this.head
						};
						if (this.length === 0) this.tail = entry;
						this.head = entry;
						++this.length;
					}
				},
				{
					key: "shift",
					value: function shift() {
						if (this.length === 0) return;
						var ret = this.head.data;
						if (this.length === 1) this.head = this.tail = null;
						else this.head = this.head.next;
						--this.length;
						return ret;
					}
				},
				{
					key: "clear",
					value: function clear() {
						this.head = this.tail = null;
						this.length = 0;
					}
				},
				{
					key: "join",
					value: function join(s) {
						if (this.length === 0) return "";
						var p = this.head;
						var ret = "" + p.data;
						while (p = p.next) ret += s + p.data;
						return ret;
					}
				},
				{
					key: "concat",
					value: function concat(n) {
						if (this.length === 0) return Buffer.alloc(0);
						var ret = Buffer.allocUnsafe(n >>> 0);
						var p = this.head;
						var i = 0;
						while (p) {
							copyBuffer(p.data, ret, i);
							i += p.data.length;
							p = p.next;
						}
						return ret;
					}
				},
				{
					key: "consume",
					value: function consume(n, hasStrings) {
						var ret;
						if (n < this.head.data.length) {
							ret = this.head.data.slice(0, n);
							this.head.data = this.head.data.slice(n);
						} else if (n === this.head.data.length) ret = this.shift();
						else ret = hasStrings ? this._getString(n) : this._getBuffer(n);
						return ret;
					}
				},
				{
					key: "first",
					value: function first() {
						return this.head.data;
					}
				},
				{
					key: "_getString",
					value: function _getString(n) {
						var p = this.head;
						var c = 1;
						var ret = p.data;
						n -= ret.length;
						while (p = p.next) {
							var str = p.data;
							var nb = n > str.length ? str.length : n;
							if (nb === str.length) ret += str;
							else ret += str.slice(0, n);
							n -= nb;
							if (n === 0) {
								if (nb === str.length) {
									++c;
									if (p.next) this.head = p.next;
									else this.head = this.tail = null;
								} else {
									this.head = p;
									p.data = str.slice(nb);
								}
								break;
							}
							++c;
						}
						this.length -= c;
						return ret;
					}
				},
				{
					key: "_getBuffer",
					value: function _getBuffer(n) {
						var ret = Buffer.allocUnsafe(n);
						var p = this.head;
						var c = 1;
						p.data.copy(ret);
						n -= p.data.length;
						while (p = p.next) {
							var buf = p.data;
							var nb = n > buf.length ? buf.length : n;
							buf.copy(ret, ret.length - n, 0, nb);
							n -= nb;
							if (n === 0) {
								if (nb === buf.length) {
									++c;
									if (p.next) this.head = p.next;
									else this.head = this.tail = null;
								} else {
									this.head = p;
									p.data = buf.slice(nb);
								}
								break;
							}
							++c;
						}
						this.length -= c;
						return ret;
					}
				},
				{
					key: custom,
					value: function value(_, options) {
						return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
							depth: 0,
							customInspect: false
						}));
					}
				}
			]);
			return BufferList;
		}();
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/destroy.js
	var require_destroy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		function destroy(err, cb) {
			var _this = this;
			var readableDestroyed = this._readableState && this._readableState.destroyed;
			var writableDestroyed = this._writableState && this._writableState.destroyed;
			if (readableDestroyed || writableDestroyed) {
				if (cb) cb(err);
				else if (err) {
					if (!this._writableState) process$1.nextTick(emitErrorNT, this, err);
					else if (!this._writableState.errorEmitted) {
						this._writableState.errorEmitted = true;
						process$1.nextTick(emitErrorNT, this, err);
					}
				}
				return this;
			}
			if (this._readableState) this._readableState.destroyed = true;
			if (this._writableState) this._writableState.destroyed = true;
			this._destroy(err || null, function(err) {
				if (!cb && err) if (!_this._writableState) process$1.nextTick(emitErrorAndCloseNT, _this, err);
				else if (!_this._writableState.errorEmitted) {
					_this._writableState.errorEmitted = true;
					process$1.nextTick(emitErrorAndCloseNT, _this, err);
				} else process$1.nextTick(emitCloseNT, _this);
				else if (cb) {
					process$1.nextTick(emitCloseNT, _this);
					cb(err);
				} else process$1.nextTick(emitCloseNT, _this);
			});
			return this;
		}
		function emitErrorAndCloseNT(self, err) {
			emitErrorNT(self, err);
			emitCloseNT(self);
		}
		function emitCloseNT(self) {
			if (self._writableState && !self._writableState.emitClose) return;
			if (self._readableState && !self._readableState.emitClose) return;
			self.emit("close");
		}
		function undestroy() {
			if (this._readableState) {
				this._readableState.destroyed = false;
				this._readableState.reading = false;
				this._readableState.ended = false;
				this._readableState.endEmitted = false;
			}
			if (this._writableState) {
				this._writableState.destroyed = false;
				this._writableState.ended = false;
				this._writableState.ending = false;
				this._writableState.finalCalled = false;
				this._writableState.prefinished = false;
				this._writableState.finished = false;
				this._writableState.errorEmitted = false;
			}
		}
		function emitErrorNT(self, err) {
			self.emit("error", err);
		}
		function errorOrDestroy(stream, err) {
			var rState = stream._readableState;
			var wState = stream._writableState;
			if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);
			else stream.emit("error", err);
		}
		module.exports = {
			destroy,
			undestroy,
			errorOrDestroy
		};
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/errors-browser.js
	var require_errors_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function _inheritsLoose(subClass, superClass) {
			subClass.prototype = Object.create(superClass.prototype);
			subClass.prototype.constructor = subClass;
			subClass.__proto__ = superClass;
		}
		var codes = {};
		function createErrorType(code, message, Base) {
			if (!Base) Base = Error;
			function getMessage(arg1, arg2, arg3) {
				if (typeof message === "string") return message;
				else return message(arg1, arg2, arg3);
			}
			var NodeError = /* @__PURE__ */ function(_Base) {
				_inheritsLoose(NodeError, _Base);
				function NodeError(arg1, arg2, arg3) {
					return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
				}
				return NodeError;
			}(Base);
			NodeError.prototype.name = Base.name;
			NodeError.prototype.code = code;
			codes[code] = NodeError;
		}
		function oneOf(expected, thing) {
			if (Array.isArray(expected)) {
				var len = expected.length;
				expected = expected.map(function(i) {
					return String(i);
				});
				if (len > 2) return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
				else if (len === 2) return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
				else return "of ".concat(thing, " ").concat(expected[0]);
			} else return "of ".concat(thing, " ").concat(String(expected));
		}
		function startsWith(str, search, pos) {
			return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
		}
		function endsWith(str, search, this_len) {
			if (this_len === void 0 || this_len > str.length) this_len = str.length;
			return str.substring(this_len - search.length, this_len) === search;
		}
		function includes(str, search, start) {
			if (typeof start !== "number") start = 0;
			if (start + search.length > str.length) return false;
			else return str.indexOf(search, start) !== -1;
		}
		createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) {
			return "The value \"" + value + "\" is invalid for option \"" + name + "\"";
		}, TypeError);
		createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
			var determiner;
			if (typeof expected === "string" && startsWith(expected, "not ")) {
				determiner = "must not be";
				expected = expected.replace(/^not /, "");
			} else determiner = "must be";
			var msg;
			if (endsWith(name, " argument")) msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
			else {
				var type = includes(name, ".") ? "property" : "argument";
				msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
			}
			msg += ". Received type ".concat(typeof actual);
			return msg;
		}, TypeError);
		createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
		createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) {
			return "The " + name + " method is not implemented";
		});
		createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
		createErrorType("ERR_STREAM_DESTROYED", function(name) {
			return "Cannot call " + name + " after a stream was destroyed";
		});
		createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
		createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
		createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end");
		createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError);
		createErrorType("ERR_UNKNOWN_ENCODING", function(arg) {
			return "Unknown encoding: " + arg;
		}, TypeError);
		createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event");
		module.exports.codes = codes;
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/state.js
	var require_state = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ERR_INVALID_OPT_VALUE = require_errors_browser().codes.ERR_INVALID_OPT_VALUE;
		function highWaterMarkFrom(options, isDuplex, duplexKey) {
			return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
		}
		function getHighWaterMark(state, options, duplexKey, isDuplex) {
			var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
			if (hwm != null) {
				if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) throw new ERR_INVALID_OPT_VALUE(isDuplex ? duplexKey : "highWaterMark", hwm);
				return Math.floor(hwm);
			}
			return state.objectMode ? 16 : 16 * 1024;
		}
		module.exports = { getHighWaterMark };
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/_stream_writable.js
	var require__stream_writable$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		module.exports = Writable;
		function CorkedRequest(state) {
			var _this = this;
			this.next = null;
			this.entry = null;
			this.finish = function() {
				onCorkedFinish(_this, state);
			};
		}
		var Duplex;
		Writable.WritableState = WritableState;
		var internalUtil = { deprecate: require_browser$10() };
		var Stream = require_stream_browser$1();
		var Buffer = require_dist().Buffer;
		var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
		function _uint8ArrayToBuffer(chunk) {
			return Buffer.from(chunk);
		}
		function _isUint8Array(obj) {
			return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
		}
		var destroyImpl = require_destroy$1();
		var getHighWaterMark = require_state().getHighWaterMark;
		var _require$codes = require_errors_browser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
		var errorOrDestroy = destroyImpl.errorOrDestroy;
		require_inherits_browser()(Writable, Stream);
		function nop() {}
		function WritableState(options, stream, isDuplex) {
			Duplex = Duplex || require__stream_duplex$1();
			options = options || {};
			if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
			this.objectMode = !!options.objectMode;
			if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
			this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex);
			this.finalCalled = false;
			this.needDrain = false;
			this.ending = false;
			this.ended = false;
			this.finished = false;
			this.destroyed = false;
			this.decodeStrings = !(options.decodeStrings === false);
			this.defaultEncoding = options.defaultEncoding || "utf8";
			this.length = 0;
			this.writing = false;
			this.corked = 0;
			this.sync = true;
			this.bufferProcessing = false;
			this.onwrite = function(er) {
				onwrite(stream, er);
			};
			this.writecb = null;
			this.writelen = 0;
			this.bufferedRequest = null;
			this.lastBufferedRequest = null;
			this.pendingcb = 0;
			this.prefinished = false;
			this.errorEmitted = false;
			this.emitClose = options.emitClose !== false;
			this.autoDestroy = !!options.autoDestroy;
			this.bufferedRequestCount = 0;
			this.corkedRequestsFree = new CorkedRequest(this);
		}
		WritableState.prototype.getBuffer = function getBuffer() {
			var current = this.bufferedRequest;
			var out = [];
			while (current) {
				out.push(current);
				current = current.next;
			}
			return out;
		};
		(function() {
			try {
				Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function writableStateBufferGetter() {
					return this.getBuffer();
				}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") });
			} catch (_) {}
		})();
		var realHasInstance;
		if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
			realHasInstance = Function.prototype[Symbol.hasInstance];
			Object.defineProperty(Writable, Symbol.hasInstance, { value: function value(object) {
				if (realHasInstance.call(this, object)) return true;
				if (this !== Writable) return false;
				return object && object._writableState instanceof WritableState;
			} });
		} else realHasInstance = function realHasInstance(object) {
			return object instanceof this;
		};
		function Writable(options) {
			Duplex = Duplex || require__stream_duplex$1();
			var isDuplex = this instanceof Duplex;
			if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options);
			this._writableState = new WritableState(options, this, isDuplex);
			this.writable = true;
			if (options) {
				if (typeof options.write === "function") this._write = options.write;
				if (typeof options.writev === "function") this._writev = options.writev;
				if (typeof options.destroy === "function") this._destroy = options.destroy;
				if (typeof options.final === "function") this._final = options.final;
			}
			Stream.call(this);
		}
		Writable.prototype.pipe = function() {
			errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
		};
		function writeAfterEnd(stream, cb) {
			var er = new ERR_STREAM_WRITE_AFTER_END();
			errorOrDestroy(stream, er);
			process$1.nextTick(cb, er);
		}
		function validChunk(stream, state, chunk, cb) {
			var er;
			if (chunk === null) er = new ERR_STREAM_NULL_VALUES();
			else if (typeof chunk !== "string" && !state.objectMode) er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
			if (er) {
				errorOrDestroy(stream, er);
				process$1.nextTick(cb, er);
				return false;
			}
			return true;
		}
		Writable.prototype.write = function(chunk, encoding, cb) {
			var state = this._writableState;
			var ret = false;
			var isBuf = !state.objectMode && _isUint8Array(chunk);
			if (isBuf && !Buffer.isBuffer(chunk)) chunk = _uint8ArrayToBuffer(chunk);
			if (typeof encoding === "function") {
				cb = encoding;
				encoding = null;
			}
			if (isBuf) encoding = "buffer";
			else if (!encoding) encoding = state.defaultEncoding;
			if (typeof cb !== "function") cb = nop;
			if (state.ending) writeAfterEnd(this, cb);
			else if (isBuf || validChunk(this, state, chunk, cb)) {
				state.pendingcb++;
				ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
			}
			return ret;
		};
		Writable.prototype.cork = function() {
			this._writableState.corked++;
		};
		Writable.prototype.uncork = function() {
			var state = this._writableState;
			if (state.corked) {
				state.corked--;
				if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
			}
		};
		Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
			if (typeof encoding === "string") encoding = encoding.toLowerCase();
			if (!([
				"hex",
				"utf8",
				"utf-8",
				"ascii",
				"binary",
				"base64",
				"ucs2",
				"ucs-2",
				"utf16le",
				"utf-16le",
				"raw"
			].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding);
			this._writableState.defaultEncoding = encoding;
			return this;
		};
		Object.defineProperty(Writable.prototype, "writableBuffer", {
			enumerable: false,
			get: function get() {
				return this._writableState && this._writableState.getBuffer();
			}
		});
		function decodeChunk(state, chunk, encoding) {
			if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer.from(chunk, encoding);
			return chunk;
		}
		Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
			enumerable: false,
			get: function get() {
				return this._writableState.highWaterMark;
			}
		});
		function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
			if (!isBuf) {
				var newChunk = decodeChunk(state, chunk, encoding);
				if (chunk !== newChunk) {
					isBuf = true;
					encoding = "buffer";
					chunk = newChunk;
				}
			}
			var len = state.objectMode ? 1 : chunk.length;
			state.length += len;
			var ret = state.length < state.highWaterMark;
			if (!ret) state.needDrain = true;
			if (state.writing || state.corked) {
				var last = state.lastBufferedRequest;
				state.lastBufferedRequest = {
					chunk,
					encoding,
					isBuf,
					callback: cb,
					next: null
				};
				if (last) last.next = state.lastBufferedRequest;
				else state.bufferedRequest = state.lastBufferedRequest;
				state.bufferedRequestCount += 1;
			} else doWrite(stream, state, false, len, chunk, encoding, cb);
			return ret;
		}
		function doWrite(stream, state, writev, len, chunk, encoding, cb) {
			state.writelen = len;
			state.writecb = cb;
			state.writing = true;
			state.sync = true;
			if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write"));
			else if (writev) stream._writev(chunk, state.onwrite);
			else stream._write(chunk, encoding, state.onwrite);
			state.sync = false;
		}
		function onwriteError(stream, state, sync, er, cb) {
			--state.pendingcb;
			if (sync) {
				process$1.nextTick(cb, er);
				process$1.nextTick(finishMaybe, stream, state);
				stream._writableState.errorEmitted = true;
				errorOrDestroy(stream, er);
			} else {
				cb(er);
				stream._writableState.errorEmitted = true;
				errorOrDestroy(stream, er);
				finishMaybe(stream, state);
			}
		}
		function onwriteStateUpdate(state) {
			state.writing = false;
			state.writecb = null;
			state.length -= state.writelen;
			state.writelen = 0;
		}
		function onwrite(stream, er) {
			var state = stream._writableState;
			var sync = state.sync;
			var cb = state.writecb;
			if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
			onwriteStateUpdate(state);
			if (er) onwriteError(stream, state, sync, er, cb);
			else {
				var finished = needFinish(state) || stream.destroyed;
				if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state);
				if (sync) process$1.nextTick(afterWrite, stream, state, finished, cb);
				else afterWrite(stream, state, finished, cb);
			}
		}
		function afterWrite(stream, state, finished, cb) {
			if (!finished) onwriteDrain(stream, state);
			state.pendingcb--;
			cb();
			finishMaybe(stream, state);
		}
		function onwriteDrain(stream, state) {
			if (state.length === 0 && state.needDrain) {
				state.needDrain = false;
				stream.emit("drain");
			}
		}
		function clearBuffer(stream, state) {
			state.bufferProcessing = true;
			var entry = state.bufferedRequest;
			if (stream._writev && entry && entry.next) {
				var l = state.bufferedRequestCount;
				var buffer = new Array(l);
				var holder = state.corkedRequestsFree;
				holder.entry = entry;
				var count = 0;
				var allBuffers = true;
				while (entry) {
					buffer[count] = entry;
					if (!entry.isBuf) allBuffers = false;
					entry = entry.next;
					count += 1;
				}
				buffer.allBuffers = allBuffers;
				doWrite(stream, state, true, state.length, buffer, "", holder.finish);
				state.pendingcb++;
				state.lastBufferedRequest = null;
				if (holder.next) {
					state.corkedRequestsFree = holder.next;
					holder.next = null;
				} else state.corkedRequestsFree = new CorkedRequest(state);
				state.bufferedRequestCount = 0;
			} else {
				while (entry) {
					var chunk = entry.chunk;
					var encoding = entry.encoding;
					var cb = entry.callback;
					doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb);
					entry = entry.next;
					state.bufferedRequestCount--;
					if (state.writing) break;
				}
				if (entry === null) state.lastBufferedRequest = null;
			}
			state.bufferedRequest = entry;
			state.bufferProcessing = false;
		}
		Writable.prototype._write = function(chunk, encoding, cb) {
			cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()"));
		};
		Writable.prototype._writev = null;
		Writable.prototype.end = function(chunk, encoding, cb) {
			var state = this._writableState;
			if (typeof chunk === "function") {
				cb = chunk;
				chunk = null;
				encoding = null;
			} else if (typeof encoding === "function") {
				cb = encoding;
				encoding = null;
			}
			if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
			if (state.corked) {
				state.corked = 1;
				this.uncork();
			}
			if (!state.ending) endWritable(this, state, cb);
			return this;
		};
		Object.defineProperty(Writable.prototype, "writableLength", {
			enumerable: false,
			get: function get() {
				return this._writableState.length;
			}
		});
		function needFinish(state) {
			return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
		}
		function callFinal(stream, state) {
			stream._final(function(err) {
				state.pendingcb--;
				if (err) errorOrDestroy(stream, err);
				state.prefinished = true;
				stream.emit("prefinish");
				finishMaybe(stream, state);
			});
		}
		function prefinish(stream, state) {
			if (!state.prefinished && !state.finalCalled) if (typeof stream._final === "function" && !state.destroyed) {
				state.pendingcb++;
				state.finalCalled = true;
				process$1.nextTick(callFinal, stream, state);
			} else {
				state.prefinished = true;
				stream.emit("prefinish");
			}
		}
		function finishMaybe(stream, state) {
			var need = needFinish(state);
			if (need) {
				prefinish(stream, state);
				if (state.pendingcb === 0) {
					state.finished = true;
					stream.emit("finish");
					if (state.autoDestroy) {
						var rState = stream._readableState;
						if (!rState || rState.autoDestroy && rState.endEmitted) stream.destroy();
					}
				}
			}
			return need;
		}
		function endWritable(stream, state, cb) {
			state.ending = true;
			finishMaybe(stream, state);
			if (cb) if (state.finished) process$1.nextTick(cb);
			else stream.once("finish", cb);
			state.ended = true;
			stream.writable = false;
		}
		function onCorkedFinish(corkReq, state, err) {
			var entry = corkReq.entry;
			corkReq.entry = null;
			while (entry) {
				var cb = entry.callback;
				state.pendingcb--;
				cb(err);
				entry = entry.next;
			}
			state.corkedRequestsFree.next = corkReq;
		}
		Object.defineProperty(Writable.prototype, "destroyed", {
			enumerable: false,
			get: function get() {
				if (this._writableState === void 0) return false;
				return this._writableState.destroyed;
			},
			set: function set(value) {
				if (!this._writableState) return;
				this._writableState.destroyed = value;
			}
		});
		Writable.prototype.destroy = destroyImpl.destroy;
		Writable.prototype._undestroy = destroyImpl.undestroy;
		Writable.prototype._destroy = function(err, cb) {
			cb(err);
		};
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/_stream_duplex.js
	var require__stream_duplex$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		var objectKeys = Object.keys || function(obj) {
			var keys = [];
			for (var key in obj) keys.push(key);
			return keys;
		};
		module.exports = Duplex;
		var Readable = require__stream_readable$1();
		var Writable = require__stream_writable$1();
		require_inherits_browser()(Duplex, Readable);
		var keys = objectKeys(Writable.prototype);
		for (var v = 0; v < keys.length; v++) {
			var method = keys[v];
			if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
		}
		function Duplex(options) {
			if (!(this instanceof Duplex)) return new Duplex(options);
			Readable.call(this, options);
			Writable.call(this, options);
			this.allowHalfOpen = true;
			if (options) {
				if (options.readable === false) this.readable = false;
				if (options.writable === false) this.writable = false;
				if (options.allowHalfOpen === false) {
					this.allowHalfOpen = false;
					this.once("end", onend);
				}
			}
		}
		Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
			enumerable: false,
			get: function get() {
				return this._writableState.highWaterMark;
			}
		});
		Object.defineProperty(Duplex.prototype, "writableBuffer", {
			enumerable: false,
			get: function get() {
				return this._writableState && this._writableState.getBuffer();
			}
		});
		Object.defineProperty(Duplex.prototype, "writableLength", {
			enumerable: false,
			get: function get() {
				return this._writableState.length;
			}
		});
		function onend() {
			if (this._writableState.ended) return;
			process$1.nextTick(onEndNT, this);
		}
		function onEndNT(self) {
			self.end();
		}
		Object.defineProperty(Duplex.prototype, "destroyed", {
			enumerable: false,
			get: function get() {
				if (this._readableState === void 0 || this._writableState === void 0) return false;
				return this._readableState.destroyed && this._writableState.destroyed;
			},
			set: function set(value) {
				if (this._readableState === void 0 || this._writableState === void 0) return;
				this._readableState.destroyed = value;
				this._writableState.destroyed = value;
			}
		});
	}));
	//#endregion
	//#region ../../node_modules/string_decoder/lib/string_decoder.js
	var require_string_decoder$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var isEncoding = Buffer.isEncoding || function(encoding) {
			encoding = "" + encoding;
			switch (encoding && encoding.toLowerCase()) {
				case "hex":
				case "utf8":
				case "utf-8":
				case "ascii":
				case "binary":
				case "base64":
				case "ucs2":
				case "ucs-2":
				case "utf16le":
				case "utf-16le":
				case "raw": return true;
				default: return false;
			}
		};
		function _normalizeEncoding(enc) {
			if (!enc) return "utf8";
			var retried;
			while (true) switch (enc) {
				case "utf8":
				case "utf-8": return "utf8";
				case "ucs2":
				case "ucs-2":
				case "utf16le":
				case "utf-16le": return "utf16le";
				case "latin1":
				case "binary": return "latin1";
				case "base64":
				case "ascii":
				case "hex": return enc;
				default:
					if (retried) return;
					enc = ("" + enc).toLowerCase();
					retried = true;
			}
		}
		function normalizeEncoding(enc) {
			var nenc = _normalizeEncoding(enc);
			if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
			return nenc || enc;
		}
		exports.StringDecoder = StringDecoder;
		function StringDecoder(encoding) {
			this.encoding = normalizeEncoding(encoding);
			var nb;
			switch (this.encoding) {
				case "utf16le":
					this.text = utf16Text;
					this.end = utf16End;
					nb = 4;
					break;
				case "utf8":
					this.fillLast = utf8FillLast;
					nb = 4;
					break;
				case "base64":
					this.text = base64Text;
					this.end = base64End;
					nb = 3;
					break;
				default:
					this.write = simpleWrite;
					this.end = simpleEnd;
					return;
			}
			this.lastNeed = 0;
			this.lastTotal = 0;
			this.lastChar = Buffer.allocUnsafe(nb);
		}
		StringDecoder.prototype.write = function(buf) {
			if (buf.length === 0) return "";
			var r;
			var i;
			if (this.lastNeed) {
				r = this.fillLast(buf);
				if (r === void 0) return "";
				i = this.lastNeed;
				this.lastNeed = 0;
			} else i = 0;
			if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
			return r || "";
		};
		StringDecoder.prototype.end = utf8End;
		StringDecoder.prototype.text = utf8Text;
		StringDecoder.prototype.fillLast = function(buf) {
			if (this.lastNeed <= buf.length) {
				buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
				return this.lastChar.toString(this.encoding, 0, this.lastTotal);
			}
			buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
			this.lastNeed -= buf.length;
		};
		function utf8CheckByte(byte) {
			if (byte <= 127) return 0;
			else if (byte >> 5 === 6) return 2;
			else if (byte >> 4 === 14) return 3;
			else if (byte >> 3 === 30) return 4;
			return byte >> 6 === 2 ? -1 : -2;
		}
		function utf8CheckIncomplete(self, buf, i) {
			var j = buf.length - 1;
			if (j < i) return 0;
			var nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) self.lastNeed = nb - 1;
				return nb;
			}
			if (--j < i || nb === -2) return 0;
			nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) self.lastNeed = nb - 2;
				return nb;
			}
			if (--j < i || nb === -2) return 0;
			nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) if (nb === 2) nb = 0;
				else self.lastNeed = nb - 3;
				return nb;
			}
			return 0;
		}
		function utf8CheckExtraBytes(self, buf, p) {
			if ((buf[0] & 192) !== 128) {
				self.lastNeed = 0;
				return "�";
			}
			if (self.lastNeed > 1 && buf.length > 1) {
				if ((buf[1] & 192) !== 128) {
					self.lastNeed = 1;
					return "�";
				}
				if (self.lastNeed > 2 && buf.length > 2) {
					if ((buf[2] & 192) !== 128) {
						self.lastNeed = 2;
						return "�";
					}
				}
			}
		}
		function utf8FillLast(buf) {
			var p = this.lastTotal - this.lastNeed;
			var r = utf8CheckExtraBytes(this, buf, p);
			if (r !== void 0) return r;
			if (this.lastNeed <= buf.length) {
				buf.copy(this.lastChar, p, 0, this.lastNeed);
				return this.lastChar.toString(this.encoding, 0, this.lastTotal);
			}
			buf.copy(this.lastChar, p, 0, buf.length);
			this.lastNeed -= buf.length;
		}
		function utf8Text(buf, i) {
			var total = utf8CheckIncomplete(this, buf, i);
			if (!this.lastNeed) return buf.toString("utf8", i);
			this.lastTotal = total;
			var end = buf.length - (total - this.lastNeed);
			buf.copy(this.lastChar, 0, end);
			return buf.toString("utf8", i, end);
		}
		function utf8End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) return r + "�";
			return r;
		}
		function utf16Text(buf, i) {
			if ((buf.length - i) % 2 === 0) {
				var r = buf.toString("utf16le", i);
				if (r) {
					var c = r.charCodeAt(r.length - 1);
					if (c >= 55296 && c <= 56319) {
						this.lastNeed = 2;
						this.lastTotal = 4;
						this.lastChar[0] = buf[buf.length - 2];
						this.lastChar[1] = buf[buf.length - 1];
						return r.slice(0, -1);
					}
				}
				return r;
			}
			this.lastNeed = 1;
			this.lastTotal = 2;
			this.lastChar[0] = buf[buf.length - 1];
			return buf.toString("utf16le", i, buf.length - 1);
		}
		function utf16End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) {
				var end = this.lastTotal - this.lastNeed;
				return r + this.lastChar.toString("utf16le", 0, end);
			}
			return r;
		}
		function base64Text(buf, i) {
			var n = (buf.length - i) % 3;
			if (n === 0) return buf.toString("base64", i);
			this.lastNeed = 3 - n;
			this.lastTotal = 3;
			if (n === 1) this.lastChar[0] = buf[buf.length - 1];
			else {
				this.lastChar[0] = buf[buf.length - 2];
				this.lastChar[1] = buf[buf.length - 1];
			}
			return buf.toString("base64", i, buf.length - n);
		}
		function base64End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
			return r;
		}
		function simpleWrite(buf) {
			return buf.toString(this.encoding);
		}
		function simpleEnd(buf) {
			return buf && buf.length ? this.write(buf) : "";
		}
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js
	var require_end_of_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ERR_STREAM_PREMATURE_CLOSE = require_errors_browser().codes.ERR_STREAM_PREMATURE_CLOSE;
		function once(callback) {
			var called = false;
			return function() {
				if (called) return;
				called = true;
				for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
				callback.apply(this, args);
			};
		}
		function noop() {}
		function isRequest(stream) {
			return stream.setHeader && typeof stream.abort === "function";
		}
		function eos(stream, opts, callback) {
			if (typeof opts === "function") return eos(stream, null, opts);
			if (!opts) opts = {};
			callback = once(callback || noop);
			var readable = opts.readable || opts.readable !== false && stream.readable;
			var writable = opts.writable || opts.writable !== false && stream.writable;
			var onlegacyfinish = function onlegacyfinish() {
				if (!stream.writable) onfinish();
			};
			var writableEnded = stream._writableState && stream._writableState.finished;
			var onfinish = function onfinish() {
				writable = false;
				writableEnded = true;
				if (!readable) callback.call(stream);
			};
			var readableEnded = stream._readableState && stream._readableState.endEmitted;
			var onend = function onend() {
				readable = false;
				readableEnded = true;
				if (!writable) callback.call(stream);
			};
			var onerror = function onerror(err) {
				callback.call(stream, err);
			};
			var onclose = function onclose() {
				var err;
				if (readable && !readableEnded) {
					if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
					return callback.call(stream, err);
				}
				if (writable && !writableEnded) {
					if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE();
					return callback.call(stream, err);
				}
			};
			var onrequest = function onrequest() {
				stream.req.on("finish", onfinish);
			};
			if (isRequest(stream)) {
				stream.on("complete", onfinish);
				stream.on("abort", onclose);
				if (stream.req) onrequest();
				else stream.on("request", onrequest);
			} else if (writable && !stream._writableState) {
				stream.on("end", onlegacyfinish);
				stream.on("close", onlegacyfinish);
			}
			stream.on("end", onend);
			stream.on("finish", onfinish);
			if (opts.error !== false) stream.on("error", onerror);
			stream.on("close", onclose);
			return function() {
				stream.removeListener("complete", onfinish);
				stream.removeListener("abort", onclose);
				stream.removeListener("request", onrequest);
				if (stream.req) stream.req.removeListener("finish", onfinish);
				stream.removeListener("end", onlegacyfinish);
				stream.removeListener("close", onlegacyfinish);
				stream.removeListener("finish", onfinish);
				stream.removeListener("end", onend);
				stream.removeListener("error", onerror);
				stream.removeListener("close", onclose);
			};
		}
		module.exports = eos;
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/async_iterator.js
	var require_async_iterator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		var _Object$setPrototypeO;
		function _defineProperty(obj, key, value) {
			key = _toPropertyKey(key);
			if (key in obj) Object.defineProperty(obj, key, {
				value,
				enumerable: true,
				configurable: true,
				writable: true
			});
			else obj[key] = value;
			return obj;
		}
		function _toPropertyKey(arg) {
			var key = _toPrimitive(arg, "string");
			return typeof key === "symbol" ? key : String(key);
		}
		function _toPrimitive(input, hint) {
			if (typeof input !== "object" || input === null) return input;
			var prim = input[Symbol.toPrimitive];
			if (prim !== void 0) {
				var res = prim.call(input, hint || "default");
				if (typeof res !== "object") return res;
				throw new TypeError("@@toPrimitive must return a primitive value.");
			}
			return (hint === "string" ? String : Number)(input);
		}
		var finished = require_end_of_stream();
		var kLastResolve = Symbol("lastResolve");
		var kLastReject = Symbol("lastReject");
		var kError = Symbol("error");
		var kEnded = Symbol("ended");
		var kLastPromise = Symbol("lastPromise");
		var kHandlePromise = Symbol("handlePromise");
		var kStream = Symbol("stream");
		function createIterResult(value, done) {
			return {
				value,
				done
			};
		}
		function readAndResolve(iter) {
			var resolve = iter[kLastResolve];
			if (resolve !== null) {
				var data = iter[kStream].read();
				if (data !== null) {
					iter[kLastPromise] = null;
					iter[kLastResolve] = null;
					iter[kLastReject] = null;
					resolve(createIterResult(data, false));
				}
			}
		}
		function onReadable(iter) {
			process$1.nextTick(readAndResolve, iter);
		}
		function wrapForNext(lastPromise, iter) {
			return function(resolve, reject) {
				lastPromise.then(function() {
					if (iter[kEnded]) {
						resolve(createIterResult(void 0, true));
						return;
					}
					iter[kHandlePromise](resolve, reject);
				}, reject);
			};
		}
		var AsyncIteratorPrototype = Object.getPrototypeOf(function() {});
		var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = {
			get stream() {
				return this[kStream];
			},
			next: function next() {
				var _this = this;
				var error = this[kError];
				if (error !== null) return Promise.reject(error);
				if (this[kEnded]) return Promise.resolve(createIterResult(void 0, true));
				if (this[kStream].destroyed) return new Promise(function(resolve, reject) {
					process$1.nextTick(function() {
						if (_this[kError]) reject(_this[kError]);
						else resolve(createIterResult(void 0, true));
					});
				});
				var lastPromise = this[kLastPromise];
				var promise;
				if (lastPromise) promise = new Promise(wrapForNext(lastPromise, this));
				else {
					var data = this[kStream].read();
					if (data !== null) return Promise.resolve(createIterResult(data, false));
					promise = new Promise(this[kHandlePromise]);
				}
				this[kLastPromise] = promise;
				return promise;
			}
		}, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() {
			return this;
		}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
			var _this2 = this;
			return new Promise(function(resolve, reject) {
				_this2[kStream].destroy(null, function(err) {
					if (err) {
						reject(err);
						return;
					}
					resolve(createIterResult(void 0, true));
				});
			});
		}), _Object$setPrototypeO), AsyncIteratorPrototype);
		module.exports = function createReadableStreamAsyncIterator(stream) {
			var _Object$create;
			var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, {
				value: stream,
				writable: true
			}), _defineProperty(_Object$create, kLastResolve, {
				value: null,
				writable: true
			}), _defineProperty(_Object$create, kLastReject, {
				value: null,
				writable: true
			}), _defineProperty(_Object$create, kError, {
				value: null,
				writable: true
			}), _defineProperty(_Object$create, kEnded, {
				value: stream._readableState.endEmitted,
				writable: true
			}), _defineProperty(_Object$create, kHandlePromise, {
				value: function value(resolve, reject) {
					var data = iterator[kStream].read();
					if (data) {
						iterator[kLastPromise] = null;
						iterator[kLastResolve] = null;
						iterator[kLastReject] = null;
						resolve(createIterResult(data, false));
					} else {
						iterator[kLastResolve] = resolve;
						iterator[kLastReject] = reject;
					}
				},
				writable: true
			}), _Object$create));
			iterator[kLastPromise] = null;
			finished(stream, function(err) {
				if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
					var reject = iterator[kLastReject];
					if (reject !== null) {
						iterator[kLastPromise] = null;
						iterator[kLastResolve] = null;
						iterator[kLastReject] = null;
						reject(err);
					}
					iterator[kError] = err;
					return;
				}
				var resolve = iterator[kLastResolve];
				if (resolve !== null) {
					iterator[kLastPromise] = null;
					iterator[kLastResolve] = null;
					iterator[kLastReject] = null;
					resolve(createIterResult(void 0, true));
				}
				iterator[kEnded] = true;
			});
			stream.on("readable", onReadable.bind(null, iterator));
			return iterator;
		};
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/from-browser.js
	var require_from_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = function() {
			throw new Error("Readable.from is not available in the browser");
		};
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/_stream_readable.js
	var require__stream_readable$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		module.exports = Readable;
		var Duplex;
		Readable.ReadableState = ReadableState;
		require_events().EventEmitter;
		var EElistenerCount = function EElistenerCount(emitter, type) {
			return emitter.listeners(type).length;
		};
		var Stream = require_stream_browser$1();
		var Buffer = require_dist().Buffer;
		var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
		function _uint8ArrayToBuffer(chunk) {
			return Buffer.from(chunk);
		}
		function _isUint8Array(obj) {
			return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
		}
		var debugUtil = require_util$2();
		var debug;
		if (debugUtil && debugUtil.debuglog) debug = debugUtil.debuglog("stream");
		else debug = function debug() {};
		var BufferList = require_buffer_list();
		var destroyImpl = require_destroy$1();
		var getHighWaterMark = require_state().getHighWaterMark;
		var _require$codes = require_errors_browser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;
		var StringDecoder;
		var createReadableStreamAsyncIterator;
		var from;
		require_inherits_browser()(Readable, Stream);
		var errorOrDestroy = destroyImpl.errorOrDestroy;
		var kProxyEvents = [
			"error",
			"close",
			"destroy",
			"pause",
			"resume"
		];
		function prependListener(emitter, event, fn) {
			if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
			if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
			else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
			else emitter._events[event] = [fn, emitter._events[event]];
		}
		function ReadableState(options, stream, isDuplex) {
			Duplex = Duplex || require__stream_duplex$1();
			options = options || {};
			if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex;
			this.objectMode = !!options.objectMode;
			if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
			this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex);
			this.buffer = new BufferList();
			this.length = 0;
			this.pipes = null;
			this.pipesCount = 0;
			this.flowing = null;
			this.ended = false;
			this.endEmitted = false;
			this.reading = false;
			this.sync = true;
			this.needReadable = false;
			this.emittedReadable = false;
			this.readableListening = false;
			this.resumeScheduled = false;
			this.paused = true;
			this.emitClose = options.emitClose !== false;
			this.autoDestroy = !!options.autoDestroy;
			this.destroyed = false;
			this.defaultEncoding = options.defaultEncoding || "utf8";
			this.awaitDrain = 0;
			this.readingMore = false;
			this.decoder = null;
			this.encoding = null;
			if (options.encoding) {
				if (!StringDecoder) StringDecoder = require_string_decoder$1().StringDecoder;
				this.decoder = new StringDecoder(options.encoding);
				this.encoding = options.encoding;
			}
		}
		function Readable(options) {
			Duplex = Duplex || require__stream_duplex$1();
			if (!(this instanceof Readable)) return new Readable(options);
			var isDuplex = this instanceof Duplex;
			this._readableState = new ReadableState(options, this, isDuplex);
			this.readable = true;
			if (options) {
				if (typeof options.read === "function") this._read = options.read;
				if (typeof options.destroy === "function") this._destroy = options.destroy;
			}
			Stream.call(this);
		}
		Object.defineProperty(Readable.prototype, "destroyed", {
			enumerable: false,
			get: function get() {
				if (this._readableState === void 0) return false;
				return this._readableState.destroyed;
			},
			set: function set(value) {
				if (!this._readableState) return;
				this._readableState.destroyed = value;
			}
		});
		Readable.prototype.destroy = destroyImpl.destroy;
		Readable.prototype._undestroy = destroyImpl.undestroy;
		Readable.prototype._destroy = function(err, cb) {
			cb(err);
		};
		Readable.prototype.push = function(chunk, encoding) {
			var state = this._readableState;
			var skipChunkCheck;
			if (!state.objectMode) {
				if (typeof chunk === "string") {
					encoding = encoding || state.defaultEncoding;
					if (encoding !== state.encoding) {
						chunk = Buffer.from(chunk, encoding);
						encoding = "";
					}
					skipChunkCheck = true;
				}
			} else skipChunkCheck = true;
			return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
		};
		Readable.prototype.unshift = function(chunk) {
			return readableAddChunk(this, chunk, null, true, false);
		};
		function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
			debug("readableAddChunk", chunk);
			var state = stream._readableState;
			if (chunk === null) {
				state.reading = false;
				onEofChunk(stream, state);
			} else {
				var er;
				if (!skipChunkCheck) er = chunkInvalid(state, chunk);
				if (er) errorOrDestroy(stream, er);
				else if (state.objectMode || chunk && chunk.length > 0) {
					if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) chunk = _uint8ArrayToBuffer(chunk);
					if (addToFront) if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT());
					else addChunk(stream, state, chunk, true);
					else if (state.ended) errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
					else if (state.destroyed) return false;
					else {
						state.reading = false;
						if (state.decoder && !encoding) {
							chunk = state.decoder.write(chunk);
							if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
							else maybeReadMore(stream, state);
						} else addChunk(stream, state, chunk, false);
					}
				} else if (!addToFront) {
					state.reading = false;
					maybeReadMore(stream, state);
				}
			}
			return !state.ended && (state.length < state.highWaterMark || state.length === 0);
		}
		function addChunk(stream, state, chunk, addToFront) {
			if (state.flowing && state.length === 0 && !state.sync) {
				state.awaitDrain = 0;
				stream.emit("data", chunk);
			} else {
				state.length += state.objectMode ? 1 : chunk.length;
				if (addToFront) state.buffer.unshift(chunk);
				else state.buffer.push(chunk);
				if (state.needReadable) emitReadable(stream);
			}
			maybeReadMore(stream, state);
		}
		function chunkInvalid(state, chunk) {
			var er;
			if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = new ERR_INVALID_ARG_TYPE("chunk", [
				"string",
				"Buffer",
				"Uint8Array"
			], chunk);
			return er;
		}
		Readable.prototype.isPaused = function() {
			return this._readableState.flowing === false;
		};
		Readable.prototype.setEncoding = function(enc) {
			if (!StringDecoder) StringDecoder = require_string_decoder$1().StringDecoder;
			var decoder = new StringDecoder(enc);
			this._readableState.decoder = decoder;
			this._readableState.encoding = this._readableState.decoder.encoding;
			var p = this._readableState.buffer.head;
			var content = "";
			while (p !== null) {
				content += decoder.write(p.data);
				p = p.next;
			}
			this._readableState.buffer.clear();
			if (content !== "") this._readableState.buffer.push(content);
			this._readableState.length = content.length;
			return this;
		};
		var MAX_HWM = 1073741824;
		function computeNewHighWaterMark(n) {
			if (n >= MAX_HWM) n = MAX_HWM;
			else {
				n--;
				n |= n >>> 1;
				n |= n >>> 2;
				n |= n >>> 4;
				n |= n >>> 8;
				n |= n >>> 16;
				n++;
			}
			return n;
		}
		function howMuchToRead(n, state) {
			if (n <= 0 || state.length === 0 && state.ended) return 0;
			if (state.objectMode) return 1;
			if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length;
			else return state.length;
			if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
			if (n <= state.length) return n;
			if (!state.ended) {
				state.needReadable = true;
				return 0;
			}
			return state.length;
		}
		Readable.prototype.read = function(n) {
			debug("read", n);
			n = parseInt(n, 10);
			var state = this._readableState;
			var nOrig = n;
			if (n !== 0) state.emittedReadable = false;
			if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
				debug("read: emitReadable", state.length, state.ended);
				if (state.length === 0 && state.ended) endReadable(this);
				else emitReadable(this);
				return null;
			}
			n = howMuchToRead(n, state);
			if (n === 0 && state.ended) {
				if (state.length === 0) endReadable(this);
				return null;
			}
			var doRead = state.needReadable;
			debug("need readable", doRead);
			if (state.length === 0 || state.length - n < state.highWaterMark) {
				doRead = true;
				debug("length less than watermark", doRead);
			}
			if (state.ended || state.reading) {
				doRead = false;
				debug("reading or ended", doRead);
			} else if (doRead) {
				debug("do read");
				state.reading = true;
				state.sync = true;
				if (state.length === 0) state.needReadable = true;
				this._read(state.highWaterMark);
				state.sync = false;
				if (!state.reading) n = howMuchToRead(nOrig, state);
			}
			var ret;
			if (n > 0) ret = fromList(n, state);
			else ret = null;
			if (ret === null) {
				state.needReadable = state.length <= state.highWaterMark;
				n = 0;
			} else {
				state.length -= n;
				state.awaitDrain = 0;
			}
			if (state.length === 0) {
				if (!state.ended) state.needReadable = true;
				if (nOrig !== n && state.ended) endReadable(this);
			}
			if (ret !== null) this.emit("data", ret);
			return ret;
		};
		function onEofChunk(stream, state) {
			debug("onEofChunk");
			if (state.ended) return;
			if (state.decoder) {
				var chunk = state.decoder.end();
				if (chunk && chunk.length) {
					state.buffer.push(chunk);
					state.length += state.objectMode ? 1 : chunk.length;
				}
			}
			state.ended = true;
			if (state.sync) emitReadable(stream);
			else {
				state.needReadable = false;
				if (!state.emittedReadable) {
					state.emittedReadable = true;
					emitReadable_(stream);
				}
			}
		}
		function emitReadable(stream) {
			var state = stream._readableState;
			debug("emitReadable", state.needReadable, state.emittedReadable);
			state.needReadable = false;
			if (!state.emittedReadable) {
				debug("emitReadable", state.flowing);
				state.emittedReadable = true;
				process$1.nextTick(emitReadable_, stream);
			}
		}
		function emitReadable_(stream) {
			var state = stream._readableState;
			debug("emitReadable_", state.destroyed, state.length, state.ended);
			if (!state.destroyed && (state.length || state.ended)) {
				stream.emit("readable");
				state.emittedReadable = false;
			}
			state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
			flow(stream);
		}
		function maybeReadMore(stream, state) {
			if (!state.readingMore) {
				state.readingMore = true;
				process$1.nextTick(maybeReadMore_, stream, state);
			}
		}
		function maybeReadMore_(stream, state) {
			while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
				var len = state.length;
				debug("maybeReadMore read 0");
				stream.read(0);
				if (len === state.length) break;
			}
			state.readingMore = false;
		}
		Readable.prototype._read = function(n) {
			errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
		};
		Readable.prototype.pipe = function(dest, pipeOpts) {
			var src = this;
			var state = this._readableState;
			switch (state.pipesCount) {
				case 0:
					state.pipes = dest;
					break;
				case 1:
					state.pipes = [state.pipes, dest];
					break;
				default:
					state.pipes.push(dest);
					break;
			}
			state.pipesCount += 1;
			debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
			var endFn = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr ? onend : unpipe;
			if (state.endEmitted) process$1.nextTick(endFn);
			else src.once("end", endFn);
			dest.on("unpipe", onunpipe);
			function onunpipe(readable, unpipeInfo) {
				debug("onunpipe");
				if (readable === src) {
					if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
						unpipeInfo.hasUnpiped = true;
						cleanup();
					}
				}
			}
			function onend() {
				debug("onend");
				dest.end();
			}
			var ondrain = pipeOnDrain(src);
			dest.on("drain", ondrain);
			var cleanedUp = false;
			function cleanup() {
				debug("cleanup");
				dest.removeListener("close", onclose);
				dest.removeListener("finish", onfinish);
				dest.removeListener("drain", ondrain);
				dest.removeListener("error", onerror);
				dest.removeListener("unpipe", onunpipe);
				src.removeListener("end", onend);
				src.removeListener("end", unpipe);
				src.removeListener("data", ondata);
				cleanedUp = true;
				if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
			}
			src.on("data", ondata);
			function ondata(chunk) {
				debug("ondata");
				var ret = dest.write(chunk);
				debug("dest.write", ret);
				if (ret === false) {
					if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
						debug("false write response, pause", state.awaitDrain);
						state.awaitDrain++;
					}
					src.pause();
				}
			}
			function onerror(er) {
				debug("onerror", er);
				unpipe();
				dest.removeListener("error", onerror);
				if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
			}
			prependListener(dest, "error", onerror);
			function onclose() {
				dest.removeListener("finish", onfinish);
				unpipe();
			}
			dest.once("close", onclose);
			function onfinish() {
				debug("onfinish");
				dest.removeListener("close", onclose);
				unpipe();
			}
			dest.once("finish", onfinish);
			function unpipe() {
				debug("unpipe");
				src.unpipe(dest);
			}
			dest.emit("pipe", src);
			if (!state.flowing) {
				debug("pipe resume");
				src.resume();
			}
			return dest;
		};
		function pipeOnDrain(src) {
			return function pipeOnDrainFunctionResult() {
				var state = src._readableState;
				debug("pipeOnDrain", state.awaitDrain);
				if (state.awaitDrain) state.awaitDrain--;
				if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
					state.flowing = true;
					flow(src);
				}
			};
		}
		Readable.prototype.unpipe = function(dest) {
			var state = this._readableState;
			var unpipeInfo = { hasUnpiped: false };
			if (state.pipesCount === 0) return this;
			if (state.pipesCount === 1) {
				if (dest && dest !== state.pipes) return this;
				if (!dest) dest = state.pipes;
				state.pipes = null;
				state.pipesCount = 0;
				state.flowing = false;
				if (dest) dest.emit("unpipe", this, unpipeInfo);
				return this;
			}
			if (!dest) {
				var dests = state.pipes;
				var len = state.pipesCount;
				state.pipes = null;
				state.pipesCount = 0;
				state.flowing = false;
				for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false });
				return this;
			}
			var index = indexOf(state.pipes, dest);
			if (index === -1) return this;
			state.pipes.splice(index, 1);
			state.pipesCount -= 1;
			if (state.pipesCount === 1) state.pipes = state.pipes[0];
			dest.emit("unpipe", this, unpipeInfo);
			return this;
		};
		Readable.prototype.on = function(ev, fn) {
			var res = Stream.prototype.on.call(this, ev, fn);
			var state = this._readableState;
			if (ev === "data") {
				state.readableListening = this.listenerCount("readable") > 0;
				if (state.flowing !== false) this.resume();
			} else if (ev === "readable") {
				if (!state.endEmitted && !state.readableListening) {
					state.readableListening = state.needReadable = true;
					state.flowing = false;
					state.emittedReadable = false;
					debug("on readable", state.length, state.reading);
					if (state.length) emitReadable(this);
					else if (!state.reading) process$1.nextTick(nReadingNextTick, this);
				}
			}
			return res;
		};
		Readable.prototype.addListener = Readable.prototype.on;
		Readable.prototype.removeListener = function(ev, fn) {
			var res = Stream.prototype.removeListener.call(this, ev, fn);
			if (ev === "readable") process$1.nextTick(updateReadableListening, this);
			return res;
		};
		Readable.prototype.removeAllListeners = function(ev) {
			var res = Stream.prototype.removeAllListeners.apply(this, arguments);
			if (ev === "readable" || ev === void 0) process$1.nextTick(updateReadableListening, this);
			return res;
		};
		function updateReadableListening(self) {
			var state = self._readableState;
			state.readableListening = self.listenerCount("readable") > 0;
			if (state.resumeScheduled && !state.paused) state.flowing = true;
			else if (self.listenerCount("data") > 0) self.resume();
		}
		function nReadingNextTick(self) {
			debug("readable nexttick read 0");
			self.read(0);
		}
		Readable.prototype.resume = function() {
			var state = this._readableState;
			if (!state.flowing) {
				debug("resume");
				state.flowing = !state.readableListening;
				resume(this, state);
			}
			state.paused = false;
			return this;
		};
		function resume(stream, state) {
			if (!state.resumeScheduled) {
				state.resumeScheduled = true;
				process$1.nextTick(resume_, stream, state);
			}
		}
		function resume_(stream, state) {
			debug("resume", state.reading);
			if (!state.reading) stream.read(0);
			state.resumeScheduled = false;
			stream.emit("resume");
			flow(stream);
			if (state.flowing && !state.reading) stream.read(0);
		}
		Readable.prototype.pause = function() {
			debug("call pause flowing=%j", this._readableState.flowing);
			if (this._readableState.flowing !== false) {
				debug("pause");
				this._readableState.flowing = false;
				this.emit("pause");
			}
			this._readableState.paused = true;
			return this;
		};
		function flow(stream) {
			var state = stream._readableState;
			debug("flow", state.flowing);
			while (state.flowing && stream.read() !== null);
		}
		Readable.prototype.wrap = function(stream) {
			var _this = this;
			var state = this._readableState;
			var paused = false;
			stream.on("end", function() {
				debug("wrapped end");
				if (state.decoder && !state.ended) {
					var chunk = state.decoder.end();
					if (chunk && chunk.length) _this.push(chunk);
				}
				_this.push(null);
			});
			stream.on("data", function(chunk) {
				debug("wrapped data");
				if (state.decoder) chunk = state.decoder.write(chunk);
				if (state.objectMode && (chunk === null || chunk === void 0)) return;
				else if (!state.objectMode && (!chunk || !chunk.length)) return;
				if (!_this.push(chunk)) {
					paused = true;
					stream.pause();
				}
			});
			for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function methodWrap(method) {
				return function methodWrapReturnFunction() {
					return stream[method].apply(stream, arguments);
				};
			}(i);
			for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
			this._read = function(n) {
				debug("wrapped _read", n);
				if (paused) {
					paused = false;
					stream.resume();
				}
			};
			return this;
		};
		if (typeof Symbol === "function") Readable.prototype[Symbol.asyncIterator] = function() {
			if (createReadableStreamAsyncIterator === void 0) createReadableStreamAsyncIterator = require_async_iterator();
			return createReadableStreamAsyncIterator(this);
		};
		Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
			enumerable: false,
			get: function get() {
				return this._readableState.highWaterMark;
			}
		});
		Object.defineProperty(Readable.prototype, "readableBuffer", {
			enumerable: false,
			get: function get() {
				return this._readableState && this._readableState.buffer;
			}
		});
		Object.defineProperty(Readable.prototype, "readableFlowing", {
			enumerable: false,
			get: function get() {
				return this._readableState.flowing;
			},
			set: function set(state) {
				if (this._readableState) this._readableState.flowing = state;
			}
		});
		Readable._fromList = fromList;
		Object.defineProperty(Readable.prototype, "readableLength", {
			enumerable: false,
			get: function get() {
				return this._readableState.length;
			}
		});
		function fromList(n, state) {
			if (state.length === 0) return null;
			var ret;
			if (state.objectMode) ret = state.buffer.shift();
			else if (!n || n >= state.length) {
				if (state.decoder) ret = state.buffer.join("");
				else if (state.buffer.length === 1) ret = state.buffer.first();
				else ret = state.buffer.concat(state.length);
				state.buffer.clear();
			} else ret = state.buffer.consume(n, state.decoder);
			return ret;
		}
		function endReadable(stream) {
			var state = stream._readableState;
			debug("endReadable", state.endEmitted);
			if (!state.endEmitted) {
				state.ended = true;
				process$1.nextTick(endReadableNT, state, stream);
			}
		}
		function endReadableNT(state, stream) {
			debug("endReadableNT", state.endEmitted, state.length);
			if (!state.endEmitted && state.length === 0) {
				state.endEmitted = true;
				stream.readable = false;
				stream.emit("end");
				if (state.autoDestroy) {
					var wState = stream._writableState;
					if (!wState || wState.autoDestroy && wState.finished) stream.destroy();
				}
			}
		}
		if (typeof Symbol === "function") Readable.from = function(iterable, opts) {
			if (from === void 0) from = require_from_browser();
			return from(Readable, iterable, opts);
		};
		function indexOf(xs, x) {
			for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i;
			return -1;
		}
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/_stream_transform.js
	var require__stream_transform$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = Transform;
		var _require$codes = require_errors_browser().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
		var Duplex = require__stream_duplex$1();
		require_inherits_browser()(Transform, Duplex);
		function afterTransform(er, data) {
			var ts = this._transformState;
			ts.transforming = false;
			var cb = ts.writecb;
			if (cb === null) return this.emit("error", new ERR_MULTIPLE_CALLBACK());
			ts.writechunk = null;
			ts.writecb = null;
			if (data != null) this.push(data);
			cb(er);
			var rs = this._readableState;
			rs.reading = false;
			if (rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
		}
		function Transform(options) {
			if (!(this instanceof Transform)) return new Transform(options);
			Duplex.call(this, options);
			this._transformState = {
				afterTransform: afterTransform.bind(this),
				needTransform: false,
				transforming: false,
				writecb: null,
				writechunk: null,
				writeencoding: null
			};
			this._readableState.needReadable = true;
			this._readableState.sync = false;
			if (options) {
				if (typeof options.transform === "function") this._transform = options.transform;
				if (typeof options.flush === "function") this._flush = options.flush;
			}
			this.on("prefinish", prefinish);
		}
		function prefinish() {
			var _this = this;
			if (typeof this._flush === "function" && !this._readableState.destroyed) this._flush(function(er, data) {
				done(_this, er, data);
			});
			else done(this, null, null);
		}
		Transform.prototype.push = function(chunk, encoding) {
			this._transformState.needTransform = false;
			return Duplex.prototype.push.call(this, chunk, encoding);
		};
		Transform.prototype._transform = function(chunk, encoding, cb) {
			cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
		};
		Transform.prototype._write = function(chunk, encoding, cb) {
			var ts = this._transformState;
			ts.writecb = cb;
			ts.writechunk = chunk;
			ts.writeencoding = encoding;
			if (!ts.transforming) {
				var rs = this._readableState;
				if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
			}
		};
		Transform.prototype._read = function(n) {
			var ts = this._transformState;
			if (ts.writechunk !== null && !ts.transforming) {
				ts.transforming = true;
				this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
			} else ts.needTransform = true;
		};
		Transform.prototype._destroy = function(err, cb) {
			Duplex.prototype._destroy.call(this, err, function(err2) {
				cb(err2);
			});
		};
		function done(stream, er, data) {
			if (er) return stream.emit("error", er);
			if (data != null) stream.push(data);
			if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
			if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING();
			return stream.push(null);
		}
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/_stream_passthrough.js
	var require__stream_passthrough$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = PassThrough;
		var Transform = require__stream_transform$1();
		require_inherits_browser()(PassThrough, Transform);
		function PassThrough(options) {
			if (!(this instanceof PassThrough)) return new PassThrough(options);
			Transform.call(this, options);
		}
		PassThrough.prototype._transform = function(chunk, encoding, cb) {
			cb(null, chunk);
		};
	}));
	//#endregion
	//#region ../../node_modules/readable-stream/lib/internal/streams/pipeline.js
	var require_pipeline = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var eos;
		function once(callback) {
			var called = false;
			return function() {
				if (called) return;
				called = true;
				callback.apply(void 0, arguments);
			};
		}
		var _require$codes = require_errors_browser().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
		function noop(err) {
			if (err) throw err;
		}
		function isRequest(stream) {
			return stream.setHeader && typeof stream.abort === "function";
		}
		function destroyer(stream, reading, writing, callback) {
			callback = once(callback);
			var closed = false;
			stream.on("close", function() {
				closed = true;
			});
			if (eos === void 0) eos = require_end_of_stream();
			eos(stream, {
				readable: reading,
				writable: writing
			}, function(err) {
				if (err) return callback(err);
				closed = true;
				callback();
			});
			var destroyed = false;
			return function(err) {
				if (closed) return;
				if (destroyed) return;
				destroyed = true;
				if (isRequest(stream)) return stream.abort();
				if (typeof stream.destroy === "function") return stream.destroy();
				callback(err || new ERR_STREAM_DESTROYED("pipe"));
			};
		}
		function call(fn) {
			fn();
		}
		function pipe(from, to) {
			return from.pipe(to);
		}
		function popCallback(streams) {
			if (!streams.length) return noop;
			if (typeof streams[streams.length - 1] !== "function") return noop;
			return streams.pop();
		}
		function pipeline() {
			for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) streams[_key] = arguments[_key];
			var callback = popCallback(streams);
			if (Array.isArray(streams[0])) streams = streams[0];
			if (streams.length < 2) throw new ERR_MISSING_ARGS("streams");
			var error;
			var destroys = streams.map(function(stream, i) {
				var reading = i < streams.length - 1;
				return destroyer(stream, reading, i > 0, function(err) {
					if (!error) error = err;
					if (err) destroys.forEach(call);
					if (reading) return;
					destroys.forEach(call);
					callback(error);
				});
			});
			return streams.reduce(pipe);
		}
		module.exports = pipeline;
	}));
	//#endregion
	//#region ../../node_modules/stream-browserify/index.js
	var require_stream_browserify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = Stream;
		var EE = require_events().EventEmitter;
		require_inherits_browser()(Stream, EE);
		Stream.Readable = require__stream_readable$1();
		Stream.Writable = require__stream_writable$1();
		Stream.Duplex = require__stream_duplex$1();
		Stream.Transform = require__stream_transform$1();
		Stream.PassThrough = require__stream_passthrough$1();
		Stream.finished = require_end_of_stream();
		Stream.pipeline = require_pipeline();
		Stream.Stream = Stream;
		function Stream() {
			EE.call(this);
		}
		Stream.prototype.pipe = function(dest, options) {
			var source = this;
			function ondata(chunk) {
				if (dest.writable) {
					if (false === dest.write(chunk) && source.pause) source.pause();
				}
			}
			source.on("data", ondata);
			function ondrain() {
				if (source.readable && source.resume) source.resume();
			}
			dest.on("drain", ondrain);
			if (!dest._isStdio && (!options || options.end !== false)) {
				source.on("end", onend);
				source.on("close", onclose);
			}
			var didOnEnd = false;
			function onend() {
				if (didOnEnd) return;
				didOnEnd = true;
				dest.end();
			}
			function onclose() {
				if (didOnEnd) return;
				didOnEnd = true;
				if (typeof dest.destroy === "function") dest.destroy();
			}
			function onerror(er) {
				cleanup();
				if (EE.listenerCount(this, "error") === 0) throw er;
			}
			source.on("error", onerror);
			dest.on("error", onerror);
			function cleanup() {
				source.removeListener("data", ondata);
				dest.removeListener("drain", ondrain);
				source.removeListener("end", onend);
				source.removeListener("close", onclose);
				source.removeListener("error", onerror);
				dest.removeListener("error", onerror);
				source.removeListener("end", cleanup);
				source.removeListener("close", cleanup);
				dest.removeListener("close", cleanup);
			}
			source.on("end", cleanup);
			source.on("close", cleanup);
			dest.on("close", cleanup);
			dest.emit("pipe", source);
			return dest;
		};
	}));
	//#endregion
	//#region ../../node_modules/cipher-base/index.js
	var require_cipher_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var Transform = require_stream_browserify().Transform;
		var StringDecoder = require_string_decoder$1().StringDecoder;
		var inherits = require_inherits_browser();
		var toBuffer = require_to_buffer$2();
		function CipherBase(hashMode) {
			Transform.call(this);
			this.hashMode = typeof hashMode === "string";
			if (this.hashMode) this[hashMode] = this._finalOrDigest;
			else this["final"] = this._finalOrDigest;
			if (this._final) {
				this.__final = this._final;
				this._final = null;
			}
			this._decoder = null;
			this._encoding = null;
		}
		inherits(CipherBase, Transform);
		CipherBase.prototype.update = function(data, inputEnc, outputEnc) {
			var bufferData = toBuffer(data, inputEnc);
			var outData = this._update(bufferData);
			if (this.hashMode) return this;
			if (outputEnc) outData = this._toString(outData, outputEnc);
			return outData;
		};
		CipherBase.prototype.setAutoPadding = function() {};
		CipherBase.prototype.getAuthTag = function() {
			throw new Error("trying to get auth tag in unsupported state");
		};
		CipherBase.prototype.setAuthTag = function() {
			throw new Error("trying to set auth tag in unsupported state");
		};
		CipherBase.prototype.setAAD = function() {
			throw new Error("trying to set aad in unsupported state");
		};
		CipherBase.prototype._transform = function(data, _, next) {
			var err;
			try {
				if (this.hashMode) this._update(data);
				else this.push(this._update(data));
			} catch (e) {
				err = e;
			} finally {
				next(err);
			}
		};
		CipherBase.prototype._flush = function(done) {
			var err;
			try {
				this.push(this.__final());
			} catch (e) {
				err = e;
			}
			done(err);
		};
		CipherBase.prototype._finalOrDigest = function(outputEnc) {
			var outData = this.__final() || Buffer.alloc(0);
			if (outputEnc) outData = this._toString(outData, outputEnc, true);
			return outData;
		};
		CipherBase.prototype._toString = function(value, enc, fin) {
			if (!this._decoder) {
				this._decoder = new StringDecoder(enc);
				this._encoding = enc;
			}
			if (this._encoding !== enc) throw new Error("can’t switch encodings");
			var out = this._decoder.write(value);
			if (fin) out += this._decoder.end();
			return out;
		};
		module.exports = CipherBase;
	}));
	//#endregion
	//#region ../../node_modules/create-hash/browser.js
	var require_browser$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var MD5 = require_md5_js();
		var RIPEMD160 = require_ripemd160();
		var sha = require_sha_js();
		var Base = require_cipher_base();
		function Hash(hash) {
			Base.call(this, "digest");
			this._hash = hash;
		}
		inherits(Hash, Base);
		Hash.prototype._update = function(data) {
			this._hash.update(data);
		};
		Hash.prototype._final = function() {
			return this._hash.digest();
		};
		module.exports = function createHash(alg) {
			alg = alg.toLowerCase();
			if (alg === "md5") return new MD5();
			if (alg === "rmd160" || alg === "ripemd160") return new RIPEMD160();
			return new Hash(sha(alg));
		};
	}));
	//#endregion
	//#region ../../node_modules/create-hmac/legacy.js
	var require_legacy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Buffer = require_safe_buffer$4().Buffer;
		var Base = require_cipher_base();
		var ZEROS = Buffer.alloc(128);
		var blocksize = 64;
		function Hmac(alg, key) {
			Base.call(this, "digest");
			if (typeof key === "string") key = Buffer.from(key);
			this._alg = alg;
			this._key = key;
			if (key.length > blocksize) key = alg(key);
			else if (key.length < blocksize) key = Buffer.concat([key, ZEROS], blocksize);
			var ipad = this._ipad = Buffer.allocUnsafe(blocksize);
			var opad = this._opad = Buffer.allocUnsafe(blocksize);
			for (var i = 0; i < blocksize; i++) {
				ipad[i] = key[i] ^ 54;
				opad[i] = key[i] ^ 92;
			}
			this._hash = [ipad];
		}
		inherits(Hmac, Base);
		Hmac.prototype._update = function(data) {
			this._hash.push(data);
		};
		Hmac.prototype._final = function() {
			var h = this._alg(Buffer.concat(this._hash));
			return this._alg(Buffer.concat([this._opad, h]));
		};
		module.exports = Hmac;
	}));
	//#endregion
	//#region ../../node_modules/create-hash/md5.js
	var require_md5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var MD5 = require_md5_js();
		module.exports = function(buffer) {
			return new MD5().update(buffer).digest();
		};
	}));
	//#endregion
	//#region ../../node_modules/create-hmac/browser.js
	var require_browser$8 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Legacy = require_legacy();
		var Base = require_cipher_base();
		var Buffer = require_safe_buffer$4().Buffer;
		var md5 = require_md5();
		var RIPEMD160 = require_ripemd160();
		var sha = require_sha_js();
		var ZEROS = Buffer.alloc(128);
		function Hmac(alg, key) {
			Base.call(this, "digest");
			if (typeof key === "string") key = Buffer.from(key);
			var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
			this._alg = alg;
			this._key = key;
			if (key.length > blocksize) key = (alg === "rmd160" ? new RIPEMD160() : sha(alg)).update(key).digest();
			else if (key.length < blocksize) key = Buffer.concat([key, ZEROS], blocksize);
			var ipad = this._ipad = Buffer.allocUnsafe(blocksize);
			var opad = this._opad = Buffer.allocUnsafe(blocksize);
			for (var i = 0; i < blocksize; i++) {
				ipad[i] = key[i] ^ 54;
				opad[i] = key[i] ^ 92;
			}
			this._hash = alg === "rmd160" ? new RIPEMD160() : sha(alg);
			this._hash.update(ipad);
		}
		inherits(Hmac, Base);
		Hmac.prototype._update = function(data) {
			this._hash.update(data);
		};
		Hmac.prototype._final = function() {
			var h = this._hash.digest();
			return (this._alg === "rmd160" ? new RIPEMD160() : sha(this._alg)).update(this._opad).update(h).digest();
		};
		module.exports = function createHmac(alg, key) {
			alg = alg.toLowerCase();
			if (alg === "rmd160" || alg === "ripemd160") return new Hmac("rmd160", key);
			if (alg === "md5") return new Legacy(md5, key);
			return new Hmac(alg, key);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/browser/algorithms.json
	var algorithms_exports = /* @__PURE__ */ __exportAll({
		DSA: () => DSA,
		default: () => algorithms_default,
		md5WithRSAEncryption: () => md5WithRSAEncryption,
		ripemd160WithRSA: () => ripemd160WithRSA,
		sha224: () => sha224,
		sha224WithRSAEncryption: () => sha224WithRSAEncryption,
		sha256: () => sha256,
		sha256WithRSAEncryption: () => sha256WithRSAEncryption,
		sha384: () => sha384,
		sha384WithRSAEncryption: () => sha384WithRSAEncryption,
		sha512: () => sha512,
		sha512WithRSAEncryption: () => sha512WithRSAEncryption
	});
	var sha224WithRSAEncryption, sha256WithRSAEncryption, sha384WithRSAEncryption, sha512WithRSAEncryption, sha256, sha224, sha384, sha512, DSA, ripemd160WithRSA, md5WithRSAEncryption, algorithms_default;
	var init_algorithms = __esmMin((() => {
		sha224WithRSAEncryption = {
			"sign": "rsa",
			"hash": "sha224",
			"id": "302d300d06096086480165030402040500041c"
		};
		sha256WithRSAEncryption = {
			"sign": "rsa",
			"hash": "sha256",
			"id": "3031300d060960864801650304020105000420"
		};
		sha384WithRSAEncryption = {
			"sign": "rsa",
			"hash": "sha384",
			"id": "3041300d060960864801650304020205000430"
		};
		sha512WithRSAEncryption = {
			"sign": "rsa",
			"hash": "sha512",
			"id": "3051300d060960864801650304020305000440"
		};
		sha256 = {
			"sign": "ecdsa",
			"hash": "sha256",
			"id": ""
		};
		sha224 = {
			"sign": "ecdsa",
			"hash": "sha224",
			"id": ""
		};
		sha384 = {
			"sign": "ecdsa",
			"hash": "sha384",
			"id": ""
		};
		sha512 = {
			"sign": "ecdsa",
			"hash": "sha512",
			"id": ""
		};
		DSA = {
			"sign": "dsa",
			"hash": "sha1",
			"id": ""
		};
		ripemd160WithRSA = {
			"sign": "rsa",
			"hash": "rmd160",
			"id": "3021300906052b2403020105000414"
		};
		md5WithRSAEncryption = {
			"sign": "rsa",
			"hash": "md5",
			"id": "3020300c06082a864886f70d020505000410"
		};
		algorithms_default = {
			sha224WithRSAEncryption,
			"RSA-SHA224": {
				"sign": "ecdsa/rsa",
				"hash": "sha224",
				"id": "302d300d06096086480165030402040500041c"
			},
			sha256WithRSAEncryption,
			"RSA-SHA256": {
				"sign": "ecdsa/rsa",
				"hash": "sha256",
				"id": "3031300d060960864801650304020105000420"
			},
			sha384WithRSAEncryption,
			"RSA-SHA384": {
				"sign": "ecdsa/rsa",
				"hash": "sha384",
				"id": "3041300d060960864801650304020205000430"
			},
			sha512WithRSAEncryption,
			"RSA-SHA512": {
				"sign": "ecdsa/rsa",
				"hash": "sha512",
				"id": "3051300d060960864801650304020305000440"
			},
			"RSA-SHA1": {
				"sign": "rsa",
				"hash": "sha1",
				"id": "3021300906052b0e03021a05000414"
			},
			"ecdsa-with-SHA1": {
				"sign": "ecdsa",
				"hash": "sha1",
				"id": ""
			},
			sha256,
			sha224,
			sha384,
			sha512,
			"DSA-SHA": {
				"sign": "dsa",
				"hash": "sha1",
				"id": ""
			},
			"DSA-SHA1": {
				"sign": "dsa",
				"hash": "sha1",
				"id": ""
			},
			DSA,
			"DSA-WITH-SHA224": {
				"sign": "dsa",
				"hash": "sha224",
				"id": ""
			},
			"DSA-SHA224": {
				"sign": "dsa",
				"hash": "sha224",
				"id": ""
			},
			"DSA-WITH-SHA256": {
				"sign": "dsa",
				"hash": "sha256",
				"id": ""
			},
			"DSA-SHA256": {
				"sign": "dsa",
				"hash": "sha256",
				"id": ""
			},
			"DSA-WITH-SHA384": {
				"sign": "dsa",
				"hash": "sha384",
				"id": ""
			},
			"DSA-SHA384": {
				"sign": "dsa",
				"hash": "sha384",
				"id": ""
			},
			"DSA-WITH-SHA512": {
				"sign": "dsa",
				"hash": "sha512",
				"id": ""
			},
			"DSA-SHA512": {
				"sign": "dsa",
				"hash": "sha512",
				"id": ""
			},
			"DSA-RIPEMD160": {
				"sign": "dsa",
				"hash": "rmd160",
				"id": ""
			},
			ripemd160WithRSA,
			"RSA-RIPEMD160": {
				"sign": "rsa",
				"hash": "rmd160",
				"id": "3021300906052b2403020105000414"
			},
			md5WithRSAEncryption,
			"RSA-MD5": {
				"sign": "rsa",
				"hash": "md5",
				"id": "3020300c06082a864886f70d020505000410"
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/algos.js
	var require_algos = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = (init_algorithms(), __toCommonJS(algorithms_exports).default);
	}));
	//#endregion
	//#region ../../node_modules/pbkdf2/lib/precondition.js
	var require_precondition = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var $isFinite = isFinite;
		var MAX_ALLOC = Math.pow(2, 30) - 1;
		module.exports = function(iterations, keylen) {
			if (typeof iterations !== "number") throw new TypeError("Iterations not a number");
			if (iterations < 0 || !$isFinite(iterations)) throw new TypeError("Bad iterations");
			if (typeof keylen !== "number") throw new TypeError("Key length not a number");
			if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) throw new TypeError("Bad key length");
		};
	}));
	//#endregion
	//#region ../../node_modules/pbkdf2/lib/default-encoding.js
	var require_default_encoding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		var defaultEncoding;
		/* istanbul ignore next */
		if (global.process && global.process.browser) defaultEncoding = "utf-8";
		else if (global.process && global.process.version) defaultEncoding = parseInt(process$1.version.split(".")[0].slice(1), 10) >= 6 ? "utf-8" : "binary";
		else defaultEncoding = "utf-8";
		module.exports = defaultEncoding;
	}));
	//#endregion
	//#region ../../node_modules/pbkdf2/lib/to-buffer.js
	var require_to_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var toBuffer = require_to_buffer$2();
		var useUint8Array = typeof Uint8Array !== "undefined";
		var isView = useUint8Array && typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView;
		module.exports = function(thing, encoding, name) {
			if (typeof thing === "string" || Buffer.isBuffer(thing) || useUint8Array && thing instanceof Uint8Array || isView && isView(thing)) return toBuffer(thing, encoding);
			throw new TypeError(name + " must be a string, a Buffer, a Uint8Array, or a DataView");
		};
	}));
	//#endregion
	//#region ../../node_modules/pbkdf2/lib/sync-browser.js
	var require_sync_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var md5 = require_md5();
		var RIPEMD160 = require_ripemd160();
		var sha = require_sha_js();
		var Buffer = require_safe_buffer$4().Buffer;
		var checkParameters = require_precondition();
		var defaultEncoding = require_default_encoding();
		var toBuffer = require_to_buffer();
		var ZEROS = Buffer.alloc(128);
		var sizes = {
			__proto__: null,
			md5: 16,
			sha1: 20,
			sha224: 28,
			sha256: 32,
			sha384: 48,
			sha512: 64,
			"sha512-256": 32,
			ripemd160: 20,
			rmd160: 20
		};
		var mapping = {
			__proto__: null,
			"sha-1": "sha1",
			"sha-224": "sha224",
			"sha-256": "sha256",
			"sha-384": "sha384",
			"sha-512": "sha512",
			"ripemd-160": "ripemd160"
		};
		function rmd160Func(data) {
			return new RIPEMD160().update(data).digest();
		}
		function getDigest(alg) {
			function shaFunc(data) {
				return sha(alg).update(data).digest();
			}
			if (alg === "rmd160" || alg === "ripemd160") return rmd160Func;
			if (alg === "md5") return md5;
			return shaFunc;
		}
		function Hmac(alg, key, saltLen) {
			var hash = getDigest(alg);
			var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
			if (key.length > blocksize) key = hash(key);
			else if (key.length < blocksize) key = Buffer.concat([key, ZEROS], blocksize);
			var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]);
			var opad = Buffer.allocUnsafe(blocksize + sizes[alg]);
			for (var i = 0; i < blocksize; i++) {
				ipad[i] = key[i] ^ 54;
				opad[i] = key[i] ^ 92;
			}
			var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4);
			ipad.copy(ipad1, 0, 0, blocksize);
			this.ipad1 = ipad1;
			this.ipad2 = ipad;
			this.opad = opad;
			this.alg = alg;
			this.blocksize = blocksize;
			this.hash = hash;
			this.size = sizes[alg];
		}
		Hmac.prototype.run = function(data, ipad) {
			data.copy(ipad, this.blocksize);
			this.hash(ipad).copy(this.opad, this.blocksize);
			return this.hash(this.opad);
		};
		function pbkdf2(password, salt, iterations, keylen, digest) {
			checkParameters(iterations, keylen);
			password = toBuffer(password, defaultEncoding, "Password");
			salt = toBuffer(salt, defaultEncoding, "Salt");
			var lowerDigest = (digest || "sha1").toLowerCase();
			var mappedDigest = mapping[lowerDigest] || lowerDigest;
			var size = sizes[mappedDigest];
			if (typeof size !== "number" || !size) throw new TypeError("Digest algorithm not supported: " + digest);
			var hmac = new Hmac(mappedDigest, password, salt.length);
			var DK = Buffer.allocUnsafe(keylen);
			var block1 = Buffer.allocUnsafe(salt.length + 4);
			salt.copy(block1, 0, 0, salt.length);
			var destPos = 0;
			var hLen = size;
			var l = Math.ceil(keylen / hLen);
			for (var i = 1; i <= l; i++) {
				block1.writeUInt32BE(i, salt.length);
				var T = hmac.run(block1, hmac.ipad1);
				var U = T;
				for (var j = 1; j < iterations; j++) {
					U = hmac.run(U, hmac.ipad2);
					for (var k = 0; k < hLen; k++) T[k] ^= U[k];
				}
				T.copy(DK, destPos);
				destPos += hLen;
			}
			return DK;
		}
		module.exports = pbkdf2;
	}));
	//#endregion
	//#region ../../node_modules/pbkdf2/lib/async.js
	var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		var Buffer = require_safe_buffer$4().Buffer;
		var checkParameters = require_precondition();
		var defaultEncoding = require_default_encoding();
		var sync = require_sync_browser();
		var toBuffer = require_to_buffer();
		var ZERO_BUF;
		var subtle = global.crypto && global.crypto.subtle;
		var toBrowser = {
			sha: "SHA-1",
			"sha-1": "SHA-1",
			sha1: "SHA-1",
			sha256: "SHA-256",
			"sha-256": "SHA-256",
			sha384: "SHA-384",
			"sha-384": "SHA-384",
			"sha-512": "SHA-512",
			sha512: "SHA-512"
		};
		var checks = [];
		var nextTick;
		function getNextTick() {
			if (nextTick) return nextTick;
			if (global.process && global.process.nextTick) nextTick = global.process.nextTick;
			else if (global.queueMicrotask) nextTick = global.queueMicrotask;
			else if (global.setImmediate) nextTick = global.setImmediate;
			else nextTick = global.setTimeout;
			return nextTick;
		}
		function browserPbkdf2(password, salt, iterations, length, algo) {
			return subtle.importKey("raw", password, { name: "PBKDF2" }, false, ["deriveBits"]).then(function(key) {
				return subtle.deriveBits({
					name: "PBKDF2",
					salt,
					iterations,
					hash: { name: algo }
				}, key, length << 3);
			}).then(function(res) {
				return Buffer.from(res);
			});
		}
		function checkNative(algo) {
			if (global.process && !global.process.browser) return Promise.resolve(false);
			if (!subtle || !subtle.importKey || !subtle.deriveBits) return Promise.resolve(false);
			if (checks[algo] !== void 0) return checks[algo];
			ZERO_BUF = ZERO_BUF || Buffer.alloc(8);
			var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then(function() {
				return true;
			}, function() {
				return false;
			});
			checks[algo] = prom;
			return prom;
		}
		function resolvePromise(promise, callback) {
			promise.then(function(out) {
				getNextTick()(function() {
					callback(null, out);
				});
			}, function(e) {
				getNextTick()(function() {
					callback(e);
				});
			});
		}
		module.exports = function(password, salt, iterations, keylen, digest, callback) {
			if (typeof digest === "function") {
				callback = digest;
				digest = void 0;
			}
			checkParameters(iterations, keylen);
			password = toBuffer(password, defaultEncoding, "Password");
			salt = toBuffer(salt, defaultEncoding, "Salt");
			if (typeof callback !== "function") throw new Error("No callback provided to pbkdf2");
			digest = digest || "sha1";
			var algo = toBrowser[digest.toLowerCase()];
			if (!algo || typeof global.Promise !== "function") {
				getNextTick()(function() {
					var out;
					try {
						out = sync(password, salt, iterations, keylen, digest);
					} catch (e) {
						callback(e);
						return;
					}
					callback(null, out);
				});
				return;
			}
			resolvePromise(checkNative(algo).then(function(resp) {
				if (resp) return browserPbkdf2(password, salt, iterations, keylen, algo);
				return sync(password, salt, iterations, keylen, digest);
			}), callback);
		};
	}));
	//#endregion
	//#region ../../node_modules/pbkdf2/browser.js
	var require_browser$7 = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.pbkdf2 = require_async();
		exports.pbkdf2Sync = require_sync_browser();
	}));
	//#endregion
	//#region ../../node_modules/des.js/lib/des/utils.js
	var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.readUInt32BE = function readUInt32BE(bytes, off) {
			return (bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off]) >>> 0;
		};
		exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
			bytes[0 + off] = value >>> 24;
			bytes[1 + off] = value >>> 16 & 255;
			bytes[2 + off] = value >>> 8 & 255;
			bytes[3 + off] = value & 255;
		};
		exports.ip = function ip(inL, inR, out, off) {
			var outL = 0;
			var outR = 0;
			for (var i = 6; i >= 0; i -= 2) {
				for (var j = 0; j <= 24; j += 8) {
					outL <<= 1;
					outL |= inR >>> j + i & 1;
				}
				for (var j = 0; j <= 24; j += 8) {
					outL <<= 1;
					outL |= inL >>> j + i & 1;
				}
			}
			for (var i = 6; i >= 0; i -= 2) {
				for (var j = 1; j <= 25; j += 8) {
					outR <<= 1;
					outR |= inR >>> j + i & 1;
				}
				for (var j = 1; j <= 25; j += 8) {
					outR <<= 1;
					outR |= inL >>> j + i & 1;
				}
			}
			out[off + 0] = outL >>> 0;
			out[off + 1] = outR >>> 0;
		};
		exports.rip = function rip(inL, inR, out, off) {
			var outL = 0;
			var outR = 0;
			for (var i = 0; i < 4; i++) for (var j = 24; j >= 0; j -= 8) {
				outL <<= 1;
				outL |= inR >>> j + i & 1;
				outL <<= 1;
				outL |= inL >>> j + i & 1;
			}
			for (var i = 4; i < 8; i++) for (var j = 24; j >= 0; j -= 8) {
				outR <<= 1;
				outR |= inR >>> j + i & 1;
				outR <<= 1;
				outR |= inL >>> j + i & 1;
			}
			out[off + 0] = outL >>> 0;
			out[off + 1] = outR >>> 0;
		};
		exports.pc1 = function pc1(inL, inR, out, off) {
			var outL = 0;
			var outR = 0;
			for (var i = 7; i >= 5; i--) {
				for (var j = 0; j <= 24; j += 8) {
					outL <<= 1;
					outL |= inR >> j + i & 1;
				}
				for (var j = 0; j <= 24; j += 8) {
					outL <<= 1;
					outL |= inL >> j + i & 1;
				}
			}
			for (var j = 0; j <= 24; j += 8) {
				outL <<= 1;
				outL |= inR >> j + i & 1;
			}
			for (var i = 1; i <= 3; i++) {
				for (var j = 0; j <= 24; j += 8) {
					outR <<= 1;
					outR |= inR >> j + i & 1;
				}
				for (var j = 0; j <= 24; j += 8) {
					outR <<= 1;
					outR |= inL >> j + i & 1;
				}
			}
			for (var j = 0; j <= 24; j += 8) {
				outR <<= 1;
				outR |= inL >> j + i & 1;
			}
			out[off + 0] = outL >>> 0;
			out[off + 1] = outR >>> 0;
		};
		exports.r28shl = function r28shl(num, shift) {
			return num << shift & 268435455 | num >>> 28 - shift;
		};
		var pc2table = [
			14,
			11,
			17,
			4,
			27,
			23,
			25,
			0,
			13,
			22,
			7,
			18,
			5,
			9,
			16,
			24,
			2,
			20,
			12,
			21,
			1,
			8,
			15,
			26,
			15,
			4,
			25,
			19,
			9,
			1,
			26,
			16,
			5,
			11,
			23,
			8,
			12,
			7,
			17,
			0,
			22,
			3,
			10,
			14,
			6,
			20,
			27,
			24
		];
		exports.pc2 = function pc2(inL, inR, out, off) {
			var outL = 0;
			var outR = 0;
			var len = pc2table.length >>> 1;
			for (var i = 0; i < len; i++) {
				outL <<= 1;
				outL |= inL >>> pc2table[i] & 1;
			}
			for (var i = len; i < pc2table.length; i++) {
				outR <<= 1;
				outR |= inR >>> pc2table[i] & 1;
			}
			out[off + 0] = outL >>> 0;
			out[off + 1] = outR >>> 0;
		};
		exports.expand = function expand(r, out, off) {
			var outL = 0;
			var outR = 0;
			outL = (r & 1) << 5 | r >>> 27;
			for (var i = 23; i >= 15; i -= 4) {
				outL <<= 6;
				outL |= r >>> i & 63;
			}
			for (var i = 11; i >= 3; i -= 4) {
				outR |= r >>> i & 63;
				outR <<= 6;
			}
			outR |= (r & 31) << 1 | r >>> 31;
			out[off + 0] = outL >>> 0;
			out[off + 1] = outR >>> 0;
		};
		var sTable = [
			14,
			0,
			4,
			15,
			13,
			7,
			1,
			4,
			2,
			14,
			15,
			2,
			11,
			13,
			8,
			1,
			3,
			10,
			10,
			6,
			6,
			12,
			12,
			11,
			5,
			9,
			9,
			5,
			0,
			3,
			7,
			8,
			4,
			15,
			1,
			12,
			14,
			8,
			8,
			2,
			13,
			4,
			6,
			9,
			2,
			1,
			11,
			7,
			15,
			5,
			12,
			11,
			9,
			3,
			7,
			14,
			3,
			10,
			10,
			0,
			5,
			6,
			0,
			13,
			15,
			3,
			1,
			13,
			8,
			4,
			14,
			7,
			6,
			15,
			11,
			2,
			3,
			8,
			4,
			14,
			9,
			12,
			7,
			0,
			2,
			1,
			13,
			10,
			12,
			6,
			0,
			9,
			5,
			11,
			10,
			5,
			0,
			13,
			14,
			8,
			7,
			10,
			11,
			1,
			10,
			3,
			4,
			15,
			13,
			4,
			1,
			2,
			5,
			11,
			8,
			6,
			12,
			7,
			6,
			12,
			9,
			0,
			3,
			5,
			2,
			14,
			15,
			9,
			10,
			13,
			0,
			7,
			9,
			0,
			14,
			9,
			6,
			3,
			3,
			4,
			15,
			6,
			5,
			10,
			1,
			2,
			13,
			8,
			12,
			5,
			7,
			14,
			11,
			12,
			4,
			11,
			2,
			15,
			8,
			1,
			13,
			1,
			6,
			10,
			4,
			13,
			9,
			0,
			8,
			6,
			15,
			9,
			3,
			8,
			0,
			7,
			11,
			4,
			1,
			15,
			2,
			14,
			12,
			3,
			5,
			11,
			10,
			5,
			14,
			2,
			7,
			12,
			7,
			13,
			13,
			8,
			14,
			11,
			3,
			5,
			0,
			6,
			6,
			15,
			9,
			0,
			10,
			3,
			1,
			4,
			2,
			7,
			8,
			2,
			5,
			12,
			11,
			1,
			12,
			10,
			4,
			14,
			15,
			9,
			10,
			3,
			6,
			15,
			9,
			0,
			0,
			6,
			12,
			10,
			11,
			1,
			7,
			13,
			13,
			8,
			15,
			9,
			1,
			4,
			3,
			5,
			14,
			11,
			5,
			12,
			2,
			7,
			8,
			2,
			4,
			14,
			2,
			14,
			12,
			11,
			4,
			2,
			1,
			12,
			7,
			4,
			10,
			7,
			11,
			13,
			6,
			1,
			8,
			5,
			5,
			0,
			3,
			15,
			15,
			10,
			13,
			3,
			0,
			9,
			14,
			8,
			9,
			6,
			4,
			11,
			2,
			8,
			1,
			12,
			11,
			7,
			10,
			1,
			13,
			14,
			7,
			2,
			8,
			13,
			15,
			6,
			9,
			15,
			12,
			0,
			5,
			9,
			6,
			10,
			3,
			4,
			0,
			5,
			14,
			3,
			12,
			10,
			1,
			15,
			10,
			4,
			15,
			2,
			9,
			7,
			2,
			12,
			6,
			9,
			8,
			5,
			0,
			6,
			13,
			1,
			3,
			13,
			4,
			14,
			14,
			0,
			7,
			11,
			5,
			3,
			11,
			8,
			9,
			4,
			14,
			3,
			15,
			2,
			5,
			12,
			2,
			9,
			8,
			5,
			12,
			15,
			3,
			10,
			7,
			11,
			0,
			14,
			4,
			1,
			10,
			7,
			1,
			6,
			13,
			0,
			11,
			8,
			6,
			13,
			4,
			13,
			11,
			0,
			2,
			11,
			14,
			7,
			15,
			4,
			0,
			9,
			8,
			1,
			13,
			10,
			3,
			14,
			12,
			3,
			9,
			5,
			7,
			12,
			5,
			2,
			10,
			15,
			6,
			8,
			1,
			6,
			1,
			6,
			4,
			11,
			11,
			13,
			13,
			8,
			12,
			1,
			3,
			4,
			7,
			10,
			14,
			7,
			10,
			9,
			15,
			5,
			6,
			0,
			8,
			15,
			0,
			14,
			5,
			2,
			9,
			3,
			2,
			12,
			13,
			1,
			2,
			15,
			8,
			13,
			4,
			8,
			6,
			10,
			15,
			3,
			11,
			7,
			1,
			4,
			10,
			12,
			9,
			5,
			3,
			6,
			14,
			11,
			5,
			0,
			0,
			14,
			12,
			9,
			7,
			2,
			7,
			2,
			11,
			1,
			4,
			14,
			1,
			7,
			9,
			4,
			12,
			10,
			14,
			8,
			2,
			13,
			0,
			15,
			6,
			12,
			10,
			9,
			13,
			0,
			15,
			3,
			3,
			5,
			5,
			6,
			8,
			11
		];
		exports.substitute = function substitute(inL, inR) {
			var out = 0;
			for (var i = 0; i < 4; i++) {
				var b = inL >>> 18 - i * 6 & 63;
				var sb = sTable[i * 64 + b];
				out <<= 4;
				out |= sb;
			}
			for (var i = 0; i < 4; i++) {
				var b = inR >>> 18 - i * 6 & 63;
				var sb = sTable[256 + i * 64 + b];
				out <<= 4;
				out |= sb;
			}
			return out >>> 0;
		};
		var permuteTable = [
			16,
			25,
			12,
			11,
			3,
			20,
			4,
			15,
			31,
			17,
			9,
			6,
			27,
			14,
			1,
			22,
			30,
			24,
			8,
			18,
			0,
			5,
			29,
			23,
			13,
			19,
			2,
			26,
			10,
			21,
			28,
			7
		];
		exports.permute = function permute(num) {
			var out = 0;
			for (var i = 0; i < permuteTable.length; i++) {
				out <<= 1;
				out |= num >>> permuteTable[i] & 1;
			}
			return out >>> 0;
		};
		exports.padSplit = function padSplit(num, size, group) {
			var str = num.toString(2);
			while (str.length < size) str = "0" + str;
			var out = [];
			for (var i = 0; i < size; i += group) out.push(str.slice(i, i + group));
			return out.join(" ");
		};
	}));
	//#endregion
	//#region ../../node_modules/minimalistic-assert/index.js
	var require_minimalistic_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = assert;
		function assert(val, msg) {
			if (!val) throw new Error(msg || "Assertion failed");
		}
		assert.equal = function assertEqual(l, r, msg) {
			if (l != r) throw new Error(msg || "Assertion failed: " + l + " != " + r);
		};
	}));
	//#endregion
	//#region ../../node_modules/des.js/lib/des/cipher.js
	var require_cipher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assert = require_minimalistic_assert();
		function Cipher(options) {
			this.options = options;
			this.type = this.options.type;
			this.blockSize = 8;
			this._init();
			this.buffer = new Array(this.blockSize);
			this.bufferOff = 0;
			this.padding = options.padding !== false;
		}
		module.exports = Cipher;
		Cipher.prototype._init = function _init() {};
		Cipher.prototype.update = function update(data) {
			if (data.length === 0) return [];
			if (this.type === "decrypt") return this._updateDecrypt(data);
			else return this._updateEncrypt(data);
		};
		Cipher.prototype._buffer = function _buffer(data, off) {
			var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
			for (var i = 0; i < min; i++) this.buffer[this.bufferOff + i] = data[off + i];
			this.bufferOff += min;
			return min;
		};
		Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
			this._update(this.buffer, 0, out, off);
			this.bufferOff = 0;
			return this.blockSize;
		};
		Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
			var inputOff = 0;
			var outputOff = 0;
			var count = (this.bufferOff + data.length) / this.blockSize | 0;
			var out = new Array(count * this.blockSize);
			if (this.bufferOff !== 0) {
				inputOff += this._buffer(data, inputOff);
				if (this.bufferOff === this.buffer.length) outputOff += this._flushBuffer(out, outputOff);
			}
			var max = data.length - (data.length - inputOff) % this.blockSize;
			for (; inputOff < max; inputOff += this.blockSize) {
				this._update(data, inputOff, out, outputOff);
				outputOff += this.blockSize;
			}
			for (; inputOff < data.length; inputOff++, this.bufferOff++) this.buffer[this.bufferOff] = data[inputOff];
			return out;
		};
		Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
			var inputOff = 0;
			var outputOff = 0;
			var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
			var out = new Array(count * this.blockSize);
			for (; count > 0; count--) {
				inputOff += this._buffer(data, inputOff);
				outputOff += this._flushBuffer(out, outputOff);
			}
			inputOff += this._buffer(data, inputOff);
			return out;
		};
		Cipher.prototype.final = function final(buffer) {
			var first;
			if (buffer) first = this.update(buffer);
			var last;
			if (this.type === "encrypt") last = this._finalEncrypt();
			else last = this._finalDecrypt();
			if (first) return first.concat(last);
			else return last;
		};
		Cipher.prototype._pad = function _pad(buffer, off) {
			if (off === 0) return false;
			while (off < buffer.length) buffer[off++] = 0;
			return true;
		};
		Cipher.prototype._finalEncrypt = function _finalEncrypt() {
			if (!this._pad(this.buffer, this.bufferOff)) return [];
			var out = new Array(this.blockSize);
			this._update(this.buffer, 0, out, 0);
			return out;
		};
		Cipher.prototype._unpad = function _unpad(buffer) {
			return buffer;
		};
		Cipher.prototype._finalDecrypt = function _finalDecrypt() {
			assert.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt");
			var out = new Array(this.blockSize);
			this._flushBuffer(out, 0);
			return this._unpad(out);
		};
	}));
	//#endregion
	//#region ../../node_modules/des.js/lib/des/des.js
	var require_des$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assert = require_minimalistic_assert();
		var inherits = require_inherits_browser();
		var utils = require_utils$5();
		var Cipher = require_cipher();
		function DESState() {
			this.tmp = new Array(2);
			this.keys = null;
		}
		function DES(options) {
			Cipher.call(this, options);
			var state = new DESState();
			this._desState = state;
			this.deriveKeys(state, options.key);
		}
		inherits(DES, Cipher);
		module.exports = DES;
		DES.create = function create(options) {
			return new DES(options);
		};
		var shiftTable = [
			1,
			1,
			2,
			2,
			2,
			2,
			2,
			2,
			1,
			2,
			2,
			2,
			2,
			2,
			2,
			1
		];
		DES.prototype.deriveKeys = function deriveKeys(state, key) {
			state.keys = new Array(32);
			assert.equal(key.length, this.blockSize, "Invalid key length");
			var kL = utils.readUInt32BE(key, 0);
			var kR = utils.readUInt32BE(key, 4);
			utils.pc1(kL, kR, state.tmp, 0);
			kL = state.tmp[0];
			kR = state.tmp[1];
			for (var i = 0; i < state.keys.length; i += 2) {
				var shift = shiftTable[i >>> 1];
				kL = utils.r28shl(kL, shift);
				kR = utils.r28shl(kR, shift);
				utils.pc2(kL, kR, state.keys, i);
			}
		};
		DES.prototype._update = function _update(inp, inOff, out, outOff) {
			var state = this._desState;
			var l = utils.readUInt32BE(inp, inOff);
			var r = utils.readUInt32BE(inp, inOff + 4);
			utils.ip(l, r, state.tmp, 0);
			l = state.tmp[0];
			r = state.tmp[1];
			if (this.type === "encrypt") this._encrypt(state, l, r, state.tmp, 0);
			else this._decrypt(state, l, r, state.tmp, 0);
			l = state.tmp[0];
			r = state.tmp[1];
			utils.writeUInt32BE(out, l, outOff);
			utils.writeUInt32BE(out, r, outOff + 4);
		};
		DES.prototype._pad = function _pad(buffer, off) {
			if (this.padding === false) return false;
			var value = buffer.length - off;
			for (var i = off; i < buffer.length; i++) buffer[i] = value;
			return true;
		};
		DES.prototype._unpad = function _unpad(buffer) {
			if (this.padding === false) return buffer;
			var pad = buffer[buffer.length - 1];
			for (var i = buffer.length - pad; i < buffer.length; i++) assert.equal(buffer[i], pad);
			return buffer.slice(0, buffer.length - pad);
		};
		DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
			var l = lStart;
			var r = rStart;
			for (var i = 0; i < state.keys.length; i += 2) {
				var keyL = state.keys[i];
				var keyR = state.keys[i + 1];
				utils.expand(r, state.tmp, 0);
				keyL ^= state.tmp[0];
				keyR ^= state.tmp[1];
				var s = utils.substitute(keyL, keyR);
				var f = utils.permute(s);
				var t = r;
				r = (l ^ f) >>> 0;
				l = t;
			}
			utils.rip(r, l, out, off);
		};
		DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
			var l = rStart;
			var r = lStart;
			for (var i = state.keys.length - 2; i >= 0; i -= 2) {
				var keyL = state.keys[i];
				var keyR = state.keys[i + 1];
				utils.expand(l, state.tmp, 0);
				keyL ^= state.tmp[0];
				keyR ^= state.tmp[1];
				var s = utils.substitute(keyL, keyR);
				var f = utils.permute(s);
				var t = l;
				l = (r ^ f) >>> 0;
				r = t;
			}
			utils.rip(l, r, out, off);
		};
	}));
	//#endregion
	//#region ../../node_modules/des.js/lib/des/cbc.js
	var require_cbc$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var assert = require_minimalistic_assert();
		var inherits = require_inherits_browser();
		var proto = {};
		function CBCState(iv) {
			assert.equal(iv.length, 8, "Invalid IV length");
			this.iv = new Array(8);
			for (var i = 0; i < this.iv.length; i++) this.iv[i] = iv[i];
		}
		function instantiate(Base) {
			function CBC(options) {
				Base.call(this, options);
				this._cbcInit();
			}
			inherits(CBC, Base);
			var keys = Object.keys(proto);
			for (var i = 0; i < keys.length; i++) {
				var key = keys[i];
				CBC.prototype[key] = proto[key];
			}
			CBC.create = function create(options) {
				return new CBC(options);
			};
			return CBC;
		}
		exports.instantiate = instantiate;
		proto._cbcInit = function _cbcInit() {
			this._cbcState = new CBCState(this.options.iv);
		};
		proto._update = function _update(inp, inOff, out, outOff) {
			var state = this._cbcState;
			var superProto = this.constructor.super_.prototype;
			var iv = state.iv;
			if (this.type === "encrypt") {
				for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i];
				superProto._update.call(this, iv, 0, out, outOff);
				for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i];
			} else {
				superProto._update.call(this, inp, inOff, out, outOff);
				for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i];
				for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i];
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/des.js/lib/des/ede.js
	var require_ede = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assert = require_minimalistic_assert();
		var inherits = require_inherits_browser();
		var Cipher = require_cipher();
		var DES = require_des$1();
		function EDEState(type, key) {
			assert.equal(key.length, 24, "Invalid key length");
			var k1 = key.slice(0, 8);
			var k2 = key.slice(8, 16);
			var k3 = key.slice(16, 24);
			if (type === "encrypt") this.ciphers = [
				DES.create({
					type: "encrypt",
					key: k1
				}),
				DES.create({
					type: "decrypt",
					key: k2
				}),
				DES.create({
					type: "encrypt",
					key: k3
				})
			];
			else this.ciphers = [
				DES.create({
					type: "decrypt",
					key: k3
				}),
				DES.create({
					type: "encrypt",
					key: k2
				}),
				DES.create({
					type: "decrypt",
					key: k1
				})
			];
		}
		function EDE(options) {
			Cipher.call(this, options);
			this._edeState = new EDEState(this.type, this.options.key);
		}
		inherits(EDE, Cipher);
		module.exports = EDE;
		EDE.create = function create(options) {
			return new EDE(options);
		};
		EDE.prototype._update = function _update(inp, inOff, out, outOff) {
			var state = this._edeState;
			state.ciphers[0]._update(inp, inOff, out, outOff);
			state.ciphers[1]._update(out, outOff, out, outOff);
			state.ciphers[2]._update(out, outOff, out, outOff);
		};
		EDE.prototype._pad = DES.prototype._pad;
		EDE.prototype._unpad = DES.prototype._unpad;
	}));
	//#endregion
	//#region ../../node_modules/des.js/lib/des.js
	var require_des = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.utils = require_utils$5();
		exports.Cipher = require_cipher();
		exports.DES = require_des$1();
		exports.CBC = require_cbc$1();
		exports.EDE = require_ede();
	}));
	//#endregion
	//#region ../../node_modules/browserify-des/index.js
	var require_browserify_des = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var CipherBase = require_cipher_base();
		var des = require_des();
		var inherits = require_inherits_browser();
		var Buffer = require_safe_buffer$4().Buffer;
		var modes = {
			"des-ede3-cbc": des.CBC.instantiate(des.EDE),
			"des-ede3": des.EDE,
			"des-ede-cbc": des.CBC.instantiate(des.EDE),
			"des-ede": des.EDE,
			"des-cbc": des.CBC.instantiate(des.DES),
			"des-ecb": des.DES
		};
		modes.des = modes["des-cbc"];
		modes.des3 = modes["des-ede3-cbc"];
		module.exports = DES;
		inherits(DES, CipherBase);
		function DES(opts) {
			CipherBase.call(this);
			var modeName = opts.mode.toLowerCase();
			var mode = modes[modeName];
			var type;
			if (opts.decrypt) type = "decrypt";
			else type = "encrypt";
			var key = opts.key;
			if (!Buffer.isBuffer(key)) key = Buffer.from(key);
			if (modeName === "des-ede" || modeName === "des-ede-cbc") key = Buffer.concat([key, key.slice(0, 8)]);
			var iv = opts.iv;
			if (!Buffer.isBuffer(iv)) iv = Buffer.from(iv);
			this._des = mode.create({
				key,
				iv,
				type
			});
		}
		DES.prototype._update = function(data) {
			return Buffer.from(this._des.update(data));
		};
		DES.prototype._final = function() {
			return Buffer.from(this._des.final());
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/ecb.js
	var require_ecb = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.encrypt = function(self, block) {
			return self._cipher.encryptBlock(block);
		};
		exports.decrypt = function(self, block) {
			return self._cipher.decryptBlock(block);
		};
	}));
	//#endregion
	//#region ../../node_modules/buffer-xor/index.js
	var require_buffer_xor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		module.exports = function xor(a, b) {
			var length = Math.min(a.length, b.length);
			var buffer = new Buffer$1(length);
			for (var i = 0; i < length; ++i) buffer[i] = a[i] ^ b[i];
			return buffer;
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/cbc.js
	var require_cbc = /* @__PURE__ */ __commonJSMin(((exports) => {
		var xor = require_buffer_xor();
		exports.encrypt = function(self, block) {
			var data = xor(block, self._prev);
			self._prev = self._cipher.encryptBlock(data);
			return self._prev;
		};
		exports.decrypt = function(self, block) {
			var pad = self._prev;
			self._prev = block;
			return xor(self._cipher.decryptBlock(block), pad);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/cfb.js
	var require_cfb = /* @__PURE__ */ __commonJSMin(((exports) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var xor = require_buffer_xor();
		function encryptStart(self, data, decrypt) {
			var len = data.length;
			var out = xor(data, self._cache);
			self._cache = self._cache.slice(len);
			self._prev = Buffer.concat([self._prev, decrypt ? data : out]);
			return out;
		}
		exports.encrypt = function(self, data, decrypt) {
			var out = Buffer.allocUnsafe(0);
			var len;
			while (data.length) {
				if (self._cache.length === 0) {
					self._cache = self._cipher.encryptBlock(self._prev);
					self._prev = Buffer.allocUnsafe(0);
				}
				if (self._cache.length <= data.length) {
					len = self._cache.length;
					out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)]);
					data = data.slice(len);
				} else {
					out = Buffer.concat([out, encryptStart(self, data, decrypt)]);
					break;
				}
			}
			return out;
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/cfb8.js
	var require_cfb8 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var Buffer = require_safe_buffer$4().Buffer;
		function encryptByte(self, byteParam, decrypt) {
			var out = self._cipher.encryptBlock(self._prev)[0] ^ byteParam;
			self._prev = Buffer.concat([self._prev.slice(1), Buffer.from([decrypt ? byteParam : out])]);
			return out;
		}
		exports.encrypt = function(self, chunk, decrypt) {
			var len = chunk.length;
			var out = Buffer.allocUnsafe(len);
			var i = -1;
			while (++i < len) out[i] = encryptByte(self, chunk[i], decrypt);
			return out;
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/cfb1.js
	var require_cfb1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var Buffer = require_safe_buffer$4().Buffer;
		function encryptByte(self, byteParam, decrypt) {
			var pad;
			var i = -1;
			var len = 8;
			var out = 0;
			var bit, value;
			while (++i < len) {
				pad = self._cipher.encryptBlock(self._prev);
				bit = byteParam & 1 << 7 - i ? 128 : 0;
				value = pad[0] ^ bit;
				out += (value & 128) >> i % 8;
				self._prev = shiftIn(self._prev, decrypt ? bit : value);
			}
			return out;
		}
		function shiftIn(buffer, value) {
			var len = buffer.length;
			var i = -1;
			var out = Buffer.allocUnsafe(buffer.length);
			buffer = Buffer.concat([buffer, Buffer.from([value])]);
			while (++i < len) out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;
			return out;
		}
		exports.encrypt = function(self, chunk, decrypt) {
			var len = chunk.length;
			var out = Buffer.allocUnsafe(len);
			var i = -1;
			while (++i < len) out[i] = encryptByte(self, chunk[i], decrypt);
			return out;
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/ofb.js
	var require_ofb = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist();
		var xor = require_buffer_xor();
		function getBlock(self) {
			self._prev = self._cipher.encryptBlock(self._prev);
			return self._prev;
		}
		exports.encrypt = function(self, chunk) {
			while (self._cache.length < chunk.length) self._cache = Buffer$1.concat([self._cache, getBlock(self)]);
			var pad = self._cache.slice(0, chunk.length);
			self._cache = self._cache.slice(chunk.length);
			return xor(chunk, pad);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/incr32.js
	var require_incr32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function incr32(iv) {
			var len = iv.length;
			var item;
			while (len--) {
				item = iv.readUInt8(len);
				if (item === 255) iv.writeUInt8(0, len);
				else {
					item++;
					iv.writeUInt8(item, len);
					break;
				}
			}
		}
		module.exports = incr32;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/ctr.js
	var require_ctr = /* @__PURE__ */ __commonJSMin(((exports) => {
		var xor = require_buffer_xor();
		var Buffer = require_safe_buffer$4().Buffer;
		var incr32 = require_incr32();
		function getBlock(self) {
			var out = self._cipher.encryptBlockRaw(self._prev);
			incr32(self._prev);
			return out;
		}
		var blockSize = 16;
		exports.encrypt = function(self, chunk) {
			var chunkNum = Math.ceil(chunk.length / blockSize);
			var start = self._cache.length;
			self._cache = Buffer.concat([self._cache, Buffer.allocUnsafe(chunkNum * blockSize)]);
			for (var i = 0; i < chunkNum; i++) {
				var out = getBlock(self);
				var offset = start + i * blockSize;
				self._cache.writeUInt32BE(out[0], offset + 0);
				self._cache.writeUInt32BE(out[1], offset + 4);
				self._cache.writeUInt32BE(out[2], offset + 8);
				self._cache.writeUInt32BE(out[3], offset + 12);
			}
			var pad = self._cache.slice(0, chunk.length);
			self._cache = self._cache.slice(chunk.length);
			return xor(chunk, pad);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/list.json
	var list_exports = /* @__PURE__ */ __exportAll({
		aes128: () => aes128,
		aes192: () => aes192,
		aes256: () => aes256,
		default: () => list_default
	});
	var aes128, aes192, aes256, list_default;
	var init_list = __esmMin((() => {
		aes128 = {
			"cipher": "AES",
			"key": 128,
			"iv": 16,
			"mode": "CBC",
			"type": "block"
		};
		aes192 = {
			"cipher": "AES",
			"key": 192,
			"iv": 16,
			"mode": "CBC",
			"type": "block"
		};
		aes256 = {
			"cipher": "AES",
			"key": 256,
			"iv": 16,
			"mode": "CBC",
			"type": "block"
		};
		list_default = {
			"aes-128-ecb": {
				"cipher": "AES",
				"key": 128,
				"iv": 0,
				"mode": "ECB",
				"type": "block"
			},
			"aes-192-ecb": {
				"cipher": "AES",
				"key": 192,
				"iv": 0,
				"mode": "ECB",
				"type": "block"
			},
			"aes-256-ecb": {
				"cipher": "AES",
				"key": 256,
				"iv": 0,
				"mode": "ECB",
				"type": "block"
			},
			"aes-128-cbc": {
				"cipher": "AES",
				"key": 128,
				"iv": 16,
				"mode": "CBC",
				"type": "block"
			},
			"aes-192-cbc": {
				"cipher": "AES",
				"key": 192,
				"iv": 16,
				"mode": "CBC",
				"type": "block"
			},
			"aes-256-cbc": {
				"cipher": "AES",
				"key": 256,
				"iv": 16,
				"mode": "CBC",
				"type": "block"
			},
			aes128,
			aes192,
			aes256,
			"aes-128-cfb": {
				"cipher": "AES",
				"key": 128,
				"iv": 16,
				"mode": "CFB",
				"type": "stream"
			},
			"aes-192-cfb": {
				"cipher": "AES",
				"key": 192,
				"iv": 16,
				"mode": "CFB",
				"type": "stream"
			},
			"aes-256-cfb": {
				"cipher": "AES",
				"key": 256,
				"iv": 16,
				"mode": "CFB",
				"type": "stream"
			},
			"aes-128-cfb8": {
				"cipher": "AES",
				"key": 128,
				"iv": 16,
				"mode": "CFB8",
				"type": "stream"
			},
			"aes-192-cfb8": {
				"cipher": "AES",
				"key": 192,
				"iv": 16,
				"mode": "CFB8",
				"type": "stream"
			},
			"aes-256-cfb8": {
				"cipher": "AES",
				"key": 256,
				"iv": 16,
				"mode": "CFB8",
				"type": "stream"
			},
			"aes-128-cfb1": {
				"cipher": "AES",
				"key": 128,
				"iv": 16,
				"mode": "CFB1",
				"type": "stream"
			},
			"aes-192-cfb1": {
				"cipher": "AES",
				"key": 192,
				"iv": 16,
				"mode": "CFB1",
				"type": "stream"
			},
			"aes-256-cfb1": {
				"cipher": "AES",
				"key": 256,
				"iv": 16,
				"mode": "CFB1",
				"type": "stream"
			},
			"aes-128-ofb": {
				"cipher": "AES",
				"key": 128,
				"iv": 16,
				"mode": "OFB",
				"type": "stream"
			},
			"aes-192-ofb": {
				"cipher": "AES",
				"key": 192,
				"iv": 16,
				"mode": "OFB",
				"type": "stream"
			},
			"aes-256-ofb": {
				"cipher": "AES",
				"key": 256,
				"iv": 16,
				"mode": "OFB",
				"type": "stream"
			},
			"aes-128-ctr": {
				"cipher": "AES",
				"key": 128,
				"iv": 16,
				"mode": "CTR",
				"type": "stream"
			},
			"aes-192-ctr": {
				"cipher": "AES",
				"key": 192,
				"iv": 16,
				"mode": "CTR",
				"type": "stream"
			},
			"aes-256-ctr": {
				"cipher": "AES",
				"key": 256,
				"iv": 16,
				"mode": "CTR",
				"type": "stream"
			},
			"aes-128-gcm": {
				"cipher": "AES",
				"key": 128,
				"iv": 12,
				"mode": "GCM",
				"type": "auth"
			},
			"aes-192-gcm": {
				"cipher": "AES",
				"key": 192,
				"iv": 12,
				"mode": "GCM",
				"type": "auth"
			},
			"aes-256-gcm": {
				"cipher": "AES",
				"key": 256,
				"iv": 12,
				"mode": "GCM",
				"type": "auth"
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/modes/index.js
	var require_modes$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var modeModules = {
			ECB: require_ecb(),
			CBC: require_cbc(),
			CFB: require_cfb(),
			CFB8: require_cfb8(),
			CFB1: require_cfb1(),
			OFB: require_ofb(),
			CTR: require_ctr(),
			GCM: require_ctr()
		};
		var modes = (init_list(), __toCommonJS(list_exports).default);
		for (var key in modes) modes[key].module = modeModules[modes[key].mode];
		module.exports = modes;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/aes.js
	var require_aes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		function asUInt32Array(buf) {
			if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
			var len = buf.length / 4 | 0;
			var out = new Array(len);
			for (var i = 0; i < len; i++) out[i] = buf.readUInt32BE(i * 4);
			return out;
		}
		function scrubVec(v) {
			for (var i = 0; i < v.length; v++) v[i] = 0;
		}
		function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {
			var SUB_MIX0 = SUB_MIX[0];
			var SUB_MIX1 = SUB_MIX[1];
			var SUB_MIX2 = SUB_MIX[2];
			var SUB_MIX3 = SUB_MIX[3];
			var s0 = M[0] ^ keySchedule[0];
			var s1 = M[1] ^ keySchedule[1];
			var s2 = M[2] ^ keySchedule[2];
			var s3 = M[3] ^ keySchedule[3];
			var t0, t1, t2, t3;
			var ksRow = 4;
			for (var round = 1; round < nRounds; round++) {
				t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++];
				t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++];
				t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++];
				t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++];
				s0 = t0;
				s1 = t1;
				s2 = t2;
				s3 = t3;
			}
			t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++];
			t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++];
			t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++];
			t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++];
			t0 = t0 >>> 0;
			t1 = t1 >>> 0;
			t2 = t2 >>> 0;
			t3 = t3 >>> 0;
			return [
				t0,
				t1,
				t2,
				t3
			];
		}
		var RCON = [
			0,
			1,
			2,
			4,
			8,
			16,
			32,
			64,
			128,
			27,
			54
		];
		var G = (function() {
			var d = new Array(256);
			for (var j = 0; j < 256; j++) if (j < 128) d[j] = j << 1;
			else d[j] = j << 1 ^ 283;
			var SBOX = [];
			var INV_SBOX = [];
			var SUB_MIX = [
				[],
				[],
				[],
				[]
			];
			var INV_SUB_MIX = [
				[],
				[],
				[],
				[]
			];
			var x = 0;
			var xi = 0;
			for (var i = 0; i < 256; ++i) {
				var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
				sx = sx >>> 8 ^ sx & 255 ^ 99;
				SBOX[x] = sx;
				INV_SBOX[sx] = x;
				var x2 = d[x];
				var x4 = d[x2];
				var x8 = d[x4];
				var t = d[sx] * 257 ^ sx * 16843008;
				SUB_MIX[0][x] = t << 24 | t >>> 8;
				SUB_MIX[1][x] = t << 16 | t >>> 16;
				SUB_MIX[2][x] = t << 8 | t >>> 24;
				SUB_MIX[3][x] = t;
				t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
				INV_SUB_MIX[0][sx] = t << 24 | t >>> 8;
				INV_SUB_MIX[1][sx] = t << 16 | t >>> 16;
				INV_SUB_MIX[2][sx] = t << 8 | t >>> 24;
				INV_SUB_MIX[3][sx] = t;
				if (x === 0) x = xi = 1;
				else {
					x = x2 ^ d[d[d[x8 ^ x2]]];
					xi ^= d[d[xi]];
				}
			}
			return {
				SBOX,
				INV_SBOX,
				SUB_MIX,
				INV_SUB_MIX
			};
		})();
		function AES(key) {
			this._key = asUInt32Array(key);
			this._reset();
		}
		AES.blockSize = 16;
		AES.keySize = 256 / 8;
		AES.prototype.blockSize = AES.blockSize;
		AES.prototype.keySize = AES.keySize;
		AES.prototype._reset = function() {
			var keyWords = this._key;
			var keySize = keyWords.length;
			var nRounds = keySize + 6;
			var ksRows = (nRounds + 1) * 4;
			var keySchedule = [];
			for (var k = 0; k < keySize; k++) keySchedule[k] = keyWords[k];
			for (k = keySize; k < ksRows; k++) {
				var t = keySchedule[k - 1];
				if (k % keySize === 0) {
					t = t << 8 | t >>> 24;
					t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255];
					t ^= RCON[k / keySize | 0] << 24;
				} else if (keySize > 6 && k % keySize === 4) t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255];
				keySchedule[k] = keySchedule[k - keySize] ^ t;
			}
			var invKeySchedule = [];
			for (var ik = 0; ik < ksRows; ik++) {
				var ksR = ksRows - ik;
				var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)];
				if (ik < 4 || ksR <= 4) invKeySchedule[ik] = tt;
				else invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];
			}
			this._nRounds = nRounds;
			this._keySchedule = keySchedule;
			this._invKeySchedule = invKeySchedule;
		};
		AES.prototype.encryptBlockRaw = function(M) {
			M = asUInt32Array(M);
			return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);
		};
		AES.prototype.encryptBlock = function(M) {
			var out = this.encryptBlockRaw(M);
			var buf = Buffer.allocUnsafe(16);
			buf.writeUInt32BE(out[0], 0);
			buf.writeUInt32BE(out[1], 4);
			buf.writeUInt32BE(out[2], 8);
			buf.writeUInt32BE(out[3], 12);
			return buf;
		};
		AES.prototype.decryptBlock = function(M) {
			M = asUInt32Array(M);
			var m1 = M[1];
			M[1] = M[3];
			M[3] = m1;
			var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds);
			var buf = Buffer.allocUnsafe(16);
			buf.writeUInt32BE(out[0], 0);
			buf.writeUInt32BE(out[3], 4);
			buf.writeUInt32BE(out[2], 8);
			buf.writeUInt32BE(out[1], 12);
			return buf;
		};
		AES.prototype.scrub = function() {
			scrubVec(this._keySchedule);
			scrubVec(this._invKeySchedule);
			scrubVec(this._key);
		};
		module.exports.AES = AES;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/ghash.js
	var require_ghash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var ZEROES = Buffer.alloc(16, 0);
		function toArray(buf) {
			return [
				buf.readUInt32BE(0),
				buf.readUInt32BE(4),
				buf.readUInt32BE(8),
				buf.readUInt32BE(12)
			];
		}
		function fromArray(out) {
			var buf = Buffer.allocUnsafe(16);
			buf.writeUInt32BE(out[0] >>> 0, 0);
			buf.writeUInt32BE(out[1] >>> 0, 4);
			buf.writeUInt32BE(out[2] >>> 0, 8);
			buf.writeUInt32BE(out[3] >>> 0, 12);
			return buf;
		}
		function GHASH(key) {
			this.h = key;
			this.state = Buffer.alloc(16, 0);
			this.cache = Buffer.allocUnsafe(0);
		}
		GHASH.prototype.ghash = function(block) {
			var i = -1;
			while (++i < block.length) this.state[i] ^= block[i];
			this._multiply();
		};
		GHASH.prototype._multiply = function() {
			var Vi = toArray(this.h);
			var Zi = [
				0,
				0,
				0,
				0
			];
			var j, xi, lsbVi;
			var i = -1;
			while (++i < 128) {
				xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0;
				if (xi) {
					Zi[0] ^= Vi[0];
					Zi[1] ^= Vi[1];
					Zi[2] ^= Vi[2];
					Zi[3] ^= Vi[3];
				}
				lsbVi = (Vi[3] & 1) !== 0;
				for (j = 3; j > 0; j--) Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;
				Vi[0] = Vi[0] >>> 1;
				if (lsbVi) Vi[0] = Vi[0] ^ 225 << 24;
			}
			this.state = fromArray(Zi);
		};
		GHASH.prototype.update = function(buf) {
			this.cache = Buffer.concat([this.cache, buf]);
			var chunk;
			while (this.cache.length >= 16) {
				chunk = this.cache.slice(0, 16);
				this.cache = this.cache.slice(16);
				this.ghash(chunk);
			}
		};
		GHASH.prototype.final = function(abl, bl) {
			if (this.cache.length) this.ghash(Buffer.concat([this.cache, ZEROES], 16));
			this.ghash(fromArray([
				0,
				abl,
				0,
				bl
			]));
			return this.state;
		};
		module.exports = GHASH;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/authCipher.js
	var require_authCipher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var aes = require_aes();
		var Buffer = require_safe_buffer$4().Buffer;
		var Transform = require_cipher_base();
		var inherits = require_inherits_browser();
		var GHASH = require_ghash();
		var xor = require_buffer_xor();
		var incr32 = require_incr32();
		function xorTest(a, b) {
			var out = 0;
			if (a.length !== b.length) out++;
			var len = Math.min(a.length, b.length);
			for (var i = 0; i < len; ++i) out += a[i] ^ b[i];
			return out;
		}
		function calcIv(self, iv, ck) {
			if (iv.length === 12) {
				self._finID = Buffer.concat([iv, Buffer.from([
					0,
					0,
					0,
					1
				])]);
				return Buffer.concat([iv, Buffer.from([
					0,
					0,
					0,
					2
				])]);
			}
			var ghash = new GHASH(ck);
			var len = iv.length;
			var toPad = len % 16;
			ghash.update(iv);
			if (toPad) {
				toPad = 16 - toPad;
				ghash.update(Buffer.alloc(toPad, 0));
			}
			ghash.update(Buffer.alloc(8, 0));
			var ivBits = len * 8;
			var tail = Buffer.alloc(8);
			tail.writeUIntBE(ivBits, 0, 8);
			ghash.update(tail);
			self._finID = ghash.state;
			var out = Buffer.from(self._finID);
			incr32(out);
			return out;
		}
		function StreamCipher(mode, key, iv, decrypt) {
			Transform.call(this);
			var h = Buffer.alloc(4, 0);
			this._cipher = new aes.AES(key);
			var ck = this._cipher.encryptBlock(h);
			this._ghash = new GHASH(ck);
			iv = calcIv(this, iv, ck);
			this._prev = Buffer.from(iv);
			this._cache = Buffer.allocUnsafe(0);
			this._secCache = Buffer.allocUnsafe(0);
			this._decrypt = decrypt;
			this._alen = 0;
			this._len = 0;
			this._mode = mode;
			this._authTag = null;
			this._called = false;
		}
		inherits(StreamCipher, Transform);
		StreamCipher.prototype._update = function(chunk) {
			if (!this._called && this._alen) {
				var rump = 16 - this._alen % 16;
				if (rump < 16) {
					rump = Buffer.alloc(rump, 0);
					this._ghash.update(rump);
				}
			}
			this._called = true;
			var out = this._mode.encrypt(this, chunk);
			if (this._decrypt) this._ghash.update(chunk);
			else this._ghash.update(out);
			this._len += chunk.length;
			return out;
		};
		StreamCipher.prototype._final = function() {
			if (this._decrypt && !this._authTag) throw new Error("Unsupported state or unable to authenticate data");
			var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));
			if (this._decrypt && xorTest(tag, this._authTag)) throw new Error("Unsupported state or unable to authenticate data");
			this._authTag = tag;
			this._cipher.scrub();
		};
		StreamCipher.prototype.getAuthTag = function getAuthTag() {
			if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error("Attempting to get auth tag in unsupported state");
			return this._authTag;
		};
		StreamCipher.prototype.setAuthTag = function setAuthTag(tag) {
			if (!this._decrypt) throw new Error("Attempting to set auth tag in unsupported state");
			this._authTag = tag;
		};
		StreamCipher.prototype.setAAD = function setAAD(buf) {
			if (this._called) throw new Error("Attempting to set AAD in unsupported state");
			this._ghash.update(buf);
			this._alen += buf.length;
		};
		module.exports = StreamCipher;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/streamCipher.js
	var require_streamCipher = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var aes = require_aes();
		var Buffer = require_safe_buffer$4().Buffer;
		var Transform = require_cipher_base();
		var inherits = require_inherits_browser();
		function StreamCipher(mode, key, iv, decrypt) {
			Transform.call(this);
			this._cipher = new aes.AES(key);
			this._prev = Buffer.from(iv);
			this._cache = Buffer.allocUnsafe(0);
			this._secCache = Buffer.allocUnsafe(0);
			this._decrypt = decrypt;
			this._mode = mode;
		}
		inherits(StreamCipher, Transform);
		StreamCipher.prototype._update = function(chunk) {
			return this._mode.encrypt(this, chunk, this._decrypt);
		};
		StreamCipher.prototype._final = function() {
			this._cipher.scrub();
		};
		module.exports = StreamCipher;
	}));
	//#endregion
	//#region ../../node_modules/evp_bytestokey/index.js
	var require_evp_bytestokey = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var MD5 = require_md5_js();
		function EVP_BytesToKey(password, salt, keyBits, ivLen) {
			if (!Buffer.isBuffer(password)) password = Buffer.from(password, "binary");
			if (salt) {
				if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, "binary");
				if (salt.length !== 8) throw new RangeError("salt should be Buffer with 8 byte length");
			}
			var keyLen = keyBits / 8;
			var key = Buffer.alloc(keyLen);
			var iv = Buffer.alloc(ivLen || 0);
			var tmp = Buffer.alloc(0);
			while (keyLen > 0 || ivLen > 0) {
				var hash = new MD5();
				hash.update(tmp);
				hash.update(password);
				if (salt) hash.update(salt);
				tmp = hash.digest();
				var used = 0;
				if (keyLen > 0) {
					var keyStart = key.length - keyLen;
					used = Math.min(keyLen, tmp.length);
					tmp.copy(key, keyStart, 0, used);
					keyLen -= used;
				}
				if (used < tmp.length && ivLen > 0) {
					var ivStart = iv.length - ivLen;
					var length = Math.min(ivLen, tmp.length - used);
					tmp.copy(iv, ivStart, used, used + length);
					ivLen -= length;
				}
			}
			tmp.fill(0);
			return {
				key,
				iv
			};
		}
		module.exports = EVP_BytesToKey;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/encrypter.js
	var require_encrypter = /* @__PURE__ */ __commonJSMin(((exports) => {
		var MODES = require_modes$1();
		var AuthCipher = require_authCipher();
		var Buffer = require_safe_buffer$4().Buffer;
		var StreamCipher = require_streamCipher();
		var Transform = require_cipher_base();
		var aes = require_aes();
		var ebtk = require_evp_bytestokey();
		var inherits = require_inherits_browser();
		function Cipher(mode, key, iv) {
			Transform.call(this);
			this._cache = new Splitter();
			this._cipher = new aes.AES(key);
			this._prev = Buffer.from(iv);
			this._mode = mode;
			this._autopadding = true;
		}
		inherits(Cipher, Transform);
		Cipher.prototype._update = function(data) {
			this._cache.add(data);
			var chunk;
			var thing;
			var out = [];
			while (chunk = this._cache.get()) {
				thing = this._mode.encrypt(this, chunk);
				out.push(thing);
			}
			return Buffer.concat(out);
		};
		var PADDING = Buffer.alloc(16, 16);
		Cipher.prototype._final = function() {
			var chunk = this._cache.flush();
			if (this._autopadding) {
				chunk = this._mode.encrypt(this, chunk);
				this._cipher.scrub();
				return chunk;
			}
			if (!chunk.equals(PADDING)) {
				this._cipher.scrub();
				throw new Error("data not multiple of block length");
			}
		};
		Cipher.prototype.setAutoPadding = function(setTo) {
			this._autopadding = !!setTo;
			return this;
		};
		function Splitter() {
			this.cache = Buffer.allocUnsafe(0);
		}
		Splitter.prototype.add = function(data) {
			this.cache = Buffer.concat([this.cache, data]);
		};
		Splitter.prototype.get = function() {
			if (this.cache.length > 15) {
				var out = this.cache.slice(0, 16);
				this.cache = this.cache.slice(16);
				return out;
			}
			return null;
		};
		Splitter.prototype.flush = function() {
			var len = 16 - this.cache.length;
			var padBuff = Buffer.allocUnsafe(len);
			var i = -1;
			while (++i < len) padBuff.writeUInt8(len, i);
			return Buffer.concat([this.cache, padBuff]);
		};
		function createCipheriv(suite, password, iv) {
			var config = MODES[suite.toLowerCase()];
			if (!config) throw new TypeError("invalid suite type");
			if (typeof password === "string") password = Buffer.from(password);
			if (password.length !== config.key / 8) throw new TypeError("invalid key length " + password.length);
			if (typeof iv === "string") iv = Buffer.from(iv);
			if (config.mode !== "GCM" && iv.length !== config.iv) throw new TypeError("invalid iv length " + iv.length);
			if (config.type === "stream") return new StreamCipher(config.module, password, iv);
			else if (config.type === "auth") return new AuthCipher(config.module, password, iv);
			return new Cipher(config.module, password, iv);
		}
		function createCipher(suite, password) {
			var config = MODES[suite.toLowerCase()];
			if (!config) throw new TypeError("invalid suite type");
			var keys = ebtk(password, false, config.key, config.iv);
			return createCipheriv(suite, keys.key, keys.iv);
		}
		exports.createCipheriv = createCipheriv;
		exports.createCipher = createCipher;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/decrypter.js
	var require_decrypter = /* @__PURE__ */ __commonJSMin(((exports) => {
		var AuthCipher = require_authCipher();
		var Buffer = require_safe_buffer$4().Buffer;
		var MODES = require_modes$1();
		var StreamCipher = require_streamCipher();
		var Transform = require_cipher_base();
		var aes = require_aes();
		var ebtk = require_evp_bytestokey();
		var inherits = require_inherits_browser();
		function Decipher(mode, key, iv) {
			Transform.call(this);
			this._cache = new Splitter();
			this._last = void 0;
			this._cipher = new aes.AES(key);
			this._prev = Buffer.from(iv);
			this._mode = mode;
			this._autopadding = true;
		}
		inherits(Decipher, Transform);
		Decipher.prototype._update = function(data) {
			this._cache.add(data);
			var chunk;
			var thing;
			var out = [];
			while (chunk = this._cache.get(this._autopadding)) {
				thing = this._mode.decrypt(this, chunk);
				out.push(thing);
			}
			return Buffer.concat(out);
		};
		Decipher.prototype._final = function() {
			var chunk = this._cache.flush();
			if (this._autopadding) return unpad(this._mode.decrypt(this, chunk));
			else if (chunk) throw new Error("data not multiple of block length");
		};
		Decipher.prototype.setAutoPadding = function(setTo) {
			this._autopadding = !!setTo;
			return this;
		};
		function Splitter() {
			this.cache = Buffer.allocUnsafe(0);
		}
		Splitter.prototype.add = function(data) {
			this.cache = Buffer.concat([this.cache, data]);
		};
		Splitter.prototype.get = function(autoPadding) {
			var out;
			if (autoPadding) {
				if (this.cache.length > 16) {
					out = this.cache.slice(0, 16);
					this.cache = this.cache.slice(16);
					return out;
				}
			} else if (this.cache.length >= 16) {
				out = this.cache.slice(0, 16);
				this.cache = this.cache.slice(16);
				return out;
			}
			return null;
		};
		Splitter.prototype.flush = function() {
			if (this.cache.length) return this.cache;
		};
		function unpad(last) {
			var padded = last[15];
			if (padded < 1 || padded > 16) throw new Error("unable to decrypt data");
			var i = -1;
			while (++i < padded) if (last[i + (16 - padded)] !== padded) throw new Error("unable to decrypt data");
			if (padded === 16) return;
			return last.slice(0, 16 - padded);
		}
		function createDecipheriv(suite, password, iv) {
			var config = MODES[suite.toLowerCase()];
			if (!config) throw new TypeError("invalid suite type");
			if (typeof iv === "string") iv = Buffer.from(iv);
			if (config.mode !== "GCM" && iv.length !== config.iv) throw new TypeError("invalid iv length " + iv.length);
			if (typeof password === "string") password = Buffer.from(password);
			if (password.length !== config.key / 8) throw new TypeError("invalid key length " + password.length);
			if (config.type === "stream") return new StreamCipher(config.module, password, iv, true);
			else if (config.type === "auth") return new AuthCipher(config.module, password, iv, true);
			return new Decipher(config.module, password, iv);
		}
		function createDecipher(suite, password) {
			var config = MODES[suite.toLowerCase()];
			if (!config) throw new TypeError("invalid suite type");
			var keys = ebtk(password, false, config.key, config.iv);
			return createDecipheriv(suite, keys.key, keys.iv);
		}
		exports.createDecipher = createDecipher;
		exports.createDecipheriv = createDecipheriv;
	}));
	//#endregion
	//#region ../../node_modules/browserify-aes/browser.js
	var require_browser$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var ciphers = require_encrypter();
		var deciphers = require_decrypter();
		var modes = (init_list(), __toCommonJS(list_exports).default);
		function getCiphers() {
			return Object.keys(modes);
		}
		exports.createCipher = exports.Cipher = ciphers.createCipher;
		exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv;
		exports.createDecipher = exports.Decipher = deciphers.createDecipher;
		exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv;
		exports.listCiphers = exports.getCiphers = getCiphers;
	}));
	//#endregion
	//#region ../../node_modules/browserify-des/modes.js
	var require_modes = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports["des-ecb"] = {
			key: 8,
			iv: 0
		};
		exports["des-cbc"] = exports.des = {
			key: 8,
			iv: 8
		};
		exports["des-ede3-cbc"] = exports.des3 = {
			key: 24,
			iv: 8
		};
		exports["des-ede3"] = {
			key: 24,
			iv: 0
		};
		exports["des-ede-cbc"] = {
			key: 16,
			iv: 8
		};
		exports["des-ede"] = {
			key: 16,
			iv: 0
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-cipher/browser.js
	var require_browser$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var DES = require_browserify_des();
		var aes = require_browser$6();
		var aesModes = require_modes$1();
		var desModes = require_modes();
		var ebtk = require_evp_bytestokey();
		function createCipher(suite, password) {
			suite = suite.toLowerCase();
			var keyLen, ivLen;
			if (aesModes[suite]) {
				keyLen = aesModes[suite].key;
				ivLen = aesModes[suite].iv;
			} else if (desModes[suite]) {
				keyLen = desModes[suite].key * 8;
				ivLen = desModes[suite].iv;
			} else throw new TypeError("invalid suite type");
			var keys = ebtk(password, false, keyLen, ivLen);
			return createCipheriv(suite, keys.key, keys.iv);
		}
		function createDecipher(suite, password) {
			suite = suite.toLowerCase();
			var keyLen, ivLen;
			if (aesModes[suite]) {
				keyLen = aesModes[suite].key;
				ivLen = aesModes[suite].iv;
			} else if (desModes[suite]) {
				keyLen = desModes[suite].key * 8;
				ivLen = desModes[suite].iv;
			} else throw new TypeError("invalid suite type");
			var keys = ebtk(password, false, keyLen, ivLen);
			return createDecipheriv(suite, keys.key, keys.iv);
		}
		function createCipheriv(suite, key, iv) {
			suite = suite.toLowerCase();
			if (aesModes[suite]) return aes.createCipheriv(suite, key, iv);
			if (desModes[suite]) return new DES({
				key,
				iv,
				mode: suite
			});
			throw new TypeError("invalid suite type");
		}
		function createDecipheriv(suite, key, iv) {
			suite = suite.toLowerCase();
			if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv);
			if (desModes[suite]) return new DES({
				key,
				iv,
				mode: suite,
				decrypt: true
			});
			throw new TypeError("invalid suite type");
		}
		function getCiphers() {
			return Object.keys(desModes).concat(aes.getCiphers());
		}
		exports.createCipher = exports.Cipher = createCipher;
		exports.createCipheriv = exports.Cipheriv = createCipheriv;
		exports.createDecipher = exports.Decipher = createDecipher;
		exports.createDecipheriv = exports.Decipheriv = createDecipheriv;
		exports.listCiphers = exports.getCiphers = getCiphers;
	}));
	//#endregion
	//#region ../../node_modules/bn.js/lib/bn.js
	var require_bn$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function(module$3, exports$3) {
			"use strict";
			function assert(val, msg) {
				if (!val) throw new Error(msg || "Assertion failed");
			}
			function inherits(ctor, superCtor) {
				ctor.super_ = superCtor;
				var TempCtor = function() {};
				TempCtor.prototype = superCtor.prototype;
				ctor.prototype = new TempCtor();
				ctor.prototype.constructor = ctor;
			}
			function BN(number, base, endian) {
				if (BN.isBN(number)) return number;
				this.negative = 0;
				this.words = null;
				this.length = 0;
				this.red = null;
				if (number !== null) {
					if (base === "le" || base === "be") {
						endian = base;
						base = 10;
					}
					this._init(number || 0, base || 10, endian || "be");
				}
			}
			if (typeof module$3 === "object") module$3.exports = BN;
			else exports$3.BN = BN;
			BN.BN = BN;
			BN.wordSize = 26;
			var Buffer;
			try {
				if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer = window.Buffer;
				else Buffer = require_dist().Buffer;
			} catch (e) {}
			BN.isBN = function isBN(num) {
				if (num instanceof BN) return true;
				return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
			};
			BN.max = function max(left, right) {
				if (left.cmp(right) > 0) return left;
				return right;
			};
			BN.min = function min(left, right) {
				if (left.cmp(right) < 0) return left;
				return right;
			};
			BN.prototype._init = function init(number, base, endian) {
				if (typeof number === "number") return this._initNumber(number, base, endian);
				if (typeof number === "object") return this._initArray(number, base, endian);
				if (base === "hex") base = 16;
				assert(base === (base | 0) && base >= 2 && base <= 36);
				number = number.toString().replace(/\s+/g, "");
				var start = 0;
				if (number[0] === "-") {
					start++;
					this.negative = 1;
				}
				if (start < number.length) if (base === 16) this._parseHex(number, start, endian);
				else {
					this._parseBase(number, base, start);
					if (endian === "le") this._initArray(this.toArray(), base, endian);
				}
			};
			BN.prototype._initNumber = function _initNumber(number, base, endian) {
				if (number < 0) {
					this.negative = 1;
					number = -number;
				}
				if (number < 67108864) {
					this.words = [number & 67108863];
					this.length = 1;
				} else if (number < 4503599627370496) {
					this.words = [number & 67108863, number / 67108864 & 67108863];
					this.length = 2;
				} else {
					assert(number < 9007199254740992);
					this.words = [
						number & 67108863,
						number / 67108864 & 67108863,
						1
					];
					this.length = 3;
				}
				if (endian !== "le") return;
				this._initArray(this.toArray(), base, endian);
			};
			BN.prototype._initArray = function _initArray(number, base, endian) {
				assert(typeof number.length === "number");
				if (number.length <= 0) {
					this.words = [0];
					this.length = 1;
					return this;
				}
				this.length = Math.ceil(number.length / 3);
				this.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) this.words[i] = 0;
				var j, w;
				var off = 0;
				if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
					w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
					this.words[j] |= w << off & 67108863;
					this.words[j + 1] = w >>> 26 - off & 67108863;
					off += 24;
					if (off >= 26) {
						off -= 26;
						j++;
					}
				}
				else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) {
					w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
					this.words[j] |= w << off & 67108863;
					this.words[j + 1] = w >>> 26 - off & 67108863;
					off += 24;
					if (off >= 26) {
						off -= 26;
						j++;
					}
				}
				return this.strip();
			};
			function parseHex4Bits(string, index) {
				var c = string.charCodeAt(index);
				if (c >= 65 && c <= 70) return c - 55;
				else if (c >= 97 && c <= 102) return c - 87;
				else return c - 48 & 15;
			}
			function parseHexByte(string, lowerBound, index) {
				var r = parseHex4Bits(string, index);
				if (index - 1 >= lowerBound) r |= parseHex4Bits(string, index - 1) << 4;
				return r;
			}
			BN.prototype._parseHex = function _parseHex(number, start, endian) {
				this.length = Math.ceil((number.length - start) / 6);
				this.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) this.words[i] = 0;
				var off = 0;
				var j = 0;
				var w;
				if (endian === "be") for (i = number.length - 1; i >= start; i -= 2) {
					w = parseHexByte(number, start, i) << off;
					this.words[j] |= w & 67108863;
					if (off >= 18) {
						off -= 18;
						j += 1;
						this.words[j] |= w >>> 26;
					} else off += 8;
				}
				else for (i = (number.length - start) % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
					w = parseHexByte(number, start, i) << off;
					this.words[j] |= w & 67108863;
					if (off >= 18) {
						off -= 18;
						j += 1;
						this.words[j] |= w >>> 26;
					} else off += 8;
				}
				this.strip();
			};
			function parseBase(str, start, end, mul) {
				var r = 0;
				var len = Math.min(str.length, end);
				for (var i = start; i < len; i++) {
					var c = str.charCodeAt(i) - 48;
					r *= mul;
					if (c >= 49) r += c - 49 + 10;
					else if (c >= 17) r += c - 17 + 10;
					else r += c;
				}
				return r;
			}
			BN.prototype._parseBase = function _parseBase(number, base, start) {
				this.words = [0];
				this.length = 1;
				for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++;
				limbLen--;
				limbPow = limbPow / base | 0;
				var total = number.length - start;
				var mod = total % limbLen;
				var end = Math.min(total, total - mod) + start;
				var word = 0;
				for (var i = start; i < end; i += limbLen) {
					word = parseBase(number, i, i + limbLen, base);
					this.imuln(limbPow);
					if (this.words[0] + word < 67108864) this.words[0] += word;
					else this._iaddn(word);
				}
				if (mod !== 0) {
					var pow = 1;
					word = parseBase(number, i, number.length, base);
					for (i = 0; i < mod; i++) pow *= base;
					this.imuln(pow);
					if (this.words[0] + word < 67108864) this.words[0] += word;
					else this._iaddn(word);
				}
				this.strip();
			};
			BN.prototype.copy = function copy(dest) {
				dest.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i];
				dest.length = this.length;
				dest.negative = this.negative;
				dest.red = this.red;
			};
			BN.prototype.clone = function clone() {
				var r = new BN(null);
				this.copy(r);
				return r;
			};
			BN.prototype._expand = function _expand(size) {
				while (this.length < size) this.words[this.length++] = 0;
				return this;
			};
			BN.prototype.strip = function strip() {
				while (this.length > 1 && this.words[this.length - 1] === 0) this.length--;
				return this._normSign();
			};
			BN.prototype._normSign = function _normSign() {
				if (this.length === 1 && this.words[0] === 0) this.negative = 0;
				return this;
			};
			BN.prototype.inspect = function inspect() {
				return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
			};
			var zeros = [
				"",
				"0",
				"00",
				"000",
				"0000",
				"00000",
				"000000",
				"0000000",
				"00000000",
				"000000000",
				"0000000000",
				"00000000000",
				"000000000000",
				"0000000000000",
				"00000000000000",
				"000000000000000",
				"0000000000000000",
				"00000000000000000",
				"000000000000000000",
				"0000000000000000000",
				"00000000000000000000",
				"000000000000000000000",
				"0000000000000000000000",
				"00000000000000000000000",
				"000000000000000000000000",
				"0000000000000000000000000"
			];
			var groupSizes = [
				0,
				0,
				25,
				16,
				12,
				11,
				10,
				9,
				8,
				8,
				7,
				7,
				7,
				7,
				6,
				6,
				6,
				6,
				6,
				6,
				6,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5
			];
			var groupBases = [
				0,
				0,
				33554432,
				43046721,
				16777216,
				48828125,
				60466176,
				40353607,
				16777216,
				43046721,
				1e7,
				19487171,
				35831808,
				62748517,
				7529536,
				11390625,
				16777216,
				24137569,
				34012224,
				47045881,
				64e6,
				4084101,
				5153632,
				6436343,
				7962624,
				9765625,
				11881376,
				14348907,
				17210368,
				20511149,
				243e5,
				28629151,
				33554432,
				39135393,
				45435424,
				52521875,
				60466176
			];
			BN.prototype.toString = function toString(base, padding) {
				base = base || 10;
				padding = padding | 0 || 1;
				var out;
				if (base === 16 || base === "hex") {
					out = "";
					var off = 0;
					var carry = 0;
					for (var i = 0; i < this.length; i++) {
						var w = this.words[i];
						var word = ((w << off | carry) & 16777215).toString(16);
						carry = w >>> 24 - off & 16777215;
						off += 2;
						if (off >= 26) {
							off -= 26;
							i--;
						}
						if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out;
						else out = word + out;
					}
					if (carry !== 0) out = carry.toString(16) + out;
					while (out.length % padding !== 0) out = "0" + out;
					if (this.negative !== 0) out = "-" + out;
					return out;
				}
				if (base === (base | 0) && base >= 2 && base <= 36) {
					var groupSize = groupSizes[base];
					var groupBase = groupBases[base];
					out = "";
					var c = this.clone();
					c.negative = 0;
					while (!c.isZero()) {
						var r = c.modn(groupBase).toString(base);
						c = c.idivn(groupBase);
						if (!c.isZero()) out = zeros[groupSize - r.length] + r + out;
						else out = r + out;
					}
					if (this.isZero()) out = "0" + out;
					while (out.length % padding !== 0) out = "0" + out;
					if (this.negative !== 0) out = "-" + out;
					return out;
				}
				assert(false, "Base should be between 2 and 36");
			};
			BN.prototype.toNumber = function toNumber() {
				var ret = this.words[0];
				if (this.length === 2) ret += this.words[1] * 67108864;
				else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864;
				else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits");
				return this.negative !== 0 ? -ret : ret;
			};
			BN.prototype.toJSON = function toJSON() {
				return this.toString(16);
			};
			BN.prototype.toBuffer = function toBuffer(endian, length) {
				assert(typeof Buffer !== "undefined");
				return this.toArrayLike(Buffer, endian, length);
			};
			BN.prototype.toArray = function toArray(endian, length) {
				return this.toArrayLike(Array, endian, length);
			};
			BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
				var byteLength = this.byteLength();
				var reqLength = length || Math.max(1, byteLength);
				assert(byteLength <= reqLength, "byte array longer than desired length");
				assert(reqLength > 0, "Requested array length <= 0");
				this.strip();
				var littleEndian = endian === "le";
				var res = new ArrayType(reqLength);
				var b, i;
				var q = this.clone();
				if (!littleEndian) {
					for (i = 0; i < reqLength - byteLength; i++) res[i] = 0;
					for (i = 0; !q.isZero(); i++) {
						b = q.andln(255);
						q.iushrn(8);
						res[reqLength - i - 1] = b;
					}
				} else {
					for (i = 0; !q.isZero(); i++) {
						b = q.andln(255);
						q.iushrn(8);
						res[i] = b;
					}
					for (; i < reqLength; i++) res[i] = 0;
				}
				return res;
			};
			if (Math.clz32) BN.prototype._countBits = function _countBits(w) {
				return 32 - Math.clz32(w);
			};
			else BN.prototype._countBits = function _countBits(w) {
				var t = w;
				var r = 0;
				if (t >= 4096) {
					r += 13;
					t >>>= 13;
				}
				if (t >= 64) {
					r += 7;
					t >>>= 7;
				}
				if (t >= 8) {
					r += 4;
					t >>>= 4;
				}
				if (t >= 2) {
					r += 2;
					t >>>= 2;
				}
				return r + t;
			};
			BN.prototype._zeroBits = function _zeroBits(w) {
				if (w === 0) return 26;
				var t = w;
				var r = 0;
				if ((t & 8191) === 0) {
					r += 13;
					t >>>= 13;
				}
				if ((t & 127) === 0) {
					r += 7;
					t >>>= 7;
				}
				if ((t & 15) === 0) {
					r += 4;
					t >>>= 4;
				}
				if ((t & 3) === 0) {
					r += 2;
					t >>>= 2;
				}
				if ((t & 1) === 0) r++;
				return r;
			};
			BN.prototype.bitLength = function bitLength() {
				var w = this.words[this.length - 1];
				var hi = this._countBits(w);
				return (this.length - 1) * 26 + hi;
			};
			function toBitArray(num) {
				var w = new Array(num.bitLength());
				for (var bit = 0; bit < w.length; bit++) {
					var off = bit / 26 | 0;
					var wbit = bit % 26;
					w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
				}
				return w;
			}
			BN.prototype.zeroBits = function zeroBits() {
				if (this.isZero()) return 0;
				var r = 0;
				for (var i = 0; i < this.length; i++) {
					var b = this._zeroBits(this.words[i]);
					r += b;
					if (b !== 26) break;
				}
				return r;
			};
			BN.prototype.byteLength = function byteLength() {
				return Math.ceil(this.bitLength() / 8);
			};
			BN.prototype.toTwos = function toTwos(width) {
				if (this.negative !== 0) return this.abs().inotn(width).iaddn(1);
				return this.clone();
			};
			BN.prototype.fromTwos = function fromTwos(width) {
				if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg();
				return this.clone();
			};
			BN.prototype.isNeg = function isNeg() {
				return this.negative !== 0;
			};
			BN.prototype.neg = function neg() {
				return this.clone().ineg();
			};
			BN.prototype.ineg = function ineg() {
				if (!this.isZero()) this.negative ^= 1;
				return this;
			};
			BN.prototype.iuor = function iuor(num) {
				while (this.length < num.length) this.words[this.length++] = 0;
				for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i];
				return this.strip();
			};
			BN.prototype.ior = function ior(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuor(num);
			};
			BN.prototype.or = function or(num) {
				if (this.length > num.length) return this.clone().ior(num);
				return num.clone().ior(this);
			};
			BN.prototype.uor = function uor(num) {
				if (this.length > num.length) return this.clone().iuor(num);
				return num.clone().iuor(this);
			};
			BN.prototype.iuand = function iuand(num) {
				var b;
				if (this.length > num.length) b = num;
				else b = this;
				for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i];
				this.length = b.length;
				return this.strip();
			};
			BN.prototype.iand = function iand(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuand(num);
			};
			BN.prototype.and = function and(num) {
				if (this.length > num.length) return this.clone().iand(num);
				return num.clone().iand(this);
			};
			BN.prototype.uand = function uand(num) {
				if (this.length > num.length) return this.clone().iuand(num);
				return num.clone().iuand(this);
			};
			BN.prototype.iuxor = function iuxor(num) {
				var a;
				var b;
				if (this.length > num.length) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i];
				if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i];
				this.length = a.length;
				return this.strip();
			};
			BN.prototype.ixor = function ixor(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuxor(num);
			};
			BN.prototype.xor = function xor(num) {
				if (this.length > num.length) return this.clone().ixor(num);
				return num.clone().ixor(this);
			};
			BN.prototype.uxor = function uxor(num) {
				if (this.length > num.length) return this.clone().iuxor(num);
				return num.clone().iuxor(this);
			};
			BN.prototype.inotn = function inotn(width) {
				assert(typeof width === "number" && width >= 0);
				var bytesNeeded = Math.ceil(width / 26) | 0;
				var bitsLeft = width % 26;
				this._expand(bytesNeeded);
				if (bitsLeft > 0) bytesNeeded--;
				for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863;
				if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
				return this.strip();
			};
			BN.prototype.notn = function notn(width) {
				return this.clone().inotn(width);
			};
			BN.prototype.setn = function setn(bit, val) {
				assert(typeof bit === "number" && bit >= 0);
				var off = bit / 26 | 0;
				var wbit = bit % 26;
				this._expand(off + 1);
				if (val) this.words[off] = this.words[off] | 1 << wbit;
				else this.words[off] = this.words[off] & ~(1 << wbit);
				return this.strip();
			};
			BN.prototype.iadd = function iadd(num) {
				var r;
				if (this.negative !== 0 && num.negative === 0) {
					this.negative = 0;
					r = this.isub(num);
					this.negative ^= 1;
					return this._normSign();
				} else if (this.negative === 0 && num.negative !== 0) {
					num.negative = 0;
					r = this.isub(num);
					num.negative = 1;
					return r._normSign();
				}
				var a, b;
				if (this.length > num.length) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				var carry = 0;
				for (var i = 0; i < b.length; i++) {
					r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
					this.words[i] = r & 67108863;
					carry = r >>> 26;
				}
				for (; carry !== 0 && i < a.length; i++) {
					r = (a.words[i] | 0) + carry;
					this.words[i] = r & 67108863;
					carry = r >>> 26;
				}
				this.length = a.length;
				if (carry !== 0) {
					this.words[this.length] = carry;
					this.length++;
				} else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i];
				return this;
			};
			BN.prototype.add = function add(num) {
				var res;
				if (num.negative !== 0 && this.negative === 0) {
					num.negative = 0;
					res = this.sub(num);
					num.negative ^= 1;
					return res;
				} else if (num.negative === 0 && this.negative !== 0) {
					this.negative = 0;
					res = num.sub(this);
					this.negative = 1;
					return res;
				}
				if (this.length > num.length) return this.clone().iadd(num);
				return num.clone().iadd(this);
			};
			BN.prototype.isub = function isub(num) {
				if (num.negative !== 0) {
					num.negative = 0;
					var r = this.iadd(num);
					num.negative = 1;
					return r._normSign();
				} else if (this.negative !== 0) {
					this.negative = 0;
					this.iadd(num);
					this.negative = 1;
					return this._normSign();
				}
				var cmp = this.cmp(num);
				if (cmp === 0) {
					this.negative = 0;
					this.length = 1;
					this.words[0] = 0;
					return this;
				}
				var a, b;
				if (cmp > 0) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				var carry = 0;
				for (var i = 0; i < b.length; i++) {
					r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
					carry = r >> 26;
					this.words[i] = r & 67108863;
				}
				for (; carry !== 0 && i < a.length; i++) {
					r = (a.words[i] | 0) + carry;
					carry = r >> 26;
					this.words[i] = r & 67108863;
				}
				if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i];
				this.length = Math.max(this.length, i);
				if (a !== this) this.negative = 1;
				return this.strip();
			};
			BN.prototype.sub = function sub(num) {
				return this.clone().isub(num);
			};
			function smallMulTo(self, num, out) {
				out.negative = num.negative ^ self.negative;
				var len = self.length + num.length | 0;
				out.length = len;
				len = len - 1 | 0;
				var a = self.words[0] | 0;
				var b = num.words[0] | 0;
				var r = a * b;
				var lo = r & 67108863;
				var carry = r / 67108864 | 0;
				out.words[0] = lo;
				for (var k = 1; k < len; k++) {
					var ncarry = carry >>> 26;
					var rword = carry & 67108863;
					var maxJ = Math.min(k, num.length - 1);
					for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
						var i = k - j | 0;
						a = self.words[i] | 0;
						b = num.words[j] | 0;
						r = a * b + rword;
						ncarry += r / 67108864 | 0;
						rword = r & 67108863;
					}
					out.words[k] = rword | 0;
					carry = ncarry | 0;
				}
				if (carry !== 0) out.words[k] = carry | 0;
				else out.length--;
				return out.strip();
			}
			var comb10MulTo = function comb10MulTo(self, num, out) {
				var a = self.words;
				var b = num.words;
				var o = out.words;
				var c = 0;
				var lo;
				var mid;
				var hi;
				var a0 = a[0] | 0;
				var al0 = a0 & 8191;
				var ah0 = a0 >>> 13;
				var a1 = a[1] | 0;
				var al1 = a1 & 8191;
				var ah1 = a1 >>> 13;
				var a2 = a[2] | 0;
				var al2 = a2 & 8191;
				var ah2 = a2 >>> 13;
				var a3 = a[3] | 0;
				var al3 = a3 & 8191;
				var ah3 = a3 >>> 13;
				var a4 = a[4] | 0;
				var al4 = a4 & 8191;
				var ah4 = a4 >>> 13;
				var a5 = a[5] | 0;
				var al5 = a5 & 8191;
				var ah5 = a5 >>> 13;
				var a6 = a[6] | 0;
				var al6 = a6 & 8191;
				var ah6 = a6 >>> 13;
				var a7 = a[7] | 0;
				var al7 = a7 & 8191;
				var ah7 = a7 >>> 13;
				var a8 = a[8] | 0;
				var al8 = a8 & 8191;
				var ah8 = a8 >>> 13;
				var a9 = a[9] | 0;
				var al9 = a9 & 8191;
				var ah9 = a9 >>> 13;
				var b0 = b[0] | 0;
				var bl0 = b0 & 8191;
				var bh0 = b0 >>> 13;
				var b1 = b[1] | 0;
				var bl1 = b1 & 8191;
				var bh1 = b1 >>> 13;
				var b2 = b[2] | 0;
				var bl2 = b2 & 8191;
				var bh2 = b2 >>> 13;
				var b3 = b[3] | 0;
				var bl3 = b3 & 8191;
				var bh3 = b3 >>> 13;
				var b4 = b[4] | 0;
				var bl4 = b4 & 8191;
				var bh4 = b4 >>> 13;
				var b5 = b[5] | 0;
				var bl5 = b5 & 8191;
				var bh5 = b5 >>> 13;
				var b6 = b[6] | 0;
				var bl6 = b6 & 8191;
				var bh6 = b6 >>> 13;
				var b7 = b[7] | 0;
				var bl7 = b7 & 8191;
				var bh7 = b7 >>> 13;
				var b8 = b[8] | 0;
				var bl8 = b8 & 8191;
				var bh8 = b8 >>> 13;
				var b9 = b[9] | 0;
				var bl9 = b9 & 8191;
				var bh9 = b9 >>> 13;
				out.negative = self.negative ^ num.negative;
				out.length = 19;
				lo = Math.imul(al0, bl0);
				mid = Math.imul(al0, bh0);
				mid = mid + Math.imul(ah0, bl0) | 0;
				hi = Math.imul(ah0, bh0);
				var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
				w0 &= 67108863;
				lo = Math.imul(al1, bl0);
				mid = Math.imul(al1, bh0);
				mid = mid + Math.imul(ah1, bl0) | 0;
				hi = Math.imul(ah1, bh0);
				lo = lo + Math.imul(al0, bl1) | 0;
				mid = mid + Math.imul(al0, bh1) | 0;
				mid = mid + Math.imul(ah0, bl1) | 0;
				hi = hi + Math.imul(ah0, bh1) | 0;
				var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
				w1 &= 67108863;
				lo = Math.imul(al2, bl0);
				mid = Math.imul(al2, bh0);
				mid = mid + Math.imul(ah2, bl0) | 0;
				hi = Math.imul(ah2, bh0);
				lo = lo + Math.imul(al1, bl1) | 0;
				mid = mid + Math.imul(al1, bh1) | 0;
				mid = mid + Math.imul(ah1, bl1) | 0;
				hi = hi + Math.imul(ah1, bh1) | 0;
				lo = lo + Math.imul(al0, bl2) | 0;
				mid = mid + Math.imul(al0, bh2) | 0;
				mid = mid + Math.imul(ah0, bl2) | 0;
				hi = hi + Math.imul(ah0, bh2) | 0;
				var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
				w2 &= 67108863;
				lo = Math.imul(al3, bl0);
				mid = Math.imul(al3, bh0);
				mid = mid + Math.imul(ah3, bl0) | 0;
				hi = Math.imul(ah3, bh0);
				lo = lo + Math.imul(al2, bl1) | 0;
				mid = mid + Math.imul(al2, bh1) | 0;
				mid = mid + Math.imul(ah2, bl1) | 0;
				hi = hi + Math.imul(ah2, bh1) | 0;
				lo = lo + Math.imul(al1, bl2) | 0;
				mid = mid + Math.imul(al1, bh2) | 0;
				mid = mid + Math.imul(ah1, bl2) | 0;
				hi = hi + Math.imul(ah1, bh2) | 0;
				lo = lo + Math.imul(al0, bl3) | 0;
				mid = mid + Math.imul(al0, bh3) | 0;
				mid = mid + Math.imul(ah0, bl3) | 0;
				hi = hi + Math.imul(ah0, bh3) | 0;
				var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
				w3 &= 67108863;
				lo = Math.imul(al4, bl0);
				mid = Math.imul(al4, bh0);
				mid = mid + Math.imul(ah4, bl0) | 0;
				hi = Math.imul(ah4, bh0);
				lo = lo + Math.imul(al3, bl1) | 0;
				mid = mid + Math.imul(al3, bh1) | 0;
				mid = mid + Math.imul(ah3, bl1) | 0;
				hi = hi + Math.imul(ah3, bh1) | 0;
				lo = lo + Math.imul(al2, bl2) | 0;
				mid = mid + Math.imul(al2, bh2) | 0;
				mid = mid + Math.imul(ah2, bl2) | 0;
				hi = hi + Math.imul(ah2, bh2) | 0;
				lo = lo + Math.imul(al1, bl3) | 0;
				mid = mid + Math.imul(al1, bh3) | 0;
				mid = mid + Math.imul(ah1, bl3) | 0;
				hi = hi + Math.imul(ah1, bh3) | 0;
				lo = lo + Math.imul(al0, bl4) | 0;
				mid = mid + Math.imul(al0, bh4) | 0;
				mid = mid + Math.imul(ah0, bl4) | 0;
				hi = hi + Math.imul(ah0, bh4) | 0;
				var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
				w4 &= 67108863;
				lo = Math.imul(al5, bl0);
				mid = Math.imul(al5, bh0);
				mid = mid + Math.imul(ah5, bl0) | 0;
				hi = Math.imul(ah5, bh0);
				lo = lo + Math.imul(al4, bl1) | 0;
				mid = mid + Math.imul(al4, bh1) | 0;
				mid = mid + Math.imul(ah4, bl1) | 0;
				hi = hi + Math.imul(ah4, bh1) | 0;
				lo = lo + Math.imul(al3, bl2) | 0;
				mid = mid + Math.imul(al3, bh2) | 0;
				mid = mid + Math.imul(ah3, bl2) | 0;
				hi = hi + Math.imul(ah3, bh2) | 0;
				lo = lo + Math.imul(al2, bl3) | 0;
				mid = mid + Math.imul(al2, bh3) | 0;
				mid = mid + Math.imul(ah2, bl3) | 0;
				hi = hi + Math.imul(ah2, bh3) | 0;
				lo = lo + Math.imul(al1, bl4) | 0;
				mid = mid + Math.imul(al1, bh4) | 0;
				mid = mid + Math.imul(ah1, bl4) | 0;
				hi = hi + Math.imul(ah1, bh4) | 0;
				lo = lo + Math.imul(al0, bl5) | 0;
				mid = mid + Math.imul(al0, bh5) | 0;
				mid = mid + Math.imul(ah0, bl5) | 0;
				hi = hi + Math.imul(ah0, bh5) | 0;
				var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
				w5 &= 67108863;
				lo = Math.imul(al6, bl0);
				mid = Math.imul(al6, bh0);
				mid = mid + Math.imul(ah6, bl0) | 0;
				hi = Math.imul(ah6, bh0);
				lo = lo + Math.imul(al5, bl1) | 0;
				mid = mid + Math.imul(al5, bh1) | 0;
				mid = mid + Math.imul(ah5, bl1) | 0;
				hi = hi + Math.imul(ah5, bh1) | 0;
				lo = lo + Math.imul(al4, bl2) | 0;
				mid = mid + Math.imul(al4, bh2) | 0;
				mid = mid + Math.imul(ah4, bl2) | 0;
				hi = hi + Math.imul(ah4, bh2) | 0;
				lo = lo + Math.imul(al3, bl3) | 0;
				mid = mid + Math.imul(al3, bh3) | 0;
				mid = mid + Math.imul(ah3, bl3) | 0;
				hi = hi + Math.imul(ah3, bh3) | 0;
				lo = lo + Math.imul(al2, bl4) | 0;
				mid = mid + Math.imul(al2, bh4) | 0;
				mid = mid + Math.imul(ah2, bl4) | 0;
				hi = hi + Math.imul(ah2, bh4) | 0;
				lo = lo + Math.imul(al1, bl5) | 0;
				mid = mid + Math.imul(al1, bh5) | 0;
				mid = mid + Math.imul(ah1, bl5) | 0;
				hi = hi + Math.imul(ah1, bh5) | 0;
				lo = lo + Math.imul(al0, bl6) | 0;
				mid = mid + Math.imul(al0, bh6) | 0;
				mid = mid + Math.imul(ah0, bl6) | 0;
				hi = hi + Math.imul(ah0, bh6) | 0;
				var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
				w6 &= 67108863;
				lo = Math.imul(al7, bl0);
				mid = Math.imul(al7, bh0);
				mid = mid + Math.imul(ah7, bl0) | 0;
				hi = Math.imul(ah7, bh0);
				lo = lo + Math.imul(al6, bl1) | 0;
				mid = mid + Math.imul(al6, bh1) | 0;
				mid = mid + Math.imul(ah6, bl1) | 0;
				hi = hi + Math.imul(ah6, bh1) | 0;
				lo = lo + Math.imul(al5, bl2) | 0;
				mid = mid + Math.imul(al5, bh2) | 0;
				mid = mid + Math.imul(ah5, bl2) | 0;
				hi = hi + Math.imul(ah5, bh2) | 0;
				lo = lo + Math.imul(al4, bl3) | 0;
				mid = mid + Math.imul(al4, bh3) | 0;
				mid = mid + Math.imul(ah4, bl3) | 0;
				hi = hi + Math.imul(ah4, bh3) | 0;
				lo = lo + Math.imul(al3, bl4) | 0;
				mid = mid + Math.imul(al3, bh4) | 0;
				mid = mid + Math.imul(ah3, bl4) | 0;
				hi = hi + Math.imul(ah3, bh4) | 0;
				lo = lo + Math.imul(al2, bl5) | 0;
				mid = mid + Math.imul(al2, bh5) | 0;
				mid = mid + Math.imul(ah2, bl5) | 0;
				hi = hi + Math.imul(ah2, bh5) | 0;
				lo = lo + Math.imul(al1, bl6) | 0;
				mid = mid + Math.imul(al1, bh6) | 0;
				mid = mid + Math.imul(ah1, bl6) | 0;
				hi = hi + Math.imul(ah1, bh6) | 0;
				lo = lo + Math.imul(al0, bl7) | 0;
				mid = mid + Math.imul(al0, bh7) | 0;
				mid = mid + Math.imul(ah0, bl7) | 0;
				hi = hi + Math.imul(ah0, bh7) | 0;
				var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
				w7 &= 67108863;
				lo = Math.imul(al8, bl0);
				mid = Math.imul(al8, bh0);
				mid = mid + Math.imul(ah8, bl0) | 0;
				hi = Math.imul(ah8, bh0);
				lo = lo + Math.imul(al7, bl1) | 0;
				mid = mid + Math.imul(al7, bh1) | 0;
				mid = mid + Math.imul(ah7, bl1) | 0;
				hi = hi + Math.imul(ah7, bh1) | 0;
				lo = lo + Math.imul(al6, bl2) | 0;
				mid = mid + Math.imul(al6, bh2) | 0;
				mid = mid + Math.imul(ah6, bl2) | 0;
				hi = hi + Math.imul(ah6, bh2) | 0;
				lo = lo + Math.imul(al5, bl3) | 0;
				mid = mid + Math.imul(al5, bh3) | 0;
				mid = mid + Math.imul(ah5, bl3) | 0;
				hi = hi + Math.imul(ah5, bh3) | 0;
				lo = lo + Math.imul(al4, bl4) | 0;
				mid = mid + Math.imul(al4, bh4) | 0;
				mid = mid + Math.imul(ah4, bl4) | 0;
				hi = hi + Math.imul(ah4, bh4) | 0;
				lo = lo + Math.imul(al3, bl5) | 0;
				mid = mid + Math.imul(al3, bh5) | 0;
				mid = mid + Math.imul(ah3, bl5) | 0;
				hi = hi + Math.imul(ah3, bh5) | 0;
				lo = lo + Math.imul(al2, bl6) | 0;
				mid = mid + Math.imul(al2, bh6) | 0;
				mid = mid + Math.imul(ah2, bl6) | 0;
				hi = hi + Math.imul(ah2, bh6) | 0;
				lo = lo + Math.imul(al1, bl7) | 0;
				mid = mid + Math.imul(al1, bh7) | 0;
				mid = mid + Math.imul(ah1, bl7) | 0;
				hi = hi + Math.imul(ah1, bh7) | 0;
				lo = lo + Math.imul(al0, bl8) | 0;
				mid = mid + Math.imul(al0, bh8) | 0;
				mid = mid + Math.imul(ah0, bl8) | 0;
				hi = hi + Math.imul(ah0, bh8) | 0;
				var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
				w8 &= 67108863;
				lo = Math.imul(al9, bl0);
				mid = Math.imul(al9, bh0);
				mid = mid + Math.imul(ah9, bl0) | 0;
				hi = Math.imul(ah9, bh0);
				lo = lo + Math.imul(al8, bl1) | 0;
				mid = mid + Math.imul(al8, bh1) | 0;
				mid = mid + Math.imul(ah8, bl1) | 0;
				hi = hi + Math.imul(ah8, bh1) | 0;
				lo = lo + Math.imul(al7, bl2) | 0;
				mid = mid + Math.imul(al7, bh2) | 0;
				mid = mid + Math.imul(ah7, bl2) | 0;
				hi = hi + Math.imul(ah7, bh2) | 0;
				lo = lo + Math.imul(al6, bl3) | 0;
				mid = mid + Math.imul(al6, bh3) | 0;
				mid = mid + Math.imul(ah6, bl3) | 0;
				hi = hi + Math.imul(ah6, bh3) | 0;
				lo = lo + Math.imul(al5, bl4) | 0;
				mid = mid + Math.imul(al5, bh4) | 0;
				mid = mid + Math.imul(ah5, bl4) | 0;
				hi = hi + Math.imul(ah5, bh4) | 0;
				lo = lo + Math.imul(al4, bl5) | 0;
				mid = mid + Math.imul(al4, bh5) | 0;
				mid = mid + Math.imul(ah4, bl5) | 0;
				hi = hi + Math.imul(ah4, bh5) | 0;
				lo = lo + Math.imul(al3, bl6) | 0;
				mid = mid + Math.imul(al3, bh6) | 0;
				mid = mid + Math.imul(ah3, bl6) | 0;
				hi = hi + Math.imul(ah3, bh6) | 0;
				lo = lo + Math.imul(al2, bl7) | 0;
				mid = mid + Math.imul(al2, bh7) | 0;
				mid = mid + Math.imul(ah2, bl7) | 0;
				hi = hi + Math.imul(ah2, bh7) | 0;
				lo = lo + Math.imul(al1, bl8) | 0;
				mid = mid + Math.imul(al1, bh8) | 0;
				mid = mid + Math.imul(ah1, bl8) | 0;
				hi = hi + Math.imul(ah1, bh8) | 0;
				lo = lo + Math.imul(al0, bl9) | 0;
				mid = mid + Math.imul(al0, bh9) | 0;
				mid = mid + Math.imul(ah0, bl9) | 0;
				hi = hi + Math.imul(ah0, bh9) | 0;
				var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
				w9 &= 67108863;
				lo = Math.imul(al9, bl1);
				mid = Math.imul(al9, bh1);
				mid = mid + Math.imul(ah9, bl1) | 0;
				hi = Math.imul(ah9, bh1);
				lo = lo + Math.imul(al8, bl2) | 0;
				mid = mid + Math.imul(al8, bh2) | 0;
				mid = mid + Math.imul(ah8, bl2) | 0;
				hi = hi + Math.imul(ah8, bh2) | 0;
				lo = lo + Math.imul(al7, bl3) | 0;
				mid = mid + Math.imul(al7, bh3) | 0;
				mid = mid + Math.imul(ah7, bl3) | 0;
				hi = hi + Math.imul(ah7, bh3) | 0;
				lo = lo + Math.imul(al6, bl4) | 0;
				mid = mid + Math.imul(al6, bh4) | 0;
				mid = mid + Math.imul(ah6, bl4) | 0;
				hi = hi + Math.imul(ah6, bh4) | 0;
				lo = lo + Math.imul(al5, bl5) | 0;
				mid = mid + Math.imul(al5, bh5) | 0;
				mid = mid + Math.imul(ah5, bl5) | 0;
				hi = hi + Math.imul(ah5, bh5) | 0;
				lo = lo + Math.imul(al4, bl6) | 0;
				mid = mid + Math.imul(al4, bh6) | 0;
				mid = mid + Math.imul(ah4, bl6) | 0;
				hi = hi + Math.imul(ah4, bh6) | 0;
				lo = lo + Math.imul(al3, bl7) | 0;
				mid = mid + Math.imul(al3, bh7) | 0;
				mid = mid + Math.imul(ah3, bl7) | 0;
				hi = hi + Math.imul(ah3, bh7) | 0;
				lo = lo + Math.imul(al2, bl8) | 0;
				mid = mid + Math.imul(al2, bh8) | 0;
				mid = mid + Math.imul(ah2, bl8) | 0;
				hi = hi + Math.imul(ah2, bh8) | 0;
				lo = lo + Math.imul(al1, bl9) | 0;
				mid = mid + Math.imul(al1, bh9) | 0;
				mid = mid + Math.imul(ah1, bl9) | 0;
				hi = hi + Math.imul(ah1, bh9) | 0;
				var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
				w10 &= 67108863;
				lo = Math.imul(al9, bl2);
				mid = Math.imul(al9, bh2);
				mid = mid + Math.imul(ah9, bl2) | 0;
				hi = Math.imul(ah9, bh2);
				lo = lo + Math.imul(al8, bl3) | 0;
				mid = mid + Math.imul(al8, bh3) | 0;
				mid = mid + Math.imul(ah8, bl3) | 0;
				hi = hi + Math.imul(ah8, bh3) | 0;
				lo = lo + Math.imul(al7, bl4) | 0;
				mid = mid + Math.imul(al7, bh4) | 0;
				mid = mid + Math.imul(ah7, bl4) | 0;
				hi = hi + Math.imul(ah7, bh4) | 0;
				lo = lo + Math.imul(al6, bl5) | 0;
				mid = mid + Math.imul(al6, bh5) | 0;
				mid = mid + Math.imul(ah6, bl5) | 0;
				hi = hi + Math.imul(ah6, bh5) | 0;
				lo = lo + Math.imul(al5, bl6) | 0;
				mid = mid + Math.imul(al5, bh6) | 0;
				mid = mid + Math.imul(ah5, bl6) | 0;
				hi = hi + Math.imul(ah5, bh6) | 0;
				lo = lo + Math.imul(al4, bl7) | 0;
				mid = mid + Math.imul(al4, bh7) | 0;
				mid = mid + Math.imul(ah4, bl7) | 0;
				hi = hi + Math.imul(ah4, bh7) | 0;
				lo = lo + Math.imul(al3, bl8) | 0;
				mid = mid + Math.imul(al3, bh8) | 0;
				mid = mid + Math.imul(ah3, bl8) | 0;
				hi = hi + Math.imul(ah3, bh8) | 0;
				lo = lo + Math.imul(al2, bl9) | 0;
				mid = mid + Math.imul(al2, bh9) | 0;
				mid = mid + Math.imul(ah2, bl9) | 0;
				hi = hi + Math.imul(ah2, bh9) | 0;
				var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
				w11 &= 67108863;
				lo = Math.imul(al9, bl3);
				mid = Math.imul(al9, bh3);
				mid = mid + Math.imul(ah9, bl3) | 0;
				hi = Math.imul(ah9, bh3);
				lo = lo + Math.imul(al8, bl4) | 0;
				mid = mid + Math.imul(al8, bh4) | 0;
				mid = mid + Math.imul(ah8, bl4) | 0;
				hi = hi + Math.imul(ah8, bh4) | 0;
				lo = lo + Math.imul(al7, bl5) | 0;
				mid = mid + Math.imul(al7, bh5) | 0;
				mid = mid + Math.imul(ah7, bl5) | 0;
				hi = hi + Math.imul(ah7, bh5) | 0;
				lo = lo + Math.imul(al6, bl6) | 0;
				mid = mid + Math.imul(al6, bh6) | 0;
				mid = mid + Math.imul(ah6, bl6) | 0;
				hi = hi + Math.imul(ah6, bh6) | 0;
				lo = lo + Math.imul(al5, bl7) | 0;
				mid = mid + Math.imul(al5, bh7) | 0;
				mid = mid + Math.imul(ah5, bl7) | 0;
				hi = hi + Math.imul(ah5, bh7) | 0;
				lo = lo + Math.imul(al4, bl8) | 0;
				mid = mid + Math.imul(al4, bh8) | 0;
				mid = mid + Math.imul(ah4, bl8) | 0;
				hi = hi + Math.imul(ah4, bh8) | 0;
				lo = lo + Math.imul(al3, bl9) | 0;
				mid = mid + Math.imul(al3, bh9) | 0;
				mid = mid + Math.imul(ah3, bl9) | 0;
				hi = hi + Math.imul(ah3, bh9) | 0;
				var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
				w12 &= 67108863;
				lo = Math.imul(al9, bl4);
				mid = Math.imul(al9, bh4);
				mid = mid + Math.imul(ah9, bl4) | 0;
				hi = Math.imul(ah9, bh4);
				lo = lo + Math.imul(al8, bl5) | 0;
				mid = mid + Math.imul(al8, bh5) | 0;
				mid = mid + Math.imul(ah8, bl5) | 0;
				hi = hi + Math.imul(ah8, bh5) | 0;
				lo = lo + Math.imul(al7, bl6) | 0;
				mid = mid + Math.imul(al7, bh6) | 0;
				mid = mid + Math.imul(ah7, bl6) | 0;
				hi = hi + Math.imul(ah7, bh6) | 0;
				lo = lo + Math.imul(al6, bl7) | 0;
				mid = mid + Math.imul(al6, bh7) | 0;
				mid = mid + Math.imul(ah6, bl7) | 0;
				hi = hi + Math.imul(ah6, bh7) | 0;
				lo = lo + Math.imul(al5, bl8) | 0;
				mid = mid + Math.imul(al5, bh8) | 0;
				mid = mid + Math.imul(ah5, bl8) | 0;
				hi = hi + Math.imul(ah5, bh8) | 0;
				lo = lo + Math.imul(al4, bl9) | 0;
				mid = mid + Math.imul(al4, bh9) | 0;
				mid = mid + Math.imul(ah4, bl9) | 0;
				hi = hi + Math.imul(ah4, bh9) | 0;
				var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
				w13 &= 67108863;
				lo = Math.imul(al9, bl5);
				mid = Math.imul(al9, bh5);
				mid = mid + Math.imul(ah9, bl5) | 0;
				hi = Math.imul(ah9, bh5);
				lo = lo + Math.imul(al8, bl6) | 0;
				mid = mid + Math.imul(al8, bh6) | 0;
				mid = mid + Math.imul(ah8, bl6) | 0;
				hi = hi + Math.imul(ah8, bh6) | 0;
				lo = lo + Math.imul(al7, bl7) | 0;
				mid = mid + Math.imul(al7, bh7) | 0;
				mid = mid + Math.imul(ah7, bl7) | 0;
				hi = hi + Math.imul(ah7, bh7) | 0;
				lo = lo + Math.imul(al6, bl8) | 0;
				mid = mid + Math.imul(al6, bh8) | 0;
				mid = mid + Math.imul(ah6, bl8) | 0;
				hi = hi + Math.imul(ah6, bh8) | 0;
				lo = lo + Math.imul(al5, bl9) | 0;
				mid = mid + Math.imul(al5, bh9) | 0;
				mid = mid + Math.imul(ah5, bl9) | 0;
				hi = hi + Math.imul(ah5, bh9) | 0;
				var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
				w14 &= 67108863;
				lo = Math.imul(al9, bl6);
				mid = Math.imul(al9, bh6);
				mid = mid + Math.imul(ah9, bl6) | 0;
				hi = Math.imul(ah9, bh6);
				lo = lo + Math.imul(al8, bl7) | 0;
				mid = mid + Math.imul(al8, bh7) | 0;
				mid = mid + Math.imul(ah8, bl7) | 0;
				hi = hi + Math.imul(ah8, bh7) | 0;
				lo = lo + Math.imul(al7, bl8) | 0;
				mid = mid + Math.imul(al7, bh8) | 0;
				mid = mid + Math.imul(ah7, bl8) | 0;
				hi = hi + Math.imul(ah7, bh8) | 0;
				lo = lo + Math.imul(al6, bl9) | 0;
				mid = mid + Math.imul(al6, bh9) | 0;
				mid = mid + Math.imul(ah6, bl9) | 0;
				hi = hi + Math.imul(ah6, bh9) | 0;
				var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
				w15 &= 67108863;
				lo = Math.imul(al9, bl7);
				mid = Math.imul(al9, bh7);
				mid = mid + Math.imul(ah9, bl7) | 0;
				hi = Math.imul(ah9, bh7);
				lo = lo + Math.imul(al8, bl8) | 0;
				mid = mid + Math.imul(al8, bh8) | 0;
				mid = mid + Math.imul(ah8, bl8) | 0;
				hi = hi + Math.imul(ah8, bh8) | 0;
				lo = lo + Math.imul(al7, bl9) | 0;
				mid = mid + Math.imul(al7, bh9) | 0;
				mid = mid + Math.imul(ah7, bl9) | 0;
				hi = hi + Math.imul(ah7, bh9) | 0;
				var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
				w16 &= 67108863;
				lo = Math.imul(al9, bl8);
				mid = Math.imul(al9, bh8);
				mid = mid + Math.imul(ah9, bl8) | 0;
				hi = Math.imul(ah9, bh8);
				lo = lo + Math.imul(al8, bl9) | 0;
				mid = mid + Math.imul(al8, bh9) | 0;
				mid = mid + Math.imul(ah8, bl9) | 0;
				hi = hi + Math.imul(ah8, bh9) | 0;
				var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
				w17 &= 67108863;
				lo = Math.imul(al9, bl9);
				mid = Math.imul(al9, bh9);
				mid = mid + Math.imul(ah9, bl9) | 0;
				hi = Math.imul(ah9, bh9);
				var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
				w18 &= 67108863;
				o[0] = w0;
				o[1] = w1;
				o[2] = w2;
				o[3] = w3;
				o[4] = w4;
				o[5] = w5;
				o[6] = w6;
				o[7] = w7;
				o[8] = w8;
				o[9] = w9;
				o[10] = w10;
				o[11] = w11;
				o[12] = w12;
				o[13] = w13;
				o[14] = w14;
				o[15] = w15;
				o[16] = w16;
				o[17] = w17;
				o[18] = w18;
				if (c !== 0) {
					o[19] = c;
					out.length++;
				}
				return out;
			};
			if (!Math.imul) comb10MulTo = smallMulTo;
			function bigMulTo(self, num, out) {
				out.negative = num.negative ^ self.negative;
				out.length = self.length + num.length;
				var carry = 0;
				var hncarry = 0;
				for (var k = 0; k < out.length - 1; k++) {
					var ncarry = hncarry;
					hncarry = 0;
					var rword = carry & 67108863;
					var maxJ = Math.min(k, num.length - 1);
					for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
						var i = k - j;
						var r = (self.words[i] | 0) * (num.words[j] | 0);
						var lo = r & 67108863;
						ncarry = ncarry + (r / 67108864 | 0) | 0;
						lo = lo + rword | 0;
						rword = lo & 67108863;
						ncarry = ncarry + (lo >>> 26) | 0;
						hncarry += ncarry >>> 26;
						ncarry &= 67108863;
					}
					out.words[k] = rword;
					carry = ncarry;
					ncarry = hncarry;
				}
				if (carry !== 0) out.words[k] = carry;
				else out.length--;
				return out.strip();
			}
			function jumboMulTo(self, num, out) {
				return new FFTM().mulp(self, num, out);
			}
			BN.prototype.mulTo = function mulTo(num, out) {
				var res;
				var len = this.length + num.length;
				if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out);
				else if (len < 63) res = smallMulTo(this, num, out);
				else if (len < 1024) res = bigMulTo(this, num, out);
				else res = jumboMulTo(this, num, out);
				return res;
			};
			function FFTM(x, y) {
				this.x = x;
				this.y = y;
			}
			FFTM.prototype.makeRBT = function makeRBT(N) {
				var t = new Array(N);
				var l = BN.prototype._countBits(N) - 1;
				for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N);
				return t;
			};
			FFTM.prototype.revBin = function revBin(x, l, N) {
				if (x === 0 || x === N - 1) return x;
				var rb = 0;
				for (var i = 0; i < l; i++) {
					rb |= (x & 1) << l - i - 1;
					x >>= 1;
				}
				return rb;
			};
			FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
				for (var i = 0; i < N; i++) {
					rtws[i] = rws[rbt[i]];
					itws[i] = iws[rbt[i]];
				}
			};
			FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
				this.permute(rbt, rws, iws, rtws, itws, N);
				for (var s = 1; s < N; s <<= 1) {
					var l = s << 1;
					var rtwdf = Math.cos(2 * Math.PI / l);
					var itwdf = Math.sin(2 * Math.PI / l);
					for (var p = 0; p < N; p += l) {
						var rtwdf_ = rtwdf;
						var itwdf_ = itwdf;
						for (var j = 0; j < s; j++) {
							var re = rtws[p + j];
							var ie = itws[p + j];
							var ro = rtws[p + j + s];
							var io = itws[p + j + s];
							var rx = rtwdf_ * ro - itwdf_ * io;
							io = rtwdf_ * io + itwdf_ * ro;
							ro = rx;
							rtws[p + j] = re + ro;
							itws[p + j] = ie + io;
							rtws[p + j + s] = re - ro;
							itws[p + j + s] = ie - io;
							if (j !== l) {
								rx = rtwdf * rtwdf_ - itwdf * itwdf_;
								itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
								rtwdf_ = rx;
							}
						}
					}
				}
			};
			FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
				var N = Math.max(m, n) | 1;
				var odd = N & 1;
				var i = 0;
				for (N = N / 2 | 0; N; N = N >>> 1) i++;
				return 1 << i + 1 + odd;
			};
			FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
				if (N <= 1) return;
				for (var i = 0; i < N / 2; i++) {
					var t = rws[i];
					rws[i] = rws[N - i - 1];
					rws[N - i - 1] = t;
					t = iws[i];
					iws[i] = -iws[N - i - 1];
					iws[N - i - 1] = -t;
				}
			};
			FFTM.prototype.normalize13b = function normalize13b(ws, N) {
				var carry = 0;
				for (var i = 0; i < N / 2; i++) {
					var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
					ws[i] = w & 67108863;
					if (w < 67108864) carry = 0;
					else carry = w / 67108864 | 0;
				}
				return ws;
			};
			FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
				var carry = 0;
				for (var i = 0; i < len; i++) {
					carry = carry + (ws[i] | 0);
					rws[2 * i] = carry & 8191;
					carry = carry >>> 13;
					rws[2 * i + 1] = carry & 8191;
					carry = carry >>> 13;
				}
				for (i = 2 * len; i < N; ++i) rws[i] = 0;
				assert(carry === 0);
				assert((carry & -8192) === 0);
			};
			FFTM.prototype.stub = function stub(N) {
				var ph = new Array(N);
				for (var i = 0; i < N; i++) ph[i] = 0;
				return ph;
			};
			FFTM.prototype.mulp = function mulp(x, y, out) {
				var N = 2 * this.guessLen13b(x.length, y.length);
				var rbt = this.makeRBT(N);
				var _ = this.stub(N);
				var rws = new Array(N);
				var rwst = new Array(N);
				var iwst = new Array(N);
				var nrws = new Array(N);
				var nrwst = new Array(N);
				var niwst = new Array(N);
				var rmws = out.words;
				rmws.length = N;
				this.convert13b(x.words, x.length, rws, N);
				this.convert13b(y.words, y.length, nrws, N);
				this.transform(rws, _, rwst, iwst, N, rbt);
				this.transform(nrws, _, nrwst, niwst, N, rbt);
				for (var i = 0; i < N; i++) {
					var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
					iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
					rwst[i] = rx;
				}
				this.conjugate(rwst, iwst, N);
				this.transform(rwst, iwst, rmws, _, N, rbt);
				this.conjugate(rmws, _, N);
				this.normalize13b(rmws, N);
				out.negative = x.negative ^ y.negative;
				out.length = x.length + y.length;
				return out.strip();
			};
			BN.prototype.mul = function mul(num) {
				var out = new BN(null);
				out.words = new Array(this.length + num.length);
				return this.mulTo(num, out);
			};
			BN.prototype.mulf = function mulf(num) {
				var out = new BN(null);
				out.words = new Array(this.length + num.length);
				return jumboMulTo(this, num, out);
			};
			BN.prototype.imul = function imul(num) {
				return this.clone().mulTo(num, this);
			};
			BN.prototype.imuln = function imuln(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				var carry = 0;
				for (var i = 0; i < this.length; i++) {
					var w = (this.words[i] | 0) * num;
					var lo = (w & 67108863) + (carry & 67108863);
					carry >>= 26;
					carry += w / 67108864 | 0;
					carry += lo >>> 26;
					this.words[i] = lo & 67108863;
				}
				if (carry !== 0) {
					this.words[i] = carry;
					this.length++;
				}
				this.length = num === 0 ? 1 : this.length;
				return this;
			};
			BN.prototype.muln = function muln(num) {
				return this.clone().imuln(num);
			};
			BN.prototype.sqr = function sqr() {
				return this.mul(this);
			};
			BN.prototype.isqr = function isqr() {
				return this.imul(this.clone());
			};
			BN.prototype.pow = function pow(num) {
				var w = toBitArray(num);
				if (w.length === 0) return new BN(1);
				var res = this;
				for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break;
				if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
					if (w[i] === 0) continue;
					res = res.mul(q);
				}
				return res;
			};
			BN.prototype.iushln = function iushln(bits) {
				assert(typeof bits === "number" && bits >= 0);
				var r = bits % 26;
				var s = (bits - r) / 26;
				var carryMask = 67108863 >>> 26 - r << 26 - r;
				var i;
				if (r !== 0) {
					var carry = 0;
					for (i = 0; i < this.length; i++) {
						var newCarry = this.words[i] & carryMask;
						var c = (this.words[i] | 0) - newCarry << r;
						this.words[i] = c | carry;
						carry = newCarry >>> 26 - r;
					}
					if (carry) {
						this.words[i] = carry;
						this.length++;
					}
				}
				if (s !== 0) {
					for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i];
					for (i = 0; i < s; i++) this.words[i] = 0;
					this.length += s;
				}
				return this.strip();
			};
			BN.prototype.ishln = function ishln(bits) {
				assert(this.negative === 0);
				return this.iushln(bits);
			};
			BN.prototype.iushrn = function iushrn(bits, hint, extended) {
				assert(typeof bits === "number" && bits >= 0);
				var h;
				if (hint) h = (hint - hint % 26) / 26;
				else h = 0;
				var r = bits % 26;
				var s = Math.min((bits - r) / 26, this.length);
				var mask = 67108863 ^ 67108863 >>> r << r;
				var maskedWords = extended;
				h -= s;
				h = Math.max(0, h);
				if (maskedWords) {
					for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i];
					maskedWords.length = s;
				}
				if (s === 0) {} else if (this.length > s) {
					this.length -= s;
					for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s];
				} else {
					this.words[0] = 0;
					this.length = 1;
				}
				var carry = 0;
				for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
					var word = this.words[i] | 0;
					this.words[i] = carry << 26 - r | word >>> r;
					carry = word & mask;
				}
				if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry;
				if (this.length === 0) {
					this.words[0] = 0;
					this.length = 1;
				}
				return this.strip();
			};
			BN.prototype.ishrn = function ishrn(bits, hint, extended) {
				assert(this.negative === 0);
				return this.iushrn(bits, hint, extended);
			};
			BN.prototype.shln = function shln(bits) {
				return this.clone().ishln(bits);
			};
			BN.prototype.ushln = function ushln(bits) {
				return this.clone().iushln(bits);
			};
			BN.prototype.shrn = function shrn(bits) {
				return this.clone().ishrn(bits);
			};
			BN.prototype.ushrn = function ushrn(bits) {
				return this.clone().iushrn(bits);
			};
			BN.prototype.testn = function testn(bit) {
				assert(typeof bit === "number" && bit >= 0);
				var r = bit % 26;
				var s = (bit - r) / 26;
				var q = 1 << r;
				if (this.length <= s) return false;
				return !!(this.words[s] & q);
			};
			BN.prototype.imaskn = function imaskn(bits) {
				assert(typeof bits === "number" && bits >= 0);
				var r = bits % 26;
				var s = (bits - r) / 26;
				assert(this.negative === 0, "imaskn works only with positive numbers");
				if (this.length <= s) return this;
				if (r !== 0) s++;
				this.length = Math.min(s, this.length);
				if (r !== 0) {
					var mask = 67108863 ^ 67108863 >>> r << r;
					this.words[this.length - 1] &= mask;
				}
				if (this.length === 0) {
					this.words[0] = 0;
					this.length = 1;
				}
				return this.strip();
			};
			BN.prototype.maskn = function maskn(bits) {
				return this.clone().imaskn(bits);
			};
			BN.prototype.iaddn = function iaddn(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				if (num < 0) return this.isubn(-num);
				if (this.negative !== 0) {
					if (this.length === 1 && (this.words[0] | 0) < num) {
						this.words[0] = num - (this.words[0] | 0);
						this.negative = 0;
						return this;
					}
					this.negative = 0;
					this.isubn(num);
					this.negative = 1;
					return this;
				}
				return this._iaddn(num);
			};
			BN.prototype._iaddn = function _iaddn(num) {
				this.words[0] += num;
				for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
					this.words[i] -= 67108864;
					if (i === this.length - 1) this.words[i + 1] = 1;
					else this.words[i + 1]++;
				}
				this.length = Math.max(this.length, i + 1);
				return this;
			};
			BN.prototype.isubn = function isubn(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				if (num < 0) return this.iaddn(-num);
				if (this.negative !== 0) {
					this.negative = 0;
					this.iaddn(num);
					this.negative = 1;
					return this;
				}
				this.words[0] -= num;
				if (this.length === 1 && this.words[0] < 0) {
					this.words[0] = -this.words[0];
					this.negative = 1;
				} else for (var i = 0; i < this.length && this.words[i] < 0; i++) {
					this.words[i] += 67108864;
					this.words[i + 1] -= 1;
				}
				return this.strip();
			};
			BN.prototype.addn = function addn(num) {
				return this.clone().iaddn(num);
			};
			BN.prototype.subn = function subn(num) {
				return this.clone().isubn(num);
			};
			BN.prototype.iabs = function iabs() {
				this.negative = 0;
				return this;
			};
			BN.prototype.abs = function abs() {
				return this.clone().iabs();
			};
			BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
				var len = num.length + shift;
				var i;
				this._expand(len);
				var w;
				var carry = 0;
				for (i = 0; i < num.length; i++) {
					w = (this.words[i + shift] | 0) + carry;
					var right = (num.words[i] | 0) * mul;
					w -= right & 67108863;
					carry = (w >> 26) - (right / 67108864 | 0);
					this.words[i + shift] = w & 67108863;
				}
				for (; i < this.length - shift; i++) {
					w = (this.words[i + shift] | 0) + carry;
					carry = w >> 26;
					this.words[i + shift] = w & 67108863;
				}
				if (carry === 0) return this.strip();
				assert(carry === -1);
				carry = 0;
				for (i = 0; i < this.length; i++) {
					w = -(this.words[i] | 0) + carry;
					carry = w >> 26;
					this.words[i] = w & 67108863;
				}
				this.negative = 1;
				return this.strip();
			};
			BN.prototype._wordDiv = function _wordDiv(num, mode) {
				var shift = this.length - num.length;
				var a = this.clone();
				var b = num;
				var bhi = b.words[b.length - 1] | 0;
				shift = 26 - this._countBits(bhi);
				if (shift !== 0) {
					b = b.ushln(shift);
					a.iushln(shift);
					bhi = b.words[b.length - 1] | 0;
				}
				var m = a.length - b.length;
				var q;
				if (mode !== "mod") {
					q = new BN(null);
					q.length = m + 1;
					q.words = new Array(q.length);
					for (var i = 0; i < q.length; i++) q.words[i] = 0;
				}
				var diff = a.clone()._ishlnsubmul(b, 1, m);
				if (diff.negative === 0) {
					a = diff;
					if (q) q.words[m] = 1;
				}
				for (var j = m - 1; j >= 0; j--) {
					var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
					qj = Math.min(qj / bhi | 0, 67108863);
					a._ishlnsubmul(b, qj, j);
					while (a.negative !== 0) {
						qj--;
						a.negative = 0;
						a._ishlnsubmul(b, 1, j);
						if (!a.isZero()) a.negative ^= 1;
					}
					if (q) q.words[j] = qj;
				}
				if (q) q.strip();
				a.strip();
				if (mode !== "div" && shift !== 0) a.iushrn(shift);
				return {
					div: q || null,
					mod: a
				};
			};
			BN.prototype.divmod = function divmod(num, mode, positive) {
				assert(!num.isZero());
				if (this.isZero()) return {
					div: new BN(0),
					mod: new BN(0)
				};
				var div, mod, res;
				if (this.negative !== 0 && num.negative === 0) {
					res = this.neg().divmod(num, mode);
					if (mode !== "mod") div = res.div.neg();
					if (mode !== "div") {
						mod = res.mod.neg();
						if (positive && mod.negative !== 0) mod.iadd(num);
					}
					return {
						div,
						mod
					};
				}
				if (this.negative === 0 && num.negative !== 0) {
					res = this.divmod(num.neg(), mode);
					if (mode !== "mod") div = res.div.neg();
					return {
						div,
						mod: res.mod
					};
				}
				if ((this.negative & num.negative) !== 0) {
					res = this.neg().divmod(num.neg(), mode);
					if (mode !== "div") {
						mod = res.mod.neg();
						if (positive && mod.negative !== 0) mod.isub(num);
					}
					return {
						div: res.div,
						mod
					};
				}
				if (num.length > this.length || this.cmp(num) < 0) return {
					div: new BN(0),
					mod: this
				};
				if (num.length === 1) {
					if (mode === "div") return {
						div: this.divn(num.words[0]),
						mod: null
					};
					if (mode === "mod") return {
						div: null,
						mod: new BN(this.modn(num.words[0]))
					};
					return {
						div: this.divn(num.words[0]),
						mod: new BN(this.modn(num.words[0]))
					};
				}
				return this._wordDiv(num, mode);
			};
			BN.prototype.div = function div(num) {
				return this.divmod(num, "div", false).div;
			};
			BN.prototype.mod = function mod(num) {
				return this.divmod(num, "mod", false).mod;
			};
			BN.prototype.umod = function umod(num) {
				return this.divmod(num, "mod", true).mod;
			};
			BN.prototype.divRound = function divRound(num) {
				var dm = this.divmod(num);
				if (dm.mod.isZero()) return dm.div;
				var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
				var half = num.ushrn(1);
				var r2 = num.andln(1);
				var cmp = mod.cmp(half);
				if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
				return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
			};
			BN.prototype.modn = function modn(num) {
				assert(num <= 67108863);
				var p = (1 << 26) % num;
				var acc = 0;
				for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num;
				return acc;
			};
			BN.prototype.idivn = function idivn(num) {
				assert(num <= 67108863);
				var carry = 0;
				for (var i = this.length - 1; i >= 0; i--) {
					var w = (this.words[i] | 0) + carry * 67108864;
					this.words[i] = w / num | 0;
					carry = w % num;
				}
				return this.strip();
			};
			BN.prototype.divn = function divn(num) {
				return this.clone().idivn(num);
			};
			BN.prototype.egcd = function egcd(p) {
				assert(p.negative === 0);
				assert(!p.isZero());
				var x = this;
				var y = p.clone();
				if (x.negative !== 0) x = x.umod(p);
				else x = x.clone();
				var A = new BN(1);
				var B = new BN(0);
				var C = new BN(0);
				var D = new BN(1);
				var g = 0;
				while (x.isEven() && y.isEven()) {
					x.iushrn(1);
					y.iushrn(1);
					++g;
				}
				var yp = y.clone();
				var xp = x.clone();
				while (!x.isZero()) {
					for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
					if (i > 0) {
						x.iushrn(i);
						while (i-- > 0) {
							if (A.isOdd() || B.isOdd()) {
								A.iadd(yp);
								B.isub(xp);
							}
							A.iushrn(1);
							B.iushrn(1);
						}
					}
					for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
					if (j > 0) {
						y.iushrn(j);
						while (j-- > 0) {
							if (C.isOdd() || D.isOdd()) {
								C.iadd(yp);
								D.isub(xp);
							}
							C.iushrn(1);
							D.iushrn(1);
						}
					}
					if (x.cmp(y) >= 0) {
						x.isub(y);
						A.isub(C);
						B.isub(D);
					} else {
						y.isub(x);
						C.isub(A);
						D.isub(B);
					}
				}
				return {
					a: C,
					b: D,
					gcd: y.iushln(g)
				};
			};
			BN.prototype._invmp = function _invmp(p) {
				assert(p.negative === 0);
				assert(!p.isZero());
				var a = this;
				var b = p.clone();
				if (a.negative !== 0) a = a.umod(p);
				else a = a.clone();
				var x1 = new BN(1);
				var x2 = new BN(0);
				var delta = b.clone();
				while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
					for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
					if (i > 0) {
						a.iushrn(i);
						while (i-- > 0) {
							if (x1.isOdd()) x1.iadd(delta);
							x1.iushrn(1);
						}
					}
					for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
					if (j > 0) {
						b.iushrn(j);
						while (j-- > 0) {
							if (x2.isOdd()) x2.iadd(delta);
							x2.iushrn(1);
						}
					}
					if (a.cmp(b) >= 0) {
						a.isub(b);
						x1.isub(x2);
					} else {
						b.isub(a);
						x2.isub(x1);
					}
				}
				var res;
				if (a.cmpn(1) === 0) res = x1;
				else res = x2;
				if (res.cmpn(0) < 0) res.iadd(p);
				return res;
			};
			BN.prototype.gcd = function gcd(num) {
				if (this.isZero()) return num.abs();
				if (num.isZero()) return this.abs();
				var a = this.clone();
				var b = num.clone();
				a.negative = 0;
				b.negative = 0;
				for (var shift = 0; a.isEven() && b.isEven(); shift++) {
					a.iushrn(1);
					b.iushrn(1);
				}
				do {
					while (a.isEven()) a.iushrn(1);
					while (b.isEven()) b.iushrn(1);
					var r = a.cmp(b);
					if (r < 0) {
						var t = a;
						a = b;
						b = t;
					} else if (r === 0 || b.cmpn(1) === 0) break;
					a.isub(b);
				} while (true);
				return b.iushln(shift);
			};
			BN.prototype.invm = function invm(num) {
				return this.egcd(num).a.umod(num);
			};
			BN.prototype.isEven = function isEven() {
				return (this.words[0] & 1) === 0;
			};
			BN.prototype.isOdd = function isOdd() {
				return (this.words[0] & 1) === 1;
			};
			BN.prototype.andln = function andln(num) {
				return this.words[0] & num;
			};
			BN.prototype.bincn = function bincn(bit) {
				assert(typeof bit === "number");
				var r = bit % 26;
				var s = (bit - r) / 26;
				var q = 1 << r;
				if (this.length <= s) {
					this._expand(s + 1);
					this.words[s] |= q;
					return this;
				}
				var carry = q;
				for (var i = s; carry !== 0 && i < this.length; i++) {
					var w = this.words[i] | 0;
					w += carry;
					carry = w >>> 26;
					w &= 67108863;
					this.words[i] = w;
				}
				if (carry !== 0) {
					this.words[i] = carry;
					this.length++;
				}
				return this;
			};
			BN.prototype.isZero = function isZero() {
				return this.length === 1 && this.words[0] === 0;
			};
			BN.prototype.cmpn = function cmpn(num) {
				var negative = num < 0;
				if (this.negative !== 0 && !negative) return -1;
				if (this.negative === 0 && negative) return 1;
				this.strip();
				var res;
				if (this.length > 1) res = 1;
				else {
					if (negative) num = -num;
					assert(num <= 67108863, "Number is too big");
					var w = this.words[0] | 0;
					res = w === num ? 0 : w < num ? -1 : 1;
				}
				if (this.negative !== 0) return -res | 0;
				return res;
			};
			BN.prototype.cmp = function cmp(num) {
				if (this.negative !== 0 && num.negative === 0) return -1;
				if (this.negative === 0 && num.negative !== 0) return 1;
				var res = this.ucmp(num);
				if (this.negative !== 0) return -res | 0;
				return res;
			};
			BN.prototype.ucmp = function ucmp(num) {
				if (this.length > num.length) return 1;
				if (this.length < num.length) return -1;
				var res = 0;
				for (var i = this.length - 1; i >= 0; i--) {
					var a = this.words[i] | 0;
					var b = num.words[i] | 0;
					if (a === b) continue;
					if (a < b) res = -1;
					else if (a > b) res = 1;
					break;
				}
				return res;
			};
			BN.prototype.gtn = function gtn(num) {
				return this.cmpn(num) === 1;
			};
			BN.prototype.gt = function gt(num) {
				return this.cmp(num) === 1;
			};
			BN.prototype.gten = function gten(num) {
				return this.cmpn(num) >= 0;
			};
			BN.prototype.gte = function gte(num) {
				return this.cmp(num) >= 0;
			};
			BN.prototype.ltn = function ltn(num) {
				return this.cmpn(num) === -1;
			};
			BN.prototype.lt = function lt(num) {
				return this.cmp(num) === -1;
			};
			BN.prototype.lten = function lten(num) {
				return this.cmpn(num) <= 0;
			};
			BN.prototype.lte = function lte(num) {
				return this.cmp(num) <= 0;
			};
			BN.prototype.eqn = function eqn(num) {
				return this.cmpn(num) === 0;
			};
			BN.prototype.eq = function eq(num) {
				return this.cmp(num) === 0;
			};
			BN.red = function red(num) {
				return new Red(num);
			};
			BN.prototype.toRed = function toRed(ctx) {
				assert(!this.red, "Already a number in reduction context");
				assert(this.negative === 0, "red works only with positives");
				return ctx.convertTo(this)._forceRed(ctx);
			};
			BN.prototype.fromRed = function fromRed() {
				assert(this.red, "fromRed works only with numbers in reduction context");
				return this.red.convertFrom(this);
			};
			BN.prototype._forceRed = function _forceRed(ctx) {
				this.red = ctx;
				return this;
			};
			BN.prototype.forceRed = function forceRed(ctx) {
				assert(!this.red, "Already a number in reduction context");
				return this._forceRed(ctx);
			};
			BN.prototype.redAdd = function redAdd(num) {
				assert(this.red, "redAdd works only with red numbers");
				return this.red.add(this, num);
			};
			BN.prototype.redIAdd = function redIAdd(num) {
				assert(this.red, "redIAdd works only with red numbers");
				return this.red.iadd(this, num);
			};
			BN.prototype.redSub = function redSub(num) {
				assert(this.red, "redSub works only with red numbers");
				return this.red.sub(this, num);
			};
			BN.prototype.redISub = function redISub(num) {
				assert(this.red, "redISub works only with red numbers");
				return this.red.isub(this, num);
			};
			BN.prototype.redShl = function redShl(num) {
				assert(this.red, "redShl works only with red numbers");
				return this.red.shl(this, num);
			};
			BN.prototype.redMul = function redMul(num) {
				assert(this.red, "redMul works only with red numbers");
				this.red._verify2(this, num);
				return this.red.mul(this, num);
			};
			BN.prototype.redIMul = function redIMul(num) {
				assert(this.red, "redMul works only with red numbers");
				this.red._verify2(this, num);
				return this.red.imul(this, num);
			};
			BN.prototype.redSqr = function redSqr() {
				assert(this.red, "redSqr works only with red numbers");
				this.red._verify1(this);
				return this.red.sqr(this);
			};
			BN.prototype.redISqr = function redISqr() {
				assert(this.red, "redISqr works only with red numbers");
				this.red._verify1(this);
				return this.red.isqr(this);
			};
			BN.prototype.redSqrt = function redSqrt() {
				assert(this.red, "redSqrt works only with red numbers");
				this.red._verify1(this);
				return this.red.sqrt(this);
			};
			BN.prototype.redInvm = function redInvm() {
				assert(this.red, "redInvm works only with red numbers");
				this.red._verify1(this);
				return this.red.invm(this);
			};
			BN.prototype.redNeg = function redNeg() {
				assert(this.red, "redNeg works only with red numbers");
				this.red._verify1(this);
				return this.red.neg(this);
			};
			BN.prototype.redPow = function redPow(num) {
				assert(this.red && !num.red, "redPow(normalNum)");
				this.red._verify1(this);
				return this.red.pow(this, num);
			};
			var primes = {
				k256: null,
				p224: null,
				p192: null,
				p25519: null
			};
			function MPrime(name, p) {
				this.name = name;
				this.p = new BN(p, 16);
				this.n = this.p.bitLength();
				this.k = new BN(1).iushln(this.n).isub(this.p);
				this.tmp = this._tmp();
			}
			MPrime.prototype._tmp = function _tmp() {
				var tmp = new BN(null);
				tmp.words = new Array(Math.ceil(this.n / 13));
				return tmp;
			};
			MPrime.prototype.ireduce = function ireduce(num) {
				var r = num;
				var rlen;
				do {
					this.split(r, this.tmp);
					r = this.imulK(r);
					r = r.iadd(this.tmp);
					rlen = r.bitLength();
				} while (rlen > this.n);
				var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
				if (cmp === 0) {
					r.words[0] = 0;
					r.length = 1;
				} else if (cmp > 0) r.isub(this.p);
				else if (r.strip !== void 0) r.strip();
				else r._strip();
				return r;
			};
			MPrime.prototype.split = function split(input, out) {
				input.iushrn(this.n, 0, out);
			};
			MPrime.prototype.imulK = function imulK(num) {
				return num.imul(this.k);
			};
			function K256() {
				MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
			}
			inherits(K256, MPrime);
			K256.prototype.split = function split(input, output) {
				var mask = 4194303;
				var outLen = Math.min(input.length, 9);
				for (var i = 0; i < outLen; i++) output.words[i] = input.words[i];
				output.length = outLen;
				if (input.length <= 9) {
					input.words[0] = 0;
					input.length = 1;
					return;
				}
				var prev = input.words[9];
				output.words[output.length++] = prev & mask;
				for (i = 10; i < input.length; i++) {
					var next = input.words[i] | 0;
					input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
					prev = next;
				}
				prev >>>= 22;
				input.words[i - 10] = prev;
				if (prev === 0 && input.length > 10) input.length -= 10;
				else input.length -= 9;
			};
			K256.prototype.imulK = function imulK(num) {
				num.words[num.length] = 0;
				num.words[num.length + 1] = 0;
				num.length += 2;
				var lo = 0;
				for (var i = 0; i < num.length; i++) {
					var w = num.words[i] | 0;
					lo += w * 977;
					num.words[i] = lo & 67108863;
					lo = w * 64 + (lo / 67108864 | 0);
				}
				if (num.words[num.length - 1] === 0) {
					num.length--;
					if (num.words[num.length - 1] === 0) num.length--;
				}
				return num;
			};
			function P224() {
				MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
			}
			inherits(P224, MPrime);
			function P192() {
				MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
			}
			inherits(P192, MPrime);
			function P25519() {
				MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
			}
			inherits(P25519, MPrime);
			P25519.prototype.imulK = function imulK(num) {
				var carry = 0;
				for (var i = 0; i < num.length; i++) {
					var hi = (num.words[i] | 0) * 19 + carry;
					var lo = hi & 67108863;
					hi >>>= 26;
					num.words[i] = lo;
					carry = hi;
				}
				if (carry !== 0) num.words[num.length++] = carry;
				return num;
			};
			BN._prime = function prime(name) {
				if (primes[name]) return primes[name];
				var prime;
				if (name === "k256") prime = new K256();
				else if (name === "p224") prime = new P224();
				else if (name === "p192") prime = new P192();
				else if (name === "p25519") prime = new P25519();
				else throw new Error("Unknown prime " + name);
				primes[name] = prime;
				return prime;
			};
			function Red(m) {
				if (typeof m === "string") {
					var prime = BN._prime(m);
					this.m = prime.p;
					this.prime = prime;
				} else {
					assert(m.gtn(1), "modulus must be greater than 1");
					this.m = m;
					this.prime = null;
				}
			}
			Red.prototype._verify1 = function _verify1(a) {
				assert(a.negative === 0, "red works only with positives");
				assert(a.red, "red works only with red numbers");
			};
			Red.prototype._verify2 = function _verify2(a, b) {
				assert((a.negative | b.negative) === 0, "red works only with positives");
				assert(a.red && a.red === b.red, "red works only with red numbers");
			};
			Red.prototype.imod = function imod(a) {
				if (this.prime) return this.prime.ireduce(a)._forceRed(this);
				return a.umod(this.m)._forceRed(this);
			};
			Red.prototype.neg = function neg(a) {
				if (a.isZero()) return a.clone();
				return this.m.sub(a)._forceRed(this);
			};
			Red.prototype.add = function add(a, b) {
				this._verify2(a, b);
				var res = a.add(b);
				if (res.cmp(this.m) >= 0) res.isub(this.m);
				return res._forceRed(this);
			};
			Red.prototype.iadd = function iadd(a, b) {
				this._verify2(a, b);
				var res = a.iadd(b);
				if (res.cmp(this.m) >= 0) res.isub(this.m);
				return res;
			};
			Red.prototype.sub = function sub(a, b) {
				this._verify2(a, b);
				var res = a.sub(b);
				if (res.cmpn(0) < 0) res.iadd(this.m);
				return res._forceRed(this);
			};
			Red.prototype.isub = function isub(a, b) {
				this._verify2(a, b);
				var res = a.isub(b);
				if (res.cmpn(0) < 0) res.iadd(this.m);
				return res;
			};
			Red.prototype.shl = function shl(a, num) {
				this._verify1(a);
				return this.imod(a.ushln(num));
			};
			Red.prototype.imul = function imul(a, b) {
				this._verify2(a, b);
				return this.imod(a.imul(b));
			};
			Red.prototype.mul = function mul(a, b) {
				this._verify2(a, b);
				return this.imod(a.mul(b));
			};
			Red.prototype.isqr = function isqr(a) {
				return this.imul(a, a.clone());
			};
			Red.prototype.sqr = function sqr(a) {
				return this.mul(a, a);
			};
			Red.prototype.sqrt = function sqrt(a) {
				if (a.isZero()) return a.clone();
				var mod3 = this.m.andln(3);
				assert(mod3 % 2 === 1);
				if (mod3 === 3) {
					var pow = this.m.add(new BN(1)).iushrn(2);
					return this.pow(a, pow);
				}
				var q = this.m.subn(1);
				var s = 0;
				while (!q.isZero() && q.andln(1) === 0) {
					s++;
					q.iushrn(1);
				}
				assert(!q.isZero());
				var one = new BN(1).toRed(this);
				var nOne = one.redNeg();
				var lpow = this.m.subn(1).iushrn(1);
				var z = this.m.bitLength();
				z = new BN(2 * z * z).toRed(this);
				while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne);
				var c = this.pow(z, q);
				var r = this.pow(a, q.addn(1).iushrn(1));
				var t = this.pow(a, q);
				var m = s;
				while (t.cmp(one) !== 0) {
					var tmp = t;
					for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr();
					assert(i < m);
					var b = this.pow(c, new BN(1).iushln(m - i - 1));
					r = r.redMul(b);
					c = b.redSqr();
					t = t.redMul(c);
					m = i;
				}
				return r;
			};
			Red.prototype.invm = function invm(a) {
				var inv = a._invmp(this.m);
				if (inv.negative !== 0) {
					inv.negative = 0;
					return this.imod(inv).redNeg();
				} else return this.imod(inv);
			};
			Red.prototype.pow = function pow(a, num) {
				if (num.isZero()) return new BN(1).toRed(this);
				if (num.cmpn(1) === 0) return a.clone();
				var windowSize = 4;
				var wnd = new Array(1 << windowSize);
				wnd[0] = new BN(1).toRed(this);
				wnd[1] = a;
				for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a);
				var res = wnd[0];
				var current = 0;
				var currentLen = 0;
				var start = num.bitLength() % 26;
				if (start === 0) start = 26;
				for (i = num.length - 1; i >= 0; i--) {
					var word = num.words[i];
					for (var j = start - 1; j >= 0; j--) {
						var bit = word >> j & 1;
						if (res !== wnd[0]) res = this.sqr(res);
						if (bit === 0 && current === 0) {
							currentLen = 0;
							continue;
						}
						current <<= 1;
						current |= bit;
						currentLen++;
						if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
						res = this.mul(res, wnd[current]);
						currentLen = 0;
						current = 0;
					}
					start = 26;
				}
				return res;
			};
			Red.prototype.convertTo = function convertTo(num) {
				var r = num.umod(this.m);
				return r === num ? r.clone() : r;
			};
			Red.prototype.convertFrom = function convertFrom(num) {
				var res = num.clone();
				res.red = null;
				return res;
			};
			BN.mont = function mont(num) {
				return new Mont(num);
			};
			function Mont(m) {
				Red.call(this, m);
				this.shift = this.m.bitLength();
				if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26;
				this.r = new BN(1).iushln(this.shift);
				this.r2 = this.imod(this.r.sqr());
				this.rinv = this.r._invmp(this.m);
				this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
				this.minv = this.minv.umod(this.r);
				this.minv = this.r.sub(this.minv);
			}
			inherits(Mont, Red);
			Mont.prototype.convertTo = function convertTo(num) {
				return this.imod(num.ushln(this.shift));
			};
			Mont.prototype.convertFrom = function convertFrom(num) {
				var r = this.imod(num.mul(this.rinv));
				r.red = null;
				return r;
			};
			Mont.prototype.imul = function imul(a, b) {
				if (a.isZero() || b.isZero()) {
					a.words[0] = 0;
					a.length = 1;
					return a;
				}
				var t = a.imul(b);
				var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
				var u = t.isub(c).iushrn(this.shift);
				var res = u;
				if (u.cmp(this.m) >= 0) res = u.isub(this.m);
				else if (u.cmpn(0) < 0) res = u.iadd(this.m);
				return res._forceRed(this);
			};
			Mont.prototype.mul = function mul(a, b) {
				if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
				var t = a.mul(b);
				var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
				var u = t.isub(c).iushrn(this.shift);
				var res = u;
				if (u.cmp(this.m) >= 0) res = u.isub(this.m);
				else if (u.cmpn(0) < 0) res = u.iadd(this.m);
				return res._forceRed(this);
			};
			Mont.prototype.invm = function invm(a) {
				return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this);
			};
		})(typeof module === "undefined" || module, exports);
	}));
	//#endregion
	//#region ../../node_modules/brorand/index.js
	var require_brorand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var r;
		module.exports = function rand(len) {
			if (!r) r = new Rand(null);
			return r.generate(len);
		};
		function Rand(rand) {
			this.rand = rand;
		}
		module.exports.Rand = Rand;
		Rand.prototype.generate = function generate(len) {
			return this._rand(len);
		};
		Rand.prototype._rand = function _rand(n) {
			if (this.rand.getBytes) return this.rand.getBytes(n);
			var res = new Uint8Array(n);
			for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte();
			return res;
		};
		if (typeof self === "object") {
			if (self.crypto && self.crypto.getRandomValues) Rand.prototype._rand = function _rand(n) {
				var arr = new Uint8Array(n);
				self.crypto.getRandomValues(arr);
				return arr;
			};
			else if (self.msCrypto && self.msCrypto.getRandomValues) Rand.prototype._rand = function _rand(n) {
				var arr = new Uint8Array(n);
				self.msCrypto.getRandomValues(arr);
				return arr;
			};
			else if (typeof window === "object") Rand.prototype._rand = function() {
				throw new Error("Not implemented yet");
			};
		} else try {
			var crypto = require_crypto_browserify();
			if (typeof crypto.randomBytes !== "function") throw new Error("Not supported");
			Rand.prototype._rand = function _rand(n) {
				return crypto.randomBytes(n);
			};
		} catch (e) {}
	}));
	//#endregion
	//#region ../../node_modules/miller-rabin/lib/mr.js
	var require_mr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var bn = require_bn$2();
		var brorand = require_brorand();
		function MillerRabin(rand) {
			this.rand = rand || new brorand.Rand();
		}
		module.exports = MillerRabin;
		MillerRabin.create = function create(rand) {
			return new MillerRabin(rand);
		};
		MillerRabin.prototype._randbelow = function _randbelow(n) {
			var len = n.bitLength();
			var min_bytes = Math.ceil(len / 8);
			do
				var a = new bn(this.rand.generate(min_bytes));
			while (a.cmp(n) >= 0);
			return a;
		};
		MillerRabin.prototype._randrange = function _randrange(start, stop) {
			var size = stop.sub(start);
			return start.add(this._randbelow(size));
		};
		MillerRabin.prototype.test = function test(n, k, cb) {
			var len = n.bitLength();
			var red = bn.mont(n);
			var rone = new bn(1).toRed(red);
			if (!k) k = Math.max(1, len / 48 | 0);
			var n1 = n.subn(1);
			for (var s = 0; !n1.testn(s); s++);
			var d = n.shrn(s);
			var rn1 = n1.toRed(red);
			var prime = true;
			for (; k > 0; k--) {
				var a = this._randrange(new bn(2), n1);
				if (cb) cb(a);
				var x = a.toRed(red).redPow(d);
				if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue;
				for (var i = 1; i < s; i++) {
					x = x.redSqr();
					if (x.cmp(rone) === 0) return false;
					if (x.cmp(rn1) === 0) break;
				}
				if (i === s) return false;
			}
			return prime;
		};
		MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
			var len = n.bitLength();
			var red = bn.mont(n);
			var rone = new bn(1).toRed(red);
			if (!k) k = Math.max(1, len / 48 | 0);
			var n1 = n.subn(1);
			for (var s = 0; !n1.testn(s); s++);
			var d = n.shrn(s);
			var rn1 = n1.toRed(red);
			for (; k > 0; k--) {
				var a = this._randrange(new bn(2), n1);
				var g = n.gcd(a);
				if (g.cmpn(1) !== 0) return g;
				var x = a.toRed(red).redPow(d);
				if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue;
				for (var i = 1; i < s; i++) {
					x = x.redSqr();
					if (x.cmp(rone) === 0) return x.fromRed().subn(1).gcd(n);
					if (x.cmp(rn1) === 0) break;
				}
				if (i === s) {
					x = x.redSqr();
					return x.fromRed().subn(1).gcd(n);
				}
			}
			return false;
		};
	}));
	//#endregion
	//#region ../../node_modules/diffie-hellman/lib/generatePrime.js
	var require_generatePrime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var randomBytes = require_browser$11();
		module.exports = findPrime;
		findPrime.simpleSieve = simpleSieve;
		findPrime.fermatTest = fermatTest;
		var BN = require_bn$2();
		var TWENTYFOUR = new BN(24);
		var millerRabin = new (require_mr())();
		var ONE = new BN(1);
		var TWO = new BN(2);
		var FIVE = new BN(5);
		new BN(16);
		new BN(8);
		var TEN = new BN(10);
		var THREE = new BN(3);
		new BN(7);
		var ELEVEN = new BN(11);
		var FOUR = new BN(4);
		new BN(12);
		var primes = null;
		function _getPrimes() {
			if (primes !== null) return primes;
			var limit = 1048576;
			var res = [];
			res[0] = 2;
			for (var i = 1, k = 3; k < limit; k += 2) {
				var sqrt = Math.ceil(Math.sqrt(k));
				for (var j = 0; j < i && res[j] <= sqrt; j++) if (k % res[j] === 0) break;
				if (i !== j && res[j] <= sqrt) continue;
				res[i++] = k;
			}
			primes = res;
			return res;
		}
		function simpleSieve(p) {
			var primes = _getPrimes();
			for (var i = 0; i < primes.length; i++) if (p.modn(primes[i]) === 0) if (p.cmpn(primes[i]) === 0) return true;
			else return false;
			return true;
		}
		function fermatTest(p) {
			var red = BN.mont(p);
			return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
		}
		function findPrime(bits, gen) {
			if (bits < 16) if (gen === 2 || gen === 5) return new BN([140, 123]);
			else return new BN([140, 39]);
			gen = new BN(gen);
			var num, n2;
			while (true) {
				num = new BN(randomBytes(Math.ceil(bits / 8)));
				while (num.bitLength() > bits) num.ishrn(1);
				if (num.isEven()) num.iadd(ONE);
				if (!num.testn(1)) num.iadd(TWO);
				if (!gen.cmp(TWO)) while (num.mod(TWENTYFOUR).cmp(ELEVEN)) num.iadd(FOUR);
				else if (!gen.cmp(FIVE)) while (num.mod(TEN).cmp(THREE)) num.iadd(FOUR);
				n2 = num.shrn(1);
				if (simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num)) return num;
			}
		}
	}));
	//#endregion
	//#region ../../node_modules/diffie-hellman/lib/primes.json
	var primes_exports = /* @__PURE__ */ __exportAll({
		default: () => primes_default,
		modp1: () => modp1,
		modp14: () => modp14,
		modp15: () => modp15,
		modp16: () => modp16,
		modp17: () => modp17,
		modp18: () => modp18,
		modp2: () => modp2,
		modp5: () => modp5
	});
	var modp1, modp2, modp5, modp14, modp15, modp16, modp17, modp18, primes_default;
	var init_primes = __esmMin((() => {
		modp1 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"
		};
		modp2 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"
		};
		modp5 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"
		};
		modp14 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"
		};
		modp15 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"
		};
		modp16 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"
		};
		modp17 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"
		};
		modp18 = {
			"gen": "02",
			"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"
		};
		primes_default = {
			modp1,
			modp2,
			modp5,
			modp14,
			modp15,
			modp16,
			modp17,
			modp18
		};
	}));
	//#endregion
	//#region ../../node_modules/diffie-hellman/lib/dh.js
	var require_dh = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var BN = require_bn$2();
		var millerRabin = new (require_mr())();
		var TWENTYFOUR = new BN(24);
		var ELEVEN = new BN(11);
		var TEN = new BN(10);
		var THREE = new BN(3);
		var SEVEN = new BN(7);
		var primes = require_generatePrime();
		var randomBytes = require_browser$11();
		module.exports = DH;
		function setPublicKey(pub, enc) {
			enc = enc || "utf8";
			if (!Buffer$1.isBuffer(pub)) pub = new Buffer$1(pub, enc);
			this._pub = new BN(pub);
			return this;
		}
		function setPrivateKey(priv, enc) {
			enc = enc || "utf8";
			if (!Buffer$1.isBuffer(priv)) priv = new Buffer$1(priv, enc);
			this._priv = new BN(priv);
			return this;
		}
		var primeCache = {};
		function checkPrime(prime, generator) {
			var gen = generator.toString("hex");
			var hex = [gen, prime.toString(16)].join("_");
			if (hex in primeCache) return primeCache[hex];
			var error = 0;
			if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) {
				error += 1;
				if (gen === "02" || gen === "05") error += 8;
				else error += 4;
				primeCache[hex] = error;
				return error;
			}
			if (!millerRabin.test(prime.shrn(1))) error += 2;
			var rem;
			switch (gen) {
				case "02":
					if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) error += 8;
					break;
				case "05":
					rem = prime.mod(TEN);
					if (rem.cmp(THREE) && rem.cmp(SEVEN)) error += 8;
					break;
				default: error += 4;
			}
			primeCache[hex] = error;
			return error;
		}
		function DH(prime, generator, malleable) {
			this.setGenerator(generator);
			this.__prime = new BN(prime);
			this._prime = BN.mont(this.__prime);
			this._primeLen = prime.length;
			this._pub = void 0;
			this._priv = void 0;
			this._primeCode = void 0;
			if (malleable) {
				this.setPublicKey = setPublicKey;
				this.setPrivateKey = setPrivateKey;
			} else this._primeCode = 8;
		}
		Object.defineProperty(DH.prototype, "verifyError", {
			enumerable: true,
			get: function() {
				if (typeof this._primeCode !== "number") this._primeCode = checkPrime(this.__prime, this.__gen);
				return this._primeCode;
			}
		});
		DH.prototype.generateKeys = function() {
			if (!this._priv) this._priv = new BN(randomBytes(this._primeLen));
			this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
			return this.getPublicKey();
		};
		DH.prototype.computeSecret = function(other) {
			other = new BN(other);
			other = other.toRed(this._prime);
			var out = new Buffer$1(other.redPow(this._priv).fromRed().toArray());
			var prime = this.getPrime();
			if (out.length < prime.length) {
				var front = new Buffer$1(prime.length - out.length);
				front.fill(0);
				out = Buffer$1.concat([front, out]);
			}
			return out;
		};
		DH.prototype.getPublicKey = function getPublicKey(enc) {
			return formatReturnValue(this._pub, enc);
		};
		DH.prototype.getPrivateKey = function getPrivateKey(enc) {
			return formatReturnValue(this._priv, enc);
		};
		DH.prototype.getPrime = function(enc) {
			return formatReturnValue(this.__prime, enc);
		};
		DH.prototype.getGenerator = function(enc) {
			return formatReturnValue(this._gen, enc);
		};
		DH.prototype.setGenerator = function(gen, enc) {
			enc = enc || "utf8";
			if (!Buffer$1.isBuffer(gen)) gen = new Buffer$1(gen, enc);
			this.__gen = gen;
			this._gen = new BN(gen);
			return this;
		};
		function formatReturnValue(bn, enc) {
			var buf = new Buffer$1(bn.toArray());
			if (!enc) return buf;
			else return buf.toString(enc);
		}
	}));
	//#endregion
	//#region ../../node_modules/diffie-hellman/browser.js
	var require_browser$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist();
		var generatePrime = require_generatePrime();
		var primes = (init_primes(), __toCommonJS(primes_exports).default);
		var DH = require_dh();
		function getDiffieHellman(mod) {
			return new DH(new Buffer$1(primes[mod].prime, "hex"), new Buffer$1(primes[mod].gen, "hex"));
		}
		var ENCODINGS = {
			"binary": true,
			"hex": true,
			"base64": true
		};
		function createDiffieHellman(prime, enc, generator, genc) {
			if (Buffer$1.isBuffer(enc) || ENCODINGS[enc] === void 0) return createDiffieHellman(prime, "binary", enc, generator);
			enc = enc || "binary";
			genc = genc || "binary";
			generator = generator || new Buffer$1([2]);
			if (!Buffer$1.isBuffer(generator)) generator = new Buffer$1(generator, genc);
			if (typeof prime === "number") return new DH(generatePrime(prime, generator), generator, true);
			if (!Buffer$1.isBuffer(prime)) prime = new Buffer$1(prime, enc);
			return new DH(prime, generator, true);
		}
		exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman;
		exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/isarray/index.js
	var require_isarray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var toString = {}.toString;
		module.exports = Array.isArray || function(arr) {
			return toString.call(arr) == "[object Array]";
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/stream-browser.js
	var require_stream_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_events().EventEmitter;
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/node_modules/safe-buffer/index.js
	var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var buffer = require_dist();
		var Buffer = buffer.Buffer;
		function copyProps(src, dst) {
			for (var key in src) dst[key] = src[key];
		}
		if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
		else {
			copyProps(buffer, exports);
			exports.Buffer = SafeBuffer;
		}
		function SafeBuffer(arg, encodingOrOffset, length) {
			return Buffer(arg, encodingOrOffset, length);
		}
		copyProps(Buffer, SafeBuffer);
		SafeBuffer.from = function(arg, encodingOrOffset, length) {
			if (typeof arg === "number") throw new TypeError("Argument must not be a number");
			return Buffer(arg, encodingOrOffset, length);
		};
		SafeBuffer.alloc = function(size, fill, encoding) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			var buf = Buffer(size);
			if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
			else buf.fill(fill);
			else buf.fill(0);
			return buf;
		};
		SafeBuffer.allocUnsafe = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return Buffer(size);
		};
		SafeBuffer.allocUnsafeSlow = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return buffer.SlowBuffer(size);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/BufferList.js
	var require_BufferList = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function _classCallCheck(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		var Buffer = require_safe_buffer$1().Buffer;
		var util = require_util$2();
		function copyBuffer(src, target, offset) {
			src.copy(target, offset);
		}
		module.exports = function() {
			function BufferList() {
				_classCallCheck(this, BufferList);
				this.head = null;
				this.tail = null;
				this.length = 0;
			}
			BufferList.prototype.push = function push(v) {
				var entry = {
					data: v,
					next: null
				};
				if (this.length > 0) this.tail.next = entry;
				else this.head = entry;
				this.tail = entry;
				++this.length;
			};
			BufferList.prototype.unshift = function unshift(v) {
				var entry = {
					data: v,
					next: this.head
				};
				if (this.length === 0) this.tail = entry;
				this.head = entry;
				++this.length;
			};
			BufferList.prototype.shift = function shift() {
				if (this.length === 0) return;
				var ret = this.head.data;
				if (this.length === 1) this.head = this.tail = null;
				else this.head = this.head.next;
				--this.length;
				return ret;
			};
			BufferList.prototype.clear = function clear() {
				this.head = this.tail = null;
				this.length = 0;
			};
			BufferList.prototype.join = function join(s) {
				if (this.length === 0) return "";
				var p = this.head;
				var ret = "" + p.data;
				while (p = p.next) ret += s + p.data;
				return ret;
			};
			BufferList.prototype.concat = function concat(n) {
				if (this.length === 0) return Buffer.alloc(0);
				var ret = Buffer.allocUnsafe(n >>> 0);
				var p = this.head;
				var i = 0;
				while (p) {
					copyBuffer(p.data, ret, i);
					i += p.data.length;
					p = p.next;
				}
				return ret;
			};
			return BufferList;
		}();
		if (util && util.inspect && util.inspect.custom) module.exports.prototype[util.inspect.custom] = function() {
			var obj = util.inspect({ length: this.length });
			return this.constructor.name + " " + obj;
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/internal/streams/destroy.js
	var require_destroy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var pna = require_process_nextick_args();
		function destroy(err, cb) {
			var _this = this;
			var readableDestroyed = this._readableState && this._readableState.destroyed;
			var writableDestroyed = this._writableState && this._writableState.destroyed;
			if (readableDestroyed || writableDestroyed) {
				if (cb) cb(err);
				else if (err) {
					if (!this._writableState) pna.nextTick(emitErrorNT, this, err);
					else if (!this._writableState.errorEmitted) {
						this._writableState.errorEmitted = true;
						pna.nextTick(emitErrorNT, this, err);
					}
				}
				return this;
			}
			if (this._readableState) this._readableState.destroyed = true;
			if (this._writableState) this._writableState.destroyed = true;
			this._destroy(err || null, function(err) {
				if (!cb && err) {
					if (!_this._writableState) pna.nextTick(emitErrorNT, _this, err);
					else if (!_this._writableState.errorEmitted) {
						_this._writableState.errorEmitted = true;
						pna.nextTick(emitErrorNT, _this, err);
					}
				} else if (cb) cb(err);
			});
			return this;
		}
		function undestroy() {
			if (this._readableState) {
				this._readableState.destroyed = false;
				this._readableState.reading = false;
				this._readableState.ended = false;
				this._readableState.endEmitted = false;
			}
			if (this._writableState) {
				this._writableState.destroyed = false;
				this._writableState.ended = false;
				this._writableState.ending = false;
				this._writableState.finalCalled = false;
				this._writableState.prefinished = false;
				this._writableState.finished = false;
				this._writableState.errorEmitted = false;
			}
		}
		function emitErrorNT(self, err) {
			self.emit("error", err);
		}
		module.exports = {
			destroy,
			undestroy
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_writable.js
	var require__stream_writable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		var pna = require_process_nextick_args();
		module.exports = Writable;
		function CorkedRequest(state) {
			var _this = this;
			this.next = null;
			this.entry = null;
			this.finish = function() {
				onCorkedFinish(_this, state);
			};
		}
		var asyncWrite = !process$1.browser && ["v0.10", "v0.9."].indexOf(process$1.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
		var Duplex;
		Writable.WritableState = WritableState;
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		var internalUtil = { deprecate: require_browser$10() };
		var Stream = require_stream_browser();
		var Buffer = require_safe_buffer$1().Buffer;
		var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
		function _uint8ArrayToBuffer(chunk) {
			return Buffer.from(chunk);
		}
		function _isUint8Array(obj) {
			return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
		}
		var destroyImpl = require_destroy();
		util.inherits(Writable, Stream);
		function nop() {}
		function WritableState(options, stream) {
			Duplex = Duplex || require__stream_duplex();
			options = options || {};
			var isDuplex = stream instanceof Duplex;
			this.objectMode = !!options.objectMode;
			if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
			var hwm = options.highWaterMark;
			var writableHwm = options.writableHighWaterMark;
			var defaultHwm = this.objectMode ? 16 : 16 * 1024;
			if (hwm || hwm === 0) this.highWaterMark = hwm;
			else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;
			else this.highWaterMark = defaultHwm;
			this.highWaterMark = Math.floor(this.highWaterMark);
			this.finalCalled = false;
			this.needDrain = false;
			this.ending = false;
			this.ended = false;
			this.finished = false;
			this.destroyed = false;
			this.decodeStrings = !(options.decodeStrings === false);
			this.defaultEncoding = options.defaultEncoding || "utf8";
			this.length = 0;
			this.writing = false;
			this.corked = 0;
			this.sync = true;
			this.bufferProcessing = false;
			this.onwrite = function(er) {
				onwrite(stream, er);
			};
			this.writecb = null;
			this.writelen = 0;
			this.bufferedRequest = null;
			this.lastBufferedRequest = null;
			this.pendingcb = 0;
			this.prefinished = false;
			this.errorEmitted = false;
			this.bufferedRequestCount = 0;
			this.corkedRequestsFree = new CorkedRequest(this);
		}
		WritableState.prototype.getBuffer = function getBuffer() {
			var current = this.bufferedRequest;
			var out = [];
			while (current) {
				out.push(current);
				current = current.next;
			}
			return out;
		};
		(function() {
			try {
				Object.defineProperty(WritableState.prototype, "buffer", { get: internalUtil.deprecate(function() {
					return this.getBuffer();
				}, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") });
			} catch (_) {}
		})();
		var realHasInstance;
		if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
			realHasInstance = Function.prototype[Symbol.hasInstance];
			Object.defineProperty(Writable, Symbol.hasInstance, { value: function(object) {
				if (realHasInstance.call(this, object)) return true;
				if (this !== Writable) return false;
				return object && object._writableState instanceof WritableState;
			} });
		} else realHasInstance = function(object) {
			return object instanceof this;
		};
		function Writable(options) {
			Duplex = Duplex || require__stream_duplex();
			if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) return new Writable(options);
			this._writableState = new WritableState(options, this);
			this.writable = true;
			if (options) {
				if (typeof options.write === "function") this._write = options.write;
				if (typeof options.writev === "function") this._writev = options.writev;
				if (typeof options.destroy === "function") this._destroy = options.destroy;
				if (typeof options.final === "function") this._final = options.final;
			}
			Stream.call(this);
		}
		Writable.prototype.pipe = function() {
			this.emit("error", /* @__PURE__ */ new Error("Cannot pipe, not readable"));
		};
		function writeAfterEnd(stream, cb) {
			var er = /* @__PURE__ */ new Error("write after end");
			stream.emit("error", er);
			pna.nextTick(cb, er);
		}
		function validChunk(stream, state, chunk, cb) {
			var valid = true;
			var er = false;
			if (chunk === null) er = /* @__PURE__ */ new TypeError("May not write null values to stream");
			else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk");
			if (er) {
				stream.emit("error", er);
				pna.nextTick(cb, er);
				valid = false;
			}
			return valid;
		}
		Writable.prototype.write = function(chunk, encoding, cb) {
			var state = this._writableState;
			var ret = false;
			var isBuf = !state.objectMode && _isUint8Array(chunk);
			if (isBuf && !Buffer.isBuffer(chunk)) chunk = _uint8ArrayToBuffer(chunk);
			if (typeof encoding === "function") {
				cb = encoding;
				encoding = null;
			}
			if (isBuf) encoding = "buffer";
			else if (!encoding) encoding = state.defaultEncoding;
			if (typeof cb !== "function") cb = nop;
			if (state.ended) writeAfterEnd(this, cb);
			else if (isBuf || validChunk(this, state, chunk, cb)) {
				state.pendingcb++;
				ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
			}
			return ret;
		};
		Writable.prototype.cork = function() {
			var state = this._writableState;
			state.corked++;
		};
		Writable.prototype.uncork = function() {
			var state = this._writableState;
			if (state.corked) {
				state.corked--;
				if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
			}
		};
		Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
			if (typeof encoding === "string") encoding = encoding.toLowerCase();
			if (!([
				"hex",
				"utf8",
				"utf-8",
				"ascii",
				"binary",
				"base64",
				"ucs2",
				"ucs-2",
				"utf16le",
				"utf-16le",
				"raw"
			].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding);
			this._writableState.defaultEncoding = encoding;
			return this;
		};
		function decodeChunk(state, chunk, encoding) {
			if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") chunk = Buffer.from(chunk, encoding);
			return chunk;
		}
		Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
			enumerable: false,
			get: function() {
				return this._writableState.highWaterMark;
			}
		});
		function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
			if (!isBuf) {
				var newChunk = decodeChunk(state, chunk, encoding);
				if (chunk !== newChunk) {
					isBuf = true;
					encoding = "buffer";
					chunk = newChunk;
				}
			}
			var len = state.objectMode ? 1 : chunk.length;
			state.length += len;
			var ret = state.length < state.highWaterMark;
			if (!ret) state.needDrain = true;
			if (state.writing || state.corked) {
				var last = state.lastBufferedRequest;
				state.lastBufferedRequest = {
					chunk,
					encoding,
					isBuf,
					callback: cb,
					next: null
				};
				if (last) last.next = state.lastBufferedRequest;
				else state.bufferedRequest = state.lastBufferedRequest;
				state.bufferedRequestCount += 1;
			} else doWrite(stream, state, false, len, chunk, encoding, cb);
			return ret;
		}
		function doWrite(stream, state, writev, len, chunk, encoding, cb) {
			state.writelen = len;
			state.writecb = cb;
			state.writing = true;
			state.sync = true;
			if (writev) stream._writev(chunk, state.onwrite);
			else stream._write(chunk, encoding, state.onwrite);
			state.sync = false;
		}
		function onwriteError(stream, state, sync, er, cb) {
			--state.pendingcb;
			if (sync) {
				pna.nextTick(cb, er);
				pna.nextTick(finishMaybe, stream, state);
				stream._writableState.errorEmitted = true;
				stream.emit("error", er);
			} else {
				cb(er);
				stream._writableState.errorEmitted = true;
				stream.emit("error", er);
				finishMaybe(stream, state);
			}
		}
		function onwriteStateUpdate(state) {
			state.writing = false;
			state.writecb = null;
			state.length -= state.writelen;
			state.writelen = 0;
		}
		function onwrite(stream, er) {
			var state = stream._writableState;
			var sync = state.sync;
			var cb = state.writecb;
			onwriteStateUpdate(state);
			if (er) onwriteError(stream, state, sync, er, cb);
			else {
				var finished = needFinish(state);
				if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(stream, state);
				if (sync) asyncWrite(afterWrite, stream, state, finished, cb);
				else afterWrite(stream, state, finished, cb);
			}
		}
		function afterWrite(stream, state, finished, cb) {
			if (!finished) onwriteDrain(stream, state);
			state.pendingcb--;
			cb();
			finishMaybe(stream, state);
		}
		function onwriteDrain(stream, state) {
			if (state.length === 0 && state.needDrain) {
				state.needDrain = false;
				stream.emit("drain");
			}
		}
		function clearBuffer(stream, state) {
			state.bufferProcessing = true;
			var entry = state.bufferedRequest;
			if (stream._writev && entry && entry.next) {
				var l = state.bufferedRequestCount;
				var buffer = new Array(l);
				var holder = state.corkedRequestsFree;
				holder.entry = entry;
				var count = 0;
				var allBuffers = true;
				while (entry) {
					buffer[count] = entry;
					if (!entry.isBuf) allBuffers = false;
					entry = entry.next;
					count += 1;
				}
				buffer.allBuffers = allBuffers;
				doWrite(stream, state, true, state.length, buffer, "", holder.finish);
				state.pendingcb++;
				state.lastBufferedRequest = null;
				if (holder.next) {
					state.corkedRequestsFree = holder.next;
					holder.next = null;
				} else state.corkedRequestsFree = new CorkedRequest(state);
				state.bufferedRequestCount = 0;
			} else {
				while (entry) {
					var chunk = entry.chunk;
					var encoding = entry.encoding;
					var cb = entry.callback;
					doWrite(stream, state, false, state.objectMode ? 1 : chunk.length, chunk, encoding, cb);
					entry = entry.next;
					state.bufferedRequestCount--;
					if (state.writing) break;
				}
				if (entry === null) state.lastBufferedRequest = null;
			}
			state.bufferedRequest = entry;
			state.bufferProcessing = false;
		}
		Writable.prototype._write = function(chunk, encoding, cb) {
			cb(/* @__PURE__ */ new Error("_write() is not implemented"));
		};
		Writable.prototype._writev = null;
		Writable.prototype.end = function(chunk, encoding, cb) {
			var state = this._writableState;
			if (typeof chunk === "function") {
				cb = chunk;
				chunk = null;
				encoding = null;
			} else if (typeof encoding === "function") {
				cb = encoding;
				encoding = null;
			}
			if (chunk !== null && chunk !== void 0) this.write(chunk, encoding);
			if (state.corked) {
				state.corked = 1;
				this.uncork();
			}
			if (!state.ending) endWritable(this, state, cb);
		};
		function needFinish(state) {
			return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
		}
		function callFinal(stream, state) {
			stream._final(function(err) {
				state.pendingcb--;
				if (err) stream.emit("error", err);
				state.prefinished = true;
				stream.emit("prefinish");
				finishMaybe(stream, state);
			});
		}
		function prefinish(stream, state) {
			if (!state.prefinished && !state.finalCalled) if (typeof stream._final === "function") {
				state.pendingcb++;
				state.finalCalled = true;
				pna.nextTick(callFinal, stream, state);
			} else {
				state.prefinished = true;
				stream.emit("prefinish");
			}
		}
		function finishMaybe(stream, state) {
			var need = needFinish(state);
			if (need) {
				prefinish(stream, state);
				if (state.pendingcb === 0) {
					state.finished = true;
					stream.emit("finish");
				}
			}
			return need;
		}
		function endWritable(stream, state, cb) {
			state.ending = true;
			finishMaybe(stream, state);
			if (cb) if (state.finished) pna.nextTick(cb);
			else stream.once("finish", cb);
			state.ended = true;
			stream.writable = false;
		}
		function onCorkedFinish(corkReq, state, err) {
			var entry = corkReq.entry;
			corkReq.entry = null;
			while (entry) {
				var cb = entry.callback;
				state.pendingcb--;
				cb(err);
				entry = entry.next;
			}
			state.corkedRequestsFree.next = corkReq;
		}
		Object.defineProperty(Writable.prototype, "destroyed", {
			get: function() {
				if (this._writableState === void 0) return false;
				return this._writableState.destroyed;
			},
			set: function(value) {
				if (!this._writableState) return;
				this._writableState.destroyed = value;
			}
		});
		Writable.prototype.destroy = destroyImpl.destroy;
		Writable.prototype._undestroy = destroyImpl.undestroy;
		Writable.prototype._destroy = function(err, cb) {
			this.end();
			cb(err);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_duplex.js
	var require__stream_duplex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var pna = require_process_nextick_args();
		var objectKeys = Object.keys || function(obj) {
			var keys = [];
			for (var key in obj) keys.push(key);
			return keys;
		};
		module.exports = Duplex;
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		var Readable = require__stream_readable();
		var Writable = require__stream_writable();
		util.inherits(Duplex, Readable);
		var keys = objectKeys(Writable.prototype);
		for (var v = 0; v < keys.length; v++) {
			var method = keys[v];
			if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
		}
		function Duplex(options) {
			if (!(this instanceof Duplex)) return new Duplex(options);
			Readable.call(this, options);
			Writable.call(this, options);
			if (options && options.readable === false) this.readable = false;
			if (options && options.writable === false) this.writable = false;
			this.allowHalfOpen = true;
			if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
			this.once("end", onend);
		}
		Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
			enumerable: false,
			get: function() {
				return this._writableState.highWaterMark;
			}
		});
		function onend() {
			if (this.allowHalfOpen || this._writableState.ended) return;
			pna.nextTick(onEndNT, this);
		}
		function onEndNT(self) {
			self.end();
		}
		Object.defineProperty(Duplex.prototype, "destroyed", {
			get: function() {
				if (this._readableState === void 0 || this._writableState === void 0) return false;
				return this._readableState.destroyed && this._writableState.destroyed;
			},
			set: function(value) {
				if (this._readableState === void 0 || this._writableState === void 0) return;
				this._readableState.destroyed = value;
				this._writableState.destroyed = value;
			}
		});
		Duplex.prototype._destroy = function(err, cb) {
			this.push(null);
			this.end();
			pna.nextTick(cb, err);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/string_decoder/node_modules/safe-buffer/index.js
	var require_safe_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var buffer = require_dist();
		var Buffer = buffer.Buffer;
		function copyProps(src, dst) {
			for (var key in src) dst[key] = src[key];
		}
		if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
		else {
			copyProps(buffer, exports);
			exports.Buffer = SafeBuffer;
		}
		function SafeBuffer(arg, encodingOrOffset, length) {
			return Buffer(arg, encodingOrOffset, length);
		}
		copyProps(Buffer, SafeBuffer);
		SafeBuffer.from = function(arg, encodingOrOffset, length) {
			if (typeof arg === "number") throw new TypeError("Argument must not be a number");
			return Buffer(arg, encodingOrOffset, length);
		};
		SafeBuffer.alloc = function(size, fill, encoding) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			var buf = Buffer(size);
			if (fill !== void 0) if (typeof encoding === "string") buf.fill(fill, encoding);
			else buf.fill(fill);
			else buf.fill(0);
			return buf;
		};
		SafeBuffer.allocUnsafe = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return Buffer(size);
		};
		SafeBuffer.allocUnsafeSlow = function(size) {
			if (typeof size !== "number") throw new TypeError("Argument must be a number");
			return buffer.SlowBuffer(size);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/string_decoder/lib/string_decoder.js
	var require_string_decoder = /* @__PURE__ */ __commonJSMin(((exports) => {
		var Buffer = require_safe_buffer().Buffer;
		var isEncoding = Buffer.isEncoding || function(encoding) {
			encoding = "" + encoding;
			switch (encoding && encoding.toLowerCase()) {
				case "hex":
				case "utf8":
				case "utf-8":
				case "ascii":
				case "binary":
				case "base64":
				case "ucs2":
				case "ucs-2":
				case "utf16le":
				case "utf-16le":
				case "raw": return true;
				default: return false;
			}
		};
		function _normalizeEncoding(enc) {
			if (!enc) return "utf8";
			var retried;
			while (true) switch (enc) {
				case "utf8":
				case "utf-8": return "utf8";
				case "ucs2":
				case "ucs-2":
				case "utf16le":
				case "utf-16le": return "utf16le";
				case "latin1":
				case "binary": return "latin1";
				case "base64":
				case "ascii":
				case "hex": return enc;
				default:
					if (retried) return;
					enc = ("" + enc).toLowerCase();
					retried = true;
			}
		}
		function normalizeEncoding(enc) {
			var nenc = _normalizeEncoding(enc);
			if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
			return nenc || enc;
		}
		exports.StringDecoder = StringDecoder;
		function StringDecoder(encoding) {
			this.encoding = normalizeEncoding(encoding);
			var nb;
			switch (this.encoding) {
				case "utf16le":
					this.text = utf16Text;
					this.end = utf16End;
					nb = 4;
					break;
				case "utf8":
					this.fillLast = utf8FillLast;
					nb = 4;
					break;
				case "base64":
					this.text = base64Text;
					this.end = base64End;
					nb = 3;
					break;
				default:
					this.write = simpleWrite;
					this.end = simpleEnd;
					return;
			}
			this.lastNeed = 0;
			this.lastTotal = 0;
			this.lastChar = Buffer.allocUnsafe(nb);
		}
		StringDecoder.prototype.write = function(buf) {
			if (buf.length === 0) return "";
			var r;
			var i;
			if (this.lastNeed) {
				r = this.fillLast(buf);
				if (r === void 0) return "";
				i = this.lastNeed;
				this.lastNeed = 0;
			} else i = 0;
			if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
			return r || "";
		};
		StringDecoder.prototype.end = utf8End;
		StringDecoder.prototype.text = utf8Text;
		StringDecoder.prototype.fillLast = function(buf) {
			if (this.lastNeed <= buf.length) {
				buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
				return this.lastChar.toString(this.encoding, 0, this.lastTotal);
			}
			buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
			this.lastNeed -= buf.length;
		};
		function utf8CheckByte(byte) {
			if (byte <= 127) return 0;
			else if (byte >> 5 === 6) return 2;
			else if (byte >> 4 === 14) return 3;
			else if (byte >> 3 === 30) return 4;
			return byte >> 6 === 2 ? -1 : -2;
		}
		function utf8CheckIncomplete(self, buf, i) {
			var j = buf.length - 1;
			if (j < i) return 0;
			var nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) self.lastNeed = nb - 1;
				return nb;
			}
			if (--j < i || nb === -2) return 0;
			nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) self.lastNeed = nb - 2;
				return nb;
			}
			if (--j < i || nb === -2) return 0;
			nb = utf8CheckByte(buf[j]);
			if (nb >= 0) {
				if (nb > 0) if (nb === 2) nb = 0;
				else self.lastNeed = nb - 3;
				return nb;
			}
			return 0;
		}
		function utf8CheckExtraBytes(self, buf, p) {
			if ((buf[0] & 192) !== 128) {
				self.lastNeed = 0;
				return "�";
			}
			if (self.lastNeed > 1 && buf.length > 1) {
				if ((buf[1] & 192) !== 128) {
					self.lastNeed = 1;
					return "�";
				}
				if (self.lastNeed > 2 && buf.length > 2) {
					if ((buf[2] & 192) !== 128) {
						self.lastNeed = 2;
						return "�";
					}
				}
			}
		}
		function utf8FillLast(buf) {
			var p = this.lastTotal - this.lastNeed;
			var r = utf8CheckExtraBytes(this, buf, p);
			if (r !== void 0) return r;
			if (this.lastNeed <= buf.length) {
				buf.copy(this.lastChar, p, 0, this.lastNeed);
				return this.lastChar.toString(this.encoding, 0, this.lastTotal);
			}
			buf.copy(this.lastChar, p, 0, buf.length);
			this.lastNeed -= buf.length;
		}
		function utf8Text(buf, i) {
			var total = utf8CheckIncomplete(this, buf, i);
			if (!this.lastNeed) return buf.toString("utf8", i);
			this.lastTotal = total;
			var end = buf.length - (total - this.lastNeed);
			buf.copy(this.lastChar, 0, end);
			return buf.toString("utf8", i, end);
		}
		function utf8End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) return r + "�";
			return r;
		}
		function utf16Text(buf, i) {
			if ((buf.length - i) % 2 === 0) {
				var r = buf.toString("utf16le", i);
				if (r) {
					var c = r.charCodeAt(r.length - 1);
					if (c >= 55296 && c <= 56319) {
						this.lastNeed = 2;
						this.lastTotal = 4;
						this.lastChar[0] = buf[buf.length - 2];
						this.lastChar[1] = buf[buf.length - 1];
						return r.slice(0, -1);
					}
				}
				return r;
			}
			this.lastNeed = 1;
			this.lastTotal = 2;
			this.lastChar[0] = buf[buf.length - 1];
			return buf.toString("utf16le", i, buf.length - 1);
		}
		function utf16End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) {
				var end = this.lastTotal - this.lastNeed;
				return r + this.lastChar.toString("utf16le", 0, end);
			}
			return r;
		}
		function base64Text(buf, i) {
			var n = (buf.length - i) % 3;
			if (n === 0) return buf.toString("base64", i);
			this.lastNeed = 3 - n;
			this.lastTotal = 3;
			if (n === 1) this.lastChar[0] = buf[buf.length - 1];
			else {
				this.lastChar[0] = buf[buf.length - 2];
				this.lastChar[1] = buf[buf.length - 1];
			}
			return buf.toString("base64", i, buf.length - n);
		}
		function base64End(buf) {
			var r = buf && buf.length ? this.write(buf) : "";
			if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
			return r;
		}
		function simpleWrite(buf) {
			return buf.toString(this.encoding);
		}
		function simpleEnd(buf) {
			return buf && buf.length ? this.write(buf) : "";
		}
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_readable.js
	var require__stream_readable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		init_dist$1();
		var pna = require_process_nextick_args();
		module.exports = Readable;
		var isArray = require_isarray();
		var Duplex;
		Readable.ReadableState = ReadableState;
		require_events().EventEmitter;
		var EElistenerCount = function(emitter, type) {
			return emitter.listeners(type).length;
		};
		var Stream = require_stream_browser();
		var Buffer = require_safe_buffer$1().Buffer;
		var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
		function _uint8ArrayToBuffer(chunk) {
			return Buffer.from(chunk);
		}
		function _isUint8Array(obj) {
			return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
		}
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		var debugUtil = require_util$2();
		var debug = void 0;
		if (debugUtil && debugUtil.debuglog) debug = debugUtil.debuglog("stream");
		else debug = function() {};
		var BufferList = require_BufferList();
		var destroyImpl = require_destroy();
		var StringDecoder;
		util.inherits(Readable, Stream);
		var kProxyEvents = [
			"error",
			"close",
			"destroy",
			"pause",
			"resume"
		];
		function prependListener(emitter, event, fn) {
			if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
			if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
			else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);
			else emitter._events[event] = [fn, emitter._events[event]];
		}
		function ReadableState(options, stream) {
			Duplex = Duplex || require__stream_duplex();
			options = options || {};
			var isDuplex = stream instanceof Duplex;
			this.objectMode = !!options.objectMode;
			if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
			var hwm = options.highWaterMark;
			var readableHwm = options.readableHighWaterMark;
			var defaultHwm = this.objectMode ? 16 : 16 * 1024;
			if (hwm || hwm === 0) this.highWaterMark = hwm;
			else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;
			else this.highWaterMark = defaultHwm;
			this.highWaterMark = Math.floor(this.highWaterMark);
			this.buffer = new BufferList();
			this.length = 0;
			this.pipes = null;
			this.pipesCount = 0;
			this.flowing = null;
			this.ended = false;
			this.endEmitted = false;
			this.reading = false;
			this.sync = true;
			this.needReadable = false;
			this.emittedReadable = false;
			this.readableListening = false;
			this.resumeScheduled = false;
			this.destroyed = false;
			this.defaultEncoding = options.defaultEncoding || "utf8";
			this.awaitDrain = 0;
			this.readingMore = false;
			this.decoder = null;
			this.encoding = null;
			if (options.encoding) {
				if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
				this.decoder = new StringDecoder(options.encoding);
				this.encoding = options.encoding;
			}
		}
		function Readable(options) {
			Duplex = Duplex || require__stream_duplex();
			if (!(this instanceof Readable)) return new Readable(options);
			this._readableState = new ReadableState(options, this);
			this.readable = true;
			if (options) {
				if (typeof options.read === "function") this._read = options.read;
				if (typeof options.destroy === "function") this._destroy = options.destroy;
			}
			Stream.call(this);
		}
		Object.defineProperty(Readable.prototype, "destroyed", {
			get: function() {
				if (this._readableState === void 0) return false;
				return this._readableState.destroyed;
			},
			set: function(value) {
				if (!this._readableState) return;
				this._readableState.destroyed = value;
			}
		});
		Readable.prototype.destroy = destroyImpl.destroy;
		Readable.prototype._undestroy = destroyImpl.undestroy;
		Readable.prototype._destroy = function(err, cb) {
			this.push(null);
			cb(err);
		};
		Readable.prototype.push = function(chunk, encoding) {
			var state = this._readableState;
			var skipChunkCheck;
			if (!state.objectMode) {
				if (typeof chunk === "string") {
					encoding = encoding || state.defaultEncoding;
					if (encoding !== state.encoding) {
						chunk = Buffer.from(chunk, encoding);
						encoding = "";
					}
					skipChunkCheck = true;
				}
			} else skipChunkCheck = true;
			return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
		};
		Readable.prototype.unshift = function(chunk) {
			return readableAddChunk(this, chunk, null, true, false);
		};
		function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
			var state = stream._readableState;
			if (chunk === null) {
				state.reading = false;
				onEofChunk(stream, state);
			} else {
				var er;
				if (!skipChunkCheck) er = chunkInvalid(state, chunk);
				if (er) stream.emit("error", er);
				else if (state.objectMode || chunk && chunk.length > 0) {
					if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) chunk = _uint8ArrayToBuffer(chunk);
					if (addToFront) if (state.endEmitted) stream.emit("error", /* @__PURE__ */ new Error("stream.unshift() after end event"));
					else addChunk(stream, state, chunk, true);
					else if (state.ended) stream.emit("error", /* @__PURE__ */ new Error("stream.push() after EOF"));
					else {
						state.reading = false;
						if (state.decoder && !encoding) {
							chunk = state.decoder.write(chunk);
							if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
							else maybeReadMore(stream, state);
						} else addChunk(stream, state, chunk, false);
					}
				} else if (!addToFront) state.reading = false;
			}
			return needMoreData(state);
		}
		function addChunk(stream, state, chunk, addToFront) {
			if (state.flowing && state.length === 0 && !state.sync) {
				stream.emit("data", chunk);
				stream.read(0);
			} else {
				state.length += state.objectMode ? 1 : chunk.length;
				if (addToFront) state.buffer.unshift(chunk);
				else state.buffer.push(chunk);
				if (state.needReadable) emitReadable(stream);
			}
			maybeReadMore(stream, state);
		}
		function chunkInvalid(state, chunk) {
			var er;
			if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) er = /* @__PURE__ */ new TypeError("Invalid non-string/buffer chunk");
			return er;
		}
		function needMoreData(state) {
			return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
		}
		Readable.prototype.isPaused = function() {
			return this._readableState.flowing === false;
		};
		Readable.prototype.setEncoding = function(enc) {
			if (!StringDecoder) StringDecoder = require_string_decoder().StringDecoder;
			this._readableState.decoder = new StringDecoder(enc);
			this._readableState.encoding = enc;
			return this;
		};
		var MAX_HWM = 8388608;
		function computeNewHighWaterMark(n) {
			if (n >= MAX_HWM) n = MAX_HWM;
			else {
				n--;
				n |= n >>> 1;
				n |= n >>> 2;
				n |= n >>> 4;
				n |= n >>> 8;
				n |= n >>> 16;
				n++;
			}
			return n;
		}
		function howMuchToRead(n, state) {
			if (n <= 0 || state.length === 0 && state.ended) return 0;
			if (state.objectMode) return 1;
			if (n !== n) if (state.flowing && state.length) return state.buffer.head.data.length;
			else return state.length;
			if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
			if (n <= state.length) return n;
			if (!state.ended) {
				state.needReadable = true;
				return 0;
			}
			return state.length;
		}
		Readable.prototype.read = function(n) {
			debug("read", n);
			n = parseInt(n, 10);
			var state = this._readableState;
			var nOrig = n;
			if (n !== 0) state.emittedReadable = false;
			if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
				debug("read: emitReadable", state.length, state.ended);
				if (state.length === 0 && state.ended) endReadable(this);
				else emitReadable(this);
				return null;
			}
			n = howMuchToRead(n, state);
			if (n === 0 && state.ended) {
				if (state.length === 0) endReadable(this);
				return null;
			}
			var doRead = state.needReadable;
			debug("need readable", doRead);
			if (state.length === 0 || state.length - n < state.highWaterMark) {
				doRead = true;
				debug("length less than watermark", doRead);
			}
			if (state.ended || state.reading) {
				doRead = false;
				debug("reading or ended", doRead);
			} else if (doRead) {
				debug("do read");
				state.reading = true;
				state.sync = true;
				if (state.length === 0) state.needReadable = true;
				this._read(state.highWaterMark);
				state.sync = false;
				if (!state.reading) n = howMuchToRead(nOrig, state);
			}
			var ret;
			if (n > 0) ret = fromList(n, state);
			else ret = null;
			if (ret === null) {
				state.needReadable = true;
				n = 0;
			} else state.length -= n;
			if (state.length === 0) {
				if (!state.ended) state.needReadable = true;
				if (nOrig !== n && state.ended) endReadable(this);
			}
			if (ret !== null) this.emit("data", ret);
			return ret;
		};
		function onEofChunk(stream, state) {
			if (state.ended) return;
			if (state.decoder) {
				var chunk = state.decoder.end();
				if (chunk && chunk.length) {
					state.buffer.push(chunk);
					state.length += state.objectMode ? 1 : chunk.length;
				}
			}
			state.ended = true;
			emitReadable(stream);
		}
		function emitReadable(stream) {
			var state = stream._readableState;
			state.needReadable = false;
			if (!state.emittedReadable) {
				debug("emitReadable", state.flowing);
				state.emittedReadable = true;
				if (state.sync) pna.nextTick(emitReadable_, stream);
				else emitReadable_(stream);
			}
		}
		function emitReadable_(stream) {
			debug("emit readable");
			stream.emit("readable");
			flow(stream);
		}
		function maybeReadMore(stream, state) {
			if (!state.readingMore) {
				state.readingMore = true;
				pna.nextTick(maybeReadMore_, stream, state);
			}
		}
		function maybeReadMore_(stream, state) {
			var len = state.length;
			while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
				debug("maybeReadMore read 0");
				stream.read(0);
				if (len === state.length) break;
				else len = state.length;
			}
			state.readingMore = false;
		}
		Readable.prototype._read = function(n) {
			this.emit("error", /* @__PURE__ */ new Error("_read() is not implemented"));
		};
		Readable.prototype.pipe = function(dest, pipeOpts) {
			var src = this;
			var state = this._readableState;
			switch (state.pipesCount) {
				case 0:
					state.pipes = dest;
					break;
				case 1:
					state.pipes = [state.pipes, dest];
					break;
				default:
					state.pipes.push(dest);
					break;
			}
			state.pipesCount += 1;
			debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
			var endFn = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr ? onend : unpipe;
			if (state.endEmitted) pna.nextTick(endFn);
			else src.once("end", endFn);
			dest.on("unpipe", onunpipe);
			function onunpipe(readable, unpipeInfo) {
				debug("onunpipe");
				if (readable === src) {
					if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
						unpipeInfo.hasUnpiped = true;
						cleanup();
					}
				}
			}
			function onend() {
				debug("onend");
				dest.end();
			}
			var ondrain = pipeOnDrain(src);
			dest.on("drain", ondrain);
			var cleanedUp = false;
			function cleanup() {
				debug("cleanup");
				dest.removeListener("close", onclose);
				dest.removeListener("finish", onfinish);
				dest.removeListener("drain", ondrain);
				dest.removeListener("error", onerror);
				dest.removeListener("unpipe", onunpipe);
				src.removeListener("end", onend);
				src.removeListener("end", unpipe);
				src.removeListener("data", ondata);
				cleanedUp = true;
				if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
			}
			var increasedAwaitDrain = false;
			src.on("data", ondata);
			function ondata(chunk) {
				debug("ondata");
				increasedAwaitDrain = false;
				if (false === dest.write(chunk) && !increasedAwaitDrain) {
					if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
						debug("false write response, pause", state.awaitDrain);
						state.awaitDrain++;
						increasedAwaitDrain = true;
					}
					src.pause();
				}
			}
			function onerror(er) {
				debug("onerror", er);
				unpipe();
				dest.removeListener("error", onerror);
				if (EElistenerCount(dest, "error") === 0) dest.emit("error", er);
			}
			prependListener(dest, "error", onerror);
			function onclose() {
				dest.removeListener("finish", onfinish);
				unpipe();
			}
			dest.once("close", onclose);
			function onfinish() {
				debug("onfinish");
				dest.removeListener("close", onclose);
				unpipe();
			}
			dest.once("finish", onfinish);
			function unpipe() {
				debug("unpipe");
				src.unpipe(dest);
			}
			dest.emit("pipe", src);
			if (!state.flowing) {
				debug("pipe resume");
				src.resume();
			}
			return dest;
		};
		function pipeOnDrain(src) {
			return function() {
				var state = src._readableState;
				debug("pipeOnDrain", state.awaitDrain);
				if (state.awaitDrain) state.awaitDrain--;
				if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
					state.flowing = true;
					flow(src);
				}
			};
		}
		Readable.prototype.unpipe = function(dest) {
			var state = this._readableState;
			var unpipeInfo = { hasUnpiped: false };
			if (state.pipesCount === 0) return this;
			if (state.pipesCount === 1) {
				if (dest && dest !== state.pipes) return this;
				if (!dest) dest = state.pipes;
				state.pipes = null;
				state.pipesCount = 0;
				state.flowing = false;
				if (dest) dest.emit("unpipe", this, unpipeInfo);
				return this;
			}
			if (!dest) {
				var dests = state.pipes;
				var len = state.pipesCount;
				state.pipes = null;
				state.pipesCount = 0;
				state.flowing = false;
				for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, { hasUnpiped: false });
				return this;
			}
			var index = indexOf(state.pipes, dest);
			if (index === -1) return this;
			state.pipes.splice(index, 1);
			state.pipesCount -= 1;
			if (state.pipesCount === 1) state.pipes = state.pipes[0];
			dest.emit("unpipe", this, unpipeInfo);
			return this;
		};
		Readable.prototype.on = function(ev, fn) {
			var res = Stream.prototype.on.call(this, ev, fn);
			if (ev === "data") {
				if (this._readableState.flowing !== false) this.resume();
			} else if (ev === "readable") {
				var state = this._readableState;
				if (!state.endEmitted && !state.readableListening) {
					state.readableListening = state.needReadable = true;
					state.emittedReadable = false;
					if (!state.reading) pna.nextTick(nReadingNextTick, this);
					else if (state.length) emitReadable(this);
				}
			}
			return res;
		};
		Readable.prototype.addListener = Readable.prototype.on;
		function nReadingNextTick(self) {
			debug("readable nexttick read 0");
			self.read(0);
		}
		Readable.prototype.resume = function() {
			var state = this._readableState;
			if (!state.flowing) {
				debug("resume");
				state.flowing = true;
				resume(this, state);
			}
			return this;
		};
		function resume(stream, state) {
			if (!state.resumeScheduled) {
				state.resumeScheduled = true;
				pna.nextTick(resume_, stream, state);
			}
		}
		function resume_(stream, state) {
			if (!state.reading) {
				debug("resume read 0");
				stream.read(0);
			}
			state.resumeScheduled = false;
			state.awaitDrain = 0;
			stream.emit("resume");
			flow(stream);
			if (state.flowing && !state.reading) stream.read(0);
		}
		Readable.prototype.pause = function() {
			debug("call pause flowing=%j", this._readableState.flowing);
			if (false !== this._readableState.flowing) {
				debug("pause");
				this._readableState.flowing = false;
				this.emit("pause");
			}
			return this;
		};
		function flow(stream) {
			var state = stream._readableState;
			debug("flow", state.flowing);
			while (state.flowing && stream.read() !== null);
		}
		Readable.prototype.wrap = function(stream) {
			var _this = this;
			var state = this._readableState;
			var paused = false;
			stream.on("end", function() {
				debug("wrapped end");
				if (state.decoder && !state.ended) {
					var chunk = state.decoder.end();
					if (chunk && chunk.length) _this.push(chunk);
				}
				_this.push(null);
			});
			stream.on("data", function(chunk) {
				debug("wrapped data");
				if (state.decoder) chunk = state.decoder.write(chunk);
				if (state.objectMode && (chunk === null || chunk === void 0)) return;
				else if (!state.objectMode && (!chunk || !chunk.length)) return;
				if (!_this.push(chunk)) {
					paused = true;
					stream.pause();
				}
			});
			for (var i in stream) if (this[i] === void 0 && typeof stream[i] === "function") this[i] = function(method) {
				return function() {
					return stream[method].apply(stream, arguments);
				};
			}(i);
			for (var n = 0; n < kProxyEvents.length; n++) stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
			this._read = function(n) {
				debug("wrapped _read", n);
				if (paused) {
					paused = false;
					stream.resume();
				}
			};
			return this;
		};
		Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
			enumerable: false,
			get: function() {
				return this._readableState.highWaterMark;
			}
		});
		Readable._fromList = fromList;
		function fromList(n, state) {
			if (state.length === 0) return null;
			var ret;
			if (state.objectMode) ret = state.buffer.shift();
			else if (!n || n >= state.length) {
				if (state.decoder) ret = state.buffer.join("");
				else if (state.buffer.length === 1) ret = state.buffer.head.data;
				else ret = state.buffer.concat(state.length);
				state.buffer.clear();
			} else ret = fromListPartial(n, state.buffer, state.decoder);
			return ret;
		}
		function fromListPartial(n, list, hasStrings) {
			var ret;
			if (n < list.head.data.length) {
				ret = list.head.data.slice(0, n);
				list.head.data = list.head.data.slice(n);
			} else if (n === list.head.data.length) ret = list.shift();
			else ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
			return ret;
		}
		function copyFromBufferString(n, list) {
			var p = list.head;
			var c = 1;
			var ret = p.data;
			n -= ret.length;
			while (p = p.next) {
				var str = p.data;
				var nb = n > str.length ? str.length : n;
				if (nb === str.length) ret += str;
				else ret += str.slice(0, n);
				n -= nb;
				if (n === 0) {
					if (nb === str.length) {
						++c;
						if (p.next) list.head = p.next;
						else list.head = list.tail = null;
					} else {
						list.head = p;
						p.data = str.slice(nb);
					}
					break;
				}
				++c;
			}
			list.length -= c;
			return ret;
		}
		function copyFromBuffer(n, list) {
			var ret = Buffer.allocUnsafe(n);
			var p = list.head;
			var c = 1;
			p.data.copy(ret);
			n -= p.data.length;
			while (p = p.next) {
				var buf = p.data;
				var nb = n > buf.length ? buf.length : n;
				buf.copy(ret, ret.length - n, 0, nb);
				n -= nb;
				if (n === 0) {
					if (nb === buf.length) {
						++c;
						if (p.next) list.head = p.next;
						else list.head = list.tail = null;
					} else {
						list.head = p;
						p.data = buf.slice(nb);
					}
					break;
				}
				++c;
			}
			list.length -= c;
			return ret;
		}
		function endReadable(stream) {
			var state = stream._readableState;
			if (state.length > 0) throw new Error("\"endReadable()\" called on non-empty stream");
			if (!state.endEmitted) {
				state.ended = true;
				pna.nextTick(endReadableNT, state, stream);
			}
		}
		function endReadableNT(state, stream) {
			if (!state.endEmitted && state.length === 0) {
				state.endEmitted = true;
				stream.readable = false;
				stream.emit("end");
			}
		}
		function indexOf(xs, x) {
			for (var i = 0, l = xs.length; i < l; i++) if (xs[i] === x) return i;
			return -1;
		}
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_transform.js
	var require__stream_transform = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = Transform;
		var Duplex = require__stream_duplex();
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		util.inherits(Transform, Duplex);
		function afterTransform(er, data) {
			var ts = this._transformState;
			ts.transforming = false;
			var cb = ts.writecb;
			if (!cb) return this.emit("error", /* @__PURE__ */ new Error("write callback called multiple times"));
			ts.writechunk = null;
			ts.writecb = null;
			if (data != null) this.push(data);
			cb(er);
			var rs = this._readableState;
			rs.reading = false;
			if (rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
		}
		function Transform(options) {
			if (!(this instanceof Transform)) return new Transform(options);
			Duplex.call(this, options);
			this._transformState = {
				afterTransform: afterTransform.bind(this),
				needTransform: false,
				transforming: false,
				writecb: null,
				writechunk: null,
				writeencoding: null
			};
			this._readableState.needReadable = true;
			this._readableState.sync = false;
			if (options) {
				if (typeof options.transform === "function") this._transform = options.transform;
				if (typeof options.flush === "function") this._flush = options.flush;
			}
			this.on("prefinish", prefinish);
		}
		function prefinish() {
			var _this = this;
			if (typeof this._flush === "function") this._flush(function(er, data) {
				done(_this, er, data);
			});
			else done(this, null, null);
		}
		Transform.prototype.push = function(chunk, encoding) {
			this._transformState.needTransform = false;
			return Duplex.prototype.push.call(this, chunk, encoding);
		};
		Transform.prototype._transform = function(chunk, encoding, cb) {
			throw new Error("_transform() is not implemented");
		};
		Transform.prototype._write = function(chunk, encoding, cb) {
			var ts = this._transformState;
			ts.writecb = cb;
			ts.writechunk = chunk;
			ts.writeencoding = encoding;
			if (!ts.transforming) {
				var rs = this._readableState;
				if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
			}
		};
		Transform.prototype._read = function(n) {
			var ts = this._transformState;
			if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
				ts.transforming = true;
				this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
			} else ts.needTransform = true;
		};
		Transform.prototype._destroy = function(err, cb) {
			var _this2 = this;
			Duplex.prototype._destroy.call(this, err, function(err2) {
				cb(err2);
				_this2.emit("close");
			});
		};
		function done(stream, er, data) {
			if (er) return stream.emit("error", er);
			if (data != null) stream.push(data);
			if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0");
			if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming");
			return stream.push(null);
		}
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_passthrough.js
	var require__stream_passthrough = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = PassThrough;
		var Transform = require__stream_transform();
		var util = Object.create(require_util$3());
		util.inherits = require_inherits_browser();
		util.inherits(PassThrough, Transform);
		function PassThrough(options) {
			if (!(this instanceof PassThrough)) return new PassThrough(options);
			Transform.call(this, options);
		}
		PassThrough.prototype._transform = function(chunk, encoding, cb) {
			cb(null, chunk);
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/readable-stream/readable-browser.js
	var require_readable_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports = module.exports = require__stream_readable();
		exports.Stream = exports;
		exports.Readable = exports;
		exports.Writable = require__stream_writable();
		exports.Duplex = require__stream_duplex();
		exports.Transform = require__stream_transform();
		exports.PassThrough = require__stream_passthrough();
	}));
	//#endregion
	//#region ../../node_modules/browserify-rsa/node_modules/bn.js/lib/bn.js
	var require_bn$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function(module$2, exports$2) {
			"use strict";
			function assert(val, msg) {
				if (!val) throw new Error(msg || "Assertion failed");
			}
			function inherits(ctor, superCtor) {
				ctor.super_ = superCtor;
				var TempCtor = function() {};
				TempCtor.prototype = superCtor.prototype;
				ctor.prototype = new TempCtor();
				ctor.prototype.constructor = ctor;
			}
			function BN(number, base, endian) {
				if (BN.isBN(number)) return number;
				this.negative = 0;
				this.words = null;
				this.length = 0;
				this.red = null;
				if (number !== null) {
					if (base === "le" || base === "be") {
						endian = base;
						base = 10;
					}
					this._init(number || 0, base || 10, endian || "be");
				}
			}
			if (typeof module$2 === "object") module$2.exports = BN;
			else exports$2.BN = BN;
			BN.BN = BN;
			BN.wordSize = 26;
			var Buffer;
			try {
				if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer = window.Buffer;
				else Buffer = require_dist().Buffer;
			} catch (e) {}
			BN.isBN = function isBN(num) {
				if (num instanceof BN) return true;
				return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
			};
			BN.max = function max(left, right) {
				if (left.cmp(right) > 0) return left;
				return right;
			};
			BN.min = function min(left, right) {
				if (left.cmp(right) < 0) return left;
				return right;
			};
			BN.prototype._init = function init(number, base, endian) {
				if (typeof number === "number") return this._initNumber(number, base, endian);
				if (typeof number === "object") return this._initArray(number, base, endian);
				if (base === "hex") base = 16;
				assert(base === (base | 0) && base >= 2 && base <= 36);
				number = number.toString().replace(/\s+/g, "");
				var start = 0;
				if (number[0] === "-") {
					start++;
					this.negative = 1;
				}
				if (start < number.length) if (base === 16) this._parseHex(number, start, endian);
				else {
					this._parseBase(number, base, start);
					if (endian === "le") this._initArray(this.toArray(), base, endian);
				}
			};
			BN.prototype._initNumber = function _initNumber(number, base, endian) {
				if (number < 0) {
					this.negative = 1;
					number = -number;
				}
				if (number < 67108864) {
					this.words = [number & 67108863];
					this.length = 1;
				} else if (number < 4503599627370496) {
					this.words = [number & 67108863, number / 67108864 & 67108863];
					this.length = 2;
				} else {
					assert(number < 9007199254740992);
					this.words = [
						number & 67108863,
						number / 67108864 & 67108863,
						1
					];
					this.length = 3;
				}
				if (endian !== "le") return;
				this._initArray(this.toArray(), base, endian);
			};
			BN.prototype._initArray = function _initArray(number, base, endian) {
				assert(typeof number.length === "number");
				if (number.length <= 0) {
					this.words = [0];
					this.length = 1;
					return this;
				}
				this.length = Math.ceil(number.length / 3);
				this.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) this.words[i] = 0;
				var j, w;
				var off = 0;
				if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
					w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
					this.words[j] |= w << off & 67108863;
					this.words[j + 1] = w >>> 26 - off & 67108863;
					off += 24;
					if (off >= 26) {
						off -= 26;
						j++;
					}
				}
				else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) {
					w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
					this.words[j] |= w << off & 67108863;
					this.words[j + 1] = w >>> 26 - off & 67108863;
					off += 24;
					if (off >= 26) {
						off -= 26;
						j++;
					}
				}
				return this._strip();
			};
			function parseHex4Bits(string, index) {
				var c = string.charCodeAt(index);
				if (c >= 48 && c <= 57) return c - 48;
				else if (c >= 65 && c <= 70) return c - 55;
				else if (c >= 97 && c <= 102) return c - 87;
				else assert(false, "Invalid character in " + string);
			}
			function parseHexByte(string, lowerBound, index) {
				var r = parseHex4Bits(string, index);
				if (index - 1 >= lowerBound) r |= parseHex4Bits(string, index - 1) << 4;
				return r;
			}
			BN.prototype._parseHex = function _parseHex(number, start, endian) {
				this.length = Math.ceil((number.length - start) / 6);
				this.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) this.words[i] = 0;
				var off = 0;
				var j = 0;
				var w;
				if (endian === "be") for (i = number.length - 1; i >= start; i -= 2) {
					w = parseHexByte(number, start, i) << off;
					this.words[j] |= w & 67108863;
					if (off >= 18) {
						off -= 18;
						j += 1;
						this.words[j] |= w >>> 26;
					} else off += 8;
				}
				else for (i = (number.length - start) % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
					w = parseHexByte(number, start, i) << off;
					this.words[j] |= w & 67108863;
					if (off >= 18) {
						off -= 18;
						j += 1;
						this.words[j] |= w >>> 26;
					} else off += 8;
				}
				this._strip();
			};
			function parseBase(str, start, end, mul) {
				var r = 0;
				var b = 0;
				var len = Math.min(str.length, end);
				for (var i = start; i < len; i++) {
					var c = str.charCodeAt(i) - 48;
					r *= mul;
					if (c >= 49) b = c - 49 + 10;
					else if (c >= 17) b = c - 17 + 10;
					else b = c;
					assert(c >= 0 && b < mul, "Invalid character");
					r += b;
				}
				return r;
			}
			BN.prototype._parseBase = function _parseBase(number, base, start) {
				this.words = [0];
				this.length = 1;
				for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++;
				limbLen--;
				limbPow = limbPow / base | 0;
				var total = number.length - start;
				var mod = total % limbLen;
				var end = Math.min(total, total - mod) + start;
				var word = 0;
				for (var i = start; i < end; i += limbLen) {
					word = parseBase(number, i, i + limbLen, base);
					this.imuln(limbPow);
					if (this.words[0] + word < 67108864) this.words[0] += word;
					else this._iaddn(word);
				}
				if (mod !== 0) {
					var pow = 1;
					word = parseBase(number, i, number.length, base);
					for (i = 0; i < mod; i++) pow *= base;
					this.imuln(pow);
					if (this.words[0] + word < 67108864) this.words[0] += word;
					else this._iaddn(word);
				}
				this._strip();
			};
			BN.prototype.copy = function copy(dest) {
				dest.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i];
				dest.length = this.length;
				dest.negative = this.negative;
				dest.red = this.red;
			};
			function move(dest, src) {
				dest.words = src.words;
				dest.length = src.length;
				dest.negative = src.negative;
				dest.red = src.red;
			}
			BN.prototype._move = function _move(dest) {
				move(dest, this);
			};
			BN.prototype.clone = function clone() {
				var r = new BN(null);
				this.copy(r);
				return r;
			};
			BN.prototype._expand = function _expand(size) {
				while (this.length < size) this.words[this.length++] = 0;
				return this;
			};
			BN.prototype._strip = function strip() {
				while (this.length > 1 && this.words[this.length - 1] === 0) this.length--;
				return this._normSign();
			};
			BN.prototype._normSign = function _normSign() {
				if (this.length === 1 && this.words[0] === 0) this.negative = 0;
				return this;
			};
			if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") try {
				BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
			} catch (e) {
				BN.prototype.inspect = inspect;
			}
			else BN.prototype.inspect = inspect;
			function inspect() {
				return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
			}
			var zeros = [
				"",
				"0",
				"00",
				"000",
				"0000",
				"00000",
				"000000",
				"0000000",
				"00000000",
				"000000000",
				"0000000000",
				"00000000000",
				"000000000000",
				"0000000000000",
				"00000000000000",
				"000000000000000",
				"0000000000000000",
				"00000000000000000",
				"000000000000000000",
				"0000000000000000000",
				"00000000000000000000",
				"000000000000000000000",
				"0000000000000000000000",
				"00000000000000000000000",
				"000000000000000000000000",
				"0000000000000000000000000"
			];
			var groupSizes = [
				0,
				0,
				25,
				16,
				12,
				11,
				10,
				9,
				8,
				8,
				7,
				7,
				7,
				7,
				6,
				6,
				6,
				6,
				6,
				6,
				6,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5
			];
			var groupBases = [
				0,
				0,
				33554432,
				43046721,
				16777216,
				48828125,
				60466176,
				40353607,
				16777216,
				43046721,
				1e7,
				19487171,
				35831808,
				62748517,
				7529536,
				11390625,
				16777216,
				24137569,
				34012224,
				47045881,
				64e6,
				4084101,
				5153632,
				6436343,
				7962624,
				9765625,
				11881376,
				14348907,
				17210368,
				20511149,
				243e5,
				28629151,
				33554432,
				39135393,
				45435424,
				52521875,
				60466176
			];
			BN.prototype.toString = function toString(base, padding) {
				base = base || 10;
				padding = padding | 0 || 1;
				var out;
				if (base === 16 || base === "hex") {
					out = "";
					var off = 0;
					var carry = 0;
					for (var i = 0; i < this.length; i++) {
						var w = this.words[i];
						var word = ((w << off | carry) & 16777215).toString(16);
						carry = w >>> 24 - off & 16777215;
						off += 2;
						if (off >= 26) {
							off -= 26;
							i--;
						}
						if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out;
						else out = word + out;
					}
					if (carry !== 0) out = carry.toString(16) + out;
					while (out.length % padding !== 0) out = "0" + out;
					if (this.negative !== 0) out = "-" + out;
					return out;
				}
				if (base === (base | 0) && base >= 2 && base <= 36) {
					var groupSize = groupSizes[base];
					var groupBase = groupBases[base];
					out = "";
					var c = this.clone();
					c.negative = 0;
					while (!c.isZero()) {
						var r = c.modrn(groupBase).toString(base);
						c = c.idivn(groupBase);
						if (!c.isZero()) out = zeros[groupSize - r.length] + r + out;
						else out = r + out;
					}
					if (this.isZero()) out = "0" + out;
					while (out.length % padding !== 0) out = "0" + out;
					if (this.negative !== 0) out = "-" + out;
					return out;
				}
				assert(false, "Base should be between 2 and 36");
			};
			BN.prototype.toNumber = function toNumber() {
				var ret = this.words[0];
				if (this.length === 2) ret += this.words[1] * 67108864;
				else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864;
				else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits");
				return this.negative !== 0 ? -ret : ret;
			};
			BN.prototype.toJSON = function toJSON() {
				return this.toString(16, 2);
			};
			if (Buffer) BN.prototype.toBuffer = function toBuffer(endian, length) {
				return this.toArrayLike(Buffer, endian, length);
			};
			BN.prototype.toArray = function toArray(endian, length) {
				return this.toArrayLike(Array, endian, length);
			};
			var allocate = function allocate(ArrayType, size) {
				if (ArrayType.allocUnsafe) return ArrayType.allocUnsafe(size);
				return new ArrayType(size);
			};
			BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
				this._strip();
				var byteLength = this.byteLength();
				var reqLength = length || Math.max(1, byteLength);
				assert(byteLength <= reqLength, "byte array longer than desired length");
				assert(reqLength > 0, "Requested array length <= 0");
				var res = allocate(ArrayType, reqLength);
				this["_toArrayLike" + (endian === "le" ? "LE" : "BE")](res, byteLength);
				return res;
			};
			BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) {
				var position = 0;
				var carry = 0;
				for (var i = 0, shift = 0; i < this.length; i++) {
					var word = this.words[i] << shift | carry;
					res[position++] = word & 255;
					if (position < res.length) res[position++] = word >> 8 & 255;
					if (position < res.length) res[position++] = word >> 16 & 255;
					if (shift === 6) {
						if (position < res.length) res[position++] = word >> 24 & 255;
						carry = 0;
						shift = 0;
					} else {
						carry = word >>> 24;
						shift += 2;
					}
				}
				if (position < res.length) {
					res[position++] = carry;
					while (position < res.length) res[position++] = 0;
				}
			};
			BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) {
				var position = res.length - 1;
				var carry = 0;
				for (var i = 0, shift = 0; i < this.length; i++) {
					var word = this.words[i] << shift | carry;
					res[position--] = word & 255;
					if (position >= 0) res[position--] = word >> 8 & 255;
					if (position >= 0) res[position--] = word >> 16 & 255;
					if (shift === 6) {
						if (position >= 0) res[position--] = word >> 24 & 255;
						carry = 0;
						shift = 0;
					} else {
						carry = word >>> 24;
						shift += 2;
					}
				}
				if (position >= 0) {
					res[position--] = carry;
					while (position >= 0) res[position--] = 0;
				}
			};
			if (Math.clz32) BN.prototype._countBits = function _countBits(w) {
				return 32 - Math.clz32(w);
			};
			else BN.prototype._countBits = function _countBits(w) {
				var t = w;
				var r = 0;
				if (t >= 4096) {
					r += 13;
					t >>>= 13;
				}
				if (t >= 64) {
					r += 7;
					t >>>= 7;
				}
				if (t >= 8) {
					r += 4;
					t >>>= 4;
				}
				if (t >= 2) {
					r += 2;
					t >>>= 2;
				}
				return r + t;
			};
			BN.prototype._zeroBits = function _zeroBits(w) {
				if (w === 0) return 26;
				var t = w;
				var r = 0;
				if ((t & 8191) === 0) {
					r += 13;
					t >>>= 13;
				}
				if ((t & 127) === 0) {
					r += 7;
					t >>>= 7;
				}
				if ((t & 15) === 0) {
					r += 4;
					t >>>= 4;
				}
				if ((t & 3) === 0) {
					r += 2;
					t >>>= 2;
				}
				if ((t & 1) === 0) r++;
				return r;
			};
			BN.prototype.bitLength = function bitLength() {
				var w = this.words[this.length - 1];
				var hi = this._countBits(w);
				return (this.length - 1) * 26 + hi;
			};
			function toBitArray(num) {
				var w = new Array(num.bitLength());
				for (var bit = 0; bit < w.length; bit++) {
					var off = bit / 26 | 0;
					var wbit = bit % 26;
					w[bit] = num.words[off] >>> wbit & 1;
				}
				return w;
			}
			BN.prototype.zeroBits = function zeroBits() {
				if (this.isZero()) return 0;
				var r = 0;
				for (var i = 0; i < this.length; i++) {
					var b = this._zeroBits(this.words[i]);
					r += b;
					if (b !== 26) break;
				}
				return r;
			};
			BN.prototype.byteLength = function byteLength() {
				return Math.ceil(this.bitLength() / 8);
			};
			BN.prototype.toTwos = function toTwos(width) {
				if (this.negative !== 0) return this.abs().inotn(width).iaddn(1);
				return this.clone();
			};
			BN.prototype.fromTwos = function fromTwos(width) {
				if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg();
				return this.clone();
			};
			BN.prototype.isNeg = function isNeg() {
				return this.negative !== 0;
			};
			BN.prototype.neg = function neg() {
				return this.clone().ineg();
			};
			BN.prototype.ineg = function ineg() {
				if (!this.isZero()) this.negative ^= 1;
				return this;
			};
			BN.prototype.iuor = function iuor(num) {
				while (this.length < num.length) this.words[this.length++] = 0;
				for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i];
				return this._strip();
			};
			BN.prototype.ior = function ior(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuor(num);
			};
			BN.prototype.or = function or(num) {
				if (this.length > num.length) return this.clone().ior(num);
				return num.clone().ior(this);
			};
			BN.prototype.uor = function uor(num) {
				if (this.length > num.length) return this.clone().iuor(num);
				return num.clone().iuor(this);
			};
			BN.prototype.iuand = function iuand(num) {
				var b;
				if (this.length > num.length) b = num;
				else b = this;
				for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i];
				this.length = b.length;
				return this._strip();
			};
			BN.prototype.iand = function iand(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuand(num);
			};
			BN.prototype.and = function and(num) {
				if (this.length > num.length) return this.clone().iand(num);
				return num.clone().iand(this);
			};
			BN.prototype.uand = function uand(num) {
				if (this.length > num.length) return this.clone().iuand(num);
				return num.clone().iuand(this);
			};
			BN.prototype.iuxor = function iuxor(num) {
				var a;
				var b;
				if (this.length > num.length) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i];
				if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i];
				this.length = a.length;
				return this._strip();
			};
			BN.prototype.ixor = function ixor(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuxor(num);
			};
			BN.prototype.xor = function xor(num) {
				if (this.length > num.length) return this.clone().ixor(num);
				return num.clone().ixor(this);
			};
			BN.prototype.uxor = function uxor(num) {
				if (this.length > num.length) return this.clone().iuxor(num);
				return num.clone().iuxor(this);
			};
			BN.prototype.inotn = function inotn(width) {
				assert(typeof width === "number" && width >= 0);
				var bytesNeeded = Math.ceil(width / 26) | 0;
				var bitsLeft = width % 26;
				this._expand(bytesNeeded);
				if (bitsLeft > 0) bytesNeeded--;
				for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863;
				if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
				return this._strip();
			};
			BN.prototype.notn = function notn(width) {
				return this.clone().inotn(width);
			};
			BN.prototype.setn = function setn(bit, val) {
				assert(typeof bit === "number" && bit >= 0);
				var off = bit / 26 | 0;
				var wbit = bit % 26;
				this._expand(off + 1);
				if (val) this.words[off] = this.words[off] | 1 << wbit;
				else this.words[off] = this.words[off] & ~(1 << wbit);
				return this._strip();
			};
			BN.prototype.iadd = function iadd(num) {
				var r;
				if (this.negative !== 0 && num.negative === 0) {
					this.negative = 0;
					r = this.isub(num);
					this.negative ^= 1;
					return this._normSign();
				} else if (this.negative === 0 && num.negative !== 0) {
					num.negative = 0;
					r = this.isub(num);
					num.negative = 1;
					return r._normSign();
				}
				var a, b;
				if (this.length > num.length) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				var carry = 0;
				for (var i = 0; i < b.length; i++) {
					r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
					this.words[i] = r & 67108863;
					carry = r >>> 26;
				}
				for (; carry !== 0 && i < a.length; i++) {
					r = (a.words[i] | 0) + carry;
					this.words[i] = r & 67108863;
					carry = r >>> 26;
				}
				this.length = a.length;
				if (carry !== 0) {
					this.words[this.length] = carry;
					this.length++;
				} else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i];
				return this;
			};
			BN.prototype.add = function add(num) {
				var res;
				if (num.negative !== 0 && this.negative === 0) {
					num.negative = 0;
					res = this.sub(num);
					num.negative ^= 1;
					return res;
				} else if (num.negative === 0 && this.negative !== 0) {
					this.negative = 0;
					res = num.sub(this);
					this.negative = 1;
					return res;
				}
				if (this.length > num.length) return this.clone().iadd(num);
				return num.clone().iadd(this);
			};
			BN.prototype.isub = function isub(num) {
				if (num.negative !== 0) {
					num.negative = 0;
					var r = this.iadd(num);
					num.negative = 1;
					return r._normSign();
				} else if (this.negative !== 0) {
					this.negative = 0;
					this.iadd(num);
					this.negative = 1;
					return this._normSign();
				}
				var cmp = this.cmp(num);
				if (cmp === 0) {
					this.negative = 0;
					this.length = 1;
					this.words[0] = 0;
					return this;
				}
				var a, b;
				if (cmp > 0) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				var carry = 0;
				for (var i = 0; i < b.length; i++) {
					r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
					carry = r >> 26;
					this.words[i] = r & 67108863;
				}
				for (; carry !== 0 && i < a.length; i++) {
					r = (a.words[i] | 0) + carry;
					carry = r >> 26;
					this.words[i] = r & 67108863;
				}
				if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i];
				this.length = Math.max(this.length, i);
				if (a !== this) this.negative = 1;
				return this._strip();
			};
			BN.prototype.sub = function sub(num) {
				return this.clone().isub(num);
			};
			function smallMulTo(self, num, out) {
				out.negative = num.negative ^ self.negative;
				var len = self.length + num.length | 0;
				out.length = len;
				len = len - 1 | 0;
				var a = self.words[0] | 0;
				var b = num.words[0] | 0;
				var r = a * b;
				var lo = r & 67108863;
				var carry = r / 67108864 | 0;
				out.words[0] = lo;
				for (var k = 1; k < len; k++) {
					var ncarry = carry >>> 26;
					var rword = carry & 67108863;
					var maxJ = Math.min(k, num.length - 1);
					for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
						var i = k - j | 0;
						a = self.words[i] | 0;
						b = num.words[j] | 0;
						r = a * b + rword;
						ncarry += r / 67108864 | 0;
						rword = r & 67108863;
					}
					out.words[k] = rword | 0;
					carry = ncarry | 0;
				}
				if (carry !== 0) out.words[k] = carry | 0;
				else out.length--;
				return out._strip();
			}
			var comb10MulTo = function comb10MulTo(self, num, out) {
				var a = self.words;
				var b = num.words;
				var o = out.words;
				var c = 0;
				var lo;
				var mid;
				var hi;
				var a0 = a[0] | 0;
				var al0 = a0 & 8191;
				var ah0 = a0 >>> 13;
				var a1 = a[1] | 0;
				var al1 = a1 & 8191;
				var ah1 = a1 >>> 13;
				var a2 = a[2] | 0;
				var al2 = a2 & 8191;
				var ah2 = a2 >>> 13;
				var a3 = a[3] | 0;
				var al3 = a3 & 8191;
				var ah3 = a3 >>> 13;
				var a4 = a[4] | 0;
				var al4 = a4 & 8191;
				var ah4 = a4 >>> 13;
				var a5 = a[5] | 0;
				var al5 = a5 & 8191;
				var ah5 = a5 >>> 13;
				var a6 = a[6] | 0;
				var al6 = a6 & 8191;
				var ah6 = a6 >>> 13;
				var a7 = a[7] | 0;
				var al7 = a7 & 8191;
				var ah7 = a7 >>> 13;
				var a8 = a[8] | 0;
				var al8 = a8 & 8191;
				var ah8 = a8 >>> 13;
				var a9 = a[9] | 0;
				var al9 = a9 & 8191;
				var ah9 = a9 >>> 13;
				var b0 = b[0] | 0;
				var bl0 = b0 & 8191;
				var bh0 = b0 >>> 13;
				var b1 = b[1] | 0;
				var bl1 = b1 & 8191;
				var bh1 = b1 >>> 13;
				var b2 = b[2] | 0;
				var bl2 = b2 & 8191;
				var bh2 = b2 >>> 13;
				var b3 = b[3] | 0;
				var bl3 = b3 & 8191;
				var bh3 = b3 >>> 13;
				var b4 = b[4] | 0;
				var bl4 = b4 & 8191;
				var bh4 = b4 >>> 13;
				var b5 = b[5] | 0;
				var bl5 = b5 & 8191;
				var bh5 = b5 >>> 13;
				var b6 = b[6] | 0;
				var bl6 = b6 & 8191;
				var bh6 = b6 >>> 13;
				var b7 = b[7] | 0;
				var bl7 = b7 & 8191;
				var bh7 = b7 >>> 13;
				var b8 = b[8] | 0;
				var bl8 = b8 & 8191;
				var bh8 = b8 >>> 13;
				var b9 = b[9] | 0;
				var bl9 = b9 & 8191;
				var bh9 = b9 >>> 13;
				out.negative = self.negative ^ num.negative;
				out.length = 19;
				lo = Math.imul(al0, bl0);
				mid = Math.imul(al0, bh0);
				mid = mid + Math.imul(ah0, bl0) | 0;
				hi = Math.imul(ah0, bh0);
				var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
				w0 &= 67108863;
				lo = Math.imul(al1, bl0);
				mid = Math.imul(al1, bh0);
				mid = mid + Math.imul(ah1, bl0) | 0;
				hi = Math.imul(ah1, bh0);
				lo = lo + Math.imul(al0, bl1) | 0;
				mid = mid + Math.imul(al0, bh1) | 0;
				mid = mid + Math.imul(ah0, bl1) | 0;
				hi = hi + Math.imul(ah0, bh1) | 0;
				var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
				w1 &= 67108863;
				lo = Math.imul(al2, bl0);
				mid = Math.imul(al2, bh0);
				mid = mid + Math.imul(ah2, bl0) | 0;
				hi = Math.imul(ah2, bh0);
				lo = lo + Math.imul(al1, bl1) | 0;
				mid = mid + Math.imul(al1, bh1) | 0;
				mid = mid + Math.imul(ah1, bl1) | 0;
				hi = hi + Math.imul(ah1, bh1) | 0;
				lo = lo + Math.imul(al0, bl2) | 0;
				mid = mid + Math.imul(al0, bh2) | 0;
				mid = mid + Math.imul(ah0, bl2) | 0;
				hi = hi + Math.imul(ah0, bh2) | 0;
				var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
				w2 &= 67108863;
				lo = Math.imul(al3, bl0);
				mid = Math.imul(al3, bh0);
				mid = mid + Math.imul(ah3, bl0) | 0;
				hi = Math.imul(ah3, bh0);
				lo = lo + Math.imul(al2, bl1) | 0;
				mid = mid + Math.imul(al2, bh1) | 0;
				mid = mid + Math.imul(ah2, bl1) | 0;
				hi = hi + Math.imul(ah2, bh1) | 0;
				lo = lo + Math.imul(al1, bl2) | 0;
				mid = mid + Math.imul(al1, bh2) | 0;
				mid = mid + Math.imul(ah1, bl2) | 0;
				hi = hi + Math.imul(ah1, bh2) | 0;
				lo = lo + Math.imul(al0, bl3) | 0;
				mid = mid + Math.imul(al0, bh3) | 0;
				mid = mid + Math.imul(ah0, bl3) | 0;
				hi = hi + Math.imul(ah0, bh3) | 0;
				var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
				w3 &= 67108863;
				lo = Math.imul(al4, bl0);
				mid = Math.imul(al4, bh0);
				mid = mid + Math.imul(ah4, bl0) | 0;
				hi = Math.imul(ah4, bh0);
				lo = lo + Math.imul(al3, bl1) | 0;
				mid = mid + Math.imul(al3, bh1) | 0;
				mid = mid + Math.imul(ah3, bl1) | 0;
				hi = hi + Math.imul(ah3, bh1) | 0;
				lo = lo + Math.imul(al2, bl2) | 0;
				mid = mid + Math.imul(al2, bh2) | 0;
				mid = mid + Math.imul(ah2, bl2) | 0;
				hi = hi + Math.imul(ah2, bh2) | 0;
				lo = lo + Math.imul(al1, bl3) | 0;
				mid = mid + Math.imul(al1, bh3) | 0;
				mid = mid + Math.imul(ah1, bl3) | 0;
				hi = hi + Math.imul(ah1, bh3) | 0;
				lo = lo + Math.imul(al0, bl4) | 0;
				mid = mid + Math.imul(al0, bh4) | 0;
				mid = mid + Math.imul(ah0, bl4) | 0;
				hi = hi + Math.imul(ah0, bh4) | 0;
				var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
				w4 &= 67108863;
				lo = Math.imul(al5, bl0);
				mid = Math.imul(al5, bh0);
				mid = mid + Math.imul(ah5, bl0) | 0;
				hi = Math.imul(ah5, bh0);
				lo = lo + Math.imul(al4, bl1) | 0;
				mid = mid + Math.imul(al4, bh1) | 0;
				mid = mid + Math.imul(ah4, bl1) | 0;
				hi = hi + Math.imul(ah4, bh1) | 0;
				lo = lo + Math.imul(al3, bl2) | 0;
				mid = mid + Math.imul(al3, bh2) | 0;
				mid = mid + Math.imul(ah3, bl2) | 0;
				hi = hi + Math.imul(ah3, bh2) | 0;
				lo = lo + Math.imul(al2, bl3) | 0;
				mid = mid + Math.imul(al2, bh3) | 0;
				mid = mid + Math.imul(ah2, bl3) | 0;
				hi = hi + Math.imul(ah2, bh3) | 0;
				lo = lo + Math.imul(al1, bl4) | 0;
				mid = mid + Math.imul(al1, bh4) | 0;
				mid = mid + Math.imul(ah1, bl4) | 0;
				hi = hi + Math.imul(ah1, bh4) | 0;
				lo = lo + Math.imul(al0, bl5) | 0;
				mid = mid + Math.imul(al0, bh5) | 0;
				mid = mid + Math.imul(ah0, bl5) | 0;
				hi = hi + Math.imul(ah0, bh5) | 0;
				var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
				w5 &= 67108863;
				lo = Math.imul(al6, bl0);
				mid = Math.imul(al6, bh0);
				mid = mid + Math.imul(ah6, bl0) | 0;
				hi = Math.imul(ah6, bh0);
				lo = lo + Math.imul(al5, bl1) | 0;
				mid = mid + Math.imul(al5, bh1) | 0;
				mid = mid + Math.imul(ah5, bl1) | 0;
				hi = hi + Math.imul(ah5, bh1) | 0;
				lo = lo + Math.imul(al4, bl2) | 0;
				mid = mid + Math.imul(al4, bh2) | 0;
				mid = mid + Math.imul(ah4, bl2) | 0;
				hi = hi + Math.imul(ah4, bh2) | 0;
				lo = lo + Math.imul(al3, bl3) | 0;
				mid = mid + Math.imul(al3, bh3) | 0;
				mid = mid + Math.imul(ah3, bl3) | 0;
				hi = hi + Math.imul(ah3, bh3) | 0;
				lo = lo + Math.imul(al2, bl4) | 0;
				mid = mid + Math.imul(al2, bh4) | 0;
				mid = mid + Math.imul(ah2, bl4) | 0;
				hi = hi + Math.imul(ah2, bh4) | 0;
				lo = lo + Math.imul(al1, bl5) | 0;
				mid = mid + Math.imul(al1, bh5) | 0;
				mid = mid + Math.imul(ah1, bl5) | 0;
				hi = hi + Math.imul(ah1, bh5) | 0;
				lo = lo + Math.imul(al0, bl6) | 0;
				mid = mid + Math.imul(al0, bh6) | 0;
				mid = mid + Math.imul(ah0, bl6) | 0;
				hi = hi + Math.imul(ah0, bh6) | 0;
				var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
				w6 &= 67108863;
				lo = Math.imul(al7, bl0);
				mid = Math.imul(al7, bh0);
				mid = mid + Math.imul(ah7, bl0) | 0;
				hi = Math.imul(ah7, bh0);
				lo = lo + Math.imul(al6, bl1) | 0;
				mid = mid + Math.imul(al6, bh1) | 0;
				mid = mid + Math.imul(ah6, bl1) | 0;
				hi = hi + Math.imul(ah6, bh1) | 0;
				lo = lo + Math.imul(al5, bl2) | 0;
				mid = mid + Math.imul(al5, bh2) | 0;
				mid = mid + Math.imul(ah5, bl2) | 0;
				hi = hi + Math.imul(ah5, bh2) | 0;
				lo = lo + Math.imul(al4, bl3) | 0;
				mid = mid + Math.imul(al4, bh3) | 0;
				mid = mid + Math.imul(ah4, bl3) | 0;
				hi = hi + Math.imul(ah4, bh3) | 0;
				lo = lo + Math.imul(al3, bl4) | 0;
				mid = mid + Math.imul(al3, bh4) | 0;
				mid = mid + Math.imul(ah3, bl4) | 0;
				hi = hi + Math.imul(ah3, bh4) | 0;
				lo = lo + Math.imul(al2, bl5) | 0;
				mid = mid + Math.imul(al2, bh5) | 0;
				mid = mid + Math.imul(ah2, bl5) | 0;
				hi = hi + Math.imul(ah2, bh5) | 0;
				lo = lo + Math.imul(al1, bl6) | 0;
				mid = mid + Math.imul(al1, bh6) | 0;
				mid = mid + Math.imul(ah1, bl6) | 0;
				hi = hi + Math.imul(ah1, bh6) | 0;
				lo = lo + Math.imul(al0, bl7) | 0;
				mid = mid + Math.imul(al0, bh7) | 0;
				mid = mid + Math.imul(ah0, bl7) | 0;
				hi = hi + Math.imul(ah0, bh7) | 0;
				var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
				w7 &= 67108863;
				lo = Math.imul(al8, bl0);
				mid = Math.imul(al8, bh0);
				mid = mid + Math.imul(ah8, bl0) | 0;
				hi = Math.imul(ah8, bh0);
				lo = lo + Math.imul(al7, bl1) | 0;
				mid = mid + Math.imul(al7, bh1) | 0;
				mid = mid + Math.imul(ah7, bl1) | 0;
				hi = hi + Math.imul(ah7, bh1) | 0;
				lo = lo + Math.imul(al6, bl2) | 0;
				mid = mid + Math.imul(al6, bh2) | 0;
				mid = mid + Math.imul(ah6, bl2) | 0;
				hi = hi + Math.imul(ah6, bh2) | 0;
				lo = lo + Math.imul(al5, bl3) | 0;
				mid = mid + Math.imul(al5, bh3) | 0;
				mid = mid + Math.imul(ah5, bl3) | 0;
				hi = hi + Math.imul(ah5, bh3) | 0;
				lo = lo + Math.imul(al4, bl4) | 0;
				mid = mid + Math.imul(al4, bh4) | 0;
				mid = mid + Math.imul(ah4, bl4) | 0;
				hi = hi + Math.imul(ah4, bh4) | 0;
				lo = lo + Math.imul(al3, bl5) | 0;
				mid = mid + Math.imul(al3, bh5) | 0;
				mid = mid + Math.imul(ah3, bl5) | 0;
				hi = hi + Math.imul(ah3, bh5) | 0;
				lo = lo + Math.imul(al2, bl6) | 0;
				mid = mid + Math.imul(al2, bh6) | 0;
				mid = mid + Math.imul(ah2, bl6) | 0;
				hi = hi + Math.imul(ah2, bh6) | 0;
				lo = lo + Math.imul(al1, bl7) | 0;
				mid = mid + Math.imul(al1, bh7) | 0;
				mid = mid + Math.imul(ah1, bl7) | 0;
				hi = hi + Math.imul(ah1, bh7) | 0;
				lo = lo + Math.imul(al0, bl8) | 0;
				mid = mid + Math.imul(al0, bh8) | 0;
				mid = mid + Math.imul(ah0, bl8) | 0;
				hi = hi + Math.imul(ah0, bh8) | 0;
				var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
				w8 &= 67108863;
				lo = Math.imul(al9, bl0);
				mid = Math.imul(al9, bh0);
				mid = mid + Math.imul(ah9, bl0) | 0;
				hi = Math.imul(ah9, bh0);
				lo = lo + Math.imul(al8, bl1) | 0;
				mid = mid + Math.imul(al8, bh1) | 0;
				mid = mid + Math.imul(ah8, bl1) | 0;
				hi = hi + Math.imul(ah8, bh1) | 0;
				lo = lo + Math.imul(al7, bl2) | 0;
				mid = mid + Math.imul(al7, bh2) | 0;
				mid = mid + Math.imul(ah7, bl2) | 0;
				hi = hi + Math.imul(ah7, bh2) | 0;
				lo = lo + Math.imul(al6, bl3) | 0;
				mid = mid + Math.imul(al6, bh3) | 0;
				mid = mid + Math.imul(ah6, bl3) | 0;
				hi = hi + Math.imul(ah6, bh3) | 0;
				lo = lo + Math.imul(al5, bl4) | 0;
				mid = mid + Math.imul(al5, bh4) | 0;
				mid = mid + Math.imul(ah5, bl4) | 0;
				hi = hi + Math.imul(ah5, bh4) | 0;
				lo = lo + Math.imul(al4, bl5) | 0;
				mid = mid + Math.imul(al4, bh5) | 0;
				mid = mid + Math.imul(ah4, bl5) | 0;
				hi = hi + Math.imul(ah4, bh5) | 0;
				lo = lo + Math.imul(al3, bl6) | 0;
				mid = mid + Math.imul(al3, bh6) | 0;
				mid = mid + Math.imul(ah3, bl6) | 0;
				hi = hi + Math.imul(ah3, bh6) | 0;
				lo = lo + Math.imul(al2, bl7) | 0;
				mid = mid + Math.imul(al2, bh7) | 0;
				mid = mid + Math.imul(ah2, bl7) | 0;
				hi = hi + Math.imul(ah2, bh7) | 0;
				lo = lo + Math.imul(al1, bl8) | 0;
				mid = mid + Math.imul(al1, bh8) | 0;
				mid = mid + Math.imul(ah1, bl8) | 0;
				hi = hi + Math.imul(ah1, bh8) | 0;
				lo = lo + Math.imul(al0, bl9) | 0;
				mid = mid + Math.imul(al0, bh9) | 0;
				mid = mid + Math.imul(ah0, bl9) | 0;
				hi = hi + Math.imul(ah0, bh9) | 0;
				var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
				w9 &= 67108863;
				lo = Math.imul(al9, bl1);
				mid = Math.imul(al9, bh1);
				mid = mid + Math.imul(ah9, bl1) | 0;
				hi = Math.imul(ah9, bh1);
				lo = lo + Math.imul(al8, bl2) | 0;
				mid = mid + Math.imul(al8, bh2) | 0;
				mid = mid + Math.imul(ah8, bl2) | 0;
				hi = hi + Math.imul(ah8, bh2) | 0;
				lo = lo + Math.imul(al7, bl3) | 0;
				mid = mid + Math.imul(al7, bh3) | 0;
				mid = mid + Math.imul(ah7, bl3) | 0;
				hi = hi + Math.imul(ah7, bh3) | 0;
				lo = lo + Math.imul(al6, bl4) | 0;
				mid = mid + Math.imul(al6, bh4) | 0;
				mid = mid + Math.imul(ah6, bl4) | 0;
				hi = hi + Math.imul(ah6, bh4) | 0;
				lo = lo + Math.imul(al5, bl5) | 0;
				mid = mid + Math.imul(al5, bh5) | 0;
				mid = mid + Math.imul(ah5, bl5) | 0;
				hi = hi + Math.imul(ah5, bh5) | 0;
				lo = lo + Math.imul(al4, bl6) | 0;
				mid = mid + Math.imul(al4, bh6) | 0;
				mid = mid + Math.imul(ah4, bl6) | 0;
				hi = hi + Math.imul(ah4, bh6) | 0;
				lo = lo + Math.imul(al3, bl7) | 0;
				mid = mid + Math.imul(al3, bh7) | 0;
				mid = mid + Math.imul(ah3, bl7) | 0;
				hi = hi + Math.imul(ah3, bh7) | 0;
				lo = lo + Math.imul(al2, bl8) | 0;
				mid = mid + Math.imul(al2, bh8) | 0;
				mid = mid + Math.imul(ah2, bl8) | 0;
				hi = hi + Math.imul(ah2, bh8) | 0;
				lo = lo + Math.imul(al1, bl9) | 0;
				mid = mid + Math.imul(al1, bh9) | 0;
				mid = mid + Math.imul(ah1, bl9) | 0;
				hi = hi + Math.imul(ah1, bh9) | 0;
				var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
				w10 &= 67108863;
				lo = Math.imul(al9, bl2);
				mid = Math.imul(al9, bh2);
				mid = mid + Math.imul(ah9, bl2) | 0;
				hi = Math.imul(ah9, bh2);
				lo = lo + Math.imul(al8, bl3) | 0;
				mid = mid + Math.imul(al8, bh3) | 0;
				mid = mid + Math.imul(ah8, bl3) | 0;
				hi = hi + Math.imul(ah8, bh3) | 0;
				lo = lo + Math.imul(al7, bl4) | 0;
				mid = mid + Math.imul(al7, bh4) | 0;
				mid = mid + Math.imul(ah7, bl4) | 0;
				hi = hi + Math.imul(ah7, bh4) | 0;
				lo = lo + Math.imul(al6, bl5) | 0;
				mid = mid + Math.imul(al6, bh5) | 0;
				mid = mid + Math.imul(ah6, bl5) | 0;
				hi = hi + Math.imul(ah6, bh5) | 0;
				lo = lo + Math.imul(al5, bl6) | 0;
				mid = mid + Math.imul(al5, bh6) | 0;
				mid = mid + Math.imul(ah5, bl6) | 0;
				hi = hi + Math.imul(ah5, bh6) | 0;
				lo = lo + Math.imul(al4, bl7) | 0;
				mid = mid + Math.imul(al4, bh7) | 0;
				mid = mid + Math.imul(ah4, bl7) | 0;
				hi = hi + Math.imul(ah4, bh7) | 0;
				lo = lo + Math.imul(al3, bl8) | 0;
				mid = mid + Math.imul(al3, bh8) | 0;
				mid = mid + Math.imul(ah3, bl8) | 0;
				hi = hi + Math.imul(ah3, bh8) | 0;
				lo = lo + Math.imul(al2, bl9) | 0;
				mid = mid + Math.imul(al2, bh9) | 0;
				mid = mid + Math.imul(ah2, bl9) | 0;
				hi = hi + Math.imul(ah2, bh9) | 0;
				var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
				w11 &= 67108863;
				lo = Math.imul(al9, bl3);
				mid = Math.imul(al9, bh3);
				mid = mid + Math.imul(ah9, bl3) | 0;
				hi = Math.imul(ah9, bh3);
				lo = lo + Math.imul(al8, bl4) | 0;
				mid = mid + Math.imul(al8, bh4) | 0;
				mid = mid + Math.imul(ah8, bl4) | 0;
				hi = hi + Math.imul(ah8, bh4) | 0;
				lo = lo + Math.imul(al7, bl5) | 0;
				mid = mid + Math.imul(al7, bh5) | 0;
				mid = mid + Math.imul(ah7, bl5) | 0;
				hi = hi + Math.imul(ah7, bh5) | 0;
				lo = lo + Math.imul(al6, bl6) | 0;
				mid = mid + Math.imul(al6, bh6) | 0;
				mid = mid + Math.imul(ah6, bl6) | 0;
				hi = hi + Math.imul(ah6, bh6) | 0;
				lo = lo + Math.imul(al5, bl7) | 0;
				mid = mid + Math.imul(al5, bh7) | 0;
				mid = mid + Math.imul(ah5, bl7) | 0;
				hi = hi + Math.imul(ah5, bh7) | 0;
				lo = lo + Math.imul(al4, bl8) | 0;
				mid = mid + Math.imul(al4, bh8) | 0;
				mid = mid + Math.imul(ah4, bl8) | 0;
				hi = hi + Math.imul(ah4, bh8) | 0;
				lo = lo + Math.imul(al3, bl9) | 0;
				mid = mid + Math.imul(al3, bh9) | 0;
				mid = mid + Math.imul(ah3, bl9) | 0;
				hi = hi + Math.imul(ah3, bh9) | 0;
				var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
				w12 &= 67108863;
				lo = Math.imul(al9, bl4);
				mid = Math.imul(al9, bh4);
				mid = mid + Math.imul(ah9, bl4) | 0;
				hi = Math.imul(ah9, bh4);
				lo = lo + Math.imul(al8, bl5) | 0;
				mid = mid + Math.imul(al8, bh5) | 0;
				mid = mid + Math.imul(ah8, bl5) | 0;
				hi = hi + Math.imul(ah8, bh5) | 0;
				lo = lo + Math.imul(al7, bl6) | 0;
				mid = mid + Math.imul(al7, bh6) | 0;
				mid = mid + Math.imul(ah7, bl6) | 0;
				hi = hi + Math.imul(ah7, bh6) | 0;
				lo = lo + Math.imul(al6, bl7) | 0;
				mid = mid + Math.imul(al6, bh7) | 0;
				mid = mid + Math.imul(ah6, bl7) | 0;
				hi = hi + Math.imul(ah6, bh7) | 0;
				lo = lo + Math.imul(al5, bl8) | 0;
				mid = mid + Math.imul(al5, bh8) | 0;
				mid = mid + Math.imul(ah5, bl8) | 0;
				hi = hi + Math.imul(ah5, bh8) | 0;
				lo = lo + Math.imul(al4, bl9) | 0;
				mid = mid + Math.imul(al4, bh9) | 0;
				mid = mid + Math.imul(ah4, bl9) | 0;
				hi = hi + Math.imul(ah4, bh9) | 0;
				var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
				w13 &= 67108863;
				lo = Math.imul(al9, bl5);
				mid = Math.imul(al9, bh5);
				mid = mid + Math.imul(ah9, bl5) | 0;
				hi = Math.imul(ah9, bh5);
				lo = lo + Math.imul(al8, bl6) | 0;
				mid = mid + Math.imul(al8, bh6) | 0;
				mid = mid + Math.imul(ah8, bl6) | 0;
				hi = hi + Math.imul(ah8, bh6) | 0;
				lo = lo + Math.imul(al7, bl7) | 0;
				mid = mid + Math.imul(al7, bh7) | 0;
				mid = mid + Math.imul(ah7, bl7) | 0;
				hi = hi + Math.imul(ah7, bh7) | 0;
				lo = lo + Math.imul(al6, bl8) | 0;
				mid = mid + Math.imul(al6, bh8) | 0;
				mid = mid + Math.imul(ah6, bl8) | 0;
				hi = hi + Math.imul(ah6, bh8) | 0;
				lo = lo + Math.imul(al5, bl9) | 0;
				mid = mid + Math.imul(al5, bh9) | 0;
				mid = mid + Math.imul(ah5, bl9) | 0;
				hi = hi + Math.imul(ah5, bh9) | 0;
				var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
				w14 &= 67108863;
				lo = Math.imul(al9, bl6);
				mid = Math.imul(al9, bh6);
				mid = mid + Math.imul(ah9, bl6) | 0;
				hi = Math.imul(ah9, bh6);
				lo = lo + Math.imul(al8, bl7) | 0;
				mid = mid + Math.imul(al8, bh7) | 0;
				mid = mid + Math.imul(ah8, bl7) | 0;
				hi = hi + Math.imul(ah8, bh7) | 0;
				lo = lo + Math.imul(al7, bl8) | 0;
				mid = mid + Math.imul(al7, bh8) | 0;
				mid = mid + Math.imul(ah7, bl8) | 0;
				hi = hi + Math.imul(ah7, bh8) | 0;
				lo = lo + Math.imul(al6, bl9) | 0;
				mid = mid + Math.imul(al6, bh9) | 0;
				mid = mid + Math.imul(ah6, bl9) | 0;
				hi = hi + Math.imul(ah6, bh9) | 0;
				var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
				w15 &= 67108863;
				lo = Math.imul(al9, bl7);
				mid = Math.imul(al9, bh7);
				mid = mid + Math.imul(ah9, bl7) | 0;
				hi = Math.imul(ah9, bh7);
				lo = lo + Math.imul(al8, bl8) | 0;
				mid = mid + Math.imul(al8, bh8) | 0;
				mid = mid + Math.imul(ah8, bl8) | 0;
				hi = hi + Math.imul(ah8, bh8) | 0;
				lo = lo + Math.imul(al7, bl9) | 0;
				mid = mid + Math.imul(al7, bh9) | 0;
				mid = mid + Math.imul(ah7, bl9) | 0;
				hi = hi + Math.imul(ah7, bh9) | 0;
				var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
				w16 &= 67108863;
				lo = Math.imul(al9, bl8);
				mid = Math.imul(al9, bh8);
				mid = mid + Math.imul(ah9, bl8) | 0;
				hi = Math.imul(ah9, bh8);
				lo = lo + Math.imul(al8, bl9) | 0;
				mid = mid + Math.imul(al8, bh9) | 0;
				mid = mid + Math.imul(ah8, bl9) | 0;
				hi = hi + Math.imul(ah8, bh9) | 0;
				var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
				w17 &= 67108863;
				lo = Math.imul(al9, bl9);
				mid = Math.imul(al9, bh9);
				mid = mid + Math.imul(ah9, bl9) | 0;
				hi = Math.imul(ah9, bh9);
				var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
				w18 &= 67108863;
				o[0] = w0;
				o[1] = w1;
				o[2] = w2;
				o[3] = w3;
				o[4] = w4;
				o[5] = w5;
				o[6] = w6;
				o[7] = w7;
				o[8] = w8;
				o[9] = w9;
				o[10] = w10;
				o[11] = w11;
				o[12] = w12;
				o[13] = w13;
				o[14] = w14;
				o[15] = w15;
				o[16] = w16;
				o[17] = w17;
				o[18] = w18;
				if (c !== 0) {
					o[19] = c;
					out.length++;
				}
				return out;
			};
			if (!Math.imul) comb10MulTo = smallMulTo;
			function bigMulTo(self, num, out) {
				out.negative = num.negative ^ self.negative;
				out.length = self.length + num.length;
				var carry = 0;
				var hncarry = 0;
				for (var k = 0; k < out.length - 1; k++) {
					var ncarry = hncarry;
					hncarry = 0;
					var rword = carry & 67108863;
					var maxJ = Math.min(k, num.length - 1);
					for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
						var i = k - j;
						var r = (self.words[i] | 0) * (num.words[j] | 0);
						var lo = r & 67108863;
						ncarry = ncarry + (r / 67108864 | 0) | 0;
						lo = lo + rword | 0;
						rword = lo & 67108863;
						ncarry = ncarry + (lo >>> 26) | 0;
						hncarry += ncarry >>> 26;
						ncarry &= 67108863;
					}
					out.words[k] = rword;
					carry = ncarry;
					ncarry = hncarry;
				}
				if (carry !== 0) out.words[k] = carry;
				else out.length--;
				return out._strip();
			}
			function jumboMulTo(self, num, out) {
				return bigMulTo(self, num, out);
			}
			BN.prototype.mulTo = function mulTo(num, out) {
				var res;
				var len = this.length + num.length;
				if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out);
				else if (len < 63) res = smallMulTo(this, num, out);
				else if (len < 1024) res = bigMulTo(this, num, out);
				else res = jumboMulTo(this, num, out);
				return res;
			};
			function FFTM(x, y) {
				this.x = x;
				this.y = y;
			}
			FFTM.prototype.makeRBT = function makeRBT(N) {
				var t = new Array(N);
				var l = BN.prototype._countBits(N) - 1;
				for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N);
				return t;
			};
			FFTM.prototype.revBin = function revBin(x, l, N) {
				if (x === 0 || x === N - 1) return x;
				var rb = 0;
				for (var i = 0; i < l; i++) {
					rb |= (x & 1) << l - i - 1;
					x >>= 1;
				}
				return rb;
			};
			FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
				for (var i = 0; i < N; i++) {
					rtws[i] = rws[rbt[i]];
					itws[i] = iws[rbt[i]];
				}
			};
			FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
				this.permute(rbt, rws, iws, rtws, itws, N);
				for (var s = 1; s < N; s <<= 1) {
					var l = s << 1;
					var rtwdf = Math.cos(2 * Math.PI / l);
					var itwdf = Math.sin(2 * Math.PI / l);
					for (var p = 0; p < N; p += l) {
						var rtwdf_ = rtwdf;
						var itwdf_ = itwdf;
						for (var j = 0; j < s; j++) {
							var re = rtws[p + j];
							var ie = itws[p + j];
							var ro = rtws[p + j + s];
							var io = itws[p + j + s];
							var rx = rtwdf_ * ro - itwdf_ * io;
							io = rtwdf_ * io + itwdf_ * ro;
							ro = rx;
							rtws[p + j] = re + ro;
							itws[p + j] = ie + io;
							rtws[p + j + s] = re - ro;
							itws[p + j + s] = ie - io;
							if (j !== l) {
								rx = rtwdf * rtwdf_ - itwdf * itwdf_;
								itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
								rtwdf_ = rx;
							}
						}
					}
				}
			};
			FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
				var N = Math.max(m, n) | 1;
				var odd = N & 1;
				var i = 0;
				for (N = N / 2 | 0; N; N = N >>> 1) i++;
				return 1 << i + 1 + odd;
			};
			FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
				if (N <= 1) return;
				for (var i = 0; i < N / 2; i++) {
					var t = rws[i];
					rws[i] = rws[N - i - 1];
					rws[N - i - 1] = t;
					t = iws[i];
					iws[i] = -iws[N - i - 1];
					iws[N - i - 1] = -t;
				}
			};
			FFTM.prototype.normalize13b = function normalize13b(ws, N) {
				var carry = 0;
				for (var i = 0; i < N / 2; i++) {
					var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
					ws[i] = w & 67108863;
					if (w < 67108864) carry = 0;
					else carry = w / 67108864 | 0;
				}
				return ws;
			};
			FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
				var carry = 0;
				for (var i = 0; i < len; i++) {
					carry = carry + (ws[i] | 0);
					rws[2 * i] = carry & 8191;
					carry = carry >>> 13;
					rws[2 * i + 1] = carry & 8191;
					carry = carry >>> 13;
				}
				for (i = 2 * len; i < N; ++i) rws[i] = 0;
				assert(carry === 0);
				assert((carry & -8192) === 0);
			};
			FFTM.prototype.stub = function stub(N) {
				var ph = new Array(N);
				for (var i = 0; i < N; i++) ph[i] = 0;
				return ph;
			};
			FFTM.prototype.mulp = function mulp(x, y, out) {
				var N = 2 * this.guessLen13b(x.length, y.length);
				var rbt = this.makeRBT(N);
				var _ = this.stub(N);
				var rws = new Array(N);
				var rwst = new Array(N);
				var iwst = new Array(N);
				var nrws = new Array(N);
				var nrwst = new Array(N);
				var niwst = new Array(N);
				var rmws = out.words;
				rmws.length = N;
				this.convert13b(x.words, x.length, rws, N);
				this.convert13b(y.words, y.length, nrws, N);
				this.transform(rws, _, rwst, iwst, N, rbt);
				this.transform(nrws, _, nrwst, niwst, N, rbt);
				for (var i = 0; i < N; i++) {
					var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
					iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
					rwst[i] = rx;
				}
				this.conjugate(rwst, iwst, N);
				this.transform(rwst, iwst, rmws, _, N, rbt);
				this.conjugate(rmws, _, N);
				this.normalize13b(rmws, N);
				out.negative = x.negative ^ y.negative;
				out.length = x.length + y.length;
				return out._strip();
			};
			BN.prototype.mul = function mul(num) {
				var out = new BN(null);
				out.words = new Array(this.length + num.length);
				return this.mulTo(num, out);
			};
			BN.prototype.mulf = function mulf(num) {
				var out = new BN(null);
				out.words = new Array(this.length + num.length);
				return jumboMulTo(this, num, out);
			};
			BN.prototype.imul = function imul(num) {
				return this.clone().mulTo(num, this);
			};
			BN.prototype.imuln = function imuln(num) {
				var isNegNum = num < 0;
				if (isNegNum) num = -num;
				assert(typeof num === "number");
				assert(num < 67108864);
				var carry = 0;
				for (var i = 0; i < this.length; i++) {
					var w = (this.words[i] | 0) * num;
					var lo = (w & 67108863) + (carry & 67108863);
					carry >>= 26;
					carry += w / 67108864 | 0;
					carry += lo >>> 26;
					this.words[i] = lo & 67108863;
				}
				if (carry !== 0) {
					this.words[i] = carry;
					this.length++;
				}
				this.length = num === 0 ? 1 : this.length;
				return isNegNum ? this.ineg() : this;
			};
			BN.prototype.muln = function muln(num) {
				return this.clone().imuln(num);
			};
			BN.prototype.sqr = function sqr() {
				return this.mul(this);
			};
			BN.prototype.isqr = function isqr() {
				return this.imul(this.clone());
			};
			BN.prototype.pow = function pow(num) {
				var w = toBitArray(num);
				if (w.length === 0) return new BN(1);
				var res = this;
				for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break;
				if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
					if (w[i] === 0) continue;
					res = res.mul(q);
				}
				return res;
			};
			BN.prototype.iushln = function iushln(bits) {
				assert(typeof bits === "number" && bits >= 0);
				var r = bits % 26;
				var s = (bits - r) / 26;
				var carryMask = 67108863 >>> 26 - r << 26 - r;
				var i;
				if (r !== 0) {
					var carry = 0;
					for (i = 0; i < this.length; i++) {
						var newCarry = this.words[i] & carryMask;
						var c = (this.words[i] | 0) - newCarry << r;
						this.words[i] = c | carry;
						carry = newCarry >>> 26 - r;
					}
					if (carry) {
						this.words[i] = carry;
						this.length++;
					}
				}
				if (s !== 0) {
					for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i];
					for (i = 0; i < s; i++) this.words[i] = 0;
					this.length += s;
				}
				return this._strip();
			};
			BN.prototype.ishln = function ishln(bits) {
				assert(this.negative === 0);
				return this.iushln(bits);
			};
			BN.prototype.iushrn = function iushrn(bits, hint, extended) {
				assert(typeof bits === "number" && bits >= 0);
				var h;
				if (hint) h = (hint - hint % 26) / 26;
				else h = 0;
				var r = bits % 26;
				var s = Math.min((bits - r) / 26, this.length);
				var mask = 67108863 ^ 67108863 >>> r << r;
				var maskedWords = extended;
				h -= s;
				h = Math.max(0, h);
				if (maskedWords) {
					for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i];
					maskedWords.length = s;
				}
				if (s === 0) {} else if (this.length > s) {
					this.length -= s;
					for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s];
				} else {
					this.words[0] = 0;
					this.length = 1;
				}
				var carry = 0;
				for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
					var word = this.words[i] | 0;
					this.words[i] = carry << 26 - r | word >>> r;
					carry = word & mask;
				}
				if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry;
				if (this.length === 0) {
					this.words[0] = 0;
					this.length = 1;
				}
				return this._strip();
			};
			BN.prototype.ishrn = function ishrn(bits, hint, extended) {
				assert(this.negative === 0);
				return this.iushrn(bits, hint, extended);
			};
			BN.prototype.shln = function shln(bits) {
				return this.clone().ishln(bits);
			};
			BN.prototype.ushln = function ushln(bits) {
				return this.clone().iushln(bits);
			};
			BN.prototype.shrn = function shrn(bits) {
				return this.clone().ishrn(bits);
			};
			BN.prototype.ushrn = function ushrn(bits) {
				return this.clone().iushrn(bits);
			};
			BN.prototype.testn = function testn(bit) {
				assert(typeof bit === "number" && bit >= 0);
				var r = bit % 26;
				var s = (bit - r) / 26;
				var q = 1 << r;
				if (this.length <= s) return false;
				return !!(this.words[s] & q);
			};
			BN.prototype.imaskn = function imaskn(bits) {
				assert(typeof bits === "number" && bits >= 0);
				var r = bits % 26;
				var s = (bits - r) / 26;
				assert(this.negative === 0, "imaskn works only with positive numbers");
				if (this.length <= s) return this;
				if (r !== 0) s++;
				this.length = Math.min(s, this.length);
				if (r !== 0) {
					var mask = 67108863 ^ 67108863 >>> r << r;
					this.words[this.length - 1] &= mask;
				}
				return this._strip();
			};
			BN.prototype.maskn = function maskn(bits) {
				return this.clone().imaskn(bits);
			};
			BN.prototype.iaddn = function iaddn(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				if (num < 0) return this.isubn(-num);
				if (this.negative !== 0) {
					if (this.length === 1 && (this.words[0] | 0) <= num) {
						this.words[0] = num - (this.words[0] | 0);
						this.negative = 0;
						return this;
					}
					this.negative = 0;
					this.isubn(num);
					this.negative = 1;
					return this;
				}
				return this._iaddn(num);
			};
			BN.prototype._iaddn = function _iaddn(num) {
				this.words[0] += num;
				for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
					this.words[i] -= 67108864;
					if (i === this.length - 1) this.words[i + 1] = 1;
					else this.words[i + 1]++;
				}
				this.length = Math.max(this.length, i + 1);
				return this;
			};
			BN.prototype.isubn = function isubn(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				if (num < 0) return this.iaddn(-num);
				if (this.negative !== 0) {
					this.negative = 0;
					this.iaddn(num);
					this.negative = 1;
					return this;
				}
				this.words[0] -= num;
				if (this.length === 1 && this.words[0] < 0) {
					this.words[0] = -this.words[0];
					this.negative = 1;
				} else for (var i = 0; i < this.length && this.words[i] < 0; i++) {
					this.words[i] += 67108864;
					this.words[i + 1] -= 1;
				}
				return this._strip();
			};
			BN.prototype.addn = function addn(num) {
				return this.clone().iaddn(num);
			};
			BN.prototype.subn = function subn(num) {
				return this.clone().isubn(num);
			};
			BN.prototype.iabs = function iabs() {
				this.negative = 0;
				return this;
			};
			BN.prototype.abs = function abs() {
				return this.clone().iabs();
			};
			BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
				var len = num.length + shift;
				var i;
				this._expand(len);
				var w;
				var carry = 0;
				for (i = 0; i < num.length; i++) {
					w = (this.words[i + shift] | 0) + carry;
					var right = (num.words[i] | 0) * mul;
					w -= right & 67108863;
					carry = (w >> 26) - (right / 67108864 | 0);
					this.words[i + shift] = w & 67108863;
				}
				for (; i < this.length - shift; i++) {
					w = (this.words[i + shift] | 0) + carry;
					carry = w >> 26;
					this.words[i + shift] = w & 67108863;
				}
				if (carry === 0) return this._strip();
				assert(carry === -1);
				carry = 0;
				for (i = 0; i < this.length; i++) {
					w = -(this.words[i] | 0) + carry;
					carry = w >> 26;
					this.words[i] = w & 67108863;
				}
				this.negative = 1;
				return this._strip();
			};
			BN.prototype._wordDiv = function _wordDiv(num, mode) {
				var shift = this.length - num.length;
				var a = this.clone();
				var b = num;
				var bhi = b.words[b.length - 1] | 0;
				shift = 26 - this._countBits(bhi);
				if (shift !== 0) {
					b = b.ushln(shift);
					a.iushln(shift);
					bhi = b.words[b.length - 1] | 0;
				}
				var m = a.length - b.length;
				var q;
				if (mode !== "mod") {
					q = new BN(null);
					q.length = m + 1;
					q.words = new Array(q.length);
					for (var i = 0; i < q.length; i++) q.words[i] = 0;
				}
				var diff = a.clone()._ishlnsubmul(b, 1, m);
				if (diff.negative === 0) {
					a = diff;
					if (q) q.words[m] = 1;
				}
				for (var j = m - 1; j >= 0; j--) {
					var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
					qj = Math.min(qj / bhi | 0, 67108863);
					a._ishlnsubmul(b, qj, j);
					while (a.negative !== 0) {
						qj--;
						a.negative = 0;
						a._ishlnsubmul(b, 1, j);
						if (!a.isZero()) a.negative ^= 1;
					}
					if (q) q.words[j] = qj;
				}
				if (q) q._strip();
				a._strip();
				if (mode !== "div" && shift !== 0) a.iushrn(shift);
				return {
					div: q || null,
					mod: a
				};
			};
			BN.prototype.divmod = function divmod(num, mode, positive) {
				assert(!num.isZero());
				if (this.isZero()) return {
					div: new BN(0),
					mod: new BN(0)
				};
				var div, mod, res;
				if (this.negative !== 0 && num.negative === 0) {
					res = this.neg().divmod(num, mode);
					if (mode !== "mod") div = res.div.neg();
					if (mode !== "div") {
						mod = res.mod.neg();
						if (positive && mod.negative !== 0) mod.iadd(num);
					}
					return {
						div,
						mod
					};
				}
				if (this.negative === 0 && num.negative !== 0) {
					res = this.divmod(num.neg(), mode);
					if (mode !== "mod") div = res.div.neg();
					return {
						div,
						mod: res.mod
					};
				}
				if ((this.negative & num.negative) !== 0) {
					res = this.neg().divmod(num.neg(), mode);
					if (mode !== "div") {
						mod = res.mod.neg();
						if (positive && mod.negative !== 0) mod.isub(num);
					}
					return {
						div: res.div,
						mod
					};
				}
				if (num.length > this.length || this.cmp(num) < 0) return {
					div: new BN(0),
					mod: this
				};
				if (num.length === 1) {
					if (mode === "div") return {
						div: this.divn(num.words[0]),
						mod: null
					};
					if (mode === "mod") return {
						div: null,
						mod: new BN(this.modrn(num.words[0]))
					};
					return {
						div: this.divn(num.words[0]),
						mod: new BN(this.modrn(num.words[0]))
					};
				}
				return this._wordDiv(num, mode);
			};
			BN.prototype.div = function div(num) {
				return this.divmod(num, "div", false).div;
			};
			BN.prototype.mod = function mod(num) {
				return this.divmod(num, "mod", false).mod;
			};
			BN.prototype.umod = function umod(num) {
				return this.divmod(num, "mod", true).mod;
			};
			BN.prototype.divRound = function divRound(num) {
				var dm = this.divmod(num);
				if (dm.mod.isZero()) return dm.div;
				var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
				var half = num.ushrn(1);
				var r2 = num.andln(1);
				var cmp = mod.cmp(half);
				if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
				return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
			};
			BN.prototype.modrn = function modrn(num) {
				var isNegNum = num < 0;
				if (isNegNum) num = -num;
				assert(num <= 67108863);
				var p = (1 << 26) % num;
				var acc = 0;
				for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num;
				return isNegNum ? -acc : acc;
			};
			BN.prototype.modn = function modn(num) {
				return this.modrn(num);
			};
			BN.prototype.idivn = function idivn(num) {
				var isNegNum = num < 0;
				if (isNegNum) num = -num;
				assert(num <= 67108863);
				var carry = 0;
				for (var i = this.length - 1; i >= 0; i--) {
					var w = (this.words[i] | 0) + carry * 67108864;
					this.words[i] = w / num | 0;
					carry = w % num;
				}
				this._strip();
				return isNegNum ? this.ineg() : this;
			};
			BN.prototype.divn = function divn(num) {
				return this.clone().idivn(num);
			};
			BN.prototype.egcd = function egcd(p) {
				assert(p.negative === 0);
				assert(!p.isZero());
				var x = this;
				var y = p.clone();
				if (x.negative !== 0) x = x.umod(p);
				else x = x.clone();
				var A = new BN(1);
				var B = new BN(0);
				var C = new BN(0);
				var D = new BN(1);
				var g = 0;
				while (x.isEven() && y.isEven()) {
					x.iushrn(1);
					y.iushrn(1);
					++g;
				}
				var yp = y.clone();
				var xp = x.clone();
				while (!x.isZero()) {
					for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
					if (i > 0) {
						x.iushrn(i);
						while (i-- > 0) {
							if (A.isOdd() || B.isOdd()) {
								A.iadd(yp);
								B.isub(xp);
							}
							A.iushrn(1);
							B.iushrn(1);
						}
					}
					for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
					if (j > 0) {
						y.iushrn(j);
						while (j-- > 0) {
							if (C.isOdd() || D.isOdd()) {
								C.iadd(yp);
								D.isub(xp);
							}
							C.iushrn(1);
							D.iushrn(1);
						}
					}
					if (x.cmp(y) >= 0) {
						x.isub(y);
						A.isub(C);
						B.isub(D);
					} else {
						y.isub(x);
						C.isub(A);
						D.isub(B);
					}
				}
				return {
					a: C,
					b: D,
					gcd: y.iushln(g)
				};
			};
			BN.prototype._invmp = function _invmp(p) {
				assert(p.negative === 0);
				assert(!p.isZero());
				var a = this;
				var b = p.clone();
				if (a.negative !== 0) a = a.umod(p);
				else a = a.clone();
				var x1 = new BN(1);
				var x2 = new BN(0);
				var delta = b.clone();
				while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
					for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
					if (i > 0) {
						a.iushrn(i);
						while (i-- > 0) {
							if (x1.isOdd()) x1.iadd(delta);
							x1.iushrn(1);
						}
					}
					for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
					if (j > 0) {
						b.iushrn(j);
						while (j-- > 0) {
							if (x2.isOdd()) x2.iadd(delta);
							x2.iushrn(1);
						}
					}
					if (a.cmp(b) >= 0) {
						a.isub(b);
						x1.isub(x2);
					} else {
						b.isub(a);
						x2.isub(x1);
					}
				}
				var res;
				if (a.cmpn(1) === 0) res = x1;
				else res = x2;
				if (res.cmpn(0) < 0) res.iadd(p);
				return res;
			};
			BN.prototype.gcd = function gcd(num) {
				if (this.isZero()) return num.abs();
				if (num.isZero()) return this.abs();
				var a = this.clone();
				var b = num.clone();
				a.negative = 0;
				b.negative = 0;
				for (var shift = 0; a.isEven() && b.isEven(); shift++) {
					a.iushrn(1);
					b.iushrn(1);
				}
				do {
					while (a.isEven()) a.iushrn(1);
					while (b.isEven()) b.iushrn(1);
					var r = a.cmp(b);
					if (r < 0) {
						var t = a;
						a = b;
						b = t;
					} else if (r === 0 || b.cmpn(1) === 0) break;
					a.isub(b);
				} while (true);
				return b.iushln(shift);
			};
			BN.prototype.invm = function invm(num) {
				return this.egcd(num).a.umod(num);
			};
			BN.prototype.isEven = function isEven() {
				return (this.words[0] & 1) === 0;
			};
			BN.prototype.isOdd = function isOdd() {
				return (this.words[0] & 1) === 1;
			};
			BN.prototype.andln = function andln(num) {
				return this.words[0] & num;
			};
			BN.prototype.bincn = function bincn(bit) {
				assert(typeof bit === "number");
				var r = bit % 26;
				var s = (bit - r) / 26;
				var q = 1 << r;
				if (this.length <= s) {
					this._expand(s + 1);
					this.words[s] |= q;
					return this;
				}
				var carry = q;
				for (var i = s; carry !== 0 && i < this.length; i++) {
					var w = this.words[i] | 0;
					w += carry;
					carry = w >>> 26;
					w &= 67108863;
					this.words[i] = w;
				}
				if (carry !== 0) {
					this.words[i] = carry;
					this.length++;
				}
				return this;
			};
			BN.prototype.isZero = function isZero() {
				return this.length === 1 && this.words[0] === 0;
			};
			BN.prototype.cmpn = function cmpn(num) {
				var negative = num < 0;
				if (this.negative !== 0 && !negative) return -1;
				if (this.negative === 0 && negative) return 1;
				this._strip();
				var res;
				if (this.length > 1) res = 1;
				else {
					if (negative) num = -num;
					assert(num <= 67108863, "Number is too big");
					var w = this.words[0] | 0;
					res = w === num ? 0 : w < num ? -1 : 1;
				}
				if (this.negative !== 0) return -res | 0;
				return res;
			};
			BN.prototype.cmp = function cmp(num) {
				if (this.negative !== 0 && num.negative === 0) return -1;
				if (this.negative === 0 && num.negative !== 0) return 1;
				var res = this.ucmp(num);
				if (this.negative !== 0) return -res | 0;
				return res;
			};
			BN.prototype.ucmp = function ucmp(num) {
				if (this.length > num.length) return 1;
				if (this.length < num.length) return -1;
				var res = 0;
				for (var i = this.length - 1; i >= 0; i--) {
					var a = this.words[i] | 0;
					var b = num.words[i] | 0;
					if (a === b) continue;
					if (a < b) res = -1;
					else if (a > b) res = 1;
					break;
				}
				return res;
			};
			BN.prototype.gtn = function gtn(num) {
				return this.cmpn(num) === 1;
			};
			BN.prototype.gt = function gt(num) {
				return this.cmp(num) === 1;
			};
			BN.prototype.gten = function gten(num) {
				return this.cmpn(num) >= 0;
			};
			BN.prototype.gte = function gte(num) {
				return this.cmp(num) >= 0;
			};
			BN.prototype.ltn = function ltn(num) {
				return this.cmpn(num) === -1;
			};
			BN.prototype.lt = function lt(num) {
				return this.cmp(num) === -1;
			};
			BN.prototype.lten = function lten(num) {
				return this.cmpn(num) <= 0;
			};
			BN.prototype.lte = function lte(num) {
				return this.cmp(num) <= 0;
			};
			BN.prototype.eqn = function eqn(num) {
				return this.cmpn(num) === 0;
			};
			BN.prototype.eq = function eq(num) {
				return this.cmp(num) === 0;
			};
			BN.red = function red(num) {
				return new Red(num);
			};
			BN.prototype.toRed = function toRed(ctx) {
				assert(!this.red, "Already a number in reduction context");
				assert(this.negative === 0, "red works only with positives");
				return ctx.convertTo(this)._forceRed(ctx);
			};
			BN.prototype.fromRed = function fromRed() {
				assert(this.red, "fromRed works only with numbers in reduction context");
				return this.red.convertFrom(this);
			};
			BN.prototype._forceRed = function _forceRed(ctx) {
				this.red = ctx;
				return this;
			};
			BN.prototype.forceRed = function forceRed(ctx) {
				assert(!this.red, "Already a number in reduction context");
				return this._forceRed(ctx);
			};
			BN.prototype.redAdd = function redAdd(num) {
				assert(this.red, "redAdd works only with red numbers");
				return this.red.add(this, num);
			};
			BN.prototype.redIAdd = function redIAdd(num) {
				assert(this.red, "redIAdd works only with red numbers");
				return this.red.iadd(this, num);
			};
			BN.prototype.redSub = function redSub(num) {
				assert(this.red, "redSub works only with red numbers");
				return this.red.sub(this, num);
			};
			BN.prototype.redISub = function redISub(num) {
				assert(this.red, "redISub works only with red numbers");
				return this.red.isub(this, num);
			};
			BN.prototype.redShl = function redShl(num) {
				assert(this.red, "redShl works only with red numbers");
				return this.red.shl(this, num);
			};
			BN.prototype.redMul = function redMul(num) {
				assert(this.red, "redMul works only with red numbers");
				this.red._verify2(this, num);
				return this.red.mul(this, num);
			};
			BN.prototype.redIMul = function redIMul(num) {
				assert(this.red, "redMul works only with red numbers");
				this.red._verify2(this, num);
				return this.red.imul(this, num);
			};
			BN.prototype.redSqr = function redSqr() {
				assert(this.red, "redSqr works only with red numbers");
				this.red._verify1(this);
				return this.red.sqr(this);
			};
			BN.prototype.redISqr = function redISqr() {
				assert(this.red, "redISqr works only with red numbers");
				this.red._verify1(this);
				return this.red.isqr(this);
			};
			BN.prototype.redSqrt = function redSqrt() {
				assert(this.red, "redSqrt works only with red numbers");
				this.red._verify1(this);
				return this.red.sqrt(this);
			};
			BN.prototype.redInvm = function redInvm() {
				assert(this.red, "redInvm works only with red numbers");
				this.red._verify1(this);
				return this.red.invm(this);
			};
			BN.prototype.redNeg = function redNeg() {
				assert(this.red, "redNeg works only with red numbers");
				this.red._verify1(this);
				return this.red.neg(this);
			};
			BN.prototype.redPow = function redPow(num) {
				assert(this.red && !num.red, "redPow(normalNum)");
				this.red._verify1(this);
				return this.red.pow(this, num);
			};
			var primes = {
				k256: null,
				p224: null,
				p192: null,
				p25519: null
			};
			function MPrime(name, p) {
				this.name = name;
				this.p = new BN(p, 16);
				this.n = this.p.bitLength();
				this.k = new BN(1).iushln(this.n).isub(this.p);
				this.tmp = this._tmp();
			}
			MPrime.prototype._tmp = function _tmp() {
				var tmp = new BN(null);
				tmp.words = new Array(Math.ceil(this.n / 13));
				return tmp;
			};
			MPrime.prototype.ireduce = function ireduce(num) {
				var r = num;
				var rlen;
				do {
					this.split(r, this.tmp);
					r = this.imulK(r);
					r = r.iadd(this.tmp);
					rlen = r.bitLength();
				} while (rlen > this.n);
				var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
				if (cmp === 0) {
					r.words[0] = 0;
					r.length = 1;
				} else if (cmp > 0) r.isub(this.p);
				else if (r.strip !== void 0) r.strip();
				else r._strip();
				return r;
			};
			MPrime.prototype.split = function split(input, out) {
				input.iushrn(this.n, 0, out);
			};
			MPrime.prototype.imulK = function imulK(num) {
				return num.imul(this.k);
			};
			function K256() {
				MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
			}
			inherits(K256, MPrime);
			K256.prototype.split = function split(input, output) {
				var mask = 4194303;
				var outLen = Math.min(input.length, 9);
				for (var i = 0; i < outLen; i++) output.words[i] = input.words[i];
				output.length = outLen;
				if (input.length <= 9) {
					input.words[0] = 0;
					input.length = 1;
					return;
				}
				var prev = input.words[9];
				output.words[output.length++] = prev & mask;
				for (i = 10; i < input.length; i++) {
					var next = input.words[i] | 0;
					input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
					prev = next;
				}
				prev >>>= 22;
				input.words[i - 10] = prev;
				if (prev === 0 && input.length > 10) input.length -= 10;
				else input.length -= 9;
			};
			K256.prototype.imulK = function imulK(num) {
				num.words[num.length] = 0;
				num.words[num.length + 1] = 0;
				num.length += 2;
				var lo = 0;
				for (var i = 0; i < num.length; i++) {
					var w = num.words[i] | 0;
					lo += w * 977;
					num.words[i] = lo & 67108863;
					lo = w * 64 + (lo / 67108864 | 0);
				}
				if (num.words[num.length - 1] === 0) {
					num.length--;
					if (num.words[num.length - 1] === 0) num.length--;
				}
				return num;
			};
			function P224() {
				MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
			}
			inherits(P224, MPrime);
			function P192() {
				MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
			}
			inherits(P192, MPrime);
			function P25519() {
				MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
			}
			inherits(P25519, MPrime);
			P25519.prototype.imulK = function imulK(num) {
				var carry = 0;
				for (var i = 0; i < num.length; i++) {
					var hi = (num.words[i] | 0) * 19 + carry;
					var lo = hi & 67108863;
					hi >>>= 26;
					num.words[i] = lo;
					carry = hi;
				}
				if (carry !== 0) num.words[num.length++] = carry;
				return num;
			};
			BN._prime = function prime(name) {
				if (primes[name]) return primes[name];
				var prime;
				if (name === "k256") prime = new K256();
				else if (name === "p224") prime = new P224();
				else if (name === "p192") prime = new P192();
				else if (name === "p25519") prime = new P25519();
				else throw new Error("Unknown prime " + name);
				primes[name] = prime;
				return prime;
			};
			function Red(m) {
				if (typeof m === "string") {
					var prime = BN._prime(m);
					this.m = prime.p;
					this.prime = prime;
				} else {
					assert(m.gtn(1), "modulus must be greater than 1");
					this.m = m;
					this.prime = null;
				}
			}
			Red.prototype._verify1 = function _verify1(a) {
				assert(a.negative === 0, "red works only with positives");
				assert(a.red, "red works only with red numbers");
			};
			Red.prototype._verify2 = function _verify2(a, b) {
				assert((a.negative | b.negative) === 0, "red works only with positives");
				assert(a.red && a.red === b.red, "red works only with red numbers");
			};
			Red.prototype.imod = function imod(a) {
				if (this.prime) return this.prime.ireduce(a)._forceRed(this);
				move(a, a.umod(this.m)._forceRed(this));
				return a;
			};
			Red.prototype.neg = function neg(a) {
				if (a.isZero()) return a.clone();
				return this.m.sub(a)._forceRed(this);
			};
			Red.prototype.add = function add(a, b) {
				this._verify2(a, b);
				var res = a.add(b);
				if (res.cmp(this.m) >= 0) res.isub(this.m);
				return res._forceRed(this);
			};
			Red.prototype.iadd = function iadd(a, b) {
				this._verify2(a, b);
				var res = a.iadd(b);
				if (res.cmp(this.m) >= 0) res.isub(this.m);
				return res;
			};
			Red.prototype.sub = function sub(a, b) {
				this._verify2(a, b);
				var res = a.sub(b);
				if (res.cmpn(0) < 0) res.iadd(this.m);
				return res._forceRed(this);
			};
			Red.prototype.isub = function isub(a, b) {
				this._verify2(a, b);
				var res = a.isub(b);
				if (res.cmpn(0) < 0) res.iadd(this.m);
				return res;
			};
			Red.prototype.shl = function shl(a, num) {
				this._verify1(a);
				return this.imod(a.ushln(num));
			};
			Red.prototype.imul = function imul(a, b) {
				this._verify2(a, b);
				return this.imod(a.imul(b));
			};
			Red.prototype.mul = function mul(a, b) {
				this._verify2(a, b);
				return this.imod(a.mul(b));
			};
			Red.prototype.isqr = function isqr(a) {
				return this.imul(a, a.clone());
			};
			Red.prototype.sqr = function sqr(a) {
				return this.mul(a, a);
			};
			Red.prototype.sqrt = function sqrt(a) {
				if (a.isZero()) return a.clone();
				var mod3 = this.m.andln(3);
				assert(mod3 % 2 === 1);
				if (mod3 === 3) {
					var pow = this.m.add(new BN(1)).iushrn(2);
					return this.pow(a, pow);
				}
				var q = this.m.subn(1);
				var s = 0;
				while (!q.isZero() && q.andln(1) === 0) {
					s++;
					q.iushrn(1);
				}
				assert(!q.isZero());
				var one = new BN(1).toRed(this);
				var nOne = one.redNeg();
				var lpow = this.m.subn(1).iushrn(1);
				var z = this.m.bitLength();
				z = new BN(2 * z * z).toRed(this);
				while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne);
				var c = this.pow(z, q);
				var r = this.pow(a, q.addn(1).iushrn(1));
				var t = this.pow(a, q);
				var m = s;
				while (t.cmp(one) !== 0) {
					var tmp = t;
					for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr();
					assert(i < m);
					var b = this.pow(c, new BN(1).iushln(m - i - 1));
					r = r.redMul(b);
					c = b.redSqr();
					t = t.redMul(c);
					m = i;
				}
				return r;
			};
			Red.prototype.invm = function invm(a) {
				var inv = a._invmp(this.m);
				if (inv.negative !== 0) {
					inv.negative = 0;
					return this.imod(inv).redNeg();
				} else return this.imod(inv);
			};
			Red.prototype.pow = function pow(a, num) {
				if (num.isZero()) return new BN(1).toRed(this);
				if (num.cmpn(1) === 0) return a.clone();
				var windowSize = 4;
				var wnd = new Array(1 << windowSize);
				wnd[0] = new BN(1).toRed(this);
				wnd[1] = a;
				for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a);
				var res = wnd[0];
				var current = 0;
				var currentLen = 0;
				var start = num.bitLength() % 26;
				if (start === 0) start = 26;
				for (i = num.length - 1; i >= 0; i--) {
					var word = num.words[i];
					for (var j = start - 1; j >= 0; j--) {
						var bit = word >> j & 1;
						if (res !== wnd[0]) res = this.sqr(res);
						if (bit === 0 && current === 0) {
							currentLen = 0;
							continue;
						}
						current <<= 1;
						current |= bit;
						currentLen++;
						if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
						res = this.mul(res, wnd[current]);
						currentLen = 0;
						current = 0;
					}
					start = 26;
				}
				return res;
			};
			Red.prototype.convertTo = function convertTo(num) {
				var r = num.umod(this.m);
				return r === num ? r.clone() : r;
			};
			Red.prototype.convertFrom = function convertFrom(num) {
				var res = num.clone();
				res.red = null;
				return res;
			};
			BN.mont = function mont(num) {
				return new Mont(num);
			};
			function Mont(m) {
				Red.call(this, m);
				this.shift = this.m.bitLength();
				if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26;
				this.r = new BN(1).iushln(this.shift);
				this.r2 = this.imod(this.r.sqr());
				this.rinv = this.r._invmp(this.m);
				this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
				this.minv = this.minv.umod(this.r);
				this.minv = this.r.sub(this.minv);
			}
			inherits(Mont, Red);
			Mont.prototype.convertTo = function convertTo(num) {
				return this.imod(num.ushln(this.shift));
			};
			Mont.prototype.convertFrom = function convertFrom(num) {
				var r = this.imod(num.mul(this.rinv));
				r.red = null;
				return r;
			};
			Mont.prototype.imul = function imul(a, b) {
				if (a.isZero() || b.isZero()) {
					a.words[0] = 0;
					a.length = 1;
					return a;
				}
				var t = a.imul(b);
				var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
				var u = t.isub(c).iushrn(this.shift);
				var res = u;
				if (u.cmp(this.m) >= 0) res = u.isub(this.m);
				else if (u.cmpn(0) < 0) res = u.iadd(this.m);
				return res._forceRed(this);
			};
			Mont.prototype.mul = function mul(a, b) {
				if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
				var t = a.mul(b);
				var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
				var u = t.isub(c).iushrn(this.shift);
				var res = u;
				if (u.cmp(this.m) >= 0) res = u.isub(this.m);
				else if (u.cmpn(0) < 0) res = u.iadd(this.m);
				return res._forceRed(this);
			};
			Mont.prototype.invm = function invm(a) {
				return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this);
			};
		})(typeof module === "undefined" || module, exports);
	}));
	//#endregion
	//#region ../../node_modules/browserify-rsa/index.js
	var require_browserify_rsa = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$1();
		var randomBytes = require_browser$11();
		var Buffer = require_safe_buffer$4().Buffer;
		function getr(priv) {
			var len = priv.modulus.byteLength();
			var r;
			do
				r = new BN(randomBytes(len));
			while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));
			return r;
		}
		function blind(priv) {
			var r = getr(priv);
			return {
				blinder: r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed(),
				unblinder: r.invm(priv.modulus)
			};
		}
		function crt(msg, priv) {
			var blinds = blind(priv);
			var len = priv.modulus.byteLength();
			var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus);
			var c1 = blinded.toRed(BN.mont(priv.prime1));
			var c2 = blinded.toRed(BN.mont(priv.prime2));
			var qinv = priv.coefficient;
			var p = priv.prime1;
			var q = priv.prime2;
			var m1 = c1.redPow(priv.exponent1).fromRed();
			var m2 = c2.redPow(priv.exponent2).fromRed();
			var h = m1.isub(m2).imul(qinv).umod(p).imul(q);
			return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, "be", len);
		}
		crt.getr = getr;
		module.exports = crt;
	}));
	//#endregion
	//#region ../../node_modules/elliptic/package.json
	var package_exports = /* @__PURE__ */ __exportAll({
		author: () => author,
		bugs: () => bugs,
		default: () => package_default,
		dependencies: () => dependencies,
		description: () => description,
		devDependencies: () => devDependencies,
		files: () => files,
		homepage: () => homepage,
		keywords: () => keywords,
		license: () => "MIT",
		main: () => main,
		name: () => name,
		repository: () => repository,
		scripts: () => scripts,
		version: () => version
	}), name, version, description, main, files, scripts, repository, keywords, author, bugs, homepage, devDependencies, dependencies, package_default;
	var init_package = __esmMin((() => {
		name = "elliptic";
		version = "6.6.1";
		description = "EC cryptography";
		main = "lib/elliptic.js";
		files = ["lib"];
		scripts = {
			"lint": "eslint lib test",
			"lint:fix": "npm run lint -- --fix",
			"unit": "istanbul test _mocha --reporter=spec test/index.js",
			"test": "npm run lint && npm run unit",
			"version": "grunt dist && git add dist/"
		};
		repository = {
			"type": "git",
			"url": "git@github.com:indutny/elliptic"
		};
		keywords = [
			"EC",
			"Elliptic",
			"curve",
			"Cryptography"
		];
		author = "Fedor Indutny <fedor@indutny.com>";
		bugs = { "url": "https://github.com/indutny/elliptic/issues" };
		homepage = "https://github.com/indutny/elliptic";
		devDependencies = {
			"brfs": "^2.0.2",
			"coveralls": "^3.1.0",
			"eslint": "^7.6.0",
			"grunt": "^1.2.1",
			"grunt-browserify": "^5.3.0",
			"grunt-cli": "^1.3.2",
			"grunt-contrib-connect": "^3.0.0",
			"grunt-contrib-copy": "^1.0.0",
			"grunt-contrib-uglify": "^5.0.0",
			"grunt-mocha-istanbul": "^5.0.2",
			"grunt-saucelabs": "^9.0.1",
			"istanbul": "^0.4.5",
			"mocha": "^8.0.1"
		};
		dependencies = {
			"bn.js": "^4.11.9",
			"brorand": "^1.1.0",
			"hash.js": "^1.0.0",
			"hmac-drbg": "^1.0.1",
			"inherits": "^2.0.4",
			"minimalistic-assert": "^1.0.1",
			"minimalistic-crypto-utils": "^1.0.1"
		};
		package_default = {
			name,
			version,
			description,
			main,
			files,
			scripts,
			repository,
			keywords,
			author,
			license: "MIT",
			bugs,
			homepage,
			devDependencies,
			dependencies
		};
	}));
	//#endregion
	//#region ../../node_modules/minimalistic-crypto-utils/lib/utils.js
	var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = exports;
		function toArray(msg, enc) {
			if (Array.isArray(msg)) return msg.slice();
			if (!msg) return [];
			var res = [];
			if (typeof msg !== "string") {
				for (var i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
				return res;
			}
			if (enc === "hex") {
				msg = msg.replace(/[^a-z0-9]+/gi, "");
				if (msg.length % 2 !== 0) msg = "0" + msg;
				for (var i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
			} else for (var i = 0; i < msg.length; i++) {
				var c = msg.charCodeAt(i);
				var hi = c >> 8;
				var lo = c & 255;
				if (hi) res.push(hi, lo);
				else res.push(lo);
			}
			return res;
		}
		utils.toArray = toArray;
		function zero2(word) {
			if (word.length === 1) return "0" + word;
			else return word;
		}
		utils.zero2 = zero2;
		function toHex(msg) {
			var res = "";
			for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
			return res;
		}
		utils.toHex = toHex;
		utils.encode = function encode(arr, enc) {
			if (enc === "hex") return toHex(arr);
			else return arr;
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/utils.js
	var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = exports;
		var BN = require_bn$2();
		var minAssert = require_minimalistic_assert();
		var minUtils = require_utils$4();
		utils.assert = minAssert;
		utils.toArray = minUtils.toArray;
		utils.zero2 = minUtils.zero2;
		utils.toHex = minUtils.toHex;
		utils.encode = minUtils.encode;
		function getNAF(num, w, bits) {
			var naf = new Array(Math.max(num.bitLength(), bits) + 1);
			var i;
			for (i = 0; i < naf.length; i += 1) naf[i] = 0;
			var ws = 1 << w + 1;
			var k = num.clone();
			for (i = 0; i < naf.length; i++) {
				var z;
				var mod = k.andln(ws - 1);
				if (k.isOdd()) {
					if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod;
					else z = mod;
					k.isubn(z);
				} else z = 0;
				naf[i] = z;
				k.iushrn(1);
			}
			return naf;
		}
		utils.getNAF = getNAF;
		function getJSF(k1, k2) {
			var jsf = [[], []];
			k1 = k1.clone();
			k2 = k2.clone();
			var d1 = 0;
			var d2 = 0;
			var m8;
			while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
				var m14 = k1.andln(3) + d1 & 3;
				var m24 = k2.andln(3) + d2 & 3;
				if (m14 === 3) m14 = -1;
				if (m24 === 3) m24 = -1;
				var u1;
				if ((m14 & 1) === 0) u1 = 0;
				else {
					m8 = k1.andln(7) + d1 & 7;
					if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14;
					else u1 = m14;
				}
				jsf[0].push(u1);
				var u2;
				if ((m24 & 1) === 0) u2 = 0;
				else {
					m8 = k2.andln(7) + d2 & 7;
					if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24;
					else u2 = m24;
				}
				jsf[1].push(u2);
				if (2 * d1 === u1 + 1) d1 = 1 - d1;
				if (2 * d2 === u2 + 1) d2 = 1 - d2;
				k1.iushrn(1);
				k2.iushrn(1);
			}
			return jsf;
		}
		utils.getJSF = getJSF;
		function cachedProperty(obj, name, computer) {
			var key = "_" + name;
			obj.prototype[name] = function cachedProperty() {
				return this[key] !== void 0 ? this[key] : this[key] = computer.call(this);
			};
		}
		utils.cachedProperty = cachedProperty;
		function parseBytes(bytes) {
			return typeof bytes === "string" ? utils.toArray(bytes, "hex") : bytes;
		}
		utils.parseBytes = parseBytes;
		function intFromLE(bytes) {
			return new BN(bytes, "hex", "le");
		}
		utils.intFromLE = intFromLE;
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/curve/base.js
	var require_base$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var utils = require_utils$3();
		var getNAF = utils.getNAF;
		var getJSF = utils.getJSF;
		var assert = utils.assert;
		function BaseCurve(type, conf) {
			this.type = type;
			this.p = new BN(conf.p, 16);
			this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
			this.zero = new BN(0).toRed(this.red);
			this.one = new BN(1).toRed(this.red);
			this.two = new BN(2).toRed(this.red);
			this.n = conf.n && new BN(conf.n, 16);
			this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
			this._wnafT1 = new Array(4);
			this._wnafT2 = new Array(4);
			this._wnafT3 = new Array(4);
			this._wnafT4 = new Array(4);
			this._bitLength = this.n ? this.n.bitLength() : 0;
			var adjustCount = this.n && this.p.div(this.n);
			if (!adjustCount || adjustCount.cmpn(100) > 0) this.redN = null;
			else {
				this._maxwellTrick = true;
				this.redN = this.n.toRed(this.red);
			}
		}
		module.exports = BaseCurve;
		BaseCurve.prototype.point = function point() {
			throw new Error("Not implemented");
		};
		BaseCurve.prototype.validate = function validate() {
			throw new Error("Not implemented");
		};
		BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
			assert(p.precomputed);
			var doubles = p._getDoubles();
			var naf = getNAF(k, 1, this._bitLength);
			var I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1);
			I /= 3;
			var repr = [];
			var j;
			var nafW;
			for (j = 0; j < naf.length; j += doubles.step) {
				nafW = 0;
				for (var l = j + doubles.step - 1; l >= j; l--) nafW = (nafW << 1) + naf[l];
				repr.push(nafW);
			}
			var a = this.jpoint(null, null, null);
			var b = this.jpoint(null, null, null);
			for (var i = I; i > 0; i--) {
				for (j = 0; j < repr.length; j++) {
					nafW = repr[j];
					if (nafW === i) b = b.mixedAdd(doubles.points[j]);
					else if (nafW === -i) b = b.mixedAdd(doubles.points[j].neg());
				}
				a = a.add(b);
			}
			return a.toP();
		};
		BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
			var w = 4;
			var nafPoints = p._getNAFPoints(w);
			w = nafPoints.wnd;
			var wnd = nafPoints.points;
			var naf = getNAF(k, w, this._bitLength);
			var acc = this.jpoint(null, null, null);
			for (var i = naf.length - 1; i >= 0; i--) {
				for (var l = 0; i >= 0 && naf[i] === 0; i--) l++;
				if (i >= 0) l++;
				acc = acc.dblp(l);
				if (i < 0) break;
				var z = naf[i];
				assert(z !== 0);
				if (p.type === "affine") if (z > 0) acc = acc.mixedAdd(wnd[z - 1 >> 1]);
				else acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());
				else if (z > 0) acc = acc.add(wnd[z - 1 >> 1]);
				else acc = acc.add(wnd[-z - 1 >> 1].neg());
			}
			return p.type === "affine" ? acc.toP() : acc;
		};
		BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) {
			var wndWidth = this._wnafT1;
			var wnd = this._wnafT2;
			var naf = this._wnafT3;
			var max = 0;
			var i;
			var j;
			var p;
			for (i = 0; i < len; i++) {
				p = points[i];
				var nafPoints = p._getNAFPoints(defW);
				wndWidth[i] = nafPoints.wnd;
				wnd[i] = nafPoints.points;
			}
			for (i = len - 1; i >= 1; i -= 2) {
				var a = i - 1;
				var b = i;
				if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
					naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
					naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
					max = Math.max(naf[a].length, max);
					max = Math.max(naf[b].length, max);
					continue;
				}
				var comb = [
					points[a],
					null,
					null,
					points[b]
				];
				if (points[a].y.cmp(points[b].y) === 0) {
					comb[1] = points[a].add(points[b]);
					comb[2] = points[a].toJ().mixedAdd(points[b].neg());
				} else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
					comb[1] = points[a].toJ().mixedAdd(points[b]);
					comb[2] = points[a].add(points[b].neg());
				} else {
					comb[1] = points[a].toJ().mixedAdd(points[b]);
					comb[2] = points[a].toJ().mixedAdd(points[b].neg());
				}
				var index = [
					-3,
					-1,
					-5,
					-7,
					0,
					7,
					5,
					1,
					3
				];
				var jsf = getJSF(coeffs[a], coeffs[b]);
				max = Math.max(jsf[0].length, max);
				naf[a] = new Array(max);
				naf[b] = new Array(max);
				for (j = 0; j < max; j++) {
					var ja = jsf[0][j] | 0;
					var jb = jsf[1][j] | 0;
					naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
					naf[b][j] = 0;
					wnd[a] = comb;
				}
			}
			var acc = this.jpoint(null, null, null);
			var tmp = this._wnafT4;
			for (i = max; i >= 0; i--) {
				var k = 0;
				while (i >= 0) {
					var zero = true;
					for (j = 0; j < len; j++) {
						tmp[j] = naf[j][i] | 0;
						if (tmp[j] !== 0) zero = false;
					}
					if (!zero) break;
					k++;
					i--;
				}
				if (i >= 0) k++;
				acc = acc.dblp(k);
				if (i < 0) break;
				for (j = 0; j < len; j++) {
					var z = tmp[j];
					if (z === 0) continue;
					else if (z > 0) p = wnd[j][z - 1 >> 1];
					else if (z < 0) p = wnd[j][-z - 1 >> 1].neg();
					if (p.type === "affine") acc = acc.mixedAdd(p);
					else acc = acc.add(p);
				}
			}
			for (i = 0; i < len; i++) wnd[i] = null;
			if (jacobianResult) return acc;
			else return acc.toP();
		};
		function BasePoint(curve, type) {
			this.curve = curve;
			this.type = type;
			this.precomputed = null;
		}
		BaseCurve.BasePoint = BasePoint;
		BasePoint.prototype.eq = function eq() {
			throw new Error("Not implemented");
		};
		BasePoint.prototype.validate = function validate() {
			return this.curve.validate(this);
		};
		BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
			bytes = utils.toArray(bytes, enc);
			var len = this.p.byteLength();
			if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {
				if (bytes[0] === 6) assert(bytes[bytes.length - 1] % 2 === 0);
				else if (bytes[0] === 7) assert(bytes[bytes.length - 1] % 2 === 1);
				return this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));
			} else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);
			throw new Error("Unknown point format");
		};
		BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
			return this.encode(enc, true);
		};
		BasePoint.prototype._encode = function _encode(compact) {
			var len = this.curve.p.byteLength();
			var x = this.getX().toArray("be", len);
			if (compact) return [this.getY().isEven() ? 2 : 3].concat(x);
			return [4].concat(x, this.getY().toArray("be", len));
		};
		BasePoint.prototype.encode = function encode(enc, compact) {
			return utils.encode(this._encode(compact), enc);
		};
		BasePoint.prototype.precompute = function precompute(power) {
			if (this.precomputed) return this;
			var precomputed = {
				doubles: null,
				naf: null,
				beta: null
			};
			precomputed.naf = this._getNAFPoints(8);
			precomputed.doubles = this._getDoubles(4, power);
			precomputed.beta = this._getBeta();
			this.precomputed = precomputed;
			return this;
		};
		BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
			if (!this.precomputed) return false;
			var doubles = this.precomputed.doubles;
			if (!doubles) return false;
			return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
		};
		BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
			if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;
			var doubles = [this];
			var acc = this;
			for (var i = 0; i < power; i += step) {
				for (var j = 0; j < step; j++) acc = acc.dbl();
				doubles.push(acc);
			}
			return {
				step,
				points: doubles
			};
		};
		BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
			if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;
			var res = [this];
			var max = (1 << wnd) - 1;
			var dbl = max === 1 ? null : this.dbl();
			for (var i = 1; i < max; i++) res[i] = res[i - 1].add(dbl);
			return {
				wnd,
				points: res
			};
		};
		BasePoint.prototype._getBeta = function _getBeta() {
			return null;
		};
		BasePoint.prototype.dblp = function dblp(k) {
			var r = this;
			for (var i = 0; i < k; i++) r = r.dbl();
			return r;
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/curve/short.js
	var require_short = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$3();
		var BN = require_bn$2();
		var inherits = require_inherits_browser();
		var Base = require_base$3();
		var assert = utils.assert;
		function ShortCurve(conf) {
			Base.call(this, "short", conf);
			this.a = new BN(conf.a, 16).toRed(this.red);
			this.b = new BN(conf.b, 16).toRed(this.red);
			this.tinv = this.two.redInvm();
			this.zeroA = this.a.fromRed().cmpn(0) === 0;
			this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
			this.endo = this._getEndomorphism(conf);
			this._endoWnafT1 = new Array(4);
			this._endoWnafT2 = new Array(4);
		}
		inherits(ShortCurve, Base);
		module.exports = ShortCurve;
		ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
			if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return;
			var beta;
			var lambda;
			if (conf.beta) beta = new BN(conf.beta, 16).toRed(this.red);
			else {
				var betas = this._getEndoRoots(this.p);
				beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
				beta = beta.toRed(this.red);
			}
			if (conf.lambda) lambda = new BN(conf.lambda, 16);
			else {
				var lambdas = this._getEndoRoots(this.n);
				if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) lambda = lambdas[0];
				else {
					lambda = lambdas[1];
					assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
				}
			}
			var basis;
			if (conf.basis) basis = conf.basis.map(function(vec) {
				return {
					a: new BN(vec.a, 16),
					b: new BN(vec.b, 16)
				};
			});
			else basis = this._getEndoBasis(lambda);
			return {
				beta,
				lambda,
				basis
			};
		};
		ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
			var red = num === this.p ? this.red : BN.mont(num);
			var tinv = new BN(2).toRed(red).redInvm();
			var ntinv = tinv.redNeg();
			var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
			return [ntinv.redAdd(s).fromRed(), ntinv.redSub(s).fromRed()];
		};
		ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
			var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
			var u = lambda;
			var v = this.n.clone();
			var x1 = new BN(1);
			var y1 = new BN(0);
			var x2 = new BN(0);
			var y2 = new BN(1);
			var a0;
			var b0;
			var a1;
			var b1;
			var a2;
			var b2;
			var prevR;
			var i = 0;
			var r;
			var x;
			while (u.cmpn(0) !== 0) {
				var q = v.div(u);
				r = v.sub(q.mul(u));
				x = x2.sub(q.mul(x1));
				var y = y2.sub(q.mul(y1));
				if (!a1 && r.cmp(aprxSqrt) < 0) {
					a0 = prevR.neg();
					b0 = x1;
					a1 = r.neg();
					b1 = x;
				} else if (a1 && ++i === 2) break;
				prevR = r;
				v = u;
				u = r;
				x2 = x1;
				x1 = x;
				y2 = y1;
				y1 = y;
			}
			a2 = r.neg();
			b2 = x;
			var len1 = a1.sqr().add(b1.sqr());
			if (a2.sqr().add(b2.sqr()).cmp(len1) >= 0) {
				a2 = a0;
				b2 = b0;
			}
			if (a1.negative) {
				a1 = a1.neg();
				b1 = b1.neg();
			}
			if (a2.negative) {
				a2 = a2.neg();
				b2 = b2.neg();
			}
			return [{
				a: a1,
				b: b1
			}, {
				a: a2,
				b: b2
			}];
		};
		ShortCurve.prototype._endoSplit = function _endoSplit(k) {
			var basis = this.endo.basis;
			var v1 = basis[0];
			var v2 = basis[1];
			var c1 = v2.b.mul(k).divRound(this.n);
			var c2 = v1.b.neg().mul(k).divRound(this.n);
			var p1 = c1.mul(v1.a);
			var p2 = c2.mul(v2.a);
			var q1 = c1.mul(v1.b);
			var q2 = c2.mul(v2.b);
			return {
				k1: k.sub(p1).sub(p2),
				k2: q1.add(q2).neg()
			};
		};
		ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
			x = new BN(x, 16);
			if (!x.red) x = x.toRed(this.red);
			var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
			var y = y2.redSqrt();
			if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point");
			var isOdd = y.fromRed().isOdd();
			if (odd && !isOdd || !odd && isOdd) y = y.redNeg();
			return this.point(x, y);
		};
		ShortCurve.prototype.validate = function validate(point) {
			if (point.inf) return true;
			var x = point.x;
			var y = point.y;
			var ax = this.a.redMul(x);
			var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
			return y.redSqr().redISub(rhs).cmpn(0) === 0;
		};
		ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) {
			var npoints = this._endoWnafT1;
			var ncoeffs = this._endoWnafT2;
			for (var i = 0; i < points.length; i++) {
				var split = this._endoSplit(coeffs[i]);
				var p = points[i];
				var beta = p._getBeta();
				if (split.k1.negative) {
					split.k1.ineg();
					p = p.neg(true);
				}
				if (split.k2.negative) {
					split.k2.ineg();
					beta = beta.neg(true);
				}
				npoints[i * 2] = p;
				npoints[i * 2 + 1] = beta;
				ncoeffs[i * 2] = split.k1;
				ncoeffs[i * 2 + 1] = split.k2;
			}
			var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
			for (var j = 0; j < i * 2; j++) {
				npoints[j] = null;
				ncoeffs[j] = null;
			}
			return res;
		};
		function Point(curve, x, y, isRed) {
			Base.BasePoint.call(this, curve, "affine");
			if (x === null && y === null) {
				this.x = null;
				this.y = null;
				this.inf = true;
			} else {
				this.x = new BN(x, 16);
				this.y = new BN(y, 16);
				if (isRed) {
					this.x.forceRed(this.curve.red);
					this.y.forceRed(this.curve.red);
				}
				if (!this.x.red) this.x = this.x.toRed(this.curve.red);
				if (!this.y.red) this.y = this.y.toRed(this.curve.red);
				this.inf = false;
			}
		}
		inherits(Point, Base.BasePoint);
		ShortCurve.prototype.point = function point(x, y, isRed) {
			return new Point(this, x, y, isRed);
		};
		ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
			return Point.fromJSON(this, obj, red);
		};
		Point.prototype._getBeta = function _getBeta() {
			if (!this.curve.endo) return;
			var pre = this.precomputed;
			if (pre && pre.beta) return pre.beta;
			var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
			if (pre) {
				var curve = this.curve;
				var endoMul = function(p) {
					return curve.point(p.x.redMul(curve.endo.beta), p.y);
				};
				pre.beta = beta;
				beta.precomputed = {
					beta: null,
					naf: pre.naf && {
						wnd: pre.naf.wnd,
						points: pre.naf.points.map(endoMul)
					},
					doubles: pre.doubles && {
						step: pre.doubles.step,
						points: pre.doubles.points.map(endoMul)
					}
				};
			}
			return beta;
		};
		Point.prototype.toJSON = function toJSON() {
			if (!this.precomputed) return [this.x, this.y];
			return [
				this.x,
				this.y,
				this.precomputed && {
					doubles: this.precomputed.doubles && {
						step: this.precomputed.doubles.step,
						points: this.precomputed.doubles.points.slice(1)
					},
					naf: this.precomputed.naf && {
						wnd: this.precomputed.naf.wnd,
						points: this.precomputed.naf.points.slice(1)
					}
				}
			];
		};
		Point.fromJSON = function fromJSON(curve, obj, red) {
			if (typeof obj === "string") obj = JSON.parse(obj);
			var res = curve.point(obj[0], obj[1], red);
			if (!obj[2]) return res;
			function obj2point(obj) {
				return curve.point(obj[0], obj[1], red);
			}
			var pre = obj[2];
			res.precomputed = {
				beta: null,
				doubles: pre.doubles && {
					step: pre.doubles.step,
					points: [res].concat(pre.doubles.points.map(obj2point))
				},
				naf: pre.naf && {
					wnd: pre.naf.wnd,
					points: [res].concat(pre.naf.points.map(obj2point))
				}
			};
			return res;
		};
		Point.prototype.inspect = function inspect() {
			if (this.isInfinity()) return "<EC Point Infinity>";
			return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">";
		};
		Point.prototype.isInfinity = function isInfinity() {
			return this.inf;
		};
		Point.prototype.add = function add(p) {
			if (this.inf) return p;
			if (p.inf) return this;
			if (this.eq(p)) return this.dbl();
			if (this.neg().eq(p)) return this.curve.point(null, null);
			if (this.x.cmp(p.x) === 0) return this.curve.point(null, null);
			var c = this.y.redSub(p.y);
			if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm());
			var nx = c.redSqr().redISub(this.x).redISub(p.x);
			var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
			return this.curve.point(nx, ny);
		};
		Point.prototype.dbl = function dbl() {
			if (this.inf) return this;
			var ys1 = this.y.redAdd(this.y);
			if (ys1.cmpn(0) === 0) return this.curve.point(null, null);
			var a = this.curve.a;
			var x2 = this.x.redSqr();
			var dyinv = ys1.redInvm();
			var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
			var nx = c.redSqr().redISub(this.x.redAdd(this.x));
			var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
			return this.curve.point(nx, ny);
		};
		Point.prototype.getX = function getX() {
			return this.x.fromRed();
		};
		Point.prototype.getY = function getY() {
			return this.y.fromRed();
		};
		Point.prototype.mul = function mul(k) {
			k = new BN(k, 16);
			if (this.isInfinity()) return this;
			else if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);
			else if (this.curve.endo) return this.curve._endoWnafMulAdd([this], [k]);
			else return this.curve._wnafMul(this, k);
		};
		Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
			var points = [this, p2];
			var coeffs = [k1, k2];
			if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs);
			else return this.curve._wnafMulAdd(1, points, coeffs, 2);
		};
		Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
			var points = [this, p2];
			var coeffs = [k1, k2];
			if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs, true);
			else return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
		};
		Point.prototype.eq = function eq(p) {
			return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
		};
		Point.prototype.neg = function neg(_precompute) {
			if (this.inf) return this;
			var res = this.curve.point(this.x, this.y.redNeg());
			if (_precompute && this.precomputed) {
				var pre = this.precomputed;
				var negate = function(p) {
					return p.neg();
				};
				res.precomputed = {
					naf: pre.naf && {
						wnd: pre.naf.wnd,
						points: pre.naf.points.map(negate)
					},
					doubles: pre.doubles && {
						step: pre.doubles.step,
						points: pre.doubles.points.map(negate)
					}
				};
			}
			return res;
		};
		Point.prototype.toJ = function toJ() {
			if (this.inf) return this.curve.jpoint(null, null, null);
			return this.curve.jpoint(this.x, this.y, this.curve.one);
		};
		function JPoint(curve, x, y, z) {
			Base.BasePoint.call(this, curve, "jacobian");
			if (x === null && y === null && z === null) {
				this.x = this.curve.one;
				this.y = this.curve.one;
				this.z = new BN(0);
			} else {
				this.x = new BN(x, 16);
				this.y = new BN(y, 16);
				this.z = new BN(z, 16);
			}
			if (!this.x.red) this.x = this.x.toRed(this.curve.red);
			if (!this.y.red) this.y = this.y.toRed(this.curve.red);
			if (!this.z.red) this.z = this.z.toRed(this.curve.red);
			this.zOne = this.z === this.curve.one;
		}
		inherits(JPoint, Base.BasePoint);
		ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
			return new JPoint(this, x, y, z);
		};
		JPoint.prototype.toP = function toP() {
			if (this.isInfinity()) return this.curve.point(null, null);
			var zinv = this.z.redInvm();
			var zinv2 = zinv.redSqr();
			var ax = this.x.redMul(zinv2);
			var ay = this.y.redMul(zinv2).redMul(zinv);
			return this.curve.point(ax, ay);
		};
		JPoint.prototype.neg = function neg() {
			return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
		};
		JPoint.prototype.add = function add(p) {
			if (this.isInfinity()) return p;
			if (p.isInfinity()) return this;
			var pz2 = p.z.redSqr();
			var z2 = this.z.redSqr();
			var u1 = this.x.redMul(pz2);
			var u2 = p.x.redMul(z2);
			var s1 = this.y.redMul(pz2.redMul(p.z));
			var s2 = p.y.redMul(z2.redMul(this.z));
			var h = u1.redSub(u2);
			var r = s1.redSub(s2);
			if (h.cmpn(0) === 0) if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);
			else return this.dbl();
			var h2 = h.redSqr();
			var h3 = h2.redMul(h);
			var v = u1.redMul(h2);
			var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
			var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
			var nz = this.z.redMul(p.z).redMul(h);
			return this.curve.jpoint(nx, ny, nz);
		};
		JPoint.prototype.mixedAdd = function mixedAdd(p) {
			if (this.isInfinity()) return p.toJ();
			if (p.isInfinity()) return this;
			var z2 = this.z.redSqr();
			var u1 = this.x;
			var u2 = p.x.redMul(z2);
			var s1 = this.y;
			var s2 = p.y.redMul(z2).redMul(this.z);
			var h = u1.redSub(u2);
			var r = s1.redSub(s2);
			if (h.cmpn(0) === 0) if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null);
			else return this.dbl();
			var h2 = h.redSqr();
			var h3 = h2.redMul(h);
			var v = u1.redMul(h2);
			var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
			var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
			var nz = this.z.redMul(h);
			return this.curve.jpoint(nx, ny, nz);
		};
		JPoint.prototype.dblp = function dblp(pow) {
			if (pow === 0) return this;
			if (this.isInfinity()) return this;
			if (!pow) return this.dbl();
			var i;
			if (this.curve.zeroA || this.curve.threeA) {
				var r = this;
				for (i = 0; i < pow; i++) r = r.dbl();
				return r;
			}
			var a = this.curve.a;
			var tinv = this.curve.tinv;
			var jx = this.x;
			var jy = this.y;
			var jz = this.z;
			var jz4 = jz.redSqr().redSqr();
			var jyd = jy.redAdd(jy);
			for (i = 0; i < pow; i++) {
				var jx2 = jx.redSqr();
				var jyd2 = jyd.redSqr();
				var jyd4 = jyd2.redSqr();
				var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
				var t1 = jx.redMul(jyd2);
				var nx = c.redSqr().redISub(t1.redAdd(t1));
				var t2 = t1.redISub(nx);
				var dny = c.redMul(t2);
				dny = dny.redIAdd(dny).redISub(jyd4);
				var nz = jyd.redMul(jz);
				if (i + 1 < pow) jz4 = jz4.redMul(jyd4);
				jx = nx;
				jz = nz;
				jyd = dny;
			}
			return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
		};
		JPoint.prototype.dbl = function dbl() {
			if (this.isInfinity()) return this;
			if (this.curve.zeroA) return this._zeroDbl();
			else if (this.curve.threeA) return this._threeDbl();
			else return this._dbl();
		};
		JPoint.prototype._zeroDbl = function _zeroDbl() {
			var nx;
			var ny;
			var nz;
			if (this.zOne) {
				var xx = this.x.redSqr();
				var yy = this.y.redSqr();
				var yyyy = yy.redSqr();
				var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
				s = s.redIAdd(s);
				var m = xx.redAdd(xx).redIAdd(xx);
				var t = m.redSqr().redISub(s).redISub(s);
				var yyyy8 = yyyy.redIAdd(yyyy);
				yyyy8 = yyyy8.redIAdd(yyyy8);
				yyyy8 = yyyy8.redIAdd(yyyy8);
				nx = t;
				ny = m.redMul(s.redISub(t)).redISub(yyyy8);
				nz = this.y.redAdd(this.y);
			} else {
				var a = this.x.redSqr();
				var b = this.y.redSqr();
				var c = b.redSqr();
				var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
				d = d.redIAdd(d);
				var e = a.redAdd(a).redIAdd(a);
				var f = e.redSqr();
				var c8 = c.redIAdd(c);
				c8 = c8.redIAdd(c8);
				c8 = c8.redIAdd(c8);
				nx = f.redISub(d).redISub(d);
				ny = e.redMul(d.redISub(nx)).redISub(c8);
				nz = this.y.redMul(this.z);
				nz = nz.redIAdd(nz);
			}
			return this.curve.jpoint(nx, ny, nz);
		};
		JPoint.prototype._threeDbl = function _threeDbl() {
			var nx;
			var ny;
			var nz;
			if (this.zOne) {
				var xx = this.x.redSqr();
				var yy = this.y.redSqr();
				var yyyy = yy.redSqr();
				var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
				s = s.redIAdd(s);
				var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
				var t = m.redSqr().redISub(s).redISub(s);
				nx = t;
				var yyyy8 = yyyy.redIAdd(yyyy);
				yyyy8 = yyyy8.redIAdd(yyyy8);
				yyyy8 = yyyy8.redIAdd(yyyy8);
				ny = m.redMul(s.redISub(t)).redISub(yyyy8);
				nz = this.y.redAdd(this.y);
			} else {
				var delta = this.z.redSqr();
				var gamma = this.y.redSqr();
				var beta = this.x.redMul(gamma);
				var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
				alpha = alpha.redAdd(alpha).redIAdd(alpha);
				var beta4 = beta.redIAdd(beta);
				beta4 = beta4.redIAdd(beta4);
				var beta8 = beta4.redAdd(beta4);
				nx = alpha.redSqr().redISub(beta8);
				nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
				var ggamma8 = gamma.redSqr();
				ggamma8 = ggamma8.redIAdd(ggamma8);
				ggamma8 = ggamma8.redIAdd(ggamma8);
				ggamma8 = ggamma8.redIAdd(ggamma8);
				ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
			}
			return this.curve.jpoint(nx, ny, nz);
		};
		JPoint.prototype._dbl = function _dbl() {
			var a = this.curve.a;
			var jx = this.x;
			var jy = this.y;
			var jz = this.z;
			var jz4 = jz.redSqr().redSqr();
			var jx2 = jx.redSqr();
			var jy2 = jy.redSqr();
			var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
			var jxd4 = jx.redAdd(jx);
			jxd4 = jxd4.redIAdd(jxd4);
			var t1 = jxd4.redMul(jy2);
			var nx = c.redSqr().redISub(t1.redAdd(t1));
			var t2 = t1.redISub(nx);
			var jyd8 = jy2.redSqr();
			jyd8 = jyd8.redIAdd(jyd8);
			jyd8 = jyd8.redIAdd(jyd8);
			jyd8 = jyd8.redIAdd(jyd8);
			var ny = c.redMul(t2).redISub(jyd8);
			var nz = jy.redAdd(jy).redMul(jz);
			return this.curve.jpoint(nx, ny, nz);
		};
		JPoint.prototype.trpl = function trpl() {
			if (!this.curve.zeroA) return this.dbl().add(this);
			var xx = this.x.redSqr();
			var yy = this.y.redSqr();
			var zz = this.z.redSqr();
			var yyyy = yy.redSqr();
			var m = xx.redAdd(xx).redIAdd(xx);
			var mm = m.redSqr();
			var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
			e = e.redIAdd(e);
			e = e.redAdd(e).redIAdd(e);
			e = e.redISub(mm);
			var ee = e.redSqr();
			var t = yyyy.redIAdd(yyyy);
			t = t.redIAdd(t);
			t = t.redIAdd(t);
			t = t.redIAdd(t);
			var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
			var yyu4 = yy.redMul(u);
			yyu4 = yyu4.redIAdd(yyu4);
			yyu4 = yyu4.redIAdd(yyu4);
			var nx = this.x.redMul(ee).redISub(yyu4);
			nx = nx.redIAdd(nx);
			nx = nx.redIAdd(nx);
			var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
			ny = ny.redIAdd(ny);
			ny = ny.redIAdd(ny);
			ny = ny.redIAdd(ny);
			var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
			return this.curve.jpoint(nx, ny, nz);
		};
		JPoint.prototype.mul = function mul(k, kbase) {
			k = new BN(k, kbase);
			return this.curve._wnafMul(this, k);
		};
		JPoint.prototype.eq = function eq(p) {
			if (p.type === "affine") return this.eq(p.toJ());
			if (this === p) return true;
			var z2 = this.z.redSqr();
			var pz2 = p.z.redSqr();
			if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) return false;
			var z3 = z2.redMul(this.z);
			var pz3 = pz2.redMul(p.z);
			return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
		};
		JPoint.prototype.eqXToP = function eqXToP(x) {
			var zs = this.z.redSqr();
			var rx = x.toRed(this.curve.red).redMul(zs);
			if (this.x.cmp(rx) === 0) return true;
			var xc = x.clone();
			var t = this.curve.redN.redMul(zs);
			for (;;) {
				xc.iadd(this.curve.n);
				if (xc.cmp(this.curve.p) >= 0) return false;
				rx.redIAdd(t);
				if (this.x.cmp(rx) === 0) return true;
			}
		};
		JPoint.prototype.inspect = function inspect() {
			if (this.isInfinity()) return "<EC JPoint Infinity>";
			return "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">";
		};
		JPoint.prototype.isInfinity = function isInfinity() {
			return this.z.cmpn(0) === 0;
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/curve/mont.js
	var require_mont = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var inherits = require_inherits_browser();
		var Base = require_base$3();
		var utils = require_utils$3();
		function MontCurve(conf) {
			Base.call(this, "mont", conf);
			this.a = new BN(conf.a, 16).toRed(this.red);
			this.b = new BN(conf.b, 16).toRed(this.red);
			this.i4 = new BN(4).toRed(this.red).redInvm();
			this.two = new BN(2).toRed(this.red);
			this.a24 = this.i4.redMul(this.a.redAdd(this.two));
		}
		inherits(MontCurve, Base);
		module.exports = MontCurve;
		MontCurve.prototype.validate = function validate(point) {
			var x = point.normalize().x;
			var x2 = x.redSqr();
			var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
			return rhs.redSqrt().redSqr().cmp(rhs) === 0;
		};
		function Point(curve, x, z) {
			Base.BasePoint.call(this, curve, "projective");
			if (x === null && z === null) {
				this.x = this.curve.one;
				this.z = this.curve.zero;
			} else {
				this.x = new BN(x, 16);
				this.z = new BN(z, 16);
				if (!this.x.red) this.x = this.x.toRed(this.curve.red);
				if (!this.z.red) this.z = this.z.toRed(this.curve.red);
			}
		}
		inherits(Point, Base.BasePoint);
		MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
			return this.point(utils.toArray(bytes, enc), 1);
		};
		MontCurve.prototype.point = function point(x, z) {
			return new Point(this, x, z);
		};
		MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
			return Point.fromJSON(this, obj);
		};
		Point.prototype.precompute = function precompute() {};
		Point.prototype._encode = function _encode() {
			return this.getX().toArray("be", this.curve.p.byteLength());
		};
		Point.fromJSON = function fromJSON(curve, obj) {
			return new Point(curve, obj[0], obj[1] || curve.one);
		};
		Point.prototype.inspect = function inspect() {
			if (this.isInfinity()) return "<EC Point Infinity>";
			return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
		};
		Point.prototype.isInfinity = function isInfinity() {
			return this.z.cmpn(0) === 0;
		};
		Point.prototype.dbl = function dbl() {
			var aa = this.x.redAdd(this.z).redSqr();
			var bb = this.x.redSub(this.z).redSqr();
			var c = aa.redSub(bb);
			var nx = aa.redMul(bb);
			var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
			return this.curve.point(nx, nz);
		};
		Point.prototype.add = function add() {
			throw new Error("Not supported on Montgomery curve");
		};
		Point.prototype.diffAdd = function diffAdd(p, diff) {
			var a = this.x.redAdd(this.z);
			var b = this.x.redSub(this.z);
			var c = p.x.redAdd(p.z);
			var da = p.x.redSub(p.z).redMul(a);
			var cb = c.redMul(b);
			var nx = diff.z.redMul(da.redAdd(cb).redSqr());
			var nz = diff.x.redMul(da.redISub(cb).redSqr());
			return this.curve.point(nx, nz);
		};
		Point.prototype.mul = function mul(k) {
			var t = k.clone();
			var a = this;
			var b = this.curve.point(null, null);
			var c = this;
			for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) bits.push(t.andln(1));
			for (var i = bits.length - 1; i >= 0; i--) if (bits[i] === 0) {
				a = a.diffAdd(b, c);
				b = b.dbl();
			} else {
				b = a.diffAdd(b, c);
				a = a.dbl();
			}
			return b;
		};
		Point.prototype.mulAdd = function mulAdd() {
			throw new Error("Not supported on Montgomery curve");
		};
		Point.prototype.jumlAdd = function jumlAdd() {
			throw new Error("Not supported on Montgomery curve");
		};
		Point.prototype.eq = function eq(other) {
			return this.getX().cmp(other.getX()) === 0;
		};
		Point.prototype.normalize = function normalize() {
			this.x = this.x.redMul(this.z.redInvm());
			this.z = this.curve.one;
			return this;
		};
		Point.prototype.getX = function getX() {
			this.normalize();
			return this.x.fromRed();
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/curve/edwards.js
	var require_edwards = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$3();
		var BN = require_bn$2();
		var inherits = require_inherits_browser();
		var Base = require_base$3();
		var assert = utils.assert;
		function EdwardsCurve(conf) {
			this.twisted = (conf.a | 0) !== 1;
			this.mOneA = this.twisted && (conf.a | 0) === -1;
			this.extended = this.mOneA;
			Base.call(this, "edwards", conf);
			this.a = new BN(conf.a, 16).umod(this.red.m);
			this.a = this.a.toRed(this.red);
			this.c = new BN(conf.c, 16).toRed(this.red);
			this.c2 = this.c.redSqr();
			this.d = new BN(conf.d, 16).toRed(this.red);
			this.dd = this.d.redAdd(this.d);
			assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
			this.oneC = (conf.c | 0) === 1;
		}
		inherits(EdwardsCurve, Base);
		module.exports = EdwardsCurve;
		EdwardsCurve.prototype._mulA = function _mulA(num) {
			if (this.mOneA) return num.redNeg();
			else return this.a.redMul(num);
		};
		EdwardsCurve.prototype._mulC = function _mulC(num) {
			if (this.oneC) return num;
			else return this.c.redMul(num);
		};
		EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
			return this.point(x, y, z, t);
		};
		EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
			x = new BN(x, 16);
			if (!x.red) x = x.toRed(this.red);
			var x2 = x.redSqr();
			var rhs = this.c2.redSub(this.a.redMul(x2));
			var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
			var y2 = rhs.redMul(lhs.redInvm());
			var y = y2.redSqrt();
			if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point");
			var isOdd = y.fromRed().isOdd();
			if (odd && !isOdd || !odd && isOdd) y = y.redNeg();
			return this.point(x, y);
		};
		EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
			y = new BN(y, 16);
			if (!y.red) y = y.toRed(this.red);
			var y2 = y.redSqr();
			var lhs = y2.redSub(this.c2);
			var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
			var x2 = lhs.redMul(rhs.redInvm());
			if (x2.cmp(this.zero) === 0) if (odd) throw new Error("invalid point");
			else return this.point(this.zero, y);
			var x = x2.redSqrt();
			if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) throw new Error("invalid point");
			if (x.fromRed().isOdd() !== odd) x = x.redNeg();
			return this.point(x, y);
		};
		EdwardsCurve.prototype.validate = function validate(point) {
			if (point.isInfinity()) return true;
			point.normalize();
			var x2 = point.x.redSqr();
			var y2 = point.y.redSqr();
			var lhs = x2.redMul(this.a).redAdd(y2);
			var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
			return lhs.cmp(rhs) === 0;
		};
		function Point(curve, x, y, z, t) {
			Base.BasePoint.call(this, curve, "projective");
			if (x === null && y === null && z === null) {
				this.x = this.curve.zero;
				this.y = this.curve.one;
				this.z = this.curve.one;
				this.t = this.curve.zero;
				this.zOne = true;
			} else {
				this.x = new BN(x, 16);
				this.y = new BN(y, 16);
				this.z = z ? new BN(z, 16) : this.curve.one;
				this.t = t && new BN(t, 16);
				if (!this.x.red) this.x = this.x.toRed(this.curve.red);
				if (!this.y.red) this.y = this.y.toRed(this.curve.red);
				if (!this.z.red) this.z = this.z.toRed(this.curve.red);
				if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red);
				this.zOne = this.z === this.curve.one;
				if (this.curve.extended && !this.t) {
					this.t = this.x.redMul(this.y);
					if (!this.zOne) this.t = this.t.redMul(this.z.redInvm());
				}
			}
		}
		inherits(Point, Base.BasePoint);
		EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
			return Point.fromJSON(this, obj);
		};
		EdwardsCurve.prototype.point = function point(x, y, z, t) {
			return new Point(this, x, y, z, t);
		};
		Point.fromJSON = function fromJSON(curve, obj) {
			return new Point(curve, obj[0], obj[1], obj[2]);
		};
		Point.prototype.inspect = function inspect() {
			if (this.isInfinity()) return "<EC Point Infinity>";
			return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
		};
		Point.prototype.isInfinity = function isInfinity() {
			return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);
		};
		Point.prototype._extDbl = function _extDbl() {
			var a = this.x.redSqr();
			var b = this.y.redSqr();
			var c = this.z.redSqr();
			c = c.redIAdd(c);
			var d = this.curve._mulA(a);
			var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
			var g = d.redAdd(b);
			var f = g.redSub(c);
			var h = d.redSub(b);
			var nx = e.redMul(f);
			var ny = g.redMul(h);
			var nt = e.redMul(h);
			var nz = f.redMul(g);
			return this.curve.point(nx, ny, nz, nt);
		};
		Point.prototype._projDbl = function _projDbl() {
			var b = this.x.redAdd(this.y).redSqr();
			var c = this.x.redSqr();
			var d = this.y.redSqr();
			var nx;
			var ny;
			var nz;
			var e;
			var h;
			var j;
			if (this.curve.twisted) {
				e = this.curve._mulA(c);
				var f = e.redAdd(d);
				if (this.zOne) {
					nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
					ny = f.redMul(e.redSub(d));
					nz = f.redSqr().redSub(f).redSub(f);
				} else {
					h = this.z.redSqr();
					j = f.redSub(h).redISub(h);
					nx = b.redSub(c).redISub(d).redMul(j);
					ny = f.redMul(e.redSub(d));
					nz = f.redMul(j);
				}
			} else {
				e = c.redAdd(d);
				h = this.curve._mulC(this.z).redSqr();
				j = e.redSub(h).redSub(h);
				nx = this.curve._mulC(b.redISub(e)).redMul(j);
				ny = this.curve._mulC(e).redMul(c.redISub(d));
				nz = e.redMul(j);
			}
			return this.curve.point(nx, ny, nz);
		};
		Point.prototype.dbl = function dbl() {
			if (this.isInfinity()) return this;
			if (this.curve.extended) return this._extDbl();
			else return this._projDbl();
		};
		Point.prototype._extAdd = function _extAdd(p) {
			var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
			var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
			var c = this.t.redMul(this.curve.dd).redMul(p.t);
			var d = this.z.redMul(p.z.redAdd(p.z));
			var e = b.redSub(a);
			var f = d.redSub(c);
			var g = d.redAdd(c);
			var h = b.redAdd(a);
			var nx = e.redMul(f);
			var ny = g.redMul(h);
			var nt = e.redMul(h);
			var nz = f.redMul(g);
			return this.curve.point(nx, ny, nz, nt);
		};
		Point.prototype._projAdd = function _projAdd(p) {
			var a = this.z.redMul(p.z);
			var b = a.redSqr();
			var c = this.x.redMul(p.x);
			var d = this.y.redMul(p.y);
			var e = this.curve.d.redMul(c).redMul(d);
			var f = b.redSub(e);
			var g = b.redAdd(e);
			var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
			var nx = a.redMul(f).redMul(tmp);
			var ny;
			var nz;
			if (this.curve.twisted) {
				ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
				nz = f.redMul(g);
			} else {
				ny = a.redMul(g).redMul(d.redSub(c));
				nz = this.curve._mulC(f).redMul(g);
			}
			return this.curve.point(nx, ny, nz);
		};
		Point.prototype.add = function add(p) {
			if (this.isInfinity()) return p;
			if (p.isInfinity()) return this;
			if (this.curve.extended) return this._extAdd(p);
			else return this._projAdd(p);
		};
		Point.prototype.mul = function mul(k) {
			if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k);
			else return this.curve._wnafMul(this, k);
		};
		Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
			return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, false);
		};
		Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
			return this.curve._wnafMulAdd(1, [this, p], [k1, k2], 2, true);
		};
		Point.prototype.normalize = function normalize() {
			if (this.zOne) return this;
			var zi = this.z.redInvm();
			this.x = this.x.redMul(zi);
			this.y = this.y.redMul(zi);
			if (this.t) this.t = this.t.redMul(zi);
			this.z = this.curve.one;
			this.zOne = true;
			return this;
		};
		Point.prototype.neg = function neg() {
			return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());
		};
		Point.prototype.getX = function getX() {
			this.normalize();
			return this.x.fromRed();
		};
		Point.prototype.getY = function getY() {
			this.normalize();
			return this.y.fromRed();
		};
		Point.prototype.eq = function eq(other) {
			return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;
		};
		Point.prototype.eqXToP = function eqXToP(x) {
			var rx = x.toRed(this.curve.red).redMul(this.z);
			if (this.x.cmp(rx) === 0) return true;
			var xc = x.clone();
			var t = this.curve.redN.redMul(this.z);
			for (;;) {
				xc.iadd(this.curve.n);
				if (xc.cmp(this.curve.p) >= 0) return false;
				rx.redIAdd(t);
				if (this.x.cmp(rx) === 0) return true;
			}
		};
		Point.prototype.toP = Point.prototype.normalize;
		Point.prototype.mixedAdd = Point.prototype.add;
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/curve/index.js
	var require_curve = /* @__PURE__ */ __commonJSMin(((exports) => {
		var curve = exports;
		curve.base = require_base$3();
		curve.short = require_short();
		curve.mont = require_mont();
		curve.edwards = require_edwards();
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/utils.js
	var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var assert = require_minimalistic_assert();
		exports.inherits = require_inherits_browser();
		function isSurrogatePair(msg, i) {
			if ((msg.charCodeAt(i) & 64512) !== 55296) return false;
			if (i < 0 || i + 1 >= msg.length) return false;
			return (msg.charCodeAt(i + 1) & 64512) === 56320;
		}
		function toArray(msg, enc) {
			if (Array.isArray(msg)) return msg.slice();
			if (!msg) return [];
			var res = [];
			if (typeof msg === "string") {
				if (!enc) {
					var p = 0;
					for (var i = 0; i < msg.length; i++) {
						var c = msg.charCodeAt(i);
						if (c < 128) res[p++] = c;
						else if (c < 2048) {
							res[p++] = c >> 6 | 192;
							res[p++] = c & 63 | 128;
						} else if (isSurrogatePair(msg, i)) {
							c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023);
							res[p++] = c >> 18 | 240;
							res[p++] = c >> 12 & 63 | 128;
							res[p++] = c >> 6 & 63 | 128;
							res[p++] = c & 63 | 128;
						} else {
							res[p++] = c >> 12 | 224;
							res[p++] = c >> 6 & 63 | 128;
							res[p++] = c & 63 | 128;
						}
					}
				} else if (enc === "hex") {
					msg = msg.replace(/[^a-z0-9]+/gi, "");
					if (msg.length % 2 !== 0) msg = "0" + msg;
					for (i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
				}
			} else for (i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
			return res;
		}
		exports.toArray = toArray;
		function toHex(msg) {
			var res = "";
			for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
			return res;
		}
		exports.toHex = toHex;
		function htonl(w) {
			return (w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24) >>> 0;
		}
		exports.htonl = htonl;
		function toHex32(msg, endian) {
			var res = "";
			for (var i = 0; i < msg.length; i++) {
				var w = msg[i];
				if (endian === "little") w = htonl(w);
				res += zero8(w.toString(16));
			}
			return res;
		}
		exports.toHex32 = toHex32;
		function zero2(word) {
			if (word.length === 1) return "0" + word;
			else return word;
		}
		exports.zero2 = zero2;
		function zero8(word) {
			if (word.length === 7) return "0" + word;
			else if (word.length === 6) return "00" + word;
			else if (word.length === 5) return "000" + word;
			else if (word.length === 4) return "0000" + word;
			else if (word.length === 3) return "00000" + word;
			else if (word.length === 2) return "000000" + word;
			else if (word.length === 1) return "0000000" + word;
			else return word;
		}
		exports.zero8 = zero8;
		function join32(msg, start, end, endian) {
			var len = end - start;
			assert(len % 4 === 0);
			var res = new Array(len / 4);
			for (var i = 0, k = start; i < res.length; i++, k += 4) {
				var w;
				if (endian === "big") w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3];
				else w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k];
				res[i] = w >>> 0;
			}
			return res;
		}
		exports.join32 = join32;
		function split32(msg, endian) {
			var res = new Array(msg.length * 4);
			for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
				var m = msg[i];
				if (endian === "big") {
					res[k] = m >>> 24;
					res[k + 1] = m >>> 16 & 255;
					res[k + 2] = m >>> 8 & 255;
					res[k + 3] = m & 255;
				} else {
					res[k + 3] = m >>> 24;
					res[k + 2] = m >>> 16 & 255;
					res[k + 1] = m >>> 8 & 255;
					res[k] = m & 255;
				}
			}
			return res;
		}
		exports.split32 = split32;
		function rotr32(w, b) {
			return w >>> b | w << 32 - b;
		}
		exports.rotr32 = rotr32;
		function rotl32(w, b) {
			return w << b | w >>> 32 - b;
		}
		exports.rotl32 = rotl32;
		function sum32(a, b) {
			return a + b >>> 0;
		}
		exports.sum32 = sum32;
		function sum32_3(a, b, c) {
			return a + b + c >>> 0;
		}
		exports.sum32_3 = sum32_3;
		function sum32_4(a, b, c, d) {
			return a + b + c + d >>> 0;
		}
		exports.sum32_4 = sum32_4;
		function sum32_5(a, b, c, d, e) {
			return a + b + c + d + e >>> 0;
		}
		exports.sum32_5 = sum32_5;
		function sum64(buf, pos, ah, al) {
			var bh = buf[pos];
			var lo = al + buf[pos + 1] >>> 0;
			buf[pos] = (lo < al ? 1 : 0) + ah + bh >>> 0;
			buf[pos + 1] = lo;
		}
		exports.sum64 = sum64;
		function sum64_hi(ah, al, bh, bl) {
			return (al + bl >>> 0 < al ? 1 : 0) + ah + bh >>> 0;
		}
		exports.sum64_hi = sum64_hi;
		function sum64_lo(ah, al, bh, bl) {
			return al + bl >>> 0;
		}
		exports.sum64_lo = sum64_lo;
		function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
			var carry = 0;
			var lo = al;
			lo = lo + bl >>> 0;
			carry += lo < al ? 1 : 0;
			lo = lo + cl >>> 0;
			carry += lo < cl ? 1 : 0;
			lo = lo + dl >>> 0;
			carry += lo < dl ? 1 : 0;
			return ah + bh + ch + dh + carry >>> 0;
		}
		exports.sum64_4_hi = sum64_4_hi;
		function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
			return al + bl + cl + dl >>> 0;
		}
		exports.sum64_4_lo = sum64_4_lo;
		function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
			var carry = 0;
			var lo = al;
			lo = lo + bl >>> 0;
			carry += lo < al ? 1 : 0;
			lo = lo + cl >>> 0;
			carry += lo < cl ? 1 : 0;
			lo = lo + dl >>> 0;
			carry += lo < dl ? 1 : 0;
			lo = lo + el >>> 0;
			carry += lo < el ? 1 : 0;
			return ah + bh + ch + dh + eh + carry >>> 0;
		}
		exports.sum64_5_hi = sum64_5_hi;
		function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
			return al + bl + cl + dl + el >>> 0;
		}
		exports.sum64_5_lo = sum64_5_lo;
		function rotr64_hi(ah, al, num) {
			return (al << 32 - num | ah >>> num) >>> 0;
		}
		exports.rotr64_hi = rotr64_hi;
		function rotr64_lo(ah, al, num) {
			return (ah << 32 - num | al >>> num) >>> 0;
		}
		exports.rotr64_lo = rotr64_lo;
		function shr64_hi(ah, al, num) {
			return ah >>> num;
		}
		exports.shr64_hi = shr64_hi;
		function shr64_lo(ah, al, num) {
			return (ah << 32 - num | al >>> num) >>> 0;
		}
		exports.shr64_lo = shr64_lo;
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/common.js
	var require_common$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = require_utils$2();
		var assert = require_minimalistic_assert();
		function BlockHash() {
			this.pending = null;
			this.pendingTotal = 0;
			this.blockSize = this.constructor.blockSize;
			this.outSize = this.constructor.outSize;
			this.hmacStrength = this.constructor.hmacStrength;
			this.padLength = this.constructor.padLength / 8;
			this.endian = "big";
			this._delta8 = this.blockSize / 8;
			this._delta32 = this.blockSize / 32;
		}
		exports.BlockHash = BlockHash;
		BlockHash.prototype.update = function update(msg, enc) {
			msg = utils.toArray(msg, enc);
			if (!this.pending) this.pending = msg;
			else this.pending = this.pending.concat(msg);
			this.pendingTotal += msg.length;
			if (this.pending.length >= this._delta8) {
				msg = this.pending;
				var r = msg.length % this._delta8;
				this.pending = msg.slice(msg.length - r, msg.length);
				if (this.pending.length === 0) this.pending = null;
				msg = utils.join32(msg, 0, msg.length - r, this.endian);
				for (var i = 0; i < msg.length; i += this._delta32) this._update(msg, i, i + this._delta32);
			}
			return this;
		};
		BlockHash.prototype.digest = function digest(enc) {
			this.update(this._pad());
			assert(this.pending === null);
			return this._digest(enc);
		};
		BlockHash.prototype._pad = function pad() {
			var len = this.pendingTotal;
			var bytes = this._delta8;
			var k = bytes - (len + this.padLength) % bytes;
			var res = new Array(k + this.padLength);
			res[0] = 128;
			for (var i = 1; i < k; i++) res[i] = 0;
			len <<= 3;
			if (this.endian === "big") {
				for (var t = 8; t < this.padLength; t++) res[i++] = 0;
				res[i++] = 0;
				res[i++] = 0;
				res[i++] = 0;
				res[i++] = 0;
				res[i++] = len >>> 24 & 255;
				res[i++] = len >>> 16 & 255;
				res[i++] = len >>> 8 & 255;
				res[i++] = len & 255;
			} else {
				res[i++] = len & 255;
				res[i++] = len >>> 8 & 255;
				res[i++] = len >>> 16 & 255;
				res[i++] = len >>> 24 & 255;
				res[i++] = 0;
				res[i++] = 0;
				res[i++] = 0;
				res[i++] = 0;
				for (t = 8; t < this.padLength; t++) res[i++] = 0;
			}
			return res;
		};
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha/common.js
	var require_common$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var rotr32 = require_utils$2().rotr32;
		function ft_1(s, x, y, z) {
			if (s === 0) return ch32(x, y, z);
			if (s === 1 || s === 3) return p32(x, y, z);
			if (s === 2) return maj32(x, y, z);
		}
		exports.ft_1 = ft_1;
		function ch32(x, y, z) {
			return x & y ^ ~x & z;
		}
		exports.ch32 = ch32;
		function maj32(x, y, z) {
			return x & y ^ x & z ^ y & z;
		}
		exports.maj32 = maj32;
		function p32(x, y, z) {
			return x ^ y ^ z;
		}
		exports.p32 = p32;
		function s0_256(x) {
			return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
		}
		exports.s0_256 = s0_256;
		function s1_256(x) {
			return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
		}
		exports.s1_256 = s1_256;
		function g0_256(x) {
			return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;
		}
		exports.g0_256 = g0_256;
		function g1_256(x) {
			return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;
		}
		exports.g1_256 = g1_256;
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha/1.js
	var require__1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$2();
		var common = require_common$2();
		var shaCommon = require_common$1();
		var rotl32 = utils.rotl32;
		var sum32 = utils.sum32;
		var sum32_5 = utils.sum32_5;
		var ft_1 = shaCommon.ft_1;
		var BlockHash = common.BlockHash;
		var sha1_K = [
			1518500249,
			1859775393,
			2400959708,
			3395469782
		];
		function SHA1() {
			if (!(this instanceof SHA1)) return new SHA1();
			BlockHash.call(this);
			this.h = [
				1732584193,
				4023233417,
				2562383102,
				271733878,
				3285377520
			];
			this.W = new Array(80);
		}
		utils.inherits(SHA1, BlockHash);
		module.exports = SHA1;
		SHA1.blockSize = 512;
		SHA1.outSize = 160;
		SHA1.hmacStrength = 80;
		SHA1.padLength = 64;
		SHA1.prototype._update = function _update(msg, start) {
			var W = this.W;
			for (var i = 0; i < 16; i++) W[i] = msg[start + i];
			for (; i < W.length; i++) W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
			var a = this.h[0];
			var b = this.h[1];
			var c = this.h[2];
			var d = this.h[3];
			var e = this.h[4];
			for (i = 0; i < W.length; i++) {
				var s = ~~(i / 20);
				var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
				e = d;
				d = c;
				c = rotl32(b, 30);
				b = a;
				a = t;
			}
			this.h[0] = sum32(this.h[0], a);
			this.h[1] = sum32(this.h[1], b);
			this.h[2] = sum32(this.h[2], c);
			this.h[3] = sum32(this.h[3], d);
			this.h[4] = sum32(this.h[4], e);
		};
		SHA1.prototype._digest = function digest(enc) {
			if (enc === "hex") return utils.toHex32(this.h, "big");
			else return utils.split32(this.h, "big");
		};
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha/256.js
	var require__256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$2();
		var common = require_common$2();
		var shaCommon = require_common$1();
		var assert = require_minimalistic_assert();
		var sum32 = utils.sum32;
		var sum32_4 = utils.sum32_4;
		var sum32_5 = utils.sum32_5;
		var ch32 = shaCommon.ch32;
		var maj32 = shaCommon.maj32;
		var s0_256 = shaCommon.s0_256;
		var s1_256 = shaCommon.s1_256;
		var g0_256 = shaCommon.g0_256;
		var g1_256 = shaCommon.g1_256;
		var BlockHash = common.BlockHash;
		var sha256_K = [
			1116352408,
			1899447441,
			3049323471,
			3921009573,
			961987163,
			1508970993,
			2453635748,
			2870763221,
			3624381080,
			310598401,
			607225278,
			1426881987,
			1925078388,
			2162078206,
			2614888103,
			3248222580,
			3835390401,
			4022224774,
			264347078,
			604807628,
			770255983,
			1249150122,
			1555081692,
			1996064986,
			2554220882,
			2821834349,
			2952996808,
			3210313671,
			3336571891,
			3584528711,
			113926993,
			338241895,
			666307205,
			773529912,
			1294757372,
			1396182291,
			1695183700,
			1986661051,
			2177026350,
			2456956037,
			2730485921,
			2820302411,
			3259730800,
			3345764771,
			3516065817,
			3600352804,
			4094571909,
			275423344,
			430227734,
			506948616,
			659060556,
			883997877,
			958139571,
			1322822218,
			1537002063,
			1747873779,
			1955562222,
			2024104815,
			2227730452,
			2361852424,
			2428436474,
			2756734187,
			3204031479,
			3329325298
		];
		function SHA256() {
			if (!(this instanceof SHA256)) return new SHA256();
			BlockHash.call(this);
			this.h = [
				1779033703,
				3144134277,
				1013904242,
				2773480762,
				1359893119,
				2600822924,
				528734635,
				1541459225
			];
			this.k = sha256_K;
			this.W = new Array(64);
		}
		utils.inherits(SHA256, BlockHash);
		module.exports = SHA256;
		SHA256.blockSize = 512;
		SHA256.outSize = 256;
		SHA256.hmacStrength = 192;
		SHA256.padLength = 64;
		SHA256.prototype._update = function _update(msg, start) {
			var W = this.W;
			for (var i = 0; i < 16; i++) W[i] = msg[start + i];
			for (; i < W.length; i++) W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
			var a = this.h[0];
			var b = this.h[1];
			var c = this.h[2];
			var d = this.h[3];
			var e = this.h[4];
			var f = this.h[5];
			var g = this.h[6];
			var h = this.h[7];
			assert(this.k.length === W.length);
			for (i = 0; i < W.length; i++) {
				var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
				var T2 = sum32(s0_256(a), maj32(a, b, c));
				h = g;
				g = f;
				f = e;
				e = sum32(d, T1);
				d = c;
				c = b;
				b = a;
				a = sum32(T1, T2);
			}
			this.h[0] = sum32(this.h[0], a);
			this.h[1] = sum32(this.h[1], b);
			this.h[2] = sum32(this.h[2], c);
			this.h[3] = sum32(this.h[3], d);
			this.h[4] = sum32(this.h[4], e);
			this.h[5] = sum32(this.h[5], f);
			this.h[6] = sum32(this.h[6], g);
			this.h[7] = sum32(this.h[7], h);
		};
		SHA256.prototype._digest = function digest(enc) {
			if (enc === "hex") return utils.toHex32(this.h, "big");
			else return utils.split32(this.h, "big");
		};
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha/224.js
	var require__224 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$2();
		var SHA256 = require__256();
		function SHA224() {
			if (!(this instanceof SHA224)) return new SHA224();
			SHA256.call(this);
			this.h = [
				3238371032,
				914150663,
				812702999,
				4144912697,
				4290775857,
				1750603025,
				1694076839,
				3204075428
			];
		}
		utils.inherits(SHA224, SHA256);
		module.exports = SHA224;
		SHA224.blockSize = 512;
		SHA224.outSize = 224;
		SHA224.hmacStrength = 192;
		SHA224.padLength = 64;
		SHA224.prototype._digest = function digest(enc) {
			if (enc === "hex") return utils.toHex32(this.h.slice(0, 7), "big");
			else return utils.split32(this.h.slice(0, 7), "big");
		};
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha/512.js
	var require__512 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$2();
		var common = require_common$2();
		var assert = require_minimalistic_assert();
		var rotr64_hi = utils.rotr64_hi;
		var rotr64_lo = utils.rotr64_lo;
		var shr64_hi = utils.shr64_hi;
		var shr64_lo = utils.shr64_lo;
		var sum64 = utils.sum64;
		var sum64_hi = utils.sum64_hi;
		var sum64_lo = utils.sum64_lo;
		var sum64_4_hi = utils.sum64_4_hi;
		var sum64_4_lo = utils.sum64_4_lo;
		var sum64_5_hi = utils.sum64_5_hi;
		var sum64_5_lo = utils.sum64_5_lo;
		var BlockHash = common.BlockHash;
		var sha512_K = [
			1116352408,
			3609767458,
			1899447441,
			602891725,
			3049323471,
			3964484399,
			3921009573,
			2173295548,
			961987163,
			4081628472,
			1508970993,
			3053834265,
			2453635748,
			2937671579,
			2870763221,
			3664609560,
			3624381080,
			2734883394,
			310598401,
			1164996542,
			607225278,
			1323610764,
			1426881987,
			3590304994,
			1925078388,
			4068182383,
			2162078206,
			991336113,
			2614888103,
			633803317,
			3248222580,
			3479774868,
			3835390401,
			2666613458,
			4022224774,
			944711139,
			264347078,
			2341262773,
			604807628,
			2007800933,
			770255983,
			1495990901,
			1249150122,
			1856431235,
			1555081692,
			3175218132,
			1996064986,
			2198950837,
			2554220882,
			3999719339,
			2821834349,
			766784016,
			2952996808,
			2566594879,
			3210313671,
			3203337956,
			3336571891,
			1034457026,
			3584528711,
			2466948901,
			113926993,
			3758326383,
			338241895,
			168717936,
			666307205,
			1188179964,
			773529912,
			1546045734,
			1294757372,
			1522805485,
			1396182291,
			2643833823,
			1695183700,
			2343527390,
			1986661051,
			1014477480,
			2177026350,
			1206759142,
			2456956037,
			344077627,
			2730485921,
			1290863460,
			2820302411,
			3158454273,
			3259730800,
			3505952657,
			3345764771,
			106217008,
			3516065817,
			3606008344,
			3600352804,
			1432725776,
			4094571909,
			1467031594,
			275423344,
			851169720,
			430227734,
			3100823752,
			506948616,
			1363258195,
			659060556,
			3750685593,
			883997877,
			3785050280,
			958139571,
			3318307427,
			1322822218,
			3812723403,
			1537002063,
			2003034995,
			1747873779,
			3602036899,
			1955562222,
			1575990012,
			2024104815,
			1125592928,
			2227730452,
			2716904306,
			2361852424,
			442776044,
			2428436474,
			593698344,
			2756734187,
			3733110249,
			3204031479,
			2999351573,
			3329325298,
			3815920427,
			3391569614,
			3928383900,
			3515267271,
			566280711,
			3940187606,
			3454069534,
			4118630271,
			4000239992,
			116418474,
			1914138554,
			174292421,
			2731055270,
			289380356,
			3203993006,
			460393269,
			320620315,
			685471733,
			587496836,
			852142971,
			1086792851,
			1017036298,
			365543100,
			1126000580,
			2618297676,
			1288033470,
			3409855158,
			1501505948,
			4234509866,
			1607167915,
			987167468,
			1816402316,
			1246189591
		];
		function SHA512() {
			if (!(this instanceof SHA512)) return new SHA512();
			BlockHash.call(this);
			this.h = [
				1779033703,
				4089235720,
				3144134277,
				2227873595,
				1013904242,
				4271175723,
				2773480762,
				1595750129,
				1359893119,
				2917565137,
				2600822924,
				725511199,
				528734635,
				4215389547,
				1541459225,
				327033209
			];
			this.k = sha512_K;
			this.W = new Array(160);
		}
		utils.inherits(SHA512, BlockHash);
		module.exports = SHA512;
		SHA512.blockSize = 1024;
		SHA512.outSize = 512;
		SHA512.hmacStrength = 192;
		SHA512.padLength = 128;
		SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
			var W = this.W;
			for (var i = 0; i < 32; i++) W[i] = msg[start + i];
			for (; i < W.length; i += 2) {
				var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);
				var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
				var c1_hi = W[i - 14];
				var c1_lo = W[i - 13];
				var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);
				var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
				var c3_hi = W[i - 32];
				var c3_lo = W[i - 31];
				W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);
				W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);
			}
		};
		SHA512.prototype._update = function _update(msg, start) {
			this._prepareBlock(msg, start);
			var W = this.W;
			var ah = this.h[0];
			var al = this.h[1];
			var bh = this.h[2];
			var bl = this.h[3];
			var ch = this.h[4];
			var cl = this.h[5];
			var dh = this.h[6];
			var dl = this.h[7];
			var eh = this.h[8];
			var el = this.h[9];
			var fh = this.h[10];
			var fl = this.h[11];
			var gh = this.h[12];
			var gl = this.h[13];
			var hh = this.h[14];
			var hl = this.h[15];
			assert(this.k.length === W.length);
			for (var i = 0; i < W.length; i += 2) {
				var c0_hi = hh;
				var c0_lo = hl;
				var c1_hi = s1_512_hi(eh, el);
				var c1_lo = s1_512_lo(eh, el);
				var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
				var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
				var c3_hi = this.k[i];
				var c3_lo = this.k[i + 1];
				var c4_hi = W[i];
				var c4_lo = W[i + 1];
				var T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);
				var T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);
				c0_hi = s0_512_hi(ah, al);
				c0_lo = s0_512_lo(ah, al);
				c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
				c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
				var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
				var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
				hh = gh;
				hl = gl;
				gh = fh;
				gl = fl;
				fh = eh;
				fl = el;
				eh = sum64_hi(dh, dl, T1_hi, T1_lo);
				el = sum64_lo(dl, dl, T1_hi, T1_lo);
				dh = ch;
				dl = cl;
				ch = bh;
				cl = bl;
				bh = ah;
				bl = al;
				ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
				al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
			}
			sum64(this.h, 0, ah, al);
			sum64(this.h, 2, bh, bl);
			sum64(this.h, 4, ch, cl);
			sum64(this.h, 6, dh, dl);
			sum64(this.h, 8, eh, el);
			sum64(this.h, 10, fh, fl);
			sum64(this.h, 12, gh, gl);
			sum64(this.h, 14, hh, hl);
		};
		SHA512.prototype._digest = function digest(enc) {
			if (enc === "hex") return utils.toHex32(this.h, "big");
			else return utils.split32(this.h, "big");
		};
		function ch64_hi(xh, xl, yh, yl, zh) {
			var r = xh & yh ^ ~xh & zh;
			if (r < 0) r += 4294967296;
			return r;
		}
		function ch64_lo(xh, xl, yh, yl, zh, zl) {
			var r = xl & yl ^ ~xl & zl;
			if (r < 0) r += 4294967296;
			return r;
		}
		function maj64_hi(xh, xl, yh, yl, zh) {
			var r = xh & yh ^ xh & zh ^ yh & zh;
			if (r < 0) r += 4294967296;
			return r;
		}
		function maj64_lo(xh, xl, yh, yl, zh, zl) {
			var r = xl & yl ^ xl & zl ^ yl & zl;
			if (r < 0) r += 4294967296;
			return r;
		}
		function s0_512_hi(xh, xl) {
			var c0_hi = rotr64_hi(xh, xl, 28);
			var c1_hi = rotr64_hi(xl, xh, 2);
			var c2_hi = rotr64_hi(xl, xh, 7);
			var r = c0_hi ^ c1_hi ^ c2_hi;
			if (r < 0) r += 4294967296;
			return r;
		}
		function s0_512_lo(xh, xl) {
			var c0_lo = rotr64_lo(xh, xl, 28);
			var c1_lo = rotr64_lo(xl, xh, 2);
			var c2_lo = rotr64_lo(xl, xh, 7);
			var r = c0_lo ^ c1_lo ^ c2_lo;
			if (r < 0) r += 4294967296;
			return r;
		}
		function s1_512_hi(xh, xl) {
			var c0_hi = rotr64_hi(xh, xl, 14);
			var c1_hi = rotr64_hi(xh, xl, 18);
			var c2_hi = rotr64_hi(xl, xh, 9);
			var r = c0_hi ^ c1_hi ^ c2_hi;
			if (r < 0) r += 4294967296;
			return r;
		}
		function s1_512_lo(xh, xl) {
			var c0_lo = rotr64_lo(xh, xl, 14);
			var c1_lo = rotr64_lo(xh, xl, 18);
			var c2_lo = rotr64_lo(xl, xh, 9);
			var r = c0_lo ^ c1_lo ^ c2_lo;
			if (r < 0) r += 4294967296;
			return r;
		}
		function g0_512_hi(xh, xl) {
			var c0_hi = rotr64_hi(xh, xl, 1);
			var c1_hi = rotr64_hi(xh, xl, 8);
			var c2_hi = shr64_hi(xh, xl, 7);
			var r = c0_hi ^ c1_hi ^ c2_hi;
			if (r < 0) r += 4294967296;
			return r;
		}
		function g0_512_lo(xh, xl) {
			var c0_lo = rotr64_lo(xh, xl, 1);
			var c1_lo = rotr64_lo(xh, xl, 8);
			var c2_lo = shr64_lo(xh, xl, 7);
			var r = c0_lo ^ c1_lo ^ c2_lo;
			if (r < 0) r += 4294967296;
			return r;
		}
		function g1_512_hi(xh, xl) {
			var c0_hi = rotr64_hi(xh, xl, 19);
			var c1_hi = rotr64_hi(xl, xh, 29);
			var c2_hi = shr64_hi(xh, xl, 6);
			var r = c0_hi ^ c1_hi ^ c2_hi;
			if (r < 0) r += 4294967296;
			return r;
		}
		function g1_512_lo(xh, xl) {
			var c0_lo = rotr64_lo(xh, xl, 19);
			var c1_lo = rotr64_lo(xl, xh, 29);
			var c2_lo = shr64_lo(xh, xl, 6);
			var r = c0_lo ^ c1_lo ^ c2_lo;
			if (r < 0) r += 4294967296;
			return r;
		}
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha/384.js
	var require__384 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$2();
		var SHA512 = require__512();
		function SHA384() {
			if (!(this instanceof SHA384)) return new SHA384();
			SHA512.call(this);
			this.h = [
				3418070365,
				3238371032,
				1654270250,
				914150663,
				2438529370,
				812702999,
				355462360,
				4144912697,
				1731405415,
				4290775857,
				2394180231,
				1750603025,
				3675008525,
				1694076839,
				1203062813,
				3204075428
			];
		}
		utils.inherits(SHA384, SHA512);
		module.exports = SHA384;
		SHA384.blockSize = 1024;
		SHA384.outSize = 384;
		SHA384.hmacStrength = 192;
		SHA384.padLength = 128;
		SHA384.prototype._digest = function digest(enc) {
			if (enc === "hex") return utils.toHex32(this.h.slice(0, 12), "big");
			else return utils.split32(this.h.slice(0, 12), "big");
		};
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/sha.js
	var require_sha = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.sha1 = require__1();
		exports.sha224 = require__224();
		exports.sha256 = require__256();
		exports.sha384 = require__384();
		exports.sha512 = require__512();
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/ripemd.js
	var require_ripemd = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = require_utils$2();
		var common = require_common$2();
		var rotl32 = utils.rotl32;
		var sum32 = utils.sum32;
		var sum32_3 = utils.sum32_3;
		var sum32_4 = utils.sum32_4;
		var BlockHash = common.BlockHash;
		function RIPEMD160() {
			if (!(this instanceof RIPEMD160)) return new RIPEMD160();
			BlockHash.call(this);
			this.h = [
				1732584193,
				4023233417,
				2562383102,
				271733878,
				3285377520
			];
			this.endian = "little";
		}
		utils.inherits(RIPEMD160, BlockHash);
		exports.ripemd160 = RIPEMD160;
		RIPEMD160.blockSize = 512;
		RIPEMD160.outSize = 160;
		RIPEMD160.hmacStrength = 192;
		RIPEMD160.padLength = 64;
		RIPEMD160.prototype._update = function update(msg, start) {
			var A = this.h[0];
			var B = this.h[1];
			var C = this.h[2];
			var D = this.h[3];
			var E = this.h[4];
			var Ah = A;
			var Bh = B;
			var Ch = C;
			var Dh = D;
			var Eh = E;
			for (var j = 0; j < 80; j++) {
				var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);
				A = E;
				E = D;
				D = rotl32(C, 10);
				C = B;
				B = T;
				T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh);
				Ah = Eh;
				Eh = Dh;
				Dh = rotl32(Ch, 10);
				Ch = Bh;
				Bh = T;
			}
			T = sum32_3(this.h[1], C, Dh);
			this.h[1] = sum32_3(this.h[2], D, Eh);
			this.h[2] = sum32_3(this.h[3], E, Ah);
			this.h[3] = sum32_3(this.h[4], A, Bh);
			this.h[4] = sum32_3(this.h[0], B, Ch);
			this.h[0] = T;
		};
		RIPEMD160.prototype._digest = function digest(enc) {
			if (enc === "hex") return utils.toHex32(this.h, "little");
			else return utils.split32(this.h, "little");
		};
		function f(j, x, y, z) {
			if (j <= 15) return x ^ y ^ z;
			else if (j <= 31) return x & y | ~x & z;
			else if (j <= 47) return (x | ~y) ^ z;
			else if (j <= 63) return x & z | y & ~z;
			else return x ^ (y | ~z);
		}
		function K(j) {
			if (j <= 15) return 0;
			else if (j <= 31) return 1518500249;
			else if (j <= 47) return 1859775393;
			else if (j <= 63) return 2400959708;
			else return 2840853838;
		}
		function Kh(j) {
			if (j <= 15) return 1352829926;
			else if (j <= 31) return 1548603684;
			else if (j <= 47) return 1836072691;
			else if (j <= 63) return 2053994217;
			else return 0;
		}
		var r = [
			0,
			1,
			2,
			3,
			4,
			5,
			6,
			7,
			8,
			9,
			10,
			11,
			12,
			13,
			14,
			15,
			7,
			4,
			13,
			1,
			10,
			6,
			15,
			3,
			12,
			0,
			9,
			5,
			2,
			14,
			11,
			8,
			3,
			10,
			14,
			4,
			9,
			15,
			8,
			1,
			2,
			7,
			0,
			6,
			13,
			11,
			5,
			12,
			1,
			9,
			11,
			10,
			0,
			8,
			12,
			4,
			13,
			3,
			7,
			15,
			14,
			5,
			6,
			2,
			4,
			0,
			5,
			9,
			7,
			12,
			2,
			10,
			14,
			1,
			3,
			8,
			11,
			6,
			15,
			13
		];
		var rh = [
			5,
			14,
			7,
			0,
			9,
			2,
			11,
			4,
			13,
			6,
			15,
			8,
			1,
			10,
			3,
			12,
			6,
			11,
			3,
			7,
			0,
			13,
			5,
			10,
			14,
			15,
			8,
			12,
			4,
			9,
			1,
			2,
			15,
			5,
			1,
			3,
			7,
			14,
			6,
			9,
			11,
			8,
			12,
			2,
			10,
			0,
			4,
			13,
			8,
			6,
			4,
			1,
			3,
			11,
			15,
			0,
			5,
			12,
			2,
			13,
			9,
			7,
			10,
			14,
			12,
			15,
			10,
			4,
			1,
			5,
			8,
			7,
			6,
			2,
			13,
			14,
			0,
			3,
			9,
			11
		];
		var s = [
			11,
			14,
			15,
			12,
			5,
			8,
			7,
			9,
			11,
			13,
			14,
			15,
			6,
			7,
			9,
			8,
			7,
			6,
			8,
			13,
			11,
			9,
			7,
			15,
			7,
			12,
			15,
			9,
			11,
			7,
			13,
			12,
			11,
			13,
			6,
			7,
			14,
			9,
			13,
			15,
			14,
			8,
			13,
			6,
			5,
			12,
			7,
			5,
			11,
			12,
			14,
			15,
			14,
			15,
			9,
			8,
			9,
			14,
			5,
			6,
			8,
			6,
			5,
			12,
			9,
			15,
			5,
			11,
			6,
			8,
			13,
			12,
			5,
			12,
			13,
			14,
			11,
			8,
			5,
			6
		];
		var sh = [
			8,
			9,
			9,
			11,
			13,
			15,
			15,
			5,
			7,
			7,
			8,
			11,
			14,
			14,
			12,
			6,
			9,
			13,
			15,
			7,
			12,
			8,
			9,
			11,
			7,
			7,
			12,
			7,
			6,
			15,
			13,
			11,
			9,
			7,
			15,
			11,
			8,
			6,
			6,
			14,
			12,
			13,
			5,
			14,
			13,
			13,
			7,
			5,
			15,
			5,
			8,
			11,
			14,
			14,
			6,
			14,
			6,
			9,
			12,
			9,
			12,
			5,
			15,
			8,
			8,
			5,
			12,
			9,
			12,
			5,
			14,
			6,
			8,
			13,
			6,
			5,
			15,
			13,
			11,
			11
		];
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash/hmac.js
	var require_hmac = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$2();
		var assert = require_minimalistic_assert();
		function Hmac(hash, key, enc) {
			if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);
			this.Hash = hash;
			this.blockSize = hash.blockSize / 8;
			this.outSize = hash.outSize / 8;
			this.inner = null;
			this.outer = null;
			this._init(utils.toArray(key, enc));
		}
		module.exports = Hmac;
		Hmac.prototype._init = function init(key) {
			if (key.length > this.blockSize) key = new this.Hash().update(key).digest();
			assert(key.length <= this.blockSize);
			for (var i = key.length; i < this.blockSize; i++) key.push(0);
			for (i = 0; i < key.length; i++) key[i] ^= 54;
			this.inner = new this.Hash().update(key);
			for (i = 0; i < key.length; i++) key[i] ^= 106;
			this.outer = new this.Hash().update(key);
		};
		Hmac.prototype.update = function update(msg, enc) {
			this.inner.update(msg, enc);
			return this;
		};
		Hmac.prototype.digest = function digest(enc) {
			this.outer.update(this.inner.digest());
			return this.outer.digest(enc);
		};
	}));
	//#endregion
	//#region ../../node_modules/hash.js/lib/hash.js
	var require_hash = /* @__PURE__ */ __commonJSMin(((exports) => {
		var hash = exports;
		hash.utils = require_utils$2();
		hash.common = require_common$2();
		hash.sha = require_sha();
		hash.ripemd = require_ripemd();
		hash.hmac = require_hmac();
		hash.sha1 = hash.sha.sha1;
		hash.sha256 = hash.sha.sha256;
		hash.sha224 = hash.sha.sha224;
		hash.sha384 = hash.sha.sha384;
		hash.sha512 = hash.sha.sha512;
		hash.ripemd160 = hash.ripemd.ripemd160;
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js
	var require_secp256k1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = {
			doubles: {
				step: 4,
				points: [
					["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],
					["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],
					["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],
					["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],
					["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],
					["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],
					["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],
					["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],
					["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],
					["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],
					["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],
					["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],
					["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],
					["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],
					["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],
					["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],
					["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],
					["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],
					["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],
					["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],
					["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],
					["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],
					["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],
					["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],
					["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],
					["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],
					["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],
					["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],
					["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],
					["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],
					["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],
					["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],
					["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],
					["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],
					["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],
					["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],
					["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],
					["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],
					["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],
					["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],
					["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],
					["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],
					["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],
					["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],
					["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],
					["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],
					["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],
					["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],
					["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],
					["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],
					["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],
					["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],
					["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],
					["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],
					["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],
					["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],
					["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],
					["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],
					["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],
					["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],
					["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],
					["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],
					["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],
					["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],
					["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]
				]
			},
			naf: {
				wnd: 7,
				points: [
					["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],
					["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],
					["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],
					["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],
					["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],
					["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],
					["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],
					["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],
					["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],
					["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],
					["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],
					["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],
					["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],
					["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],
					["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],
					["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],
					["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],
					["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],
					["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],
					["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],
					["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],
					["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],
					["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],
					["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],
					["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],
					["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],
					["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],
					["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],
					["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],
					["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],
					["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],
					["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],
					["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],
					["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],
					["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],
					["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],
					["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],
					["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],
					["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],
					["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],
					["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],
					["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],
					["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],
					["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],
					["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],
					["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],
					["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],
					["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],
					["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],
					["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],
					["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],
					["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],
					["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],
					["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],
					["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],
					["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],
					["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],
					["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],
					["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],
					["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],
					["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],
					["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],
					["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],
					["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],
					["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],
					["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],
					["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],
					["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],
					["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],
					["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],
					["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],
					["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],
					["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],
					["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],
					["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],
					["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],
					["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],
					["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],
					["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],
					["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],
					["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],
					["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],
					["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],
					["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],
					["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],
					["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],
					["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],
					["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],
					["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],
					["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],
					["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],
					["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],
					["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],
					["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],
					["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],
					["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],
					["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],
					["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],
					["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],
					["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],
					["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],
					["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],
					["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],
					["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],
					["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],
					["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],
					["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],
					["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],
					["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],
					["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],
					["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],
					["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],
					["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],
					["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],
					["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],
					["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],
					["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],
					["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],
					["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],
					["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],
					["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],
					["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],
					["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],
					["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],
					["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],
					["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],
					["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]
				]
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/curves.js
	var require_curves = /* @__PURE__ */ __commonJSMin(((exports) => {
		var curves = exports;
		var hash = require_hash();
		var curve = require_curve();
		var assert = require_utils$3().assert;
		function PresetCurve(options) {
			if (options.type === "short") this.curve = new curve.short(options);
			else if (options.type === "edwards") this.curve = new curve.edwards(options);
			else this.curve = new curve.mont(options);
			this.g = this.curve.g;
			this.n = this.curve.n;
			this.hash = options.hash;
			assert(this.g.validate(), "Invalid curve");
			assert(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O");
		}
		curves.PresetCurve = PresetCurve;
		function defineCurve(name, options) {
			Object.defineProperty(curves, name, {
				configurable: true,
				enumerable: true,
				get: function() {
					var curve = new PresetCurve(options);
					Object.defineProperty(curves, name, {
						configurable: true,
						enumerable: true,
						value: curve
					});
					return curve;
				}
			});
		}
		defineCurve("p192", {
			type: "short",
			prime: "p192",
			p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",
			a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",
			b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",
			n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",
			hash: hash.sha256,
			gRed: false,
			g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]
		});
		defineCurve("p224", {
			type: "short",
			prime: "p224",
			p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",
			a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",
			b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",
			n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",
			hash: hash.sha256,
			gRed: false,
			g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]
		});
		defineCurve("p256", {
			type: "short",
			prime: null,
			p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",
			a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",
			b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",
			n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",
			hash: hash.sha256,
			gRed: false,
			g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]
		});
		defineCurve("p384", {
			type: "short",
			prime: null,
			p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",
			a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",
			b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",
			n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",
			hash: hash.sha384,
			gRed: false,
			g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]
		});
		defineCurve("p521", {
			type: "short",
			prime: null,
			p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",
			a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",
			b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",
			n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",
			hash: hash.sha512,
			gRed: false,
			g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]
		});
		defineCurve("curve25519", {
			type: "mont",
			prime: "p25519",
			p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
			a: "76d06",
			b: "1",
			n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
			hash: hash.sha256,
			gRed: false,
			g: ["9"]
		});
		defineCurve("ed25519", {
			type: "edwards",
			prime: "p25519",
			p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
			a: "-1",
			c: "1",
			d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",
			n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
			hash: hash.sha256,
			gRed: false,
			g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"]
		});
		var pre;
		try {
			pre = require_secp256k1();
		} catch (e) {
			pre = void 0;
		}
		defineCurve("secp256k1", {
			type: "short",
			prime: "k256",
			p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",
			a: "0",
			b: "7",
			n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",
			h: "1",
			hash: hash.sha256,
			beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",
			lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",
			basis: [{
				a: "3086d221a7d46bcde86c90e49284eb15",
				b: "-e4437ed6010e88286f547fa90abfe4c3"
			}, {
				a: "114ca50f7a8e2f3f657c1108d9d44cfd8",
				b: "3086d221a7d46bcde86c90e49284eb15"
			}],
			gRed: false,
			g: [
				"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
				"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",
				pre
			]
		});
	}));
	//#endregion
	//#region ../../node_modules/hmac-drbg/lib/hmac-drbg.js
	var require_hmac_drbg = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var hash = require_hash();
		var utils = require_utils$4();
		var assert = require_minimalistic_assert();
		function HmacDRBG(options) {
			if (!(this instanceof HmacDRBG)) return new HmacDRBG(options);
			this.hash = options.hash;
			this.predResist = !!options.predResist;
			this.outLen = this.hash.outSize;
			this.minEntropy = options.minEntropy || this.hash.hmacStrength;
			this._reseed = null;
			this.reseedInterval = null;
			this.K = null;
			this.V = null;
			var entropy = utils.toArray(options.entropy, options.entropyEnc || "hex");
			var nonce = utils.toArray(options.nonce, options.nonceEnc || "hex");
			var pers = utils.toArray(options.pers, options.persEnc || "hex");
			assert(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits");
			this._init(entropy, nonce, pers);
		}
		module.exports = HmacDRBG;
		HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
			var seed = entropy.concat(nonce).concat(pers);
			this.K = new Array(this.outLen / 8);
			this.V = new Array(this.outLen / 8);
			for (var i = 0; i < this.V.length; i++) {
				this.K[i] = 0;
				this.V[i] = 1;
			}
			this._update(seed);
			this._reseed = 1;
			this.reseedInterval = 281474976710656;
		};
		HmacDRBG.prototype._hmac = function hmac() {
			return new hash.hmac(this.hash, this.K);
		};
		HmacDRBG.prototype._update = function update(seed) {
			var kmac = this._hmac().update(this.V).update([0]);
			if (seed) kmac = kmac.update(seed);
			this.K = kmac.digest();
			this.V = this._hmac().update(this.V).digest();
			if (!seed) return;
			this.K = this._hmac().update(this.V).update([1]).update(seed).digest();
			this.V = this._hmac().update(this.V).digest();
		};
		HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
			if (typeof entropyEnc !== "string") {
				addEnc = add;
				add = entropyEnc;
				entropyEnc = null;
			}
			entropy = utils.toArray(entropy, entropyEnc);
			add = utils.toArray(add, addEnc);
			assert(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits");
			this._update(entropy.concat(add || []));
			this._reseed = 1;
		};
		HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
			if (this._reseed > this.reseedInterval) throw new Error("Reseed is required");
			if (typeof enc !== "string") {
				addEnc = add;
				add = enc;
				enc = null;
			}
			if (add) {
				add = utils.toArray(add, addEnc || "hex");
				this._update(add);
			}
			var temp = [];
			while (temp.length < len) {
				this.V = this._hmac().update(this.V).digest();
				temp = temp.concat(this.V);
			}
			var res = temp.slice(0, len);
			this._update(add);
			this._reseed++;
			return utils.encode(res, enc);
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/ec/key.js
	var require_key$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var assert = require_utils$3().assert;
		function KeyPair(ec, options) {
			this.ec = ec;
			this.priv = null;
			this.pub = null;
			if (options.priv) this._importPrivate(options.priv, options.privEnc);
			if (options.pub) this._importPublic(options.pub, options.pubEnc);
		}
		module.exports = KeyPair;
		KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
			if (pub instanceof KeyPair) return pub;
			return new KeyPair(ec, {
				pub,
				pubEnc: enc
			});
		};
		KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
			if (priv instanceof KeyPair) return priv;
			return new KeyPair(ec, {
				priv,
				privEnc: enc
			});
		};
		KeyPair.prototype.validate = function validate() {
			var pub = this.getPublic();
			if (pub.isInfinity()) return {
				result: false,
				reason: "Invalid public key"
			};
			if (!pub.validate()) return {
				result: false,
				reason: "Public key is not a point"
			};
			if (!pub.mul(this.ec.curve.n).isInfinity()) return {
				result: false,
				reason: "Public key * N != O"
			};
			return {
				result: true,
				reason: null
			};
		};
		KeyPair.prototype.getPublic = function getPublic(compact, enc) {
			if (typeof compact === "string") {
				enc = compact;
				compact = null;
			}
			if (!this.pub) this.pub = this.ec.g.mul(this.priv);
			if (!enc) return this.pub;
			return this.pub.encode(enc, compact);
		};
		KeyPair.prototype.getPrivate = function getPrivate(enc) {
			if (enc === "hex") return this.priv.toString(16, 2);
			else return this.priv;
		};
		KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
			this.priv = new BN(key, enc || 16);
			this.priv = this.priv.umod(this.ec.curve.n);
		};
		KeyPair.prototype._importPublic = function _importPublic(key, enc) {
			if (key.x || key.y) {
				if (this.ec.curve.type === "mont") assert(key.x, "Need x coordinate");
				else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") assert(key.x && key.y, "Need both x and y coordinate");
				this.pub = this.ec.curve.point(key.x, key.y);
				return;
			}
			this.pub = this.ec.curve.decodePoint(key, enc);
		};
		KeyPair.prototype.derive = function derive(pub) {
			if (!pub.validate()) assert(pub.validate(), "public point not validated");
			return pub.mul(this.priv).getX();
		};
		KeyPair.prototype.sign = function sign(msg, enc, options) {
			return this.ec.sign(msg, this, enc, options);
		};
		KeyPair.prototype.verify = function verify(msg, signature, options) {
			return this.ec.verify(msg, signature, this, void 0, options);
		};
		KeyPair.prototype.inspect = function inspect() {
			return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >";
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/ec/signature.js
	var require_signature$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var utils = require_utils$3();
		var assert = utils.assert;
		function Signature(options, enc) {
			if (options instanceof Signature) return options;
			if (this._importDER(options, enc)) return;
			assert(options.r && options.s, "Signature without r or s");
			this.r = new BN(options.r, 16);
			this.s = new BN(options.s, 16);
			if (options.recoveryParam === void 0) this.recoveryParam = null;
			else this.recoveryParam = options.recoveryParam;
		}
		module.exports = Signature;
		function Position() {
			this.place = 0;
		}
		function getLength(buf, p) {
			var initial = buf[p.place++];
			if (!(initial & 128)) return initial;
			var octetLen = initial & 15;
			if (octetLen === 0 || octetLen > 4) return false;
			if (buf[p.place] === 0) return false;
			var val = 0;
			for (var i = 0, off = p.place; i < octetLen; i++, off++) {
				val <<= 8;
				val |= buf[off];
				val >>>= 0;
			}
			if (val <= 127) return false;
			p.place = off;
			return val;
		}
		function rmPadding(buf) {
			var i = 0;
			var len = buf.length - 1;
			while (!buf[i] && !(buf[i + 1] & 128) && i < len) i++;
			if (i === 0) return buf;
			return buf.slice(i);
		}
		Signature.prototype._importDER = function _importDER(data, enc) {
			data = utils.toArray(data, enc);
			var p = new Position();
			if (data[p.place++] !== 48) return false;
			var len = getLength(data, p);
			if (len === false) return false;
			if (len + p.place !== data.length) return false;
			if (data[p.place++] !== 2) return false;
			var rlen = getLength(data, p);
			if (rlen === false) return false;
			if ((data[p.place] & 128) !== 0) return false;
			var r = data.slice(p.place, rlen + p.place);
			p.place += rlen;
			if (data[p.place++] !== 2) return false;
			var slen = getLength(data, p);
			if (slen === false) return false;
			if (data.length !== slen + p.place) return false;
			if ((data[p.place] & 128) !== 0) return false;
			var s = data.slice(p.place, slen + p.place);
			if (r[0] === 0) if (r[1] & 128) r = r.slice(1);
			else return false;
			if (s[0] === 0) if (s[1] & 128) s = s.slice(1);
			else return false;
			this.r = new BN(r);
			this.s = new BN(s);
			this.recoveryParam = null;
			return true;
		};
		function constructLength(arr, len) {
			if (len < 128) {
				arr.push(len);
				return;
			}
			var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
			arr.push(octets | 128);
			while (--octets) arr.push(len >>> (octets << 3) & 255);
			arr.push(len);
		}
		Signature.prototype.toDER = function toDER(enc) {
			var r = this.r.toArray();
			var s = this.s.toArray();
			if (r[0] & 128) r = [0].concat(r);
			if (s[0] & 128) s = [0].concat(s);
			r = rmPadding(r);
			s = rmPadding(s);
			while (!s[0] && !(s[1] & 128)) s = s.slice(1);
			var arr = [2];
			constructLength(arr, r.length);
			arr = arr.concat(r);
			arr.push(2);
			constructLength(arr, s.length);
			var backHalf = arr.concat(s);
			var res = [48];
			constructLength(res, backHalf.length);
			res = res.concat(backHalf);
			return utils.encode(res, enc);
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/ec/index.js
	var require_ec = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var HmacDRBG = require_hmac_drbg();
		var utils = require_utils$3();
		var curves = require_curves();
		var rand = require_brorand();
		var assert = utils.assert;
		var KeyPair = require_key$1();
		var Signature = require_signature$1();
		function EC(options) {
			if (!(this instanceof EC)) return new EC(options);
			if (typeof options === "string") {
				assert(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options);
				options = curves[options];
			}
			if (options instanceof curves.PresetCurve) options = { curve: options };
			this.curve = options.curve.curve;
			this.n = this.curve.n;
			this.nh = this.n.ushrn(1);
			this.g = this.curve.g;
			this.g = options.curve.g;
			this.g.precompute(options.curve.n.bitLength() + 1);
			this.hash = options.hash || options.curve.hash;
		}
		module.exports = EC;
		EC.prototype.keyPair = function keyPair(options) {
			return new KeyPair(this, options);
		};
		EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
			return KeyPair.fromPrivate(this, priv, enc);
		};
		EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
			return KeyPair.fromPublic(this, pub, enc);
		};
		EC.prototype.genKeyPair = function genKeyPair(options) {
			if (!options) options = {};
			var drbg = new HmacDRBG({
				hash: this.hash,
				pers: options.pers,
				persEnc: options.persEnc || "utf8",
				entropy: options.entropy || rand(this.hash.hmacStrength),
				entropyEnc: options.entropy && options.entropyEnc || "utf8",
				nonce: this.n.toArray()
			});
			var bytes = this.n.byteLength();
			var ns2 = this.n.sub(new BN(2));
			for (;;) {
				var priv = new BN(drbg.generate(bytes));
				if (priv.cmp(ns2) > 0) continue;
				priv.iaddn(1);
				return this.keyFromPrivate(priv);
			}
		};
		EC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) {
			var byteLength;
			if (BN.isBN(msg) || typeof msg === "number") {
				msg = new BN(msg, 16);
				byteLength = msg.byteLength();
			} else if (typeof msg === "object") {
				byteLength = msg.length;
				msg = new BN(msg, 16);
			} else {
				var str = msg.toString();
				byteLength = str.length + 1 >>> 1;
				msg = new BN(str, 16);
			}
			if (typeof bitLength !== "number") bitLength = byteLength * 8;
			var delta = bitLength - this.n.bitLength();
			if (delta > 0) msg = msg.ushrn(delta);
			if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n);
			else return msg;
		};
		EC.prototype.sign = function sign(msg, key, enc, options) {
			if (typeof enc === "object") {
				options = enc;
				enc = null;
			}
			if (!options) options = {};
			if (typeof msg !== "string" && typeof msg !== "number" && !BN.isBN(msg)) {
				assert(typeof msg === "object" && msg && typeof msg.length === "number", "Expected message to be an array-like, a hex string, or a BN instance");
				assert(msg.length >>> 0 === msg.length);
				for (var i = 0; i < msg.length; i++) assert((msg[i] & 255) === msg[i]);
			}
			key = this.keyFromPrivate(key, enc);
			msg = this._truncateToN(msg, false, options.msgBitLength);
			assert(!msg.isNeg(), "Can not sign a negative message");
			var bytes = this.n.byteLength();
			var bkey = key.getPrivate().toArray("be", bytes);
			var nonce = msg.toArray("be", bytes);
			assert(new BN(nonce).eq(msg), "Can not sign message");
			var drbg = new HmacDRBG({
				hash: this.hash,
				entropy: bkey,
				nonce,
				pers: options.pers,
				persEnc: options.persEnc || "utf8"
			});
			var ns1 = this.n.sub(new BN(1));
			for (var iter = 0;; iter++) {
				var k = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));
				k = this._truncateToN(k, true);
				if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue;
				var kp = this.g.mul(k);
				if (kp.isInfinity()) continue;
				var kpX = kp.getX();
				var r = kpX.umod(this.n);
				if (r.cmpn(0) === 0) continue;
				var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
				s = s.umod(this.n);
				if (s.cmpn(0) === 0) continue;
				var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r) !== 0 ? 2 : 0);
				if (options.canonical && s.cmp(this.nh) > 0) {
					s = this.n.sub(s);
					recoveryParam ^= 1;
				}
				return new Signature({
					r,
					s,
					recoveryParam
				});
			}
		};
		EC.prototype.verify = function verify(msg, signature, key, enc, options) {
			if (!options) options = {};
			msg = this._truncateToN(msg, false, options.msgBitLength);
			key = this.keyFromPublic(key, enc);
			signature = new Signature(signature, "hex");
			var r = signature.r;
			var s = signature.s;
			if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) return false;
			if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false;
			var sinv = s.invm(this.n);
			var u1 = sinv.mul(msg).umod(this.n);
			var u2 = sinv.mul(r).umod(this.n);
			var p;
			if (!this.curve._maxwellTrick) {
				p = this.g.mulAdd(u1, key.getPublic(), u2);
				if (p.isInfinity()) return false;
				return p.getX().umod(this.n).cmp(r) === 0;
			}
			p = this.g.jmulAdd(u1, key.getPublic(), u2);
			if (p.isInfinity()) return false;
			return p.eqXToP(r);
		};
		EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
			assert((3 & j) === j, "The recovery param is more than two bits");
			signature = new Signature(signature, enc);
			var n = this.n;
			var e = new BN(msg);
			var r = signature.r;
			var s = signature.s;
			var isYOdd = j & 1;
			var isSecondKey = j >> 1;
			if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) throw new Error("Unable to find sencond key candinate");
			if (isSecondKey) r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);
			else r = this.curve.pointFromX(r, isYOdd);
			var rInv = signature.r.invm(n);
			var s1 = n.sub(e).mul(rInv).umod(n);
			var s2 = s.mul(rInv).umod(n);
			return this.g.mulAdd(s1, r, s2);
		};
		EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
			signature = new Signature(signature, enc);
			if (signature.recoveryParam !== null) return signature.recoveryParam;
			for (var i = 0; i < 4; i++) {
				var Qprime;
				try {
					Qprime = this.recoverPubKey(e, signature, i);
				} catch (e) {
					continue;
				}
				if (Qprime.eq(Q)) return i;
			}
			throw new Error("Unable to find valid recovery factor");
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/eddsa/key.js
	var require_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_utils$3();
		var assert = utils.assert;
		var parseBytes = utils.parseBytes;
		var cachedProperty = utils.cachedProperty;
		/**
		* @param {EDDSA} eddsa - instance
		* @param {Object} params - public/private key parameters
		*
		* @param {Array<Byte>} [params.secret] - secret seed bytes
		* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)
		* @param {Array<Byte>} [params.pub] - public key point encoded as bytes
		*
		*/
		function KeyPair(eddsa, params) {
			this.eddsa = eddsa;
			this._secret = parseBytes(params.secret);
			if (eddsa.isPoint(params.pub)) this._pub = params.pub;
			else this._pubBytes = parseBytes(params.pub);
		}
		KeyPair.fromPublic = function fromPublic(eddsa, pub) {
			if (pub instanceof KeyPair) return pub;
			return new KeyPair(eddsa, { pub });
		};
		KeyPair.fromSecret = function fromSecret(eddsa, secret) {
			if (secret instanceof KeyPair) return secret;
			return new KeyPair(eddsa, { secret });
		};
		KeyPair.prototype.secret = function secret() {
			return this._secret;
		};
		cachedProperty(KeyPair, "pubBytes", function pubBytes() {
			return this.eddsa.encodePoint(this.pub());
		});
		cachedProperty(KeyPair, "pub", function pub() {
			if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes);
			return this.eddsa.g.mul(this.priv());
		});
		cachedProperty(KeyPair, "privBytes", function privBytes() {
			var eddsa = this.eddsa;
			var hash = this.hash();
			var lastIx = eddsa.encodingLength - 1;
			var a = hash.slice(0, eddsa.encodingLength);
			a[0] &= 248;
			a[lastIx] &= 127;
			a[lastIx] |= 64;
			return a;
		});
		cachedProperty(KeyPair, "priv", function priv() {
			return this.eddsa.decodeInt(this.privBytes());
		});
		cachedProperty(KeyPair, "hash", function hash() {
			return this.eddsa.hash().update(this.secret()).digest();
		});
		cachedProperty(KeyPair, "messagePrefix", function messagePrefix() {
			return this.hash().slice(this.eddsa.encodingLength);
		});
		KeyPair.prototype.sign = function sign(message) {
			assert(this._secret, "KeyPair can only verify");
			return this.eddsa.sign(message, this);
		};
		KeyPair.prototype.verify = function verify(message, sig) {
			return this.eddsa.verify(message, sig, this);
		};
		KeyPair.prototype.getSecret = function getSecret(enc) {
			assert(this._secret, "KeyPair is public only");
			return utils.encode(this.secret(), enc);
		};
		KeyPair.prototype.getPublic = function getPublic(enc) {
			return utils.encode(this.pubBytes(), enc);
		};
		module.exports = KeyPair;
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/eddsa/signature.js
	var require_signature = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var utils = require_utils$3();
		var assert = utils.assert;
		var cachedProperty = utils.cachedProperty;
		var parseBytes = utils.parseBytes;
		/**
		* @param {EDDSA} eddsa - eddsa instance
		* @param {Array<Bytes>|Object} sig -
		* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes
		* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes
		* @param {Array<Bytes>} [sig.Rencoded] - R point encoded
		* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded
		*/
		function Signature(eddsa, sig) {
			this.eddsa = eddsa;
			if (typeof sig !== "object") sig = parseBytes(sig);
			if (Array.isArray(sig)) {
				assert(sig.length === eddsa.encodingLength * 2, "Signature has invalid size");
				sig = {
					R: sig.slice(0, eddsa.encodingLength),
					S: sig.slice(eddsa.encodingLength)
				};
			}
			assert(sig.R && sig.S, "Signature without R or S");
			if (eddsa.isPoint(sig.R)) this._R = sig.R;
			if (sig.S instanceof BN) this._S = sig.S;
			this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
			this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
		}
		cachedProperty(Signature, "S", function S() {
			return this.eddsa.decodeInt(this.Sencoded());
		});
		cachedProperty(Signature, "R", function R() {
			return this.eddsa.decodePoint(this.Rencoded());
		});
		cachedProperty(Signature, "Rencoded", function Rencoded() {
			return this.eddsa.encodePoint(this.R());
		});
		cachedProperty(Signature, "Sencoded", function Sencoded() {
			return this.eddsa.encodeInt(this.S());
		});
		Signature.prototype.toBytes = function toBytes() {
			return this.Rencoded().concat(this.Sencoded());
		};
		Signature.prototype.toHex = function toHex() {
			return utils.encode(this.toBytes(), "hex").toUpperCase();
		};
		module.exports = Signature;
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic/eddsa/index.js
	var require_eddsa = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var hash = require_hash();
		var curves = require_curves();
		var utils = require_utils$3();
		var assert = utils.assert;
		var parseBytes = utils.parseBytes;
		var KeyPair = require_key();
		var Signature = require_signature();
		function EDDSA(curve) {
			assert(curve === "ed25519", "only tested with ed25519 so far");
			if (!(this instanceof EDDSA)) return new EDDSA(curve);
			curve = curves[curve].curve;
			this.curve = curve;
			this.g = curve.g;
			this.g.precompute(curve.n.bitLength() + 1);
			this.pointClass = curve.point().constructor;
			this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
			this.hash = hash.sha512;
		}
		module.exports = EDDSA;
		/**
		* @param {Array|String} message - message bytes
		* @param {Array|String|KeyPair} secret - secret bytes or a keypair
		* @returns {Signature} - signature
		*/
		EDDSA.prototype.sign = function sign(message, secret) {
			message = parseBytes(message);
			var key = this.keyFromSecret(secret);
			var r = this.hashInt(key.messagePrefix(), message);
			var R = this.g.mul(r);
			var Rencoded = this.encodePoint(R);
			var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv());
			var S = r.add(s_).umod(this.curve.n);
			return this.makeSignature({
				R,
				S,
				Rencoded
			});
		};
		/**
		* @param {Array} message - message bytes
		* @param {Array|String|Signature} sig - sig bytes
		* @param {Array|String|Point|KeyPair} pub - public key
		* @returns {Boolean} - true if public key matches sig of message
		*/
		EDDSA.prototype.verify = function verify(message, sig, pub) {
			message = parseBytes(message);
			sig = this.makeSignature(sig);
			if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) return false;
			var key = this.keyFromPublic(pub);
			var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
			var SG = this.g.mul(sig.S());
			return sig.R().add(key.pub().mul(h)).eq(SG);
		};
		EDDSA.prototype.hashInt = function hashInt() {
			var hash = this.hash();
			for (var i = 0; i < arguments.length; i++) hash.update(arguments[i]);
			return utils.intFromLE(hash.digest()).umod(this.curve.n);
		};
		EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
			return KeyPair.fromPublic(this, pub);
		};
		EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
			return KeyPair.fromSecret(this, secret);
		};
		EDDSA.prototype.makeSignature = function makeSignature(sig) {
			if (sig instanceof Signature) return sig;
			return new Signature(this, sig);
		};
		/**
		* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2
		*
		* EDDSA defines methods for encoding and decoding points and integers. These are
		* helper convenience methods, that pass along to utility functions implied
		* parameters.
		*
		*/
		EDDSA.prototype.encodePoint = function encodePoint(point) {
			var enc = point.getY().toArray("le", this.encodingLength);
			enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0;
			return enc;
		};
		EDDSA.prototype.decodePoint = function decodePoint(bytes) {
			bytes = utils.parseBytes(bytes);
			var lastIx = bytes.length - 1;
			var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & -129);
			var xIsOdd = (bytes[lastIx] & 128) !== 0;
			var y = utils.intFromLE(normed);
			return this.curve.pointFromY(y, xIsOdd);
		};
		EDDSA.prototype.encodeInt = function encodeInt(num) {
			return num.toArray("le", this.encodingLength);
		};
		EDDSA.prototype.decodeInt = function decodeInt(bytes) {
			return utils.intFromLE(bytes);
		};
		EDDSA.prototype.isPoint = function isPoint(val) {
			return val instanceof this.pointClass;
		};
	}));
	//#endregion
	//#region ../../node_modules/elliptic/lib/elliptic.js
	var require_elliptic = /* @__PURE__ */ __commonJSMin(((exports) => {
		var elliptic = exports;
		elliptic.version = (init_package(), __toCommonJS(package_exports).default).version;
		elliptic.utils = require_utils$3();
		elliptic.rand = require_brorand();
		elliptic.curve = require_curve();
		elliptic.curves = require_curves();
		elliptic.ec = require_ec();
		elliptic.eddsa = require_eddsa();
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/node_modules/bn.js/lib/bn.js
	var require_bn = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function(module$1, exports$1) {
			"use strict";
			function assert(val, msg) {
				if (!val) throw new Error(msg || "Assertion failed");
			}
			function inherits(ctor, superCtor) {
				ctor.super_ = superCtor;
				var TempCtor = function() {};
				TempCtor.prototype = superCtor.prototype;
				ctor.prototype = new TempCtor();
				ctor.prototype.constructor = ctor;
			}
			function BN(number, base, endian) {
				if (BN.isBN(number)) return number;
				this.negative = 0;
				this.words = null;
				this.length = 0;
				this.red = null;
				if (number !== null) {
					if (base === "le" || base === "be") {
						endian = base;
						base = 10;
					}
					this._init(number || 0, base || 10, endian || "be");
				}
			}
			if (typeof module$1 === "object") module$1.exports = BN;
			else exports$1.BN = BN;
			BN.BN = BN;
			BN.wordSize = 26;
			var Buffer;
			try {
				if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") Buffer = window.Buffer;
				else Buffer = require_dist().Buffer;
			} catch (e) {}
			BN.isBN = function isBN(num) {
				if (num instanceof BN) return true;
				return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
			};
			BN.max = function max(left, right) {
				if (left.cmp(right) > 0) return left;
				return right;
			};
			BN.min = function min(left, right) {
				if (left.cmp(right) < 0) return left;
				return right;
			};
			BN.prototype._init = function init(number, base, endian) {
				if (typeof number === "number") return this._initNumber(number, base, endian);
				if (typeof number === "object") return this._initArray(number, base, endian);
				if (base === "hex") base = 16;
				assert(base === (base | 0) && base >= 2 && base <= 36);
				number = number.toString().replace(/\s+/g, "");
				var start = 0;
				if (number[0] === "-") {
					start++;
					this.negative = 1;
				}
				if (start < number.length) if (base === 16) this._parseHex(number, start, endian);
				else {
					this._parseBase(number, base, start);
					if (endian === "le") this._initArray(this.toArray(), base, endian);
				}
			};
			BN.prototype._initNumber = function _initNumber(number, base, endian) {
				if (number < 0) {
					this.negative = 1;
					number = -number;
				}
				if (number < 67108864) {
					this.words = [number & 67108863];
					this.length = 1;
				} else if (number < 4503599627370496) {
					this.words = [number & 67108863, number / 67108864 & 67108863];
					this.length = 2;
				} else {
					assert(number < 9007199254740992);
					this.words = [
						number & 67108863,
						number / 67108864 & 67108863,
						1
					];
					this.length = 3;
				}
				if (endian !== "le") return;
				this._initArray(this.toArray(), base, endian);
			};
			BN.prototype._initArray = function _initArray(number, base, endian) {
				assert(typeof number.length === "number");
				if (number.length <= 0) {
					this.words = [0];
					this.length = 1;
					return this;
				}
				this.length = Math.ceil(number.length / 3);
				this.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) this.words[i] = 0;
				var j, w;
				var off = 0;
				if (endian === "be") for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
					w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
					this.words[j] |= w << off & 67108863;
					this.words[j + 1] = w >>> 26 - off & 67108863;
					off += 24;
					if (off >= 26) {
						off -= 26;
						j++;
					}
				}
				else if (endian === "le") for (i = 0, j = 0; i < number.length; i += 3) {
					w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
					this.words[j] |= w << off & 67108863;
					this.words[j + 1] = w >>> 26 - off & 67108863;
					off += 24;
					if (off >= 26) {
						off -= 26;
						j++;
					}
				}
				return this._strip();
			};
			function parseHex4Bits(string, index) {
				var c = string.charCodeAt(index);
				if (c >= 48 && c <= 57) return c - 48;
				else if (c >= 65 && c <= 70) return c - 55;
				else if (c >= 97 && c <= 102) return c - 87;
				else assert(false, "Invalid character in " + string);
			}
			function parseHexByte(string, lowerBound, index) {
				var r = parseHex4Bits(string, index);
				if (index - 1 >= lowerBound) r |= parseHex4Bits(string, index - 1) << 4;
				return r;
			}
			BN.prototype._parseHex = function _parseHex(number, start, endian) {
				this.length = Math.ceil((number.length - start) / 6);
				this.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) this.words[i] = 0;
				var off = 0;
				var j = 0;
				var w;
				if (endian === "be") for (i = number.length - 1; i >= start; i -= 2) {
					w = parseHexByte(number, start, i) << off;
					this.words[j] |= w & 67108863;
					if (off >= 18) {
						off -= 18;
						j += 1;
						this.words[j] |= w >>> 26;
					} else off += 8;
				}
				else for (i = (number.length - start) % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
					w = parseHexByte(number, start, i) << off;
					this.words[j] |= w & 67108863;
					if (off >= 18) {
						off -= 18;
						j += 1;
						this.words[j] |= w >>> 26;
					} else off += 8;
				}
				this._strip();
			};
			function parseBase(str, start, end, mul) {
				var r = 0;
				var b = 0;
				var len = Math.min(str.length, end);
				for (var i = start; i < len; i++) {
					var c = str.charCodeAt(i) - 48;
					r *= mul;
					if (c >= 49) b = c - 49 + 10;
					else if (c >= 17) b = c - 17 + 10;
					else b = c;
					assert(c >= 0 && b < mul, "Invalid character");
					r += b;
				}
				return r;
			}
			BN.prototype._parseBase = function _parseBase(number, base, start) {
				this.words = [0];
				this.length = 1;
				for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) limbLen++;
				limbLen--;
				limbPow = limbPow / base | 0;
				var total = number.length - start;
				var mod = total % limbLen;
				var end = Math.min(total, total - mod) + start;
				var word = 0;
				for (var i = start; i < end; i += limbLen) {
					word = parseBase(number, i, i + limbLen, base);
					this.imuln(limbPow);
					if (this.words[0] + word < 67108864) this.words[0] += word;
					else this._iaddn(word);
				}
				if (mod !== 0) {
					var pow = 1;
					word = parseBase(number, i, number.length, base);
					for (i = 0; i < mod; i++) pow *= base;
					this.imuln(pow);
					if (this.words[0] + word < 67108864) this.words[0] += word;
					else this._iaddn(word);
				}
				this._strip();
			};
			BN.prototype.copy = function copy(dest) {
				dest.words = new Array(this.length);
				for (var i = 0; i < this.length; i++) dest.words[i] = this.words[i];
				dest.length = this.length;
				dest.negative = this.negative;
				dest.red = this.red;
			};
			function move(dest, src) {
				dest.words = src.words;
				dest.length = src.length;
				dest.negative = src.negative;
				dest.red = src.red;
			}
			BN.prototype._move = function _move(dest) {
				move(dest, this);
			};
			BN.prototype.clone = function clone() {
				var r = new BN(null);
				this.copy(r);
				return r;
			};
			BN.prototype._expand = function _expand(size) {
				while (this.length < size) this.words[this.length++] = 0;
				return this;
			};
			BN.prototype._strip = function strip() {
				while (this.length > 1 && this.words[this.length - 1] === 0) this.length--;
				return this._normSign();
			};
			BN.prototype._normSign = function _normSign() {
				if (this.length === 1 && this.words[0] === 0) this.negative = 0;
				return this;
			};
			if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") try {
				BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
			} catch (e) {
				BN.prototype.inspect = inspect;
			}
			else BN.prototype.inspect = inspect;
			function inspect() {
				return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
			}
			var zeros = [
				"",
				"0",
				"00",
				"000",
				"0000",
				"00000",
				"000000",
				"0000000",
				"00000000",
				"000000000",
				"0000000000",
				"00000000000",
				"000000000000",
				"0000000000000",
				"00000000000000",
				"000000000000000",
				"0000000000000000",
				"00000000000000000",
				"000000000000000000",
				"0000000000000000000",
				"00000000000000000000",
				"000000000000000000000",
				"0000000000000000000000",
				"00000000000000000000000",
				"000000000000000000000000",
				"0000000000000000000000000"
			];
			var groupSizes = [
				0,
				0,
				25,
				16,
				12,
				11,
				10,
				9,
				8,
				8,
				7,
				7,
				7,
				7,
				6,
				6,
				6,
				6,
				6,
				6,
				6,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5,
				5
			];
			var groupBases = [
				0,
				0,
				33554432,
				43046721,
				16777216,
				48828125,
				60466176,
				40353607,
				16777216,
				43046721,
				1e7,
				19487171,
				35831808,
				62748517,
				7529536,
				11390625,
				16777216,
				24137569,
				34012224,
				47045881,
				64e6,
				4084101,
				5153632,
				6436343,
				7962624,
				9765625,
				11881376,
				14348907,
				17210368,
				20511149,
				243e5,
				28629151,
				33554432,
				39135393,
				45435424,
				52521875,
				60466176
			];
			BN.prototype.toString = function toString(base, padding) {
				base = base || 10;
				padding = padding | 0 || 1;
				var out;
				if (base === 16 || base === "hex") {
					out = "";
					var off = 0;
					var carry = 0;
					for (var i = 0; i < this.length; i++) {
						var w = this.words[i];
						var word = ((w << off | carry) & 16777215).toString(16);
						carry = w >>> 24 - off & 16777215;
						off += 2;
						if (off >= 26) {
							off -= 26;
							i--;
						}
						if (carry !== 0 || i !== this.length - 1) out = zeros[6 - word.length] + word + out;
						else out = word + out;
					}
					if (carry !== 0) out = carry.toString(16) + out;
					while (out.length % padding !== 0) out = "0" + out;
					if (this.negative !== 0) out = "-" + out;
					return out;
				}
				if (base === (base | 0) && base >= 2 && base <= 36) {
					var groupSize = groupSizes[base];
					var groupBase = groupBases[base];
					out = "";
					var c = this.clone();
					c.negative = 0;
					while (!c.isZero()) {
						var r = c.modrn(groupBase).toString(base);
						c = c.idivn(groupBase);
						if (!c.isZero()) out = zeros[groupSize - r.length] + r + out;
						else out = r + out;
					}
					if (this.isZero()) out = "0" + out;
					while (out.length % padding !== 0) out = "0" + out;
					if (this.negative !== 0) out = "-" + out;
					return out;
				}
				assert(false, "Base should be between 2 and 36");
			};
			BN.prototype.toNumber = function toNumber() {
				var ret = this.words[0];
				if (this.length === 2) ret += this.words[1] * 67108864;
				else if (this.length === 3 && this.words[2] === 1) ret += 4503599627370496 + this.words[1] * 67108864;
				else if (this.length > 2) assert(false, "Number can only safely store up to 53 bits");
				return this.negative !== 0 ? -ret : ret;
			};
			BN.prototype.toJSON = function toJSON() {
				return this.toString(16, 2);
			};
			if (Buffer) BN.prototype.toBuffer = function toBuffer(endian, length) {
				return this.toArrayLike(Buffer, endian, length);
			};
			BN.prototype.toArray = function toArray(endian, length) {
				return this.toArrayLike(Array, endian, length);
			};
			var allocate = function allocate(ArrayType, size) {
				if (ArrayType.allocUnsafe) return ArrayType.allocUnsafe(size);
				return new ArrayType(size);
			};
			BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
				this._strip();
				var byteLength = this.byteLength();
				var reqLength = length || Math.max(1, byteLength);
				assert(byteLength <= reqLength, "byte array longer than desired length");
				assert(reqLength > 0, "Requested array length <= 0");
				var res = allocate(ArrayType, reqLength);
				this["_toArrayLike" + (endian === "le" ? "LE" : "BE")](res, byteLength);
				return res;
			};
			BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) {
				var position = 0;
				var carry = 0;
				for (var i = 0, shift = 0; i < this.length; i++) {
					var word = this.words[i] << shift | carry;
					res[position++] = word & 255;
					if (position < res.length) res[position++] = word >> 8 & 255;
					if (position < res.length) res[position++] = word >> 16 & 255;
					if (shift === 6) {
						if (position < res.length) res[position++] = word >> 24 & 255;
						carry = 0;
						shift = 0;
					} else {
						carry = word >>> 24;
						shift += 2;
					}
				}
				if (position < res.length) {
					res[position++] = carry;
					while (position < res.length) res[position++] = 0;
				}
			};
			BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) {
				var position = res.length - 1;
				var carry = 0;
				for (var i = 0, shift = 0; i < this.length; i++) {
					var word = this.words[i] << shift | carry;
					res[position--] = word & 255;
					if (position >= 0) res[position--] = word >> 8 & 255;
					if (position >= 0) res[position--] = word >> 16 & 255;
					if (shift === 6) {
						if (position >= 0) res[position--] = word >> 24 & 255;
						carry = 0;
						shift = 0;
					} else {
						carry = word >>> 24;
						shift += 2;
					}
				}
				if (position >= 0) {
					res[position--] = carry;
					while (position >= 0) res[position--] = 0;
				}
			};
			if (Math.clz32) BN.prototype._countBits = function _countBits(w) {
				return 32 - Math.clz32(w);
			};
			else BN.prototype._countBits = function _countBits(w) {
				var t = w;
				var r = 0;
				if (t >= 4096) {
					r += 13;
					t >>>= 13;
				}
				if (t >= 64) {
					r += 7;
					t >>>= 7;
				}
				if (t >= 8) {
					r += 4;
					t >>>= 4;
				}
				if (t >= 2) {
					r += 2;
					t >>>= 2;
				}
				return r + t;
			};
			BN.prototype._zeroBits = function _zeroBits(w) {
				if (w === 0) return 26;
				var t = w;
				var r = 0;
				if ((t & 8191) === 0) {
					r += 13;
					t >>>= 13;
				}
				if ((t & 127) === 0) {
					r += 7;
					t >>>= 7;
				}
				if ((t & 15) === 0) {
					r += 4;
					t >>>= 4;
				}
				if ((t & 3) === 0) {
					r += 2;
					t >>>= 2;
				}
				if ((t & 1) === 0) r++;
				return r;
			};
			BN.prototype.bitLength = function bitLength() {
				var w = this.words[this.length - 1];
				var hi = this._countBits(w);
				return (this.length - 1) * 26 + hi;
			};
			function toBitArray(num) {
				var w = new Array(num.bitLength());
				for (var bit = 0; bit < w.length; bit++) {
					var off = bit / 26 | 0;
					var wbit = bit % 26;
					w[bit] = num.words[off] >>> wbit & 1;
				}
				return w;
			}
			BN.prototype.zeroBits = function zeroBits() {
				if (this.isZero()) return 0;
				var r = 0;
				for (var i = 0; i < this.length; i++) {
					var b = this._zeroBits(this.words[i]);
					r += b;
					if (b !== 26) break;
				}
				return r;
			};
			BN.prototype.byteLength = function byteLength() {
				return Math.ceil(this.bitLength() / 8);
			};
			BN.prototype.toTwos = function toTwos(width) {
				if (this.negative !== 0) return this.abs().inotn(width).iaddn(1);
				return this.clone();
			};
			BN.prototype.fromTwos = function fromTwos(width) {
				if (this.testn(width - 1)) return this.notn(width).iaddn(1).ineg();
				return this.clone();
			};
			BN.prototype.isNeg = function isNeg() {
				return this.negative !== 0;
			};
			BN.prototype.neg = function neg() {
				return this.clone().ineg();
			};
			BN.prototype.ineg = function ineg() {
				if (!this.isZero()) this.negative ^= 1;
				return this;
			};
			BN.prototype.iuor = function iuor(num) {
				while (this.length < num.length) this.words[this.length++] = 0;
				for (var i = 0; i < num.length; i++) this.words[i] = this.words[i] | num.words[i];
				return this._strip();
			};
			BN.prototype.ior = function ior(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuor(num);
			};
			BN.prototype.or = function or(num) {
				if (this.length > num.length) return this.clone().ior(num);
				return num.clone().ior(this);
			};
			BN.prototype.uor = function uor(num) {
				if (this.length > num.length) return this.clone().iuor(num);
				return num.clone().iuor(this);
			};
			BN.prototype.iuand = function iuand(num) {
				var b;
				if (this.length > num.length) b = num;
				else b = this;
				for (var i = 0; i < b.length; i++) this.words[i] = this.words[i] & num.words[i];
				this.length = b.length;
				return this._strip();
			};
			BN.prototype.iand = function iand(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuand(num);
			};
			BN.prototype.and = function and(num) {
				if (this.length > num.length) return this.clone().iand(num);
				return num.clone().iand(this);
			};
			BN.prototype.uand = function uand(num) {
				if (this.length > num.length) return this.clone().iuand(num);
				return num.clone().iuand(this);
			};
			BN.prototype.iuxor = function iuxor(num) {
				var a;
				var b;
				if (this.length > num.length) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				for (var i = 0; i < b.length; i++) this.words[i] = a.words[i] ^ b.words[i];
				if (this !== a) for (; i < a.length; i++) this.words[i] = a.words[i];
				this.length = a.length;
				return this._strip();
			};
			BN.prototype.ixor = function ixor(num) {
				assert((this.negative | num.negative) === 0);
				return this.iuxor(num);
			};
			BN.prototype.xor = function xor(num) {
				if (this.length > num.length) return this.clone().ixor(num);
				return num.clone().ixor(this);
			};
			BN.prototype.uxor = function uxor(num) {
				if (this.length > num.length) return this.clone().iuxor(num);
				return num.clone().iuxor(this);
			};
			BN.prototype.inotn = function inotn(width) {
				assert(typeof width === "number" && width >= 0);
				var bytesNeeded = Math.ceil(width / 26) | 0;
				var bitsLeft = width % 26;
				this._expand(bytesNeeded);
				if (bitsLeft > 0) bytesNeeded--;
				for (var i = 0; i < bytesNeeded; i++) this.words[i] = ~this.words[i] & 67108863;
				if (bitsLeft > 0) this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
				return this._strip();
			};
			BN.prototype.notn = function notn(width) {
				return this.clone().inotn(width);
			};
			BN.prototype.setn = function setn(bit, val) {
				assert(typeof bit === "number" && bit >= 0);
				var off = bit / 26 | 0;
				var wbit = bit % 26;
				this._expand(off + 1);
				if (val) this.words[off] = this.words[off] | 1 << wbit;
				else this.words[off] = this.words[off] & ~(1 << wbit);
				return this._strip();
			};
			BN.prototype.iadd = function iadd(num) {
				var r;
				if (this.negative !== 0 && num.negative === 0) {
					this.negative = 0;
					r = this.isub(num);
					this.negative ^= 1;
					return this._normSign();
				} else if (this.negative === 0 && num.negative !== 0) {
					num.negative = 0;
					r = this.isub(num);
					num.negative = 1;
					return r._normSign();
				}
				var a, b;
				if (this.length > num.length) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				var carry = 0;
				for (var i = 0; i < b.length; i++) {
					r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
					this.words[i] = r & 67108863;
					carry = r >>> 26;
				}
				for (; carry !== 0 && i < a.length; i++) {
					r = (a.words[i] | 0) + carry;
					this.words[i] = r & 67108863;
					carry = r >>> 26;
				}
				this.length = a.length;
				if (carry !== 0) {
					this.words[this.length] = carry;
					this.length++;
				} else if (a !== this) for (; i < a.length; i++) this.words[i] = a.words[i];
				return this;
			};
			BN.prototype.add = function add(num) {
				var res;
				if (num.negative !== 0 && this.negative === 0) {
					num.negative = 0;
					res = this.sub(num);
					num.negative ^= 1;
					return res;
				} else if (num.negative === 0 && this.negative !== 0) {
					this.negative = 0;
					res = num.sub(this);
					this.negative = 1;
					return res;
				}
				if (this.length > num.length) return this.clone().iadd(num);
				return num.clone().iadd(this);
			};
			BN.prototype.isub = function isub(num) {
				if (num.negative !== 0) {
					num.negative = 0;
					var r = this.iadd(num);
					num.negative = 1;
					return r._normSign();
				} else if (this.negative !== 0) {
					this.negative = 0;
					this.iadd(num);
					this.negative = 1;
					return this._normSign();
				}
				var cmp = this.cmp(num);
				if (cmp === 0) {
					this.negative = 0;
					this.length = 1;
					this.words[0] = 0;
					return this;
				}
				var a, b;
				if (cmp > 0) {
					a = this;
					b = num;
				} else {
					a = num;
					b = this;
				}
				var carry = 0;
				for (var i = 0; i < b.length; i++) {
					r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
					carry = r >> 26;
					this.words[i] = r & 67108863;
				}
				for (; carry !== 0 && i < a.length; i++) {
					r = (a.words[i] | 0) + carry;
					carry = r >> 26;
					this.words[i] = r & 67108863;
				}
				if (carry === 0 && i < a.length && a !== this) for (; i < a.length; i++) this.words[i] = a.words[i];
				this.length = Math.max(this.length, i);
				if (a !== this) this.negative = 1;
				return this._strip();
			};
			BN.prototype.sub = function sub(num) {
				return this.clone().isub(num);
			};
			function smallMulTo(self, num, out) {
				out.negative = num.negative ^ self.negative;
				var len = self.length + num.length | 0;
				out.length = len;
				len = len - 1 | 0;
				var a = self.words[0] | 0;
				var b = num.words[0] | 0;
				var r = a * b;
				var lo = r & 67108863;
				var carry = r / 67108864 | 0;
				out.words[0] = lo;
				for (var k = 1; k < len; k++) {
					var ncarry = carry >>> 26;
					var rword = carry & 67108863;
					var maxJ = Math.min(k, num.length - 1);
					for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
						var i = k - j | 0;
						a = self.words[i] | 0;
						b = num.words[j] | 0;
						r = a * b + rword;
						ncarry += r / 67108864 | 0;
						rword = r & 67108863;
					}
					out.words[k] = rword | 0;
					carry = ncarry | 0;
				}
				if (carry !== 0) out.words[k] = carry | 0;
				else out.length--;
				return out._strip();
			}
			var comb10MulTo = function comb10MulTo(self, num, out) {
				var a = self.words;
				var b = num.words;
				var o = out.words;
				var c = 0;
				var lo;
				var mid;
				var hi;
				var a0 = a[0] | 0;
				var al0 = a0 & 8191;
				var ah0 = a0 >>> 13;
				var a1 = a[1] | 0;
				var al1 = a1 & 8191;
				var ah1 = a1 >>> 13;
				var a2 = a[2] | 0;
				var al2 = a2 & 8191;
				var ah2 = a2 >>> 13;
				var a3 = a[3] | 0;
				var al3 = a3 & 8191;
				var ah3 = a3 >>> 13;
				var a4 = a[4] | 0;
				var al4 = a4 & 8191;
				var ah4 = a4 >>> 13;
				var a5 = a[5] | 0;
				var al5 = a5 & 8191;
				var ah5 = a5 >>> 13;
				var a6 = a[6] | 0;
				var al6 = a6 & 8191;
				var ah6 = a6 >>> 13;
				var a7 = a[7] | 0;
				var al7 = a7 & 8191;
				var ah7 = a7 >>> 13;
				var a8 = a[8] | 0;
				var al8 = a8 & 8191;
				var ah8 = a8 >>> 13;
				var a9 = a[9] | 0;
				var al9 = a9 & 8191;
				var ah9 = a9 >>> 13;
				var b0 = b[0] | 0;
				var bl0 = b0 & 8191;
				var bh0 = b0 >>> 13;
				var b1 = b[1] | 0;
				var bl1 = b1 & 8191;
				var bh1 = b1 >>> 13;
				var b2 = b[2] | 0;
				var bl2 = b2 & 8191;
				var bh2 = b2 >>> 13;
				var b3 = b[3] | 0;
				var bl3 = b3 & 8191;
				var bh3 = b3 >>> 13;
				var b4 = b[4] | 0;
				var bl4 = b4 & 8191;
				var bh4 = b4 >>> 13;
				var b5 = b[5] | 0;
				var bl5 = b5 & 8191;
				var bh5 = b5 >>> 13;
				var b6 = b[6] | 0;
				var bl6 = b6 & 8191;
				var bh6 = b6 >>> 13;
				var b7 = b[7] | 0;
				var bl7 = b7 & 8191;
				var bh7 = b7 >>> 13;
				var b8 = b[8] | 0;
				var bl8 = b8 & 8191;
				var bh8 = b8 >>> 13;
				var b9 = b[9] | 0;
				var bl9 = b9 & 8191;
				var bh9 = b9 >>> 13;
				out.negative = self.negative ^ num.negative;
				out.length = 19;
				lo = Math.imul(al0, bl0);
				mid = Math.imul(al0, bh0);
				mid = mid + Math.imul(ah0, bl0) | 0;
				hi = Math.imul(ah0, bh0);
				var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
				w0 &= 67108863;
				lo = Math.imul(al1, bl0);
				mid = Math.imul(al1, bh0);
				mid = mid + Math.imul(ah1, bl0) | 0;
				hi = Math.imul(ah1, bh0);
				lo = lo + Math.imul(al0, bl1) | 0;
				mid = mid + Math.imul(al0, bh1) | 0;
				mid = mid + Math.imul(ah0, bl1) | 0;
				hi = hi + Math.imul(ah0, bh1) | 0;
				var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
				w1 &= 67108863;
				lo = Math.imul(al2, bl0);
				mid = Math.imul(al2, bh0);
				mid = mid + Math.imul(ah2, bl0) | 0;
				hi = Math.imul(ah2, bh0);
				lo = lo + Math.imul(al1, bl1) | 0;
				mid = mid + Math.imul(al1, bh1) | 0;
				mid = mid + Math.imul(ah1, bl1) | 0;
				hi = hi + Math.imul(ah1, bh1) | 0;
				lo = lo + Math.imul(al0, bl2) | 0;
				mid = mid + Math.imul(al0, bh2) | 0;
				mid = mid + Math.imul(ah0, bl2) | 0;
				hi = hi + Math.imul(ah0, bh2) | 0;
				var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
				w2 &= 67108863;
				lo = Math.imul(al3, bl0);
				mid = Math.imul(al3, bh0);
				mid = mid + Math.imul(ah3, bl0) | 0;
				hi = Math.imul(ah3, bh0);
				lo = lo + Math.imul(al2, bl1) | 0;
				mid = mid + Math.imul(al2, bh1) | 0;
				mid = mid + Math.imul(ah2, bl1) | 0;
				hi = hi + Math.imul(ah2, bh1) | 0;
				lo = lo + Math.imul(al1, bl2) | 0;
				mid = mid + Math.imul(al1, bh2) | 0;
				mid = mid + Math.imul(ah1, bl2) | 0;
				hi = hi + Math.imul(ah1, bh2) | 0;
				lo = lo + Math.imul(al0, bl3) | 0;
				mid = mid + Math.imul(al0, bh3) | 0;
				mid = mid + Math.imul(ah0, bl3) | 0;
				hi = hi + Math.imul(ah0, bh3) | 0;
				var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
				w3 &= 67108863;
				lo = Math.imul(al4, bl0);
				mid = Math.imul(al4, bh0);
				mid = mid + Math.imul(ah4, bl0) | 0;
				hi = Math.imul(ah4, bh0);
				lo = lo + Math.imul(al3, bl1) | 0;
				mid = mid + Math.imul(al3, bh1) | 0;
				mid = mid + Math.imul(ah3, bl1) | 0;
				hi = hi + Math.imul(ah3, bh1) | 0;
				lo = lo + Math.imul(al2, bl2) | 0;
				mid = mid + Math.imul(al2, bh2) | 0;
				mid = mid + Math.imul(ah2, bl2) | 0;
				hi = hi + Math.imul(ah2, bh2) | 0;
				lo = lo + Math.imul(al1, bl3) | 0;
				mid = mid + Math.imul(al1, bh3) | 0;
				mid = mid + Math.imul(ah1, bl3) | 0;
				hi = hi + Math.imul(ah1, bh3) | 0;
				lo = lo + Math.imul(al0, bl4) | 0;
				mid = mid + Math.imul(al0, bh4) | 0;
				mid = mid + Math.imul(ah0, bl4) | 0;
				hi = hi + Math.imul(ah0, bh4) | 0;
				var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
				w4 &= 67108863;
				lo = Math.imul(al5, bl0);
				mid = Math.imul(al5, bh0);
				mid = mid + Math.imul(ah5, bl0) | 0;
				hi = Math.imul(ah5, bh0);
				lo = lo + Math.imul(al4, bl1) | 0;
				mid = mid + Math.imul(al4, bh1) | 0;
				mid = mid + Math.imul(ah4, bl1) | 0;
				hi = hi + Math.imul(ah4, bh1) | 0;
				lo = lo + Math.imul(al3, bl2) | 0;
				mid = mid + Math.imul(al3, bh2) | 0;
				mid = mid + Math.imul(ah3, bl2) | 0;
				hi = hi + Math.imul(ah3, bh2) | 0;
				lo = lo + Math.imul(al2, bl3) | 0;
				mid = mid + Math.imul(al2, bh3) | 0;
				mid = mid + Math.imul(ah2, bl3) | 0;
				hi = hi + Math.imul(ah2, bh3) | 0;
				lo = lo + Math.imul(al1, bl4) | 0;
				mid = mid + Math.imul(al1, bh4) | 0;
				mid = mid + Math.imul(ah1, bl4) | 0;
				hi = hi + Math.imul(ah1, bh4) | 0;
				lo = lo + Math.imul(al0, bl5) | 0;
				mid = mid + Math.imul(al0, bh5) | 0;
				mid = mid + Math.imul(ah0, bl5) | 0;
				hi = hi + Math.imul(ah0, bh5) | 0;
				var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
				w5 &= 67108863;
				lo = Math.imul(al6, bl0);
				mid = Math.imul(al6, bh0);
				mid = mid + Math.imul(ah6, bl0) | 0;
				hi = Math.imul(ah6, bh0);
				lo = lo + Math.imul(al5, bl1) | 0;
				mid = mid + Math.imul(al5, bh1) | 0;
				mid = mid + Math.imul(ah5, bl1) | 0;
				hi = hi + Math.imul(ah5, bh1) | 0;
				lo = lo + Math.imul(al4, bl2) | 0;
				mid = mid + Math.imul(al4, bh2) | 0;
				mid = mid + Math.imul(ah4, bl2) | 0;
				hi = hi + Math.imul(ah4, bh2) | 0;
				lo = lo + Math.imul(al3, bl3) | 0;
				mid = mid + Math.imul(al3, bh3) | 0;
				mid = mid + Math.imul(ah3, bl3) | 0;
				hi = hi + Math.imul(ah3, bh3) | 0;
				lo = lo + Math.imul(al2, bl4) | 0;
				mid = mid + Math.imul(al2, bh4) | 0;
				mid = mid + Math.imul(ah2, bl4) | 0;
				hi = hi + Math.imul(ah2, bh4) | 0;
				lo = lo + Math.imul(al1, bl5) | 0;
				mid = mid + Math.imul(al1, bh5) | 0;
				mid = mid + Math.imul(ah1, bl5) | 0;
				hi = hi + Math.imul(ah1, bh5) | 0;
				lo = lo + Math.imul(al0, bl6) | 0;
				mid = mid + Math.imul(al0, bh6) | 0;
				mid = mid + Math.imul(ah0, bl6) | 0;
				hi = hi + Math.imul(ah0, bh6) | 0;
				var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
				w6 &= 67108863;
				lo = Math.imul(al7, bl0);
				mid = Math.imul(al7, bh0);
				mid = mid + Math.imul(ah7, bl0) | 0;
				hi = Math.imul(ah7, bh0);
				lo = lo + Math.imul(al6, bl1) | 0;
				mid = mid + Math.imul(al6, bh1) | 0;
				mid = mid + Math.imul(ah6, bl1) | 0;
				hi = hi + Math.imul(ah6, bh1) | 0;
				lo = lo + Math.imul(al5, bl2) | 0;
				mid = mid + Math.imul(al5, bh2) | 0;
				mid = mid + Math.imul(ah5, bl2) | 0;
				hi = hi + Math.imul(ah5, bh2) | 0;
				lo = lo + Math.imul(al4, bl3) | 0;
				mid = mid + Math.imul(al4, bh3) | 0;
				mid = mid + Math.imul(ah4, bl3) | 0;
				hi = hi + Math.imul(ah4, bh3) | 0;
				lo = lo + Math.imul(al3, bl4) | 0;
				mid = mid + Math.imul(al3, bh4) | 0;
				mid = mid + Math.imul(ah3, bl4) | 0;
				hi = hi + Math.imul(ah3, bh4) | 0;
				lo = lo + Math.imul(al2, bl5) | 0;
				mid = mid + Math.imul(al2, bh5) | 0;
				mid = mid + Math.imul(ah2, bl5) | 0;
				hi = hi + Math.imul(ah2, bh5) | 0;
				lo = lo + Math.imul(al1, bl6) | 0;
				mid = mid + Math.imul(al1, bh6) | 0;
				mid = mid + Math.imul(ah1, bl6) | 0;
				hi = hi + Math.imul(ah1, bh6) | 0;
				lo = lo + Math.imul(al0, bl7) | 0;
				mid = mid + Math.imul(al0, bh7) | 0;
				mid = mid + Math.imul(ah0, bl7) | 0;
				hi = hi + Math.imul(ah0, bh7) | 0;
				var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
				w7 &= 67108863;
				lo = Math.imul(al8, bl0);
				mid = Math.imul(al8, bh0);
				mid = mid + Math.imul(ah8, bl0) | 0;
				hi = Math.imul(ah8, bh0);
				lo = lo + Math.imul(al7, bl1) | 0;
				mid = mid + Math.imul(al7, bh1) | 0;
				mid = mid + Math.imul(ah7, bl1) | 0;
				hi = hi + Math.imul(ah7, bh1) | 0;
				lo = lo + Math.imul(al6, bl2) | 0;
				mid = mid + Math.imul(al6, bh2) | 0;
				mid = mid + Math.imul(ah6, bl2) | 0;
				hi = hi + Math.imul(ah6, bh2) | 0;
				lo = lo + Math.imul(al5, bl3) | 0;
				mid = mid + Math.imul(al5, bh3) | 0;
				mid = mid + Math.imul(ah5, bl3) | 0;
				hi = hi + Math.imul(ah5, bh3) | 0;
				lo = lo + Math.imul(al4, bl4) | 0;
				mid = mid + Math.imul(al4, bh4) | 0;
				mid = mid + Math.imul(ah4, bl4) | 0;
				hi = hi + Math.imul(ah4, bh4) | 0;
				lo = lo + Math.imul(al3, bl5) | 0;
				mid = mid + Math.imul(al3, bh5) | 0;
				mid = mid + Math.imul(ah3, bl5) | 0;
				hi = hi + Math.imul(ah3, bh5) | 0;
				lo = lo + Math.imul(al2, bl6) | 0;
				mid = mid + Math.imul(al2, bh6) | 0;
				mid = mid + Math.imul(ah2, bl6) | 0;
				hi = hi + Math.imul(ah2, bh6) | 0;
				lo = lo + Math.imul(al1, bl7) | 0;
				mid = mid + Math.imul(al1, bh7) | 0;
				mid = mid + Math.imul(ah1, bl7) | 0;
				hi = hi + Math.imul(ah1, bh7) | 0;
				lo = lo + Math.imul(al0, bl8) | 0;
				mid = mid + Math.imul(al0, bh8) | 0;
				mid = mid + Math.imul(ah0, bl8) | 0;
				hi = hi + Math.imul(ah0, bh8) | 0;
				var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
				w8 &= 67108863;
				lo = Math.imul(al9, bl0);
				mid = Math.imul(al9, bh0);
				mid = mid + Math.imul(ah9, bl0) | 0;
				hi = Math.imul(ah9, bh0);
				lo = lo + Math.imul(al8, bl1) | 0;
				mid = mid + Math.imul(al8, bh1) | 0;
				mid = mid + Math.imul(ah8, bl1) | 0;
				hi = hi + Math.imul(ah8, bh1) | 0;
				lo = lo + Math.imul(al7, bl2) | 0;
				mid = mid + Math.imul(al7, bh2) | 0;
				mid = mid + Math.imul(ah7, bl2) | 0;
				hi = hi + Math.imul(ah7, bh2) | 0;
				lo = lo + Math.imul(al6, bl3) | 0;
				mid = mid + Math.imul(al6, bh3) | 0;
				mid = mid + Math.imul(ah6, bl3) | 0;
				hi = hi + Math.imul(ah6, bh3) | 0;
				lo = lo + Math.imul(al5, bl4) | 0;
				mid = mid + Math.imul(al5, bh4) | 0;
				mid = mid + Math.imul(ah5, bl4) | 0;
				hi = hi + Math.imul(ah5, bh4) | 0;
				lo = lo + Math.imul(al4, bl5) | 0;
				mid = mid + Math.imul(al4, bh5) | 0;
				mid = mid + Math.imul(ah4, bl5) | 0;
				hi = hi + Math.imul(ah4, bh5) | 0;
				lo = lo + Math.imul(al3, bl6) | 0;
				mid = mid + Math.imul(al3, bh6) | 0;
				mid = mid + Math.imul(ah3, bl6) | 0;
				hi = hi + Math.imul(ah3, bh6) | 0;
				lo = lo + Math.imul(al2, bl7) | 0;
				mid = mid + Math.imul(al2, bh7) | 0;
				mid = mid + Math.imul(ah2, bl7) | 0;
				hi = hi + Math.imul(ah2, bh7) | 0;
				lo = lo + Math.imul(al1, bl8) | 0;
				mid = mid + Math.imul(al1, bh8) | 0;
				mid = mid + Math.imul(ah1, bl8) | 0;
				hi = hi + Math.imul(ah1, bh8) | 0;
				lo = lo + Math.imul(al0, bl9) | 0;
				mid = mid + Math.imul(al0, bh9) | 0;
				mid = mid + Math.imul(ah0, bl9) | 0;
				hi = hi + Math.imul(ah0, bh9) | 0;
				var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
				w9 &= 67108863;
				lo = Math.imul(al9, bl1);
				mid = Math.imul(al9, bh1);
				mid = mid + Math.imul(ah9, bl1) | 0;
				hi = Math.imul(ah9, bh1);
				lo = lo + Math.imul(al8, bl2) | 0;
				mid = mid + Math.imul(al8, bh2) | 0;
				mid = mid + Math.imul(ah8, bl2) | 0;
				hi = hi + Math.imul(ah8, bh2) | 0;
				lo = lo + Math.imul(al7, bl3) | 0;
				mid = mid + Math.imul(al7, bh3) | 0;
				mid = mid + Math.imul(ah7, bl3) | 0;
				hi = hi + Math.imul(ah7, bh3) | 0;
				lo = lo + Math.imul(al6, bl4) | 0;
				mid = mid + Math.imul(al6, bh4) | 0;
				mid = mid + Math.imul(ah6, bl4) | 0;
				hi = hi + Math.imul(ah6, bh4) | 0;
				lo = lo + Math.imul(al5, bl5) | 0;
				mid = mid + Math.imul(al5, bh5) | 0;
				mid = mid + Math.imul(ah5, bl5) | 0;
				hi = hi + Math.imul(ah5, bh5) | 0;
				lo = lo + Math.imul(al4, bl6) | 0;
				mid = mid + Math.imul(al4, bh6) | 0;
				mid = mid + Math.imul(ah4, bl6) | 0;
				hi = hi + Math.imul(ah4, bh6) | 0;
				lo = lo + Math.imul(al3, bl7) | 0;
				mid = mid + Math.imul(al3, bh7) | 0;
				mid = mid + Math.imul(ah3, bl7) | 0;
				hi = hi + Math.imul(ah3, bh7) | 0;
				lo = lo + Math.imul(al2, bl8) | 0;
				mid = mid + Math.imul(al2, bh8) | 0;
				mid = mid + Math.imul(ah2, bl8) | 0;
				hi = hi + Math.imul(ah2, bh8) | 0;
				lo = lo + Math.imul(al1, bl9) | 0;
				mid = mid + Math.imul(al1, bh9) | 0;
				mid = mid + Math.imul(ah1, bl9) | 0;
				hi = hi + Math.imul(ah1, bh9) | 0;
				var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
				w10 &= 67108863;
				lo = Math.imul(al9, bl2);
				mid = Math.imul(al9, bh2);
				mid = mid + Math.imul(ah9, bl2) | 0;
				hi = Math.imul(ah9, bh2);
				lo = lo + Math.imul(al8, bl3) | 0;
				mid = mid + Math.imul(al8, bh3) | 0;
				mid = mid + Math.imul(ah8, bl3) | 0;
				hi = hi + Math.imul(ah8, bh3) | 0;
				lo = lo + Math.imul(al7, bl4) | 0;
				mid = mid + Math.imul(al7, bh4) | 0;
				mid = mid + Math.imul(ah7, bl4) | 0;
				hi = hi + Math.imul(ah7, bh4) | 0;
				lo = lo + Math.imul(al6, bl5) | 0;
				mid = mid + Math.imul(al6, bh5) | 0;
				mid = mid + Math.imul(ah6, bl5) | 0;
				hi = hi + Math.imul(ah6, bh5) | 0;
				lo = lo + Math.imul(al5, bl6) | 0;
				mid = mid + Math.imul(al5, bh6) | 0;
				mid = mid + Math.imul(ah5, bl6) | 0;
				hi = hi + Math.imul(ah5, bh6) | 0;
				lo = lo + Math.imul(al4, bl7) | 0;
				mid = mid + Math.imul(al4, bh7) | 0;
				mid = mid + Math.imul(ah4, bl7) | 0;
				hi = hi + Math.imul(ah4, bh7) | 0;
				lo = lo + Math.imul(al3, bl8) | 0;
				mid = mid + Math.imul(al3, bh8) | 0;
				mid = mid + Math.imul(ah3, bl8) | 0;
				hi = hi + Math.imul(ah3, bh8) | 0;
				lo = lo + Math.imul(al2, bl9) | 0;
				mid = mid + Math.imul(al2, bh9) | 0;
				mid = mid + Math.imul(ah2, bl9) | 0;
				hi = hi + Math.imul(ah2, bh9) | 0;
				var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
				w11 &= 67108863;
				lo = Math.imul(al9, bl3);
				mid = Math.imul(al9, bh3);
				mid = mid + Math.imul(ah9, bl3) | 0;
				hi = Math.imul(ah9, bh3);
				lo = lo + Math.imul(al8, bl4) | 0;
				mid = mid + Math.imul(al8, bh4) | 0;
				mid = mid + Math.imul(ah8, bl4) | 0;
				hi = hi + Math.imul(ah8, bh4) | 0;
				lo = lo + Math.imul(al7, bl5) | 0;
				mid = mid + Math.imul(al7, bh5) | 0;
				mid = mid + Math.imul(ah7, bl5) | 0;
				hi = hi + Math.imul(ah7, bh5) | 0;
				lo = lo + Math.imul(al6, bl6) | 0;
				mid = mid + Math.imul(al6, bh6) | 0;
				mid = mid + Math.imul(ah6, bl6) | 0;
				hi = hi + Math.imul(ah6, bh6) | 0;
				lo = lo + Math.imul(al5, bl7) | 0;
				mid = mid + Math.imul(al5, bh7) | 0;
				mid = mid + Math.imul(ah5, bl7) | 0;
				hi = hi + Math.imul(ah5, bh7) | 0;
				lo = lo + Math.imul(al4, bl8) | 0;
				mid = mid + Math.imul(al4, bh8) | 0;
				mid = mid + Math.imul(ah4, bl8) | 0;
				hi = hi + Math.imul(ah4, bh8) | 0;
				lo = lo + Math.imul(al3, bl9) | 0;
				mid = mid + Math.imul(al3, bh9) | 0;
				mid = mid + Math.imul(ah3, bl9) | 0;
				hi = hi + Math.imul(ah3, bh9) | 0;
				var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
				w12 &= 67108863;
				lo = Math.imul(al9, bl4);
				mid = Math.imul(al9, bh4);
				mid = mid + Math.imul(ah9, bl4) | 0;
				hi = Math.imul(ah9, bh4);
				lo = lo + Math.imul(al8, bl5) | 0;
				mid = mid + Math.imul(al8, bh5) | 0;
				mid = mid + Math.imul(ah8, bl5) | 0;
				hi = hi + Math.imul(ah8, bh5) | 0;
				lo = lo + Math.imul(al7, bl6) | 0;
				mid = mid + Math.imul(al7, bh6) | 0;
				mid = mid + Math.imul(ah7, bl6) | 0;
				hi = hi + Math.imul(ah7, bh6) | 0;
				lo = lo + Math.imul(al6, bl7) | 0;
				mid = mid + Math.imul(al6, bh7) | 0;
				mid = mid + Math.imul(ah6, bl7) | 0;
				hi = hi + Math.imul(ah6, bh7) | 0;
				lo = lo + Math.imul(al5, bl8) | 0;
				mid = mid + Math.imul(al5, bh8) | 0;
				mid = mid + Math.imul(ah5, bl8) | 0;
				hi = hi + Math.imul(ah5, bh8) | 0;
				lo = lo + Math.imul(al4, bl9) | 0;
				mid = mid + Math.imul(al4, bh9) | 0;
				mid = mid + Math.imul(ah4, bl9) | 0;
				hi = hi + Math.imul(ah4, bh9) | 0;
				var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
				w13 &= 67108863;
				lo = Math.imul(al9, bl5);
				mid = Math.imul(al9, bh5);
				mid = mid + Math.imul(ah9, bl5) | 0;
				hi = Math.imul(ah9, bh5);
				lo = lo + Math.imul(al8, bl6) | 0;
				mid = mid + Math.imul(al8, bh6) | 0;
				mid = mid + Math.imul(ah8, bl6) | 0;
				hi = hi + Math.imul(ah8, bh6) | 0;
				lo = lo + Math.imul(al7, bl7) | 0;
				mid = mid + Math.imul(al7, bh7) | 0;
				mid = mid + Math.imul(ah7, bl7) | 0;
				hi = hi + Math.imul(ah7, bh7) | 0;
				lo = lo + Math.imul(al6, bl8) | 0;
				mid = mid + Math.imul(al6, bh8) | 0;
				mid = mid + Math.imul(ah6, bl8) | 0;
				hi = hi + Math.imul(ah6, bh8) | 0;
				lo = lo + Math.imul(al5, bl9) | 0;
				mid = mid + Math.imul(al5, bh9) | 0;
				mid = mid + Math.imul(ah5, bl9) | 0;
				hi = hi + Math.imul(ah5, bh9) | 0;
				var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
				w14 &= 67108863;
				lo = Math.imul(al9, bl6);
				mid = Math.imul(al9, bh6);
				mid = mid + Math.imul(ah9, bl6) | 0;
				hi = Math.imul(ah9, bh6);
				lo = lo + Math.imul(al8, bl7) | 0;
				mid = mid + Math.imul(al8, bh7) | 0;
				mid = mid + Math.imul(ah8, bl7) | 0;
				hi = hi + Math.imul(ah8, bh7) | 0;
				lo = lo + Math.imul(al7, bl8) | 0;
				mid = mid + Math.imul(al7, bh8) | 0;
				mid = mid + Math.imul(ah7, bl8) | 0;
				hi = hi + Math.imul(ah7, bh8) | 0;
				lo = lo + Math.imul(al6, bl9) | 0;
				mid = mid + Math.imul(al6, bh9) | 0;
				mid = mid + Math.imul(ah6, bl9) | 0;
				hi = hi + Math.imul(ah6, bh9) | 0;
				var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
				w15 &= 67108863;
				lo = Math.imul(al9, bl7);
				mid = Math.imul(al9, bh7);
				mid = mid + Math.imul(ah9, bl7) | 0;
				hi = Math.imul(ah9, bh7);
				lo = lo + Math.imul(al8, bl8) | 0;
				mid = mid + Math.imul(al8, bh8) | 0;
				mid = mid + Math.imul(ah8, bl8) | 0;
				hi = hi + Math.imul(ah8, bh8) | 0;
				lo = lo + Math.imul(al7, bl9) | 0;
				mid = mid + Math.imul(al7, bh9) | 0;
				mid = mid + Math.imul(ah7, bl9) | 0;
				hi = hi + Math.imul(ah7, bh9) | 0;
				var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
				w16 &= 67108863;
				lo = Math.imul(al9, bl8);
				mid = Math.imul(al9, bh8);
				mid = mid + Math.imul(ah9, bl8) | 0;
				hi = Math.imul(ah9, bh8);
				lo = lo + Math.imul(al8, bl9) | 0;
				mid = mid + Math.imul(al8, bh9) | 0;
				mid = mid + Math.imul(ah8, bl9) | 0;
				hi = hi + Math.imul(ah8, bh9) | 0;
				var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
				w17 &= 67108863;
				lo = Math.imul(al9, bl9);
				mid = Math.imul(al9, bh9);
				mid = mid + Math.imul(ah9, bl9) | 0;
				hi = Math.imul(ah9, bh9);
				var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
				c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
				w18 &= 67108863;
				o[0] = w0;
				o[1] = w1;
				o[2] = w2;
				o[3] = w3;
				o[4] = w4;
				o[5] = w5;
				o[6] = w6;
				o[7] = w7;
				o[8] = w8;
				o[9] = w9;
				o[10] = w10;
				o[11] = w11;
				o[12] = w12;
				o[13] = w13;
				o[14] = w14;
				o[15] = w15;
				o[16] = w16;
				o[17] = w17;
				o[18] = w18;
				if (c !== 0) {
					o[19] = c;
					out.length++;
				}
				return out;
			};
			if (!Math.imul) comb10MulTo = smallMulTo;
			function bigMulTo(self, num, out) {
				out.negative = num.negative ^ self.negative;
				out.length = self.length + num.length;
				var carry = 0;
				var hncarry = 0;
				for (var k = 0; k < out.length - 1; k++) {
					var ncarry = hncarry;
					hncarry = 0;
					var rword = carry & 67108863;
					var maxJ = Math.min(k, num.length - 1);
					for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
						var i = k - j;
						var r = (self.words[i] | 0) * (num.words[j] | 0);
						var lo = r & 67108863;
						ncarry = ncarry + (r / 67108864 | 0) | 0;
						lo = lo + rword | 0;
						rword = lo & 67108863;
						ncarry = ncarry + (lo >>> 26) | 0;
						hncarry += ncarry >>> 26;
						ncarry &= 67108863;
					}
					out.words[k] = rword;
					carry = ncarry;
					ncarry = hncarry;
				}
				if (carry !== 0) out.words[k] = carry;
				else out.length--;
				return out._strip();
			}
			function jumboMulTo(self, num, out) {
				return bigMulTo(self, num, out);
			}
			BN.prototype.mulTo = function mulTo(num, out) {
				var res;
				var len = this.length + num.length;
				if (this.length === 10 && num.length === 10) res = comb10MulTo(this, num, out);
				else if (len < 63) res = smallMulTo(this, num, out);
				else if (len < 1024) res = bigMulTo(this, num, out);
				else res = jumboMulTo(this, num, out);
				return res;
			};
			function FFTM(x, y) {
				this.x = x;
				this.y = y;
			}
			FFTM.prototype.makeRBT = function makeRBT(N) {
				var t = new Array(N);
				var l = BN.prototype._countBits(N) - 1;
				for (var i = 0; i < N; i++) t[i] = this.revBin(i, l, N);
				return t;
			};
			FFTM.prototype.revBin = function revBin(x, l, N) {
				if (x === 0 || x === N - 1) return x;
				var rb = 0;
				for (var i = 0; i < l; i++) {
					rb |= (x & 1) << l - i - 1;
					x >>= 1;
				}
				return rb;
			};
			FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
				for (var i = 0; i < N; i++) {
					rtws[i] = rws[rbt[i]];
					itws[i] = iws[rbt[i]];
				}
			};
			FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
				this.permute(rbt, rws, iws, rtws, itws, N);
				for (var s = 1; s < N; s <<= 1) {
					var l = s << 1;
					var rtwdf = Math.cos(2 * Math.PI / l);
					var itwdf = Math.sin(2 * Math.PI / l);
					for (var p = 0; p < N; p += l) {
						var rtwdf_ = rtwdf;
						var itwdf_ = itwdf;
						for (var j = 0; j < s; j++) {
							var re = rtws[p + j];
							var ie = itws[p + j];
							var ro = rtws[p + j + s];
							var io = itws[p + j + s];
							var rx = rtwdf_ * ro - itwdf_ * io;
							io = rtwdf_ * io + itwdf_ * ro;
							ro = rx;
							rtws[p + j] = re + ro;
							itws[p + j] = ie + io;
							rtws[p + j + s] = re - ro;
							itws[p + j + s] = ie - io;
							if (j !== l) {
								rx = rtwdf * rtwdf_ - itwdf * itwdf_;
								itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
								rtwdf_ = rx;
							}
						}
					}
				}
			};
			FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
				var N = Math.max(m, n) | 1;
				var odd = N & 1;
				var i = 0;
				for (N = N / 2 | 0; N; N = N >>> 1) i++;
				return 1 << i + 1 + odd;
			};
			FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
				if (N <= 1) return;
				for (var i = 0; i < N / 2; i++) {
					var t = rws[i];
					rws[i] = rws[N - i - 1];
					rws[N - i - 1] = t;
					t = iws[i];
					iws[i] = -iws[N - i - 1];
					iws[N - i - 1] = -t;
				}
			};
			FFTM.prototype.normalize13b = function normalize13b(ws, N) {
				var carry = 0;
				for (var i = 0; i < N / 2; i++) {
					var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
					ws[i] = w & 67108863;
					if (w < 67108864) carry = 0;
					else carry = w / 67108864 | 0;
				}
				return ws;
			};
			FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
				var carry = 0;
				for (var i = 0; i < len; i++) {
					carry = carry + (ws[i] | 0);
					rws[2 * i] = carry & 8191;
					carry = carry >>> 13;
					rws[2 * i + 1] = carry & 8191;
					carry = carry >>> 13;
				}
				for (i = 2 * len; i < N; ++i) rws[i] = 0;
				assert(carry === 0);
				assert((carry & -8192) === 0);
			};
			FFTM.prototype.stub = function stub(N) {
				var ph = new Array(N);
				for (var i = 0; i < N; i++) ph[i] = 0;
				return ph;
			};
			FFTM.prototype.mulp = function mulp(x, y, out) {
				var N = 2 * this.guessLen13b(x.length, y.length);
				var rbt = this.makeRBT(N);
				var _ = this.stub(N);
				var rws = new Array(N);
				var rwst = new Array(N);
				var iwst = new Array(N);
				var nrws = new Array(N);
				var nrwst = new Array(N);
				var niwst = new Array(N);
				var rmws = out.words;
				rmws.length = N;
				this.convert13b(x.words, x.length, rws, N);
				this.convert13b(y.words, y.length, nrws, N);
				this.transform(rws, _, rwst, iwst, N, rbt);
				this.transform(nrws, _, nrwst, niwst, N, rbt);
				for (var i = 0; i < N; i++) {
					var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
					iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
					rwst[i] = rx;
				}
				this.conjugate(rwst, iwst, N);
				this.transform(rwst, iwst, rmws, _, N, rbt);
				this.conjugate(rmws, _, N);
				this.normalize13b(rmws, N);
				out.negative = x.negative ^ y.negative;
				out.length = x.length + y.length;
				return out._strip();
			};
			BN.prototype.mul = function mul(num) {
				var out = new BN(null);
				out.words = new Array(this.length + num.length);
				return this.mulTo(num, out);
			};
			BN.prototype.mulf = function mulf(num) {
				var out = new BN(null);
				out.words = new Array(this.length + num.length);
				return jumboMulTo(this, num, out);
			};
			BN.prototype.imul = function imul(num) {
				return this.clone().mulTo(num, this);
			};
			BN.prototype.imuln = function imuln(num) {
				var isNegNum = num < 0;
				if (isNegNum) num = -num;
				assert(typeof num === "number");
				assert(num < 67108864);
				var carry = 0;
				for (var i = 0; i < this.length; i++) {
					var w = (this.words[i] | 0) * num;
					var lo = (w & 67108863) + (carry & 67108863);
					carry >>= 26;
					carry += w / 67108864 | 0;
					carry += lo >>> 26;
					this.words[i] = lo & 67108863;
				}
				if (carry !== 0) {
					this.words[i] = carry;
					this.length++;
				}
				this.length = num === 0 ? 1 : this.length;
				return isNegNum ? this.ineg() : this;
			};
			BN.prototype.muln = function muln(num) {
				return this.clone().imuln(num);
			};
			BN.prototype.sqr = function sqr() {
				return this.mul(this);
			};
			BN.prototype.isqr = function isqr() {
				return this.imul(this.clone());
			};
			BN.prototype.pow = function pow(num) {
				var w = toBitArray(num);
				if (w.length === 0) return new BN(1);
				var res = this;
				for (var i = 0; i < w.length; i++, res = res.sqr()) if (w[i] !== 0) break;
				if (++i < w.length) for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
					if (w[i] === 0) continue;
					res = res.mul(q);
				}
				return res;
			};
			BN.prototype.iushln = function iushln(bits) {
				assert(typeof bits === "number" && bits >= 0);
				var r = bits % 26;
				var s = (bits - r) / 26;
				var carryMask = 67108863 >>> 26 - r << 26 - r;
				var i;
				if (r !== 0) {
					var carry = 0;
					for (i = 0; i < this.length; i++) {
						var newCarry = this.words[i] & carryMask;
						var c = (this.words[i] | 0) - newCarry << r;
						this.words[i] = c | carry;
						carry = newCarry >>> 26 - r;
					}
					if (carry) {
						this.words[i] = carry;
						this.length++;
					}
				}
				if (s !== 0) {
					for (i = this.length - 1; i >= 0; i--) this.words[i + s] = this.words[i];
					for (i = 0; i < s; i++) this.words[i] = 0;
					this.length += s;
				}
				return this._strip();
			};
			BN.prototype.ishln = function ishln(bits) {
				assert(this.negative === 0);
				return this.iushln(bits);
			};
			BN.prototype.iushrn = function iushrn(bits, hint, extended) {
				assert(typeof bits === "number" && bits >= 0);
				var h;
				if (hint) h = (hint - hint % 26) / 26;
				else h = 0;
				var r = bits % 26;
				var s = Math.min((bits - r) / 26, this.length);
				var mask = 67108863 ^ 67108863 >>> r << r;
				var maskedWords = extended;
				h -= s;
				h = Math.max(0, h);
				if (maskedWords) {
					for (var i = 0; i < s; i++) maskedWords.words[i] = this.words[i];
					maskedWords.length = s;
				}
				if (s === 0) {} else if (this.length > s) {
					this.length -= s;
					for (i = 0; i < this.length; i++) this.words[i] = this.words[i + s];
				} else {
					this.words[0] = 0;
					this.length = 1;
				}
				var carry = 0;
				for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
					var word = this.words[i] | 0;
					this.words[i] = carry << 26 - r | word >>> r;
					carry = word & mask;
				}
				if (maskedWords && carry !== 0) maskedWords.words[maskedWords.length++] = carry;
				if (this.length === 0) {
					this.words[0] = 0;
					this.length = 1;
				}
				return this._strip();
			};
			BN.prototype.ishrn = function ishrn(bits, hint, extended) {
				assert(this.negative === 0);
				return this.iushrn(bits, hint, extended);
			};
			BN.prototype.shln = function shln(bits) {
				return this.clone().ishln(bits);
			};
			BN.prototype.ushln = function ushln(bits) {
				return this.clone().iushln(bits);
			};
			BN.prototype.shrn = function shrn(bits) {
				return this.clone().ishrn(bits);
			};
			BN.prototype.ushrn = function ushrn(bits) {
				return this.clone().iushrn(bits);
			};
			BN.prototype.testn = function testn(bit) {
				assert(typeof bit === "number" && bit >= 0);
				var r = bit % 26;
				var s = (bit - r) / 26;
				var q = 1 << r;
				if (this.length <= s) return false;
				return !!(this.words[s] & q);
			};
			BN.prototype.imaskn = function imaskn(bits) {
				assert(typeof bits === "number" && bits >= 0);
				var r = bits % 26;
				var s = (bits - r) / 26;
				assert(this.negative === 0, "imaskn works only with positive numbers");
				if (this.length <= s) return this;
				if (r !== 0) s++;
				this.length = Math.min(s, this.length);
				if (r !== 0) {
					var mask = 67108863 ^ 67108863 >>> r << r;
					this.words[this.length - 1] &= mask;
				}
				return this._strip();
			};
			BN.prototype.maskn = function maskn(bits) {
				return this.clone().imaskn(bits);
			};
			BN.prototype.iaddn = function iaddn(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				if (num < 0) return this.isubn(-num);
				if (this.negative !== 0) {
					if (this.length === 1 && (this.words[0] | 0) <= num) {
						this.words[0] = num - (this.words[0] | 0);
						this.negative = 0;
						return this;
					}
					this.negative = 0;
					this.isubn(num);
					this.negative = 1;
					return this;
				}
				return this._iaddn(num);
			};
			BN.prototype._iaddn = function _iaddn(num) {
				this.words[0] += num;
				for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
					this.words[i] -= 67108864;
					if (i === this.length - 1) this.words[i + 1] = 1;
					else this.words[i + 1]++;
				}
				this.length = Math.max(this.length, i + 1);
				return this;
			};
			BN.prototype.isubn = function isubn(num) {
				assert(typeof num === "number");
				assert(num < 67108864);
				if (num < 0) return this.iaddn(-num);
				if (this.negative !== 0) {
					this.negative = 0;
					this.iaddn(num);
					this.negative = 1;
					return this;
				}
				this.words[0] -= num;
				if (this.length === 1 && this.words[0] < 0) {
					this.words[0] = -this.words[0];
					this.negative = 1;
				} else for (var i = 0; i < this.length && this.words[i] < 0; i++) {
					this.words[i] += 67108864;
					this.words[i + 1] -= 1;
				}
				return this._strip();
			};
			BN.prototype.addn = function addn(num) {
				return this.clone().iaddn(num);
			};
			BN.prototype.subn = function subn(num) {
				return this.clone().isubn(num);
			};
			BN.prototype.iabs = function iabs() {
				this.negative = 0;
				return this;
			};
			BN.prototype.abs = function abs() {
				return this.clone().iabs();
			};
			BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
				var len = num.length + shift;
				var i;
				this._expand(len);
				var w;
				var carry = 0;
				for (i = 0; i < num.length; i++) {
					w = (this.words[i + shift] | 0) + carry;
					var right = (num.words[i] | 0) * mul;
					w -= right & 67108863;
					carry = (w >> 26) - (right / 67108864 | 0);
					this.words[i + shift] = w & 67108863;
				}
				for (; i < this.length - shift; i++) {
					w = (this.words[i + shift] | 0) + carry;
					carry = w >> 26;
					this.words[i + shift] = w & 67108863;
				}
				if (carry === 0) return this._strip();
				assert(carry === -1);
				carry = 0;
				for (i = 0; i < this.length; i++) {
					w = -(this.words[i] | 0) + carry;
					carry = w >> 26;
					this.words[i] = w & 67108863;
				}
				this.negative = 1;
				return this._strip();
			};
			BN.prototype._wordDiv = function _wordDiv(num, mode) {
				var shift = this.length - num.length;
				var a = this.clone();
				var b = num;
				var bhi = b.words[b.length - 1] | 0;
				shift = 26 - this._countBits(bhi);
				if (shift !== 0) {
					b = b.ushln(shift);
					a.iushln(shift);
					bhi = b.words[b.length - 1] | 0;
				}
				var m = a.length - b.length;
				var q;
				if (mode !== "mod") {
					q = new BN(null);
					q.length = m + 1;
					q.words = new Array(q.length);
					for (var i = 0; i < q.length; i++) q.words[i] = 0;
				}
				var diff = a.clone()._ishlnsubmul(b, 1, m);
				if (diff.negative === 0) {
					a = diff;
					if (q) q.words[m] = 1;
				}
				for (var j = m - 1; j >= 0; j--) {
					var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
					qj = Math.min(qj / bhi | 0, 67108863);
					a._ishlnsubmul(b, qj, j);
					while (a.negative !== 0) {
						qj--;
						a.negative = 0;
						a._ishlnsubmul(b, 1, j);
						if (!a.isZero()) a.negative ^= 1;
					}
					if (q) q.words[j] = qj;
				}
				if (q) q._strip();
				a._strip();
				if (mode !== "div" && shift !== 0) a.iushrn(shift);
				return {
					div: q || null,
					mod: a
				};
			};
			BN.prototype.divmod = function divmod(num, mode, positive) {
				assert(!num.isZero());
				if (this.isZero()) return {
					div: new BN(0),
					mod: new BN(0)
				};
				var div, mod, res;
				if (this.negative !== 0 && num.negative === 0) {
					res = this.neg().divmod(num, mode);
					if (mode !== "mod") div = res.div.neg();
					if (mode !== "div") {
						mod = res.mod.neg();
						if (positive && mod.negative !== 0) mod.iadd(num);
					}
					return {
						div,
						mod
					};
				}
				if (this.negative === 0 && num.negative !== 0) {
					res = this.divmod(num.neg(), mode);
					if (mode !== "mod") div = res.div.neg();
					return {
						div,
						mod: res.mod
					};
				}
				if ((this.negative & num.negative) !== 0) {
					res = this.neg().divmod(num.neg(), mode);
					if (mode !== "div") {
						mod = res.mod.neg();
						if (positive && mod.negative !== 0) mod.isub(num);
					}
					return {
						div: res.div,
						mod
					};
				}
				if (num.length > this.length || this.cmp(num) < 0) return {
					div: new BN(0),
					mod: this
				};
				if (num.length === 1) {
					if (mode === "div") return {
						div: this.divn(num.words[0]),
						mod: null
					};
					if (mode === "mod") return {
						div: null,
						mod: new BN(this.modrn(num.words[0]))
					};
					return {
						div: this.divn(num.words[0]),
						mod: new BN(this.modrn(num.words[0]))
					};
				}
				return this._wordDiv(num, mode);
			};
			BN.prototype.div = function div(num) {
				return this.divmod(num, "div", false).div;
			};
			BN.prototype.mod = function mod(num) {
				return this.divmod(num, "mod", false).mod;
			};
			BN.prototype.umod = function umod(num) {
				return this.divmod(num, "mod", true).mod;
			};
			BN.prototype.divRound = function divRound(num) {
				var dm = this.divmod(num);
				if (dm.mod.isZero()) return dm.div;
				var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
				var half = num.ushrn(1);
				var r2 = num.andln(1);
				var cmp = mod.cmp(half);
				if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
				return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
			};
			BN.prototype.modrn = function modrn(num) {
				var isNegNum = num < 0;
				if (isNegNum) num = -num;
				assert(num <= 67108863);
				var p = (1 << 26) % num;
				var acc = 0;
				for (var i = this.length - 1; i >= 0; i--) acc = (p * acc + (this.words[i] | 0)) % num;
				return isNegNum ? -acc : acc;
			};
			BN.prototype.modn = function modn(num) {
				return this.modrn(num);
			};
			BN.prototype.idivn = function idivn(num) {
				var isNegNum = num < 0;
				if (isNegNum) num = -num;
				assert(num <= 67108863);
				var carry = 0;
				for (var i = this.length - 1; i >= 0; i--) {
					var w = (this.words[i] | 0) + carry * 67108864;
					this.words[i] = w / num | 0;
					carry = w % num;
				}
				this._strip();
				return isNegNum ? this.ineg() : this;
			};
			BN.prototype.divn = function divn(num) {
				return this.clone().idivn(num);
			};
			BN.prototype.egcd = function egcd(p) {
				assert(p.negative === 0);
				assert(!p.isZero());
				var x = this;
				var y = p.clone();
				if (x.negative !== 0) x = x.umod(p);
				else x = x.clone();
				var A = new BN(1);
				var B = new BN(0);
				var C = new BN(0);
				var D = new BN(1);
				var g = 0;
				while (x.isEven() && y.isEven()) {
					x.iushrn(1);
					y.iushrn(1);
					++g;
				}
				var yp = y.clone();
				var xp = x.clone();
				while (!x.isZero()) {
					for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
					if (i > 0) {
						x.iushrn(i);
						while (i-- > 0) {
							if (A.isOdd() || B.isOdd()) {
								A.iadd(yp);
								B.isub(xp);
							}
							A.iushrn(1);
							B.iushrn(1);
						}
					}
					for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
					if (j > 0) {
						y.iushrn(j);
						while (j-- > 0) {
							if (C.isOdd() || D.isOdd()) {
								C.iadd(yp);
								D.isub(xp);
							}
							C.iushrn(1);
							D.iushrn(1);
						}
					}
					if (x.cmp(y) >= 0) {
						x.isub(y);
						A.isub(C);
						B.isub(D);
					} else {
						y.isub(x);
						C.isub(A);
						D.isub(B);
					}
				}
				return {
					a: C,
					b: D,
					gcd: y.iushln(g)
				};
			};
			BN.prototype._invmp = function _invmp(p) {
				assert(p.negative === 0);
				assert(!p.isZero());
				var a = this;
				var b = p.clone();
				if (a.negative !== 0) a = a.umod(p);
				else a = a.clone();
				var x1 = new BN(1);
				var x2 = new BN(0);
				var delta = b.clone();
				while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
					for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);
					if (i > 0) {
						a.iushrn(i);
						while (i-- > 0) {
							if (x1.isOdd()) x1.iadd(delta);
							x1.iushrn(1);
						}
					}
					for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);
					if (j > 0) {
						b.iushrn(j);
						while (j-- > 0) {
							if (x2.isOdd()) x2.iadd(delta);
							x2.iushrn(1);
						}
					}
					if (a.cmp(b) >= 0) {
						a.isub(b);
						x1.isub(x2);
					} else {
						b.isub(a);
						x2.isub(x1);
					}
				}
				var res;
				if (a.cmpn(1) === 0) res = x1;
				else res = x2;
				if (res.cmpn(0) < 0) res.iadd(p);
				return res;
			};
			BN.prototype.gcd = function gcd(num) {
				if (this.isZero()) return num.abs();
				if (num.isZero()) return this.abs();
				var a = this.clone();
				var b = num.clone();
				a.negative = 0;
				b.negative = 0;
				for (var shift = 0; a.isEven() && b.isEven(); shift++) {
					a.iushrn(1);
					b.iushrn(1);
				}
				do {
					while (a.isEven()) a.iushrn(1);
					while (b.isEven()) b.iushrn(1);
					var r = a.cmp(b);
					if (r < 0) {
						var t = a;
						a = b;
						b = t;
					} else if (r === 0 || b.cmpn(1) === 0) break;
					a.isub(b);
				} while (true);
				return b.iushln(shift);
			};
			BN.prototype.invm = function invm(num) {
				return this.egcd(num).a.umod(num);
			};
			BN.prototype.isEven = function isEven() {
				return (this.words[0] & 1) === 0;
			};
			BN.prototype.isOdd = function isOdd() {
				return (this.words[0] & 1) === 1;
			};
			BN.prototype.andln = function andln(num) {
				return this.words[0] & num;
			};
			BN.prototype.bincn = function bincn(bit) {
				assert(typeof bit === "number");
				var r = bit % 26;
				var s = (bit - r) / 26;
				var q = 1 << r;
				if (this.length <= s) {
					this._expand(s + 1);
					this.words[s] |= q;
					return this;
				}
				var carry = q;
				for (var i = s; carry !== 0 && i < this.length; i++) {
					var w = this.words[i] | 0;
					w += carry;
					carry = w >>> 26;
					w &= 67108863;
					this.words[i] = w;
				}
				if (carry !== 0) {
					this.words[i] = carry;
					this.length++;
				}
				return this;
			};
			BN.prototype.isZero = function isZero() {
				return this.length === 1 && this.words[0] === 0;
			};
			BN.prototype.cmpn = function cmpn(num) {
				var negative = num < 0;
				if (this.negative !== 0 && !negative) return -1;
				if (this.negative === 0 && negative) return 1;
				this._strip();
				var res;
				if (this.length > 1) res = 1;
				else {
					if (negative) num = -num;
					assert(num <= 67108863, "Number is too big");
					var w = this.words[0] | 0;
					res = w === num ? 0 : w < num ? -1 : 1;
				}
				if (this.negative !== 0) return -res | 0;
				return res;
			};
			BN.prototype.cmp = function cmp(num) {
				if (this.negative !== 0 && num.negative === 0) return -1;
				if (this.negative === 0 && num.negative !== 0) return 1;
				var res = this.ucmp(num);
				if (this.negative !== 0) return -res | 0;
				return res;
			};
			BN.prototype.ucmp = function ucmp(num) {
				if (this.length > num.length) return 1;
				if (this.length < num.length) return -1;
				var res = 0;
				for (var i = this.length - 1; i >= 0; i--) {
					var a = this.words[i] | 0;
					var b = num.words[i] | 0;
					if (a === b) continue;
					if (a < b) res = -1;
					else if (a > b) res = 1;
					break;
				}
				return res;
			};
			BN.prototype.gtn = function gtn(num) {
				return this.cmpn(num) === 1;
			};
			BN.prototype.gt = function gt(num) {
				return this.cmp(num) === 1;
			};
			BN.prototype.gten = function gten(num) {
				return this.cmpn(num) >= 0;
			};
			BN.prototype.gte = function gte(num) {
				return this.cmp(num) >= 0;
			};
			BN.prototype.ltn = function ltn(num) {
				return this.cmpn(num) === -1;
			};
			BN.prototype.lt = function lt(num) {
				return this.cmp(num) === -1;
			};
			BN.prototype.lten = function lten(num) {
				return this.cmpn(num) <= 0;
			};
			BN.prototype.lte = function lte(num) {
				return this.cmp(num) <= 0;
			};
			BN.prototype.eqn = function eqn(num) {
				return this.cmpn(num) === 0;
			};
			BN.prototype.eq = function eq(num) {
				return this.cmp(num) === 0;
			};
			BN.red = function red(num) {
				return new Red(num);
			};
			BN.prototype.toRed = function toRed(ctx) {
				assert(!this.red, "Already a number in reduction context");
				assert(this.negative === 0, "red works only with positives");
				return ctx.convertTo(this)._forceRed(ctx);
			};
			BN.prototype.fromRed = function fromRed() {
				assert(this.red, "fromRed works only with numbers in reduction context");
				return this.red.convertFrom(this);
			};
			BN.prototype._forceRed = function _forceRed(ctx) {
				this.red = ctx;
				return this;
			};
			BN.prototype.forceRed = function forceRed(ctx) {
				assert(!this.red, "Already a number in reduction context");
				return this._forceRed(ctx);
			};
			BN.prototype.redAdd = function redAdd(num) {
				assert(this.red, "redAdd works only with red numbers");
				return this.red.add(this, num);
			};
			BN.prototype.redIAdd = function redIAdd(num) {
				assert(this.red, "redIAdd works only with red numbers");
				return this.red.iadd(this, num);
			};
			BN.prototype.redSub = function redSub(num) {
				assert(this.red, "redSub works only with red numbers");
				return this.red.sub(this, num);
			};
			BN.prototype.redISub = function redISub(num) {
				assert(this.red, "redISub works only with red numbers");
				return this.red.isub(this, num);
			};
			BN.prototype.redShl = function redShl(num) {
				assert(this.red, "redShl works only with red numbers");
				return this.red.shl(this, num);
			};
			BN.prototype.redMul = function redMul(num) {
				assert(this.red, "redMul works only with red numbers");
				this.red._verify2(this, num);
				return this.red.mul(this, num);
			};
			BN.prototype.redIMul = function redIMul(num) {
				assert(this.red, "redMul works only with red numbers");
				this.red._verify2(this, num);
				return this.red.imul(this, num);
			};
			BN.prototype.redSqr = function redSqr() {
				assert(this.red, "redSqr works only with red numbers");
				this.red._verify1(this);
				return this.red.sqr(this);
			};
			BN.prototype.redISqr = function redISqr() {
				assert(this.red, "redISqr works only with red numbers");
				this.red._verify1(this);
				return this.red.isqr(this);
			};
			BN.prototype.redSqrt = function redSqrt() {
				assert(this.red, "redSqrt works only with red numbers");
				this.red._verify1(this);
				return this.red.sqrt(this);
			};
			BN.prototype.redInvm = function redInvm() {
				assert(this.red, "redInvm works only with red numbers");
				this.red._verify1(this);
				return this.red.invm(this);
			};
			BN.prototype.redNeg = function redNeg() {
				assert(this.red, "redNeg works only with red numbers");
				this.red._verify1(this);
				return this.red.neg(this);
			};
			BN.prototype.redPow = function redPow(num) {
				assert(this.red && !num.red, "redPow(normalNum)");
				this.red._verify1(this);
				return this.red.pow(this, num);
			};
			var primes = {
				k256: null,
				p224: null,
				p192: null,
				p25519: null
			};
			function MPrime(name, p) {
				this.name = name;
				this.p = new BN(p, 16);
				this.n = this.p.bitLength();
				this.k = new BN(1).iushln(this.n).isub(this.p);
				this.tmp = this._tmp();
			}
			MPrime.prototype._tmp = function _tmp() {
				var tmp = new BN(null);
				tmp.words = new Array(Math.ceil(this.n / 13));
				return tmp;
			};
			MPrime.prototype.ireduce = function ireduce(num) {
				var r = num;
				var rlen;
				do {
					this.split(r, this.tmp);
					r = this.imulK(r);
					r = r.iadd(this.tmp);
					rlen = r.bitLength();
				} while (rlen > this.n);
				var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
				if (cmp === 0) {
					r.words[0] = 0;
					r.length = 1;
				} else if (cmp > 0) r.isub(this.p);
				else if (r.strip !== void 0) r.strip();
				else r._strip();
				return r;
			};
			MPrime.prototype.split = function split(input, out) {
				input.iushrn(this.n, 0, out);
			};
			MPrime.prototype.imulK = function imulK(num) {
				return num.imul(this.k);
			};
			function K256() {
				MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
			}
			inherits(K256, MPrime);
			K256.prototype.split = function split(input, output) {
				var mask = 4194303;
				var outLen = Math.min(input.length, 9);
				for (var i = 0; i < outLen; i++) output.words[i] = input.words[i];
				output.length = outLen;
				if (input.length <= 9) {
					input.words[0] = 0;
					input.length = 1;
					return;
				}
				var prev = input.words[9];
				output.words[output.length++] = prev & mask;
				for (i = 10; i < input.length; i++) {
					var next = input.words[i] | 0;
					input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
					prev = next;
				}
				prev >>>= 22;
				input.words[i - 10] = prev;
				if (prev === 0 && input.length > 10) input.length -= 10;
				else input.length -= 9;
			};
			K256.prototype.imulK = function imulK(num) {
				num.words[num.length] = 0;
				num.words[num.length + 1] = 0;
				num.length += 2;
				var lo = 0;
				for (var i = 0; i < num.length; i++) {
					var w = num.words[i] | 0;
					lo += w * 977;
					num.words[i] = lo & 67108863;
					lo = w * 64 + (lo / 67108864 | 0);
				}
				if (num.words[num.length - 1] === 0) {
					num.length--;
					if (num.words[num.length - 1] === 0) num.length--;
				}
				return num;
			};
			function P224() {
				MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
			}
			inherits(P224, MPrime);
			function P192() {
				MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
			}
			inherits(P192, MPrime);
			function P25519() {
				MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
			}
			inherits(P25519, MPrime);
			P25519.prototype.imulK = function imulK(num) {
				var carry = 0;
				for (var i = 0; i < num.length; i++) {
					var hi = (num.words[i] | 0) * 19 + carry;
					var lo = hi & 67108863;
					hi >>>= 26;
					num.words[i] = lo;
					carry = hi;
				}
				if (carry !== 0) num.words[num.length++] = carry;
				return num;
			};
			BN._prime = function prime(name) {
				if (primes[name]) return primes[name];
				var prime;
				if (name === "k256") prime = new K256();
				else if (name === "p224") prime = new P224();
				else if (name === "p192") prime = new P192();
				else if (name === "p25519") prime = new P25519();
				else throw new Error("Unknown prime " + name);
				primes[name] = prime;
				return prime;
			};
			function Red(m) {
				if (typeof m === "string") {
					var prime = BN._prime(m);
					this.m = prime.p;
					this.prime = prime;
				} else {
					assert(m.gtn(1), "modulus must be greater than 1");
					this.m = m;
					this.prime = null;
				}
			}
			Red.prototype._verify1 = function _verify1(a) {
				assert(a.negative === 0, "red works only with positives");
				assert(a.red, "red works only with red numbers");
			};
			Red.prototype._verify2 = function _verify2(a, b) {
				assert((a.negative | b.negative) === 0, "red works only with positives");
				assert(a.red && a.red === b.red, "red works only with red numbers");
			};
			Red.prototype.imod = function imod(a) {
				if (this.prime) return this.prime.ireduce(a)._forceRed(this);
				move(a, a.umod(this.m)._forceRed(this));
				return a;
			};
			Red.prototype.neg = function neg(a) {
				if (a.isZero()) return a.clone();
				return this.m.sub(a)._forceRed(this);
			};
			Red.prototype.add = function add(a, b) {
				this._verify2(a, b);
				var res = a.add(b);
				if (res.cmp(this.m) >= 0) res.isub(this.m);
				return res._forceRed(this);
			};
			Red.prototype.iadd = function iadd(a, b) {
				this._verify2(a, b);
				var res = a.iadd(b);
				if (res.cmp(this.m) >= 0) res.isub(this.m);
				return res;
			};
			Red.prototype.sub = function sub(a, b) {
				this._verify2(a, b);
				var res = a.sub(b);
				if (res.cmpn(0) < 0) res.iadd(this.m);
				return res._forceRed(this);
			};
			Red.prototype.isub = function isub(a, b) {
				this._verify2(a, b);
				var res = a.isub(b);
				if (res.cmpn(0) < 0) res.iadd(this.m);
				return res;
			};
			Red.prototype.shl = function shl(a, num) {
				this._verify1(a);
				return this.imod(a.ushln(num));
			};
			Red.prototype.imul = function imul(a, b) {
				this._verify2(a, b);
				return this.imod(a.imul(b));
			};
			Red.prototype.mul = function mul(a, b) {
				this._verify2(a, b);
				return this.imod(a.mul(b));
			};
			Red.prototype.isqr = function isqr(a) {
				return this.imul(a, a.clone());
			};
			Red.prototype.sqr = function sqr(a) {
				return this.mul(a, a);
			};
			Red.prototype.sqrt = function sqrt(a) {
				if (a.isZero()) return a.clone();
				var mod3 = this.m.andln(3);
				assert(mod3 % 2 === 1);
				if (mod3 === 3) {
					var pow = this.m.add(new BN(1)).iushrn(2);
					return this.pow(a, pow);
				}
				var q = this.m.subn(1);
				var s = 0;
				while (!q.isZero() && q.andln(1) === 0) {
					s++;
					q.iushrn(1);
				}
				assert(!q.isZero());
				var one = new BN(1).toRed(this);
				var nOne = one.redNeg();
				var lpow = this.m.subn(1).iushrn(1);
				var z = this.m.bitLength();
				z = new BN(2 * z * z).toRed(this);
				while (this.pow(z, lpow).cmp(nOne) !== 0) z.redIAdd(nOne);
				var c = this.pow(z, q);
				var r = this.pow(a, q.addn(1).iushrn(1));
				var t = this.pow(a, q);
				var m = s;
				while (t.cmp(one) !== 0) {
					var tmp = t;
					for (var i = 0; tmp.cmp(one) !== 0; i++) tmp = tmp.redSqr();
					assert(i < m);
					var b = this.pow(c, new BN(1).iushln(m - i - 1));
					r = r.redMul(b);
					c = b.redSqr();
					t = t.redMul(c);
					m = i;
				}
				return r;
			};
			Red.prototype.invm = function invm(a) {
				var inv = a._invmp(this.m);
				if (inv.negative !== 0) {
					inv.negative = 0;
					return this.imod(inv).redNeg();
				} else return this.imod(inv);
			};
			Red.prototype.pow = function pow(a, num) {
				if (num.isZero()) return new BN(1).toRed(this);
				if (num.cmpn(1) === 0) return a.clone();
				var windowSize = 4;
				var wnd = new Array(1 << windowSize);
				wnd[0] = new BN(1).toRed(this);
				wnd[1] = a;
				for (var i = 2; i < wnd.length; i++) wnd[i] = this.mul(wnd[i - 1], a);
				var res = wnd[0];
				var current = 0;
				var currentLen = 0;
				var start = num.bitLength() % 26;
				if (start === 0) start = 26;
				for (i = num.length - 1; i >= 0; i--) {
					var word = num.words[i];
					for (var j = start - 1; j >= 0; j--) {
						var bit = word >> j & 1;
						if (res !== wnd[0]) res = this.sqr(res);
						if (bit === 0 && current === 0) {
							currentLen = 0;
							continue;
						}
						current <<= 1;
						current |= bit;
						currentLen++;
						if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
						res = this.mul(res, wnd[current]);
						currentLen = 0;
						current = 0;
					}
					start = 26;
				}
				return res;
			};
			Red.prototype.convertTo = function convertTo(num) {
				var r = num.umod(this.m);
				return r === num ? r.clone() : r;
			};
			Red.prototype.convertFrom = function convertFrom(num) {
				var res = num.clone();
				res.red = null;
				return res;
			};
			BN.mont = function mont(num) {
				return new Mont(num);
			};
			function Mont(m) {
				Red.call(this, m);
				this.shift = this.m.bitLength();
				if (this.shift % 26 !== 0) this.shift += 26 - this.shift % 26;
				this.r = new BN(1).iushln(this.shift);
				this.r2 = this.imod(this.r.sqr());
				this.rinv = this.r._invmp(this.m);
				this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
				this.minv = this.minv.umod(this.r);
				this.minv = this.r.sub(this.minv);
			}
			inherits(Mont, Red);
			Mont.prototype.convertTo = function convertTo(num) {
				return this.imod(num.ushln(this.shift));
			};
			Mont.prototype.convertFrom = function convertFrom(num) {
				var r = this.imod(num.mul(this.rinv));
				r.red = null;
				return r;
			};
			Mont.prototype.imul = function imul(a, b) {
				if (a.isZero() || b.isZero()) {
					a.words[0] = 0;
					a.length = 1;
					return a;
				}
				var t = a.imul(b);
				var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
				var u = t.isub(c).iushrn(this.shift);
				var res = u;
				if (u.cmp(this.m) >= 0) res = u.isub(this.m);
				else if (u.cmpn(0) < 0) res = u.iadd(this.m);
				return res._forceRed(this);
			};
			Mont.prototype.mul = function mul(a, b) {
				if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
				var t = a.mul(b);
				var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
				var u = t.isub(c).iushrn(this.shift);
				var res = u;
				if (u.cmp(this.m) >= 0) res = u.isub(this.m);
				else if (u.cmpn(0) < 0) res = u.iadd(this.m);
				return res._forceRed(this);
			};
			Mont.prototype.invm = function invm(a) {
				return this.imod(a._invmp(this.m).mul(this.r2))._forceRed(this);
			};
		})(typeof module === "undefined" || module, exports);
	}));
	//#endregion
	//#region __vite-browser-external
	var require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = {};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/api.js
	var require_api = /* @__PURE__ */ __commonJSMin(((exports) => {
		var asn1 = require_asn1$1();
		var inherits = require_inherits_browser();
		var api = exports;
		api.define = function define(name, body) {
			return new Entity(name, body);
		};
		function Entity(name, body) {
			this.name = name;
			this.body = body;
			this.decoders = {};
			this.encoders = {};
		}
		Entity.prototype._createNamed = function createNamed(base) {
			var named;
			try {
				named = require___vite_browser_external().runInThisContext("(function " + this.name + "(entity) {\n  this._initNamed(entity);\n})");
			} catch (e) {
				named = function(entity) {
					this._initNamed(entity);
				};
			}
			inherits(named, base);
			named.prototype._initNamed = function initnamed(entity) {
				base.call(this, entity);
			};
			return new named(this);
		};
		Entity.prototype._getDecoder = function _getDecoder(enc) {
			enc = enc || "der";
			if (!this.decoders.hasOwnProperty(enc)) this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
			return this.decoders[enc];
		};
		Entity.prototype.decode = function decode(data, enc, options) {
			return this._getDecoder(enc).decode(data, options);
		};
		Entity.prototype._getEncoder = function _getEncoder(enc) {
			enc = enc || "der";
			if (!this.encoders.hasOwnProperty(enc)) this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
			return this.encoders[enc];
		};
		Entity.prototype.encode = function encode(data, enc, reporter) {
			return this._getEncoder(enc).encode(data, reporter);
		};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/base/reporter.js
	var require_reporter = /* @__PURE__ */ __commonJSMin(((exports) => {
		var inherits = require_inherits_browser();
		function Reporter(options) {
			this._reporterState = {
				obj: null,
				path: [],
				options: options || {},
				errors: []
			};
		}
		exports.Reporter = Reporter;
		Reporter.prototype.isError = function isError(obj) {
			return obj instanceof ReporterError;
		};
		Reporter.prototype.save = function save() {
			var state = this._reporterState;
			return {
				obj: state.obj,
				pathLen: state.path.length
			};
		};
		Reporter.prototype.restore = function restore(data) {
			var state = this._reporterState;
			state.obj = data.obj;
			state.path = state.path.slice(0, data.pathLen);
		};
		Reporter.prototype.enterKey = function enterKey(key) {
			return this._reporterState.path.push(key);
		};
		Reporter.prototype.exitKey = function exitKey(index) {
			var state = this._reporterState;
			state.path = state.path.slice(0, index - 1);
		};
		Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
			var state = this._reporterState;
			this.exitKey(index);
			if (state.obj !== null) state.obj[key] = value;
		};
		Reporter.prototype.path = function path() {
			return this._reporterState.path.join("/");
		};
		Reporter.prototype.enterObject = function enterObject() {
			var state = this._reporterState;
			var prev = state.obj;
			state.obj = {};
			return prev;
		};
		Reporter.prototype.leaveObject = function leaveObject(prev) {
			var state = this._reporterState;
			var now = state.obj;
			state.obj = prev;
			return now;
		};
		Reporter.prototype.error = function error(msg) {
			var err;
			var state = this._reporterState;
			var inherited = msg instanceof ReporterError;
			if (inherited) err = msg;
			else err = new ReporterError(state.path.map(function(elem) {
				return "[" + JSON.stringify(elem) + "]";
			}).join(""), msg.message || msg, msg.stack);
			if (!state.options.partial) throw err;
			if (!inherited) state.errors.push(err);
			return err;
		};
		Reporter.prototype.wrapResult = function wrapResult(result) {
			var state = this._reporterState;
			if (!state.options.partial) return result;
			return {
				result: this.isError(result) ? null : result,
				errors: state.errors
			};
		};
		function ReporterError(path, msg) {
			this.path = path;
			this.rethrow(msg);
		}
		inherits(ReporterError, Error);
		ReporterError.prototype.rethrow = function rethrow(msg) {
			this.message = msg + " at: " + (this.path || "(shallow)");
			if (Error.captureStackTrace) Error.captureStackTrace(this, ReporterError);
			if (!this.stack) try {
				throw new Error(this.message);
			} catch (e) {
				this.stack = e.stack;
			}
			return this;
		};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/base/buffer.js
	var require_buffer = /* @__PURE__ */ __commonJSMin(((exports) => {
		var inherits = require_inherits_browser();
		var Reporter = require_base$2().Reporter;
		var Buffer = require_dist().Buffer;
		function DecoderBuffer(base, options) {
			Reporter.call(this, options);
			if (!Buffer.isBuffer(base)) {
				this.error("Input not Buffer");
				return;
			}
			this.base = base;
			this.offset = 0;
			this.length = base.length;
		}
		inherits(DecoderBuffer, Reporter);
		exports.DecoderBuffer = DecoderBuffer;
		DecoderBuffer.prototype.save = function save() {
			return {
				offset: this.offset,
				reporter: Reporter.prototype.save.call(this)
			};
		};
		DecoderBuffer.prototype.restore = function restore(save) {
			var res = new DecoderBuffer(this.base);
			res.offset = save.offset;
			res.length = this.offset;
			this.offset = save.offset;
			Reporter.prototype.restore.call(this, save.reporter);
			return res;
		};
		DecoderBuffer.prototype.isEmpty = function isEmpty() {
			return this.offset === this.length;
		};
		DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
			if (this.offset + 1 <= this.length) return this.base.readUInt8(this.offset++, true);
			else return this.error(fail || "DecoderBuffer overrun");
		};
		DecoderBuffer.prototype.skip = function skip(bytes, fail) {
			if (!(this.offset + bytes <= this.length)) return this.error(fail || "DecoderBuffer overrun");
			var res = new DecoderBuffer(this.base);
			res._reporterState = this._reporterState;
			res.offset = this.offset;
			res.length = this.offset + bytes;
			this.offset += bytes;
			return res;
		};
		DecoderBuffer.prototype.raw = function raw(save) {
			return this.base.slice(save ? save.offset : this.offset, this.length);
		};
		function EncoderBuffer(value, reporter) {
			if (Array.isArray(value)) {
				this.length = 0;
				this.value = value.map(function(item) {
					if (!(item instanceof EncoderBuffer)) item = new EncoderBuffer(item, reporter);
					this.length += item.length;
					return item;
				}, this);
			} else if (typeof value === "number") {
				if (!(0 <= value && value <= 255)) return reporter.error("non-byte EncoderBuffer value");
				this.value = value;
				this.length = 1;
			} else if (typeof value === "string") {
				this.value = value;
				this.length = Buffer.byteLength(value);
			} else if (Buffer.isBuffer(value)) {
				this.value = value;
				this.length = value.length;
			} else return reporter.error("Unsupported type: " + typeof value);
		}
		exports.EncoderBuffer = EncoderBuffer;
		EncoderBuffer.prototype.join = function join(out, offset) {
			if (!out) out = new Buffer(this.length);
			if (!offset) offset = 0;
			if (this.length === 0) return out;
			if (Array.isArray(this.value)) this.value.forEach(function(item) {
				item.join(out, offset);
				offset += item.length;
			});
			else {
				if (typeof this.value === "number") out[offset] = this.value;
				else if (typeof this.value === "string") out.write(this.value, offset);
				else if (Buffer.isBuffer(this.value)) this.value.copy(out, offset);
				offset += this.length;
			}
			return out;
		};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/base/node.js
	var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Reporter = require_base$2().Reporter;
		var EncoderBuffer = require_base$2().EncoderBuffer;
		var DecoderBuffer = require_base$2().DecoderBuffer;
		var assert = require_minimalistic_assert();
		var tags = [
			"seq",
			"seqof",
			"set",
			"setof",
			"objid",
			"bool",
			"gentime",
			"utctime",
			"null_",
			"enum",
			"int",
			"objDesc",
			"bitstr",
			"bmpstr",
			"charstr",
			"genstr",
			"graphstr",
			"ia5str",
			"iso646str",
			"numstr",
			"octstr",
			"printstr",
			"t61str",
			"unistr",
			"utf8str",
			"videostr"
		];
		var methods = [
			"key",
			"obj",
			"use",
			"optional",
			"explicit",
			"implicit",
			"def",
			"choice",
			"any",
			"contains"
		].concat(tags);
		var overrided = [
			"_peekTag",
			"_decodeTag",
			"_use",
			"_decodeStr",
			"_decodeObjid",
			"_decodeTime",
			"_decodeNull",
			"_decodeInt",
			"_decodeBool",
			"_decodeList",
			"_encodeComposite",
			"_encodeStr",
			"_encodeObjid",
			"_encodeTime",
			"_encodeNull",
			"_encodeInt",
			"_encodeBool"
		];
		function Node(enc, parent) {
			var state = {};
			this._baseState = state;
			state.enc = enc;
			state.parent = parent || null;
			state.children = null;
			state.tag = null;
			state.args = null;
			state.reverseArgs = null;
			state.choice = null;
			state.optional = false;
			state.any = false;
			state.obj = false;
			state.use = null;
			state.useDecoder = null;
			state.key = null;
			state["default"] = null;
			state.explicit = null;
			state.implicit = null;
			state.contains = null;
			if (!state.parent) {
				state.children = [];
				this._wrap();
			}
		}
		module.exports = Node;
		var stateProps = [
			"enc",
			"parent",
			"children",
			"tag",
			"args",
			"reverseArgs",
			"choice",
			"optional",
			"any",
			"obj",
			"use",
			"alteredUse",
			"key",
			"default",
			"explicit",
			"implicit",
			"contains"
		];
		Node.prototype.clone = function clone() {
			var state = this._baseState;
			var cstate = {};
			stateProps.forEach(function(prop) {
				cstate[prop] = state[prop];
			});
			var res = new this.constructor(cstate.parent);
			res._baseState = cstate;
			return res;
		};
		Node.prototype._wrap = function wrap() {
			var state = this._baseState;
			methods.forEach(function(method) {
				this[method] = function _wrappedMethod() {
					var clone = new this.constructor(this);
					state.children.push(clone);
					return clone[method].apply(clone, arguments);
				};
			}, this);
		};
		Node.prototype._init = function init(body) {
			var state = this._baseState;
			assert(state.parent === null);
			body.call(this);
			state.children = state.children.filter(function(child) {
				return child._baseState.parent === this;
			}, this);
			assert.equal(state.children.length, 1, "Root node can have only one child");
		};
		Node.prototype._useArgs = function useArgs(args) {
			var state = this._baseState;
			var children = args.filter(function(arg) {
				return arg instanceof this.constructor;
			}, this);
			args = args.filter(function(arg) {
				return !(arg instanceof this.constructor);
			}, this);
			if (children.length !== 0) {
				assert(state.children === null);
				state.children = children;
				children.forEach(function(child) {
					child._baseState.parent = this;
				}, this);
			}
			if (args.length !== 0) {
				assert(state.args === null);
				state.args = args;
				state.reverseArgs = args.map(function(arg) {
					if (typeof arg !== "object" || arg.constructor !== Object) return arg;
					var res = {};
					Object.keys(arg).forEach(function(key) {
						if (key == (key | 0)) key |= 0;
						var value = arg[key];
						res[value] = key;
					});
					return res;
				});
			}
		};
		overrided.forEach(function(method) {
			Node.prototype[method] = function _overrided() {
				var state = this._baseState;
				throw new Error(method + " not implemented for encoding: " + state.enc);
			};
		});
		tags.forEach(function(tag) {
			Node.prototype[tag] = function _tagMethod() {
				var state = this._baseState;
				var args = Array.prototype.slice.call(arguments);
				assert(state.tag === null);
				state.tag = tag;
				this._useArgs(args);
				return this;
			};
		});
		Node.prototype.use = function use(item) {
			assert(item);
			var state = this._baseState;
			assert(state.use === null);
			state.use = item;
			return this;
		};
		Node.prototype.optional = function optional() {
			var state = this._baseState;
			state.optional = true;
			return this;
		};
		Node.prototype.def = function def(val) {
			var state = this._baseState;
			assert(state["default"] === null);
			state["default"] = val;
			state.optional = true;
			return this;
		};
		Node.prototype.explicit = function explicit(num) {
			var state = this._baseState;
			assert(state.explicit === null && state.implicit === null);
			state.explicit = num;
			return this;
		};
		Node.prototype.implicit = function implicit(num) {
			var state = this._baseState;
			assert(state.explicit === null && state.implicit === null);
			state.implicit = num;
			return this;
		};
		Node.prototype.obj = function obj() {
			var state = this._baseState;
			var args = Array.prototype.slice.call(arguments);
			state.obj = true;
			if (args.length !== 0) this._useArgs(args);
			return this;
		};
		Node.prototype.key = function key(newKey) {
			var state = this._baseState;
			assert(state.key === null);
			state.key = newKey;
			return this;
		};
		Node.prototype.any = function any() {
			var state = this._baseState;
			state.any = true;
			return this;
		};
		Node.prototype.choice = function choice(obj) {
			var state = this._baseState;
			assert(state.choice === null);
			state.choice = obj;
			this._useArgs(Object.keys(obj).map(function(key) {
				return obj[key];
			}));
			return this;
		};
		Node.prototype.contains = function contains(item) {
			var state = this._baseState;
			assert(state.use === null);
			state.contains = item;
			return this;
		};
		Node.prototype._decode = function decode(input, options) {
			var state = this._baseState;
			if (state.parent === null) return input.wrapResult(state.children[0]._decode(input, options));
			var result = state["default"];
			var present = true;
			var prevKey = null;
			if (state.key !== null) prevKey = input.enterKey(state.key);
			if (state.optional) {
				var tag = null;
				if (state.explicit !== null) tag = state.explicit;
				else if (state.implicit !== null) tag = state.implicit;
				else if (state.tag !== null) tag = state.tag;
				if (tag === null && !state.any) {
					var save = input.save();
					try {
						if (state.choice === null) this._decodeGeneric(state.tag, input, options);
						else this._decodeChoice(input, options);
						present = true;
					} catch (e) {
						present = false;
					}
					input.restore(save);
				} else {
					present = this._peekTag(input, tag, state.any);
					if (input.isError(present)) return present;
				}
			}
			var prevObj;
			if (state.obj && present) prevObj = input.enterObject();
			if (present) {
				if (state.explicit !== null) {
					var explicit = this._decodeTag(input, state.explicit);
					if (input.isError(explicit)) return explicit;
					input = explicit;
				}
				var start = input.offset;
				if (state.use === null && state.choice === null) {
					if (state.any) var save = input.save();
					var body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any);
					if (input.isError(body)) return body;
					if (state.any) result = input.raw(save);
					else input = body;
				}
				if (options && options.track && state.tag !== null) options.track(input.path(), start, input.length, "tagged");
				if (options && options.track && state.tag !== null) options.track(input.path(), input.offset, input.length, "content");
				if (state.any) result = result;
				else if (state.choice === null) result = this._decodeGeneric(state.tag, input, options);
				else result = this._decodeChoice(input, options);
				if (input.isError(result)) return result;
				if (!state.any && state.choice === null && state.children !== null) state.children.forEach(function decodeChildren(child) {
					child._decode(input, options);
				});
				if (state.contains && (state.tag === "octstr" || state.tag === "bitstr")) {
					var data = new DecoderBuffer(result);
					result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);
				}
			}
			if (state.obj && present) result = input.leaveObject(prevObj);
			if (state.key !== null && (result !== null || present === true)) input.leaveKey(prevKey, state.key, result);
			else if (prevKey !== null) input.exitKey(prevKey);
			return result;
		};
		Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
			var state = this._baseState;
			if (tag === "seq" || tag === "set") return null;
			if (tag === "seqof" || tag === "setof") return this._decodeList(input, tag, state.args[0], options);
			else if (/str$/.test(tag)) return this._decodeStr(input, tag, options);
			else if (tag === "objid" && state.args) return this._decodeObjid(input, state.args[0], state.args[1], options);
			else if (tag === "objid") return this._decodeObjid(input, null, null, options);
			else if (tag === "gentime" || tag === "utctime") return this._decodeTime(input, tag, options);
			else if (tag === "null_") return this._decodeNull(input, options);
			else if (tag === "bool") return this._decodeBool(input, options);
			else if (tag === "objDesc") return this._decodeStr(input, tag, options);
			else if (tag === "int" || tag === "enum") return this._decodeInt(input, state.args && state.args[0], options);
			if (state.use !== null) return this._getUse(state.use, input._reporterState.obj)._decode(input, options);
			else return input.error("unknown tag: " + tag);
		};
		Node.prototype._getUse = function _getUse(entity, obj) {
			var state = this._baseState;
			state.useDecoder = this._use(entity, obj);
			assert(state.useDecoder._baseState.parent === null);
			state.useDecoder = state.useDecoder._baseState.children[0];
			if (state.implicit !== state.useDecoder._baseState.implicit) {
				state.useDecoder = state.useDecoder.clone();
				state.useDecoder._baseState.implicit = state.implicit;
			}
			return state.useDecoder;
		};
		Node.prototype._decodeChoice = function decodeChoice(input, options) {
			var state = this._baseState;
			var result = null;
			var match = false;
			Object.keys(state.choice).some(function(key) {
				var save = input.save();
				var node = state.choice[key];
				try {
					var value = node._decode(input, options);
					if (input.isError(value)) return false;
					result = {
						type: key,
						value
					};
					match = true;
				} catch (e) {
					input.restore(save);
					return false;
				}
				return true;
			}, this);
			if (!match) return input.error("Choice not matched");
			return result;
		};
		Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
			return new EncoderBuffer(data, this.reporter);
		};
		Node.prototype._encode = function encode(data, reporter, parent) {
			var state = this._baseState;
			if (state["default"] !== null && state["default"] === data) return;
			var result = this._encodeValue(data, reporter, parent);
			if (result === void 0) return;
			if (this._skipDefault(result, reporter, parent)) return;
			return result;
		};
		Node.prototype._encodeValue = function encode(data, reporter, parent) {
			var state = this._baseState;
			if (state.parent === null) return state.children[0]._encode(data, reporter || new Reporter());
			var result = null;
			this.reporter = reporter;
			if (state.optional && data === void 0) if (state["default"] !== null) data = state["default"];
			else return;
			var content = null;
			var primitive = false;
			if (state.any) result = this._createEncoderBuffer(data);
			else if (state.choice) result = this._encodeChoice(data, reporter);
			else if (state.contains) {
				content = this._getUse(state.contains, parent)._encode(data, reporter);
				primitive = true;
			} else if (state.children) {
				content = state.children.map(function(child) {
					if (child._baseState.tag === "null_") return child._encode(null, reporter, data);
					if (child._baseState.key === null) return reporter.error("Child should have a key");
					var prevKey = reporter.enterKey(child._baseState.key);
					if (typeof data !== "object") return reporter.error("Child expected, but input is not object");
					var res = child._encode(data[child._baseState.key], reporter, data);
					reporter.leaveKey(prevKey);
					return res;
				}, this).filter(function(child) {
					return child;
				});
				content = this._createEncoderBuffer(content);
			} else if (state.tag === "seqof" || state.tag === "setof") {
				if (!(state.args && state.args.length === 1)) return reporter.error("Too many args for : " + state.tag);
				if (!Array.isArray(data)) return reporter.error("seqof/setof, but data is not Array");
				var child = this.clone();
				child._baseState.implicit = null;
				content = this._createEncoderBuffer(data.map(function(item) {
					var state = this._baseState;
					return this._getUse(state.args[0], data)._encode(item, reporter);
				}, child));
			} else if (state.use !== null) result = this._getUse(state.use, parent)._encode(data, reporter);
			else {
				content = this._encodePrimitive(state.tag, data);
				primitive = true;
			}
			var result;
			if (!state.any && state.choice === null) {
				var tag = state.implicit !== null ? state.implicit : state.tag;
				var cls = state.implicit === null ? "universal" : "context";
				if (tag === null) {
					if (state.use === null) reporter.error("Tag could be omitted only for .use()");
				} else if (state.use === null) result = this._encodeComposite(tag, primitive, cls, content);
			}
			if (state.explicit !== null) result = this._encodeComposite(state.explicit, false, "context", result);
			return result;
		};
		Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
			var state = this._baseState;
			var node = state.choice[data.type];
			if (!node) assert(false, data.type + " not found in " + JSON.stringify(Object.keys(state.choice)));
			return node._encode(data.value, reporter);
		};
		Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
			var state = this._baseState;
			if (/str$/.test(tag)) return this._encodeStr(data, tag);
			else if (tag === "objid" && state.args) return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);
			else if (tag === "objid") return this._encodeObjid(data, null, null);
			else if (tag === "gentime" || tag === "utctime") return this._encodeTime(data, tag);
			else if (tag === "null_") return this._encodeNull();
			else if (tag === "int" || tag === "enum") return this._encodeInt(data, state.args && state.reverseArgs[0]);
			else if (tag === "bool") return this._encodeBool(data);
			else if (tag === "objDesc") return this._encodeStr(data, tag);
			else throw new Error("Unsupported tag: " + tag);
		};
		Node.prototype._isNumstr = function isNumstr(str) {
			return /^[0-9 ]*$/.test(str);
		};
		Node.prototype._isPrintstr = function isPrintstr(str) {
			return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
		};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/base/index.js
	var require_base$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var base = exports;
		base.Reporter = require_reporter().Reporter;
		base.DecoderBuffer = require_buffer().DecoderBuffer;
		base.EncoderBuffer = require_buffer().EncoderBuffer;
		base.Node = require_node();
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/constants/der.js
	var require_der$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var constants = require_constants$2();
		exports.tagClass = {
			0: "universal",
			1: "application",
			2: "context",
			3: "private"
		};
		exports.tagClassByName = constants._reverse(exports.tagClass);
		exports.tag = {
			0: "end",
			1: "bool",
			2: "int",
			3: "bitstr",
			4: "octstr",
			5: "null_",
			6: "objid",
			7: "objDesc",
			8: "external",
			9: "real",
			10: "enum",
			11: "embed",
			12: "utf8str",
			13: "relativeOid",
			16: "seq",
			17: "set",
			18: "numstr",
			19: "printstr",
			20: "t61str",
			21: "videostr",
			22: "ia5str",
			23: "utctime",
			24: "gentime",
			25: "graphstr",
			26: "iso646str",
			27: "genstr",
			28: "unistr",
			29: "charstr",
			30: "bmpstr"
		};
		exports.tagByName = constants._reverse(exports.tag);
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/constants/index.js
	var require_constants$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var constants = exports;
		constants._reverse = function reverse(map) {
			var res = {};
			Object.keys(map).forEach(function(key) {
				if ((key | 0) == key) key = key | 0;
				var value = map[key];
				res[value] = key;
			});
			return res;
		};
		constants.der = require_der$2();
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/decoders/der.js
	var require_der$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var asn1 = require_asn1$1();
		var base = asn1.base;
		var bignum = asn1.bignum;
		var der = asn1.constants.der;
		function DERDecoder(entity) {
			this.enc = "der";
			this.name = entity.name;
			this.entity = entity;
			this.tree = new DERNode();
			this.tree._init(entity.body);
		}
		module.exports = DERDecoder;
		DERDecoder.prototype.decode = function decode(data, options) {
			if (!(data instanceof base.DecoderBuffer)) data = new base.DecoderBuffer(data, options);
			return this.tree._decode(data, options);
		};
		function DERNode(parent) {
			base.Node.call(this, "der", parent);
		}
		inherits(DERNode, base.Node);
		DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
			if (buffer.isEmpty()) return false;
			var state = buffer.save();
			var decodedTag = derDecodeTag(buffer, "Failed to peek tag: \"" + tag + "\"");
			if (buffer.isError(decodedTag)) return decodedTag;
			buffer.restore(state);
			return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + "of" === tag || any;
		};
		DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
			var decodedTag = derDecodeTag(buffer, "Failed to decode tag of \"" + tag + "\"");
			if (buffer.isError(decodedTag)) return decodedTag;
			var len = derDecodeLen(buffer, decodedTag.primitive, "Failed to get length of \"" + tag + "\"");
			if (buffer.isError(len)) return len;
			if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + "of" !== tag) return buffer.error("Failed to match tag: \"" + tag + "\"");
			if (decodedTag.primitive || len !== null) return buffer.skip(len, "Failed to match body of: \"" + tag + "\"");
			var state = buffer.save();
			var res = this._skipUntilEnd(buffer, "Failed to skip indefinite length body: \"" + this.tag + "\"");
			if (buffer.isError(res)) return res;
			len = buffer.offset - state.offset;
			buffer.restore(state);
			return buffer.skip(len, "Failed to match body of: \"" + tag + "\"");
		};
		DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
			while (true) {
				var tag = derDecodeTag(buffer, fail);
				if (buffer.isError(tag)) return tag;
				var len = derDecodeLen(buffer, tag.primitive, fail);
				if (buffer.isError(len)) return len;
				var res;
				if (tag.primitive || len !== null) res = buffer.skip(len);
				else res = this._skipUntilEnd(buffer, fail);
				if (buffer.isError(res)) return res;
				if (tag.tagStr === "end") break;
			}
		};
		DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, options) {
			var result = [];
			while (!buffer.isEmpty()) {
				var possibleEnd = this._peekTag(buffer, "end");
				if (buffer.isError(possibleEnd)) return possibleEnd;
				var res = decoder.decode(buffer, "der", options);
				if (buffer.isError(res) && possibleEnd) break;
				result.push(res);
			}
			return result;
		};
		DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
			if (tag === "bitstr") {
				var unused = buffer.readUInt8();
				if (buffer.isError(unused)) return unused;
				return {
					unused,
					data: buffer.raw()
				};
			} else if (tag === "bmpstr") {
				var raw = buffer.raw();
				if (raw.length % 2 === 1) return buffer.error("Decoding of string type: bmpstr length mismatch");
				var str = "";
				for (var i = 0; i < raw.length / 2; i++) str += String.fromCharCode(raw.readUInt16BE(i * 2));
				return str;
			} else if (tag === "numstr") {
				var numstr = buffer.raw().toString("ascii");
				if (!this._isNumstr(numstr)) return buffer.error("Decoding of string type: numstr unsupported characters");
				return numstr;
			} else if (tag === "octstr") return buffer.raw();
			else if (tag === "objDesc") return buffer.raw();
			else if (tag === "printstr") {
				var printstr = buffer.raw().toString("ascii");
				if (!this._isPrintstr(printstr)) return buffer.error("Decoding of string type: printstr unsupported characters");
				return printstr;
			} else if (/str$/.test(tag)) return buffer.raw().toString();
			else return buffer.error("Decoding of string type: " + tag + " unsupported");
		};
		DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
			var result;
			var identifiers = [];
			var ident = 0;
			while (!buffer.isEmpty()) {
				var subident = buffer.readUInt8();
				ident <<= 7;
				ident |= subident & 127;
				if ((subident & 128) === 0) {
					identifiers.push(ident);
					ident = 0;
				}
			}
			if (subident & 128) identifiers.push(ident);
			var first = identifiers[0] / 40 | 0;
			var second = identifiers[0] % 40;
			if (relative) result = identifiers;
			else result = [first, second].concat(identifiers.slice(1));
			if (values) {
				var tmp = values[result.join(" ")];
				if (tmp === void 0) tmp = values[result.join(".")];
				if (tmp !== void 0) result = tmp;
			}
			return result;
		};
		DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
			var str = buffer.raw().toString();
			if (tag === "gentime") {
				var year = str.slice(0, 4) | 0;
				var mon = str.slice(4, 6) | 0;
				var day = str.slice(6, 8) | 0;
				var hour = str.slice(8, 10) | 0;
				var min = str.slice(10, 12) | 0;
				var sec = str.slice(12, 14) | 0;
			} else if (tag === "utctime") {
				var year = str.slice(0, 2) | 0;
				var mon = str.slice(2, 4) | 0;
				var day = str.slice(4, 6) | 0;
				var hour = str.slice(6, 8) | 0;
				var min = str.slice(8, 10) | 0;
				var sec = str.slice(10, 12) | 0;
				if (year < 70) year = 2e3 + year;
				else year = 1900 + year;
			} else return buffer.error("Decoding " + tag + " time is not supported yet");
			return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
		};
		DERNode.prototype._decodeNull = function decodeNull(buffer) {
			return null;
		};
		DERNode.prototype._decodeBool = function decodeBool(buffer) {
			var res = buffer.readUInt8();
			if (buffer.isError(res)) return res;
			else return res !== 0;
		};
		DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
			var res = new bignum(buffer.raw());
			if (values) res = values[res.toString(10)] || res;
			return res;
		};
		DERNode.prototype._use = function use(entity, obj) {
			if (typeof entity === "function") entity = entity(obj);
			return entity._getDecoder("der").tree;
		};
		function derDecodeTag(buf, fail) {
			var tag = buf.readUInt8(fail);
			if (buf.isError(tag)) return tag;
			var cls = der.tagClass[tag >> 6];
			var primitive = (tag & 32) === 0;
			if ((tag & 31) === 31) {
				var oct = tag;
				tag = 0;
				while ((oct & 128) === 128) {
					oct = buf.readUInt8(fail);
					if (buf.isError(oct)) return oct;
					tag <<= 7;
					tag |= oct & 127;
				}
			} else tag &= 31;
			var tagStr = der.tag[tag];
			return {
				cls,
				primitive,
				tag,
				tagStr
			};
		}
		function derDecodeLen(buf, primitive, fail) {
			var len = buf.readUInt8(fail);
			if (buf.isError(len)) return len;
			if (!primitive && len === 128) return null;
			if ((len & 128) === 0) return len;
			var num = len & 127;
			if (num > 4) return buf.error("length octect is too long");
			len = 0;
			for (var i = 0; i < num; i++) {
				len <<= 8;
				var j = buf.readUInt8(fail);
				if (buf.isError(j)) return j;
				len |= j;
			}
			return len;
		}
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/decoders/pem.js
	var require_pem$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Buffer = require_dist().Buffer;
		var DERDecoder = require_der$1();
		function PEMDecoder(entity) {
			DERDecoder.call(this, entity);
			this.enc = "pem";
		}
		inherits(PEMDecoder, DERDecoder);
		module.exports = PEMDecoder;
		PEMDecoder.prototype.decode = function decode(data, options) {
			var lines = data.toString().split(/[\r\n]+/g);
			var label = options.label.toUpperCase();
			var re = /^-----(BEGIN|END) ([^-]+)-----$/;
			var start = -1;
			var end = -1;
			for (var i = 0; i < lines.length; i++) {
				var match = lines[i].match(re);
				if (match === null) continue;
				if (match[2] !== label) continue;
				if (start === -1) {
					if (match[1] !== "BEGIN") break;
					start = i;
				} else {
					if (match[1] !== "END") break;
					end = i;
					break;
				}
			}
			if (start === -1 || end === -1) throw new Error("PEM section not found for: " + label);
			var base64 = lines.slice(start + 1, end).join("");
			base64.replace(/[^a-z0-9\+\/=]+/gi, "");
			var input = new Buffer(base64, "base64");
			return DERDecoder.prototype.decode.call(this, input, options);
		};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/decoders/index.js
	var require_decoders = /* @__PURE__ */ __commonJSMin(((exports) => {
		var decoders = exports;
		decoders.der = require_der$1();
		decoders.pem = require_pem$1();
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/encoders/der.js
	var require_der = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var Buffer = require_dist().Buffer;
		var asn1 = require_asn1$1();
		var base = asn1.base;
		var der = asn1.constants.der;
		function DEREncoder(entity) {
			this.enc = "der";
			this.name = entity.name;
			this.entity = entity;
			this.tree = new DERNode();
			this.tree._init(entity.body);
		}
		module.exports = DEREncoder;
		DEREncoder.prototype.encode = function encode(data, reporter) {
			return this.tree._encode(data, reporter).join();
		};
		function DERNode(parent) {
			base.Node.call(this, "der", parent);
		}
		inherits(DERNode, base.Node);
		DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) {
			var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
			if (content.length < 128) {
				var header = new Buffer(2);
				header[0] = encodedTag;
				header[1] = content.length;
				return this._createEncoderBuffer([header, content]);
			}
			var lenOctets = 1;
			for (var i = content.length; i >= 256; i >>= 8) lenOctets++;
			var header = new Buffer(2 + lenOctets);
			header[0] = encodedTag;
			header[1] = 128 | lenOctets;
			for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) header[i] = j & 255;
			return this._createEncoderBuffer([header, content]);
		};
		DERNode.prototype._encodeStr = function encodeStr(str, tag) {
			if (tag === "bitstr") return this._createEncoderBuffer([str.unused | 0, str.data]);
			else if (tag === "bmpstr") {
				var buf = new Buffer(str.length * 2);
				for (var i = 0; i < str.length; i++) buf.writeUInt16BE(str.charCodeAt(i), i * 2);
				return this._createEncoderBuffer(buf);
			} else if (tag === "numstr") {
				if (!this._isNumstr(str)) return this.reporter.error("Encoding of string type: numstr supports only digits and space");
				return this._createEncoderBuffer(str);
			} else if (tag === "printstr") {
				if (!this._isPrintstr(str)) return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");
				return this._createEncoderBuffer(str);
			} else if (/str$/.test(tag)) return this._createEncoderBuffer(str);
			else if (tag === "objDesc") return this._createEncoderBuffer(str);
			else return this.reporter.error("Encoding of string type: " + tag + " unsupported");
		};
		DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
			if (typeof id === "string") {
				if (!values) return this.reporter.error("string objid given, but no values map found");
				if (!values.hasOwnProperty(id)) return this.reporter.error("objid not found in values map");
				id = values[id].split(/[\s\.]+/g);
				for (var i = 0; i < id.length; i++) id[i] |= 0;
			} else if (Array.isArray(id)) {
				id = id.slice();
				for (var i = 0; i < id.length; i++) id[i] |= 0;
			}
			if (!Array.isArray(id)) return this.reporter.error("objid() should be either array or string, got: " + JSON.stringify(id));
			if (!relative) {
				if (id[1] >= 40) return this.reporter.error("Second objid identifier OOB");
				id.splice(0, 2, id[0] * 40 + id[1]);
			}
			var size = 0;
			for (var i = 0; i < id.length; i++) {
				var ident = id[i];
				for (size++; ident >= 128; ident >>= 7) size++;
			}
			var objid = new Buffer(size);
			var offset = objid.length - 1;
			for (var i = id.length - 1; i >= 0; i--) {
				var ident = id[i];
				objid[offset--] = ident & 127;
				while ((ident >>= 7) > 0) objid[offset--] = 128 | ident & 127;
			}
			return this._createEncoderBuffer(objid);
		};
		function two(num) {
			if (num < 10) return "0" + num;
			else return num;
		}
		DERNode.prototype._encodeTime = function encodeTime(time, tag) {
			var str;
			var date = new Date(time);
			if (tag === "gentime") str = [
				two(date.getFullYear()),
				two(date.getUTCMonth() + 1),
				two(date.getUTCDate()),
				two(date.getUTCHours()),
				two(date.getUTCMinutes()),
				two(date.getUTCSeconds()),
				"Z"
			].join("");
			else if (tag === "utctime") str = [
				two(date.getFullYear() % 100),
				two(date.getUTCMonth() + 1),
				two(date.getUTCDate()),
				two(date.getUTCHours()),
				two(date.getUTCMinutes()),
				two(date.getUTCSeconds()),
				"Z"
			].join("");
			else this.reporter.error("Encoding " + tag + " time is not supported yet");
			return this._encodeStr(str, "octstr");
		};
		DERNode.prototype._encodeNull = function encodeNull() {
			return this._createEncoderBuffer("");
		};
		DERNode.prototype._encodeInt = function encodeInt(num, values) {
			if (typeof num === "string") {
				if (!values) return this.reporter.error("String int or enum given, but no values map");
				if (!values.hasOwnProperty(num)) return this.reporter.error("Values map doesn't contain: " + JSON.stringify(num));
				num = values[num];
			}
			if (typeof num !== "number" && !Buffer.isBuffer(num)) {
				var numArray = num.toArray();
				if (!num.sign && numArray[0] & 128) numArray.unshift(0);
				num = new Buffer(numArray);
			}
			if (Buffer.isBuffer(num)) {
				var size = num.length;
				if (num.length === 0) size++;
				var out = new Buffer(size);
				num.copy(out);
				if (num.length === 0) out[0] = 0;
				return this._createEncoderBuffer(out);
			}
			if (num < 128) return this._createEncoderBuffer(num);
			if (num < 256) return this._createEncoderBuffer([0, num]);
			var size = 1;
			for (var i = num; i >= 256; i >>= 8) size++;
			var out = new Array(size);
			for (var i = out.length - 1; i >= 0; i--) {
				out[i] = num & 255;
				num >>= 8;
			}
			if (out[0] & 128) out.unshift(0);
			return this._createEncoderBuffer(new Buffer(out));
		};
		DERNode.prototype._encodeBool = function encodeBool(value) {
			return this._createEncoderBuffer(value ? 255 : 0);
		};
		DERNode.prototype._use = function use(entity, obj) {
			if (typeof entity === "function") entity = entity(obj);
			return entity._getEncoder("der").tree;
		};
		DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
			var state = this._baseState;
			var i;
			if (state["default"] === null) return false;
			var data = dataBuffer.join();
			if (state.defaultBuffer === void 0) state.defaultBuffer = this._encodeValue(state["default"], reporter, parent).join();
			if (data.length !== state.defaultBuffer.length) return false;
			for (i = 0; i < data.length; i++) if (data[i] !== state.defaultBuffer[i]) return false;
			return true;
		};
		function encodeTag(tag, primitive, cls, reporter) {
			var res;
			if (tag === "seqof") tag = "seq";
			else if (tag === "setof") tag = "set";
			if (der.tagByName.hasOwnProperty(tag)) res = der.tagByName[tag];
			else if (typeof tag === "number" && (tag | 0) === tag) res = tag;
			else return reporter.error("Unknown tag: " + tag);
			if (res >= 31) return reporter.error("Multi-octet tag encoding unsupported");
			if (!primitive) res |= 32;
			res |= der.tagClassByName[cls || "universal"] << 6;
			return res;
		}
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/encoders/pem.js
	var require_pem = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var inherits = require_inherits_browser();
		var DEREncoder = require_der();
		function PEMEncoder(entity) {
			DEREncoder.call(this, entity);
			this.enc = "pem";
		}
		inherits(PEMEncoder, DEREncoder);
		module.exports = PEMEncoder;
		PEMEncoder.prototype.encode = function encode(data, options) {
			var p = DEREncoder.prototype.encode.call(this, data).toString("base64");
			var out = ["-----BEGIN " + options.label + "-----"];
			for (var i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64));
			out.push("-----END " + options.label + "-----");
			return out.join("\n");
		};
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1/encoders/index.js
	var require_encoders = /* @__PURE__ */ __commonJSMin(((exports) => {
		var encoders = exports;
		encoders.der = require_der();
		encoders.pem = require_pem();
	}));
	//#endregion
	//#region ../../node_modules/asn1.js/lib/asn1.js
	var require_asn1$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var asn1 = exports;
		asn1.bignum = require_bn$2();
		asn1.define = require_api().define;
		asn1.base = require_base$2();
		asn1.constants = require_constants$2();
		asn1.decoders = require_decoders();
		asn1.encoders = require_encoders();
	}));
	//#endregion
	//#region ../../node_modules/parse-asn1/certificate.js
	var require_certificate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var asn = require_asn1$1();
		var Time = asn.define("Time", function() {
			this.choice({
				utcTime: this.utctime(),
				generalTime: this.gentime()
			});
		});
		var AttributeTypeValue = asn.define("AttributeTypeValue", function() {
			this.seq().obj(this.key("type").objid(), this.key("value").any());
		});
		var AlgorithmIdentifier = asn.define("AlgorithmIdentifier", function() {
			this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional());
		});
		var SubjectPublicKeyInfo = asn.define("SubjectPublicKeyInfo", function() {
			this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr());
		});
		var RelativeDistinguishedName = asn.define("RelativeDistinguishedName", function() {
			this.setof(AttributeTypeValue);
		});
		var RDNSequence = asn.define("RDNSequence", function() {
			this.seqof(RelativeDistinguishedName);
		});
		var Name = asn.define("Name", function() {
			this.choice({ rdnSequence: this.use(RDNSequence) });
		});
		var Validity = asn.define("Validity", function() {
			this.seq().obj(this.key("notBefore").use(Time), this.key("notAfter").use(Time));
		});
		var Extension = asn.define("Extension", function() {
			this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr());
		});
		var TBSCertificate = asn.define("TBSCertificate", function() {
			this.seq().obj(this.key("version").explicit(0)["int"]().optional(), this.key("serialNumber")["int"](), this.key("signature").use(AlgorithmIdentifier), this.key("issuer").use(Name), this.key("validity").use(Validity), this.key("subject").use(Name), this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(Extension).optional());
		});
		module.exports = asn.define("X509Certificate", function() {
			this.seq().obj(this.key("tbsCertificate").use(TBSCertificate), this.key("signatureAlgorithm").use(AlgorithmIdentifier), this.key("signatureValue").bitstr());
		});
	}));
	//#endregion
	//#region ../../node_modules/parse-asn1/asn1.js
	var require_asn1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var asn1 = require_asn1$1();
		exports.certificate = require_certificate();
		exports.RSAPrivateKey = asn1.define("RSAPrivateKey", function() {
			this.seq().obj(this.key("version")["int"](), this.key("modulus")["int"](), this.key("publicExponent")["int"](), this.key("privateExponent")["int"](), this.key("prime1")["int"](), this.key("prime2")["int"](), this.key("exponent1")["int"](), this.key("exponent2")["int"](), this.key("coefficient")["int"]());
		});
		exports.RSAPublicKey = asn1.define("RSAPublicKey", function() {
			this.seq().obj(this.key("modulus")["int"](), this.key("publicExponent")["int"]());
		});
		var AlgorithmIdentifier = asn1.define("AlgorithmIdentifier", function() {
			this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"]()).optional());
		});
		exports.PublicKey = asn1.define("SubjectPublicKeyInfo", function() {
			this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr());
		});
		exports.PrivateKey = asn1.define("PrivateKeyInfo", function() {
			this.seq().obj(this.key("version")["int"](), this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPrivateKey").octstr());
		});
		exports.EncryptedPrivateKey = asn1.define("EncryptedPrivateKeyInfo", function() {
			this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters")["int"]())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr());
		});
		exports.DSAPrivateKey = asn1.define("DSAPrivateKey", function() {
			this.seq().obj(this.key("version")["int"](), this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"](), this.key("pub_key")["int"](), this.key("priv_key")["int"]());
		});
		exports.DSAparam = asn1.define("DSAparam", function() {
			this["int"]();
		});
		var ECParameters = asn1.define("ECParameters", function() {
			this.choice({ namedCurve: this.objid() });
		});
		exports.ECPrivateKey = asn1.define("ECPrivateKey", function() {
			this.seq().obj(this.key("version")["int"](), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(ECParameters), this.key("publicKey").optional().explicit(1).bitstr());
		});
		exports.signature = asn1.define("signature", function() {
			this.seq().obj(this.key("r")["int"](), this.key("s")["int"]());
		});
	}));
	//#endregion
	//#region ../../node_modules/parse-asn1/aesid.json
	var aesid_exports = /* @__PURE__ */ __exportAll({ default: () => aesid_default });
	var aesid_default;
	var init_aesid = __esmMin((() => {
		aesid_default = {
			"2.16.840.1.101.3.4.1.1": "aes-128-ecb",
			"2.16.840.1.101.3.4.1.2": "aes-128-cbc",
			"2.16.840.1.101.3.4.1.3": "aes-128-ofb",
			"2.16.840.1.101.3.4.1.4": "aes-128-cfb",
			"2.16.840.1.101.3.4.1.21": "aes-192-ecb",
			"2.16.840.1.101.3.4.1.22": "aes-192-cbc",
			"2.16.840.1.101.3.4.1.23": "aes-192-ofb",
			"2.16.840.1.101.3.4.1.24": "aes-192-cfb",
			"2.16.840.1.101.3.4.1.41": "aes-256-ecb",
			"2.16.840.1.101.3.4.1.42": "aes-256-cbc",
			"2.16.840.1.101.3.4.1.43": "aes-256-ofb",
			"2.16.840.1.101.3.4.1.44": "aes-256-cfb"
		};
	}));
	//#endregion
	//#region ../../node_modules/parse-asn1/fixProc.js
	var require_fixProc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m;
		var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m;
		var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m;
		var evp = require_evp_bytestokey();
		var ciphers = require_browser$6();
		var Buffer = require_safe_buffer$4().Buffer;
		module.exports = function(okey, password) {
			var key = okey.toString();
			var match = key.match(findProc);
			var decrypted;
			if (!match) {
				var match2 = key.match(fullRegex);
				decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ""), "base64");
			} else {
				var suite = "aes" + match[1];
				var iv = Buffer.from(match[2], "hex");
				var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ""), "base64");
				var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key;
				var out = [];
				var cipher = ciphers.createDecipheriv(suite, cipherKey, iv);
				out.push(cipher.update(cipherText));
				out.push(cipher["final"]());
				decrypted = Buffer.concat(out);
			}
			return {
				tag: key.match(startRegex)[1],
				data: decrypted
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/parse-asn1/index.js
	var require_parse_asn1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var asn1 = require_asn1();
		var aesid = (init_aesid(), __toCommonJS(aesid_exports).default);
		var fixProc = require_fixProc();
		var ciphers = require_browser$6();
		var pbkdf2Sync = require_browser$7().pbkdf2Sync;
		var Buffer = require_safe_buffer$4().Buffer;
		function decrypt(data, password) {
			var salt = data.algorithm.decrypt.kde.kdeparams.salt;
			var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10);
			var algo = aesid[data.algorithm.decrypt.cipher.algo.join(".")];
			var iv = data.algorithm.decrypt.cipher.iv;
			var cipherText = data.subjectPrivateKey;
			var key = pbkdf2Sync(password, salt, iters, parseInt(algo.split("-")[1], 10) / 8, "sha1");
			var cipher = ciphers.createDecipheriv(algo, key, iv);
			var out = [];
			out.push(cipher.update(cipherText));
			out.push(cipher["final"]());
			return Buffer.concat(out);
		}
		function parseKeys(buffer) {
			var password;
			if (typeof buffer === "object" && !Buffer.isBuffer(buffer)) {
				password = buffer.passphrase;
				buffer = buffer.key;
			}
			if (typeof buffer === "string") buffer = Buffer.from(buffer);
			var stripped = fixProc(buffer, password);
			var type = stripped.tag;
			var data = stripped.data;
			var subtype, ndata;
			switch (type) {
				case "CERTIFICATE": ndata = asn1.certificate.decode(data, "der").tbsCertificate.subjectPublicKeyInfo;
				case "PUBLIC KEY":
					if (!ndata) ndata = asn1.PublicKey.decode(data, "der");
					subtype = ndata.algorithm.algorithm.join(".");
					switch (subtype) {
						case "1.2.840.113549.1.1.1": return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, "der");
						case "1.2.840.10045.2.1":
							ndata.subjectPrivateKey = ndata.subjectPublicKey;
							return {
								type: "ec",
								data: ndata
							};
						case "1.2.840.10040.4.1":
							ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, "der");
							return {
								type: "dsa",
								data: ndata.algorithm.params
							};
						default: throw new Error("unknown key id " + subtype);
					}
				case "ENCRYPTED PRIVATE KEY":
					data = asn1.EncryptedPrivateKey.decode(data, "der");
					data = decrypt(data, password);
				case "PRIVATE KEY":
					ndata = asn1.PrivateKey.decode(data, "der");
					subtype = ndata.algorithm.algorithm.join(".");
					switch (subtype) {
						case "1.2.840.113549.1.1.1": return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, "der");
						case "1.2.840.10045.2.1": return {
							curve: ndata.algorithm.curve,
							privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, "der").privateKey
						};
						case "1.2.840.10040.4.1":
							ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, "der");
							return {
								type: "dsa",
								params: ndata.algorithm.params
							};
						default: throw new Error("unknown key id " + subtype);
					}
				case "RSA PUBLIC KEY": return asn1.RSAPublicKey.decode(data, "der");
				case "RSA PRIVATE KEY": return asn1.RSAPrivateKey.decode(data, "der");
				case "DSA PRIVATE KEY": return {
					type: "dsa",
					params: asn1.DSAPrivateKey.decode(data, "der")
				};
				case "EC PRIVATE KEY":
					data = asn1.ECPrivateKey.decode(data, "der");
					return {
						curve: data.parameters.value,
						privateKey: data.privateKey
					};
				default: throw new Error("unknown key type " + type);
			}
		}
		parseKeys.signature = asn1.signature;
		module.exports = parseKeys;
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/browser/curves.json
	var curves_exports = /* @__PURE__ */ __exportAll({ default: () => curves_default });
	var curves_default;
	var init_curves = __esmMin((() => {
		curves_default = {
			"1.3.132.0.10": "secp256k1",
			"1.3.132.0.33": "p224",
			"1.2.840.10045.3.1.1": "p192",
			"1.2.840.10045.3.1.7": "p256",
			"1.3.132.0.34": "p384",
			"1.3.132.0.35": "p521"
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/browser/sign.js
	var require_sign = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var createHmac = require_browser$8();
		var crt = require_browserify_rsa();
		var EC = require_elliptic().ec;
		var BN = require_bn();
		var parseKeys = require_parse_asn1();
		var curves = (init_curves(), __toCommonJS(curves_exports).default);
		var RSA_PKCS1_PADDING = 1;
		function sign(hash, key, hashType, signType, tag) {
			var priv = parseKeys(key);
			if (priv.curve) {
				if (signType !== "ecdsa" && signType !== "ecdsa/rsa") throw new Error("wrong private key type");
				return ecSign(hash, priv);
			} else if (priv.type === "dsa") {
				if (signType !== "dsa") throw new Error("wrong private key type");
				return dsaSign(hash, priv, hashType);
			}
			if (signType !== "rsa" && signType !== "ecdsa/rsa") throw new Error("wrong private key type");
			if (key.padding !== void 0 && key.padding !== RSA_PKCS1_PADDING) throw new Error("illegal or unsupported padding mode");
			hash = Buffer.concat([tag, hash]);
			var len = priv.modulus.byteLength();
			var pad = [0, 1];
			while (hash.length + pad.length + 1 < len) pad.push(255);
			pad.push(0);
			var i = -1;
			while (++i < hash.length) pad.push(hash[i]);
			return crt(pad, priv);
		}
		function ecSign(hash, priv) {
			var curveId = curves[priv.curve.join(".")];
			if (!curveId) throw new Error("unknown curve " + priv.curve.join("."));
			var out = new EC(curveId).keyFromPrivate(priv.privateKey).sign(hash);
			return Buffer.from(out.toDER());
		}
		function dsaSign(hash, priv, algo) {
			var x = priv.params.priv_key;
			var p = priv.params.p;
			var q = priv.params.q;
			var g = priv.params.g;
			var r = new BN(0);
			var k;
			var H = bits2int(hash, q).mod(q);
			var s = false;
			var kv = getKey(x, q, hash, algo);
			while (s === false) {
				k = makeKey(q, kv, algo);
				r = makeR(g, k, p, q);
				s = k.invm(q).imul(H.add(x.mul(r))).mod(q);
				if (s.cmpn(0) === 0) {
					s = false;
					r = new BN(0);
				}
			}
			return toDER(r, s);
		}
		function toDER(r, s) {
			r = r.toArray();
			s = s.toArray();
			if (r[0] & 128) r = [0].concat(r);
			if (s[0] & 128) s = [0].concat(s);
			var res = [
				48,
				r.length + s.length + 4,
				2,
				r.length
			];
			res = res.concat(r, [2, s.length], s);
			return Buffer.from(res);
		}
		function getKey(x, q, hash, algo) {
			x = Buffer.from(x.toArray());
			if (x.length < q.byteLength()) {
				var zeros = Buffer.alloc(q.byteLength() - x.length);
				x = Buffer.concat([zeros, x]);
			}
			var hlen = hash.length;
			var hbits = bits2octets(hash, q);
			var v = Buffer.alloc(hlen);
			v.fill(1);
			var k = Buffer.alloc(hlen);
			k = createHmac(algo, k).update(v).update(Buffer.from([0])).update(x).update(hbits).digest();
			v = createHmac(algo, k).update(v).digest();
			k = createHmac(algo, k).update(v).update(Buffer.from([1])).update(x).update(hbits).digest();
			v = createHmac(algo, k).update(v).digest();
			return {
				k,
				v
			};
		}
		function bits2int(obits, q) {
			var bits = new BN(obits);
			var shift = (obits.length << 3) - q.bitLength();
			if (shift > 0) bits.ishrn(shift);
			return bits;
		}
		function bits2octets(bits, q) {
			bits = bits2int(bits, q);
			bits = bits.mod(q);
			var out = Buffer.from(bits.toArray());
			if (out.length < q.byteLength()) {
				var zeros = Buffer.alloc(q.byteLength() - out.length);
				out = Buffer.concat([zeros, out]);
			}
			return out;
		}
		function makeKey(q, kv, algo) {
			var t;
			var k;
			do {
				t = Buffer.alloc(0);
				while (t.length * 8 < q.bitLength()) {
					kv.v = createHmac(algo, kv.k).update(kv.v).digest();
					t = Buffer.concat([t, kv.v]);
				}
				k = bits2int(t, q);
				kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([0])).digest();
				kv.v = createHmac(algo, kv.k).update(kv.v).digest();
			} while (k.cmp(q) !== -1);
			return k;
		}
		function makeR(g, k, p, q) {
			return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);
		}
		module.exports = sign;
		module.exports.getKey = getKey;
		module.exports.makeKey = makeKey;
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/browser/verify.js
	var require_verify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var BN = require_bn();
		var EC = require_elliptic().ec;
		var parseKeys = require_parse_asn1();
		var curves = (init_curves(), __toCommonJS(curves_exports).default);
		function verify(sig, hash, key, signType, tag) {
			var pub = parseKeys(key);
			if (pub.type === "ec") {
				if (signType !== "ecdsa" && signType !== "ecdsa/rsa") throw new Error("wrong public key type");
				return ecVerify(sig, hash, pub);
			} else if (pub.type === "dsa") {
				if (signType !== "dsa") throw new Error("wrong public key type");
				return dsaVerify(sig, hash, pub);
			}
			if (signType !== "rsa" && signType !== "ecdsa/rsa") throw new Error("wrong public key type");
			hash = Buffer.concat([tag, hash]);
			var len = pub.modulus.byteLength();
			var pad = [1];
			var padNum = 0;
			while (hash.length + pad.length + 2 < len) {
				pad.push(255);
				padNum += 1;
			}
			pad.push(0);
			var i = -1;
			while (++i < hash.length) pad.push(hash[i]);
			pad = Buffer.from(pad);
			var red = BN.mont(pub.modulus);
			sig = new BN(sig).toRed(red);
			sig = sig.redPow(new BN(pub.publicExponent));
			sig = Buffer.from(sig.fromRed().toArray());
			var out = padNum < 8 ? 1 : 0;
			len = Math.min(sig.length, pad.length);
			if (sig.length !== pad.length) out = 1;
			i = -1;
			while (++i < len) out |= sig[i] ^ pad[i];
			return out === 0;
		}
		function ecVerify(sig, hash, pub) {
			var curveId = curves[pub.data.algorithm.curve.join(".")];
			if (!curveId) throw new Error("unknown curve " + pub.data.algorithm.curve.join("."));
			var curve = new EC(curveId);
			var pubkey = pub.data.subjectPrivateKey.data;
			return curve.verify(hash, sig, pubkey);
		}
		function dsaVerify(sig, hash, pub) {
			var p = pub.data.p;
			var q = pub.data.q;
			var g = pub.data.g;
			var y = pub.data.pub_key;
			var unpacked = parseKeys.signature.decode(sig, "der");
			var s = unpacked.s;
			var r = unpacked.r;
			checkValue(s, q);
			checkValue(r, q);
			var montp = BN.mont(p);
			var w = s.invm(q);
			return g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q).cmp(r) === 0;
		}
		function checkValue(b, q) {
			if (b.cmpn(0) <= 0) throw new Error("invalid sig");
			if (b.cmp(q) >= 0) throw new Error("invalid sig");
		}
		module.exports = verify;
	}));
	//#endregion
	//#region ../../node_modules/browserify-sign/browser/index.js
	var require_browser$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Buffer = require_safe_buffer$4().Buffer;
		var createHash = require_browser$9();
		var stream = require_readable_browser();
		var inherits = require_inherits_browser();
		var sign = require_sign();
		var verify = require_verify();
		var algorithms = (init_algorithms(), __toCommonJS(algorithms_exports).default);
		Object.keys(algorithms).forEach(function(key) {
			algorithms[key].id = Buffer.from(algorithms[key].id, "hex");
			algorithms[key.toLowerCase()] = algorithms[key];
		});
		function Sign(algorithm) {
			stream.Writable.call(this);
			var data = algorithms[algorithm];
			if (!data) throw new Error("Unknown message digest");
			this._hashType = data.hash;
			this._hash = createHash(data.hash);
			this._tag = data.id;
			this._signType = data.sign;
		}
		inherits(Sign, stream.Writable);
		Sign.prototype._write = function _write(data, _, done) {
			this._hash.update(data);
			done();
		};
		Sign.prototype.update = function update(data, enc) {
			this._hash.update(typeof data === "string" ? Buffer.from(data, enc) : data);
			return this;
		};
		Sign.prototype.sign = function signMethod(key, enc) {
			this.end();
			var sig = sign(this._hash.digest(), key, this._hashType, this._signType, this._tag);
			return enc ? sig.toString(enc) : sig;
		};
		function Verify(algorithm) {
			stream.Writable.call(this);
			var data = algorithms[algorithm];
			if (!data) throw new Error("Unknown message digest");
			this._hash = createHash(data.hash);
			this._tag = data.id;
			this._signType = data.sign;
		}
		inherits(Verify, stream.Writable);
		Verify.prototype._write = function _write(data, _, done) {
			this._hash.update(data);
			done();
		};
		Verify.prototype.update = function update(data, enc) {
			this._hash.update(typeof data === "string" ? Buffer.from(data, enc) : data);
			return this;
		};
		Verify.prototype.verify = function verifyMethod(key, sig, enc) {
			var sigBuffer = typeof sig === "string" ? Buffer.from(sig, enc) : sig;
			this.end();
			return verify(sigBuffer, this._hash.digest(), key, this._signType, this._tag);
		};
		function createSign(algorithm) {
			return new Sign(algorithm);
		}
		function createVerify(algorithm) {
			return new Verify(algorithm);
		}
		module.exports = {
			Sign: createSign,
			Verify: createVerify,
			createSign,
			createVerify
		};
	}));
	//#endregion
	//#region ../../node_modules/create-ecdh/browser.js
	var require_browser$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var elliptic = require_elliptic();
		var BN = require_bn$2();
		module.exports = function createECDH(curve) {
			return new ECDH(curve);
		};
		var aliases = {
			secp256k1: {
				name: "secp256k1",
				byteLength: 32
			},
			secp224r1: {
				name: "p224",
				byteLength: 28
			},
			prime256v1: {
				name: "p256",
				byteLength: 32
			},
			prime192v1: {
				name: "p192",
				byteLength: 24
			},
			ed25519: {
				name: "ed25519",
				byteLength: 32
			},
			secp384r1: {
				name: "p384",
				byteLength: 48
			},
			secp521r1: {
				name: "p521",
				byteLength: 66
			}
		};
		aliases.p224 = aliases.secp224r1;
		aliases.p256 = aliases.secp256r1 = aliases.prime256v1;
		aliases.p192 = aliases.secp192r1 = aliases.prime192v1;
		aliases.p384 = aliases.secp384r1;
		aliases.p521 = aliases.secp521r1;
		function ECDH(curve) {
			this.curveType = aliases[curve];
			if (!this.curveType) this.curveType = { name: curve };
			this.curve = new elliptic.ec(this.curveType.name);
			this.keys = void 0;
		}
		ECDH.prototype.generateKeys = function(enc, format) {
			this.keys = this.curve.genKeyPair();
			return this.getPublicKey(enc, format);
		};
		ECDH.prototype.computeSecret = function(other, inenc, enc) {
			inenc = inenc || "utf8";
			if (!Buffer$1.isBuffer(other)) other = new Buffer$1(other, inenc);
			return formatReturnValue(this.curve.keyFromPublic(other).getPublic().mul(this.keys.getPrivate()).getX(), enc, this.curveType.byteLength);
		};
		ECDH.prototype.getPublicKey = function(enc, format) {
			var key = this.keys.getPublic(format === "compressed", true);
			if (format === "hybrid") if (key[key.length - 1] % 2) key[0] = 7;
			else key[0] = 6;
			return formatReturnValue(key, enc);
		};
		ECDH.prototype.getPrivateKey = function(enc) {
			return formatReturnValue(this.keys.getPrivate(), enc);
		};
		ECDH.prototype.setPublicKey = function(pub, enc) {
			enc = enc || "utf8";
			if (!Buffer$1.isBuffer(pub)) pub = new Buffer$1(pub, enc);
			this.keys._importPublic(pub);
			return this;
		};
		ECDH.prototype.setPrivateKey = function(priv, enc) {
			enc = enc || "utf8";
			if (!Buffer$1.isBuffer(priv)) priv = new Buffer$1(priv, enc);
			var _priv = new BN(priv);
			_priv = _priv.toString(16);
			this.keys = this.curve.genKeyPair();
			this.keys._importPrivate(_priv);
			return this;
		};
		function formatReturnValue(bn, enc, len) {
			if (!Array.isArray(bn)) bn = bn.toArray();
			var buf = new Buffer$1(bn);
			if (len && buf.length < len) {
				var zeros = new Buffer$1(len - buf.length);
				zeros.fill(0);
				buf = Buffer$1.concat([zeros, buf]);
			}
			if (!enc) return buf;
			else return buf.toString(enc);
		}
	}));
	//#endregion
	//#region ../../node_modules/public-encrypt/mgf.js
	var require_mgf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var createHash = require_browser$9();
		var Buffer = require_safe_buffer$4().Buffer;
		module.exports = function(seed, len) {
			var t = Buffer.alloc(0);
			var i = 0;
			var c;
			while (t.length < len) {
				c = i2ops(i++);
				t = Buffer.concat([t, createHash("sha1").update(seed).update(c).digest()]);
			}
			return t.slice(0, len);
		};
		function i2ops(c) {
			var out = Buffer.allocUnsafe(4);
			out.writeUInt32BE(c, 0);
			return out;
		}
	}));
	//#endregion
	//#region ../../node_modules/public-encrypt/xor.js
	var require_xor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = function xor(a, b) {
			var len = a.length;
			var i = -1;
			while (++i < len) a[i] ^= b[i];
			return a;
		};
	}));
	//#endregion
	//#region ../../node_modules/public-encrypt/withPublic.js
	var require_withPublic = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BN = require_bn$2();
		var Buffer = require_safe_buffer$4().Buffer;
		function withPublic(paddedMsg, key) {
			return Buffer.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray());
		}
		module.exports = withPublic;
	}));
	//#endregion
	//#region ../../node_modules/public-encrypt/publicEncrypt.js
	var require_publicEncrypt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var parseKeys = require_parse_asn1();
		var randomBytes = require_browser$11();
		var createHash = require_browser$9();
		var mgf = require_mgf();
		var xor = require_xor();
		var BN = require_bn$2();
		var withPublic = require_withPublic();
		var crt = require_browserify_rsa();
		var Buffer = require_safe_buffer$4().Buffer;
		module.exports = function publicEncrypt(publicKey, msg, reverse) {
			var padding;
			if (publicKey.padding) padding = publicKey.padding;
			else if (reverse) padding = 1;
			else padding = 4;
			var key = parseKeys(publicKey);
			var paddedMsg;
			if (padding === 4) paddedMsg = oaep(key, msg);
			else if (padding === 1) paddedMsg = pkcs1(key, msg, reverse);
			else if (padding === 3) {
				paddedMsg = new BN(msg);
				if (paddedMsg.cmp(key.modulus) >= 0) throw new Error("data too long for modulus");
			} else throw new Error("unknown padding");
			if (reverse) return crt(paddedMsg, key);
			else return withPublic(paddedMsg, key);
		};
		function oaep(key, msg) {
			var k = key.modulus.byteLength();
			var mLen = msg.length;
			var iHash = createHash("sha1").update(Buffer.alloc(0)).digest();
			var hLen = iHash.length;
			var hLen2 = 2 * hLen;
			if (mLen > k - hLen2 - 2) throw new Error("message too long");
			var ps = Buffer.alloc(k - mLen - hLen2 - 2);
			var dblen = k - hLen - 1;
			var seed = randomBytes(hLen);
			var maskedDb = xor(Buffer.concat([
				iHash,
				ps,
				Buffer.alloc(1, 1),
				msg
			], dblen), mgf(seed, dblen));
			var maskedSeed = xor(seed, mgf(maskedDb, hLen));
			return new BN(Buffer.concat([
				Buffer.alloc(1),
				maskedSeed,
				maskedDb
			], k));
		}
		function pkcs1(key, msg, reverse) {
			var mLen = msg.length;
			var k = key.modulus.byteLength();
			if (mLen > k - 11) throw new Error("message too long");
			var ps;
			if (reverse) ps = Buffer.alloc(k - mLen - 3, 255);
			else ps = nonZero(k - mLen - 3);
			return new BN(Buffer.concat([
				Buffer.from([0, reverse ? 1 : 2]),
				ps,
				Buffer.alloc(1),
				msg
			], k));
		}
		function nonZero(len) {
			var out = Buffer.allocUnsafe(len);
			var i = 0;
			var cache = randomBytes(len * 2);
			var cur = 0;
			var num;
			while (i < len) {
				if (cur === cache.length) {
					cache = randomBytes(len * 2);
					cur = 0;
				}
				num = cache[cur++];
				if (num) out[i++] = num;
			}
			return out;
		}
	}));
	//#endregion
	//#region ../../node_modules/public-encrypt/privateDecrypt.js
	var require_privateDecrypt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var parseKeys = require_parse_asn1();
		var mgf = require_mgf();
		var xor = require_xor();
		var BN = require_bn$2();
		var crt = require_browserify_rsa();
		var createHash = require_browser$9();
		var withPublic = require_withPublic();
		var Buffer = require_safe_buffer$4().Buffer;
		module.exports = function privateDecrypt(privateKey, enc, reverse) {
			var padding;
			if (privateKey.padding) padding = privateKey.padding;
			else if (reverse) padding = 1;
			else padding = 4;
			var key = parseKeys(privateKey);
			var k = key.modulus.byteLength();
			if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) throw new Error("decryption error");
			var msg;
			if (reverse) msg = withPublic(new BN(enc), key);
			else msg = crt(enc, key);
			var zBuffer = Buffer.alloc(k - msg.length);
			msg = Buffer.concat([zBuffer, msg], k);
			if (padding === 4) return oaep(key, msg);
			else if (padding === 1) return pkcs1(key, msg, reverse);
			else if (padding === 3) return msg;
			else throw new Error("unknown padding");
		};
		function oaep(key, msg) {
			var k = key.modulus.byteLength();
			var iHash = createHash("sha1").update(Buffer.alloc(0)).digest();
			var hLen = iHash.length;
			if (msg[0] !== 0) throw new Error("decryption error");
			var maskedSeed = msg.slice(1, hLen + 1);
			var maskedDb = msg.slice(hLen + 1);
			var db = xor(maskedDb, mgf(xor(maskedSeed, mgf(maskedDb, hLen)), k - hLen - 1));
			if (compare(iHash, db.slice(0, hLen))) throw new Error("decryption error");
			var i = hLen;
			while (db[i] === 0) i++;
			if (db[i++] !== 1) throw new Error("decryption error");
			return db.slice(i);
		}
		function pkcs1(key, msg, reverse) {
			var p1 = msg.slice(0, 2);
			var i = 2;
			var status = 0;
			while (msg[i++] !== 0) if (i >= msg.length) {
				status++;
				break;
			}
			var ps = msg.slice(2, i - 1);
			if (p1.toString("hex") !== "0002" && !reverse || p1.toString("hex") !== "0001" && reverse) status++;
			if (ps.length < 8) status++;
			if (status) throw new Error("decryption error");
			return msg.slice(i);
		}
		function compare(a, b) {
			a = Buffer.from(a);
			b = Buffer.from(b);
			var dif = 0;
			var len = a.length;
			if (a.length !== b.length) {
				dif++;
				len = Math.min(a.length, b.length);
			}
			var i = -1;
			while (++i < len) dif += a[i] ^ b[i];
			return dif;
		}
	}));
	//#endregion
	//#region ../../node_modules/public-encrypt/browser.js
	var require_browser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.publicEncrypt = require_publicEncrypt();
		exports.privateDecrypt = require_privateDecrypt();
		exports.privateEncrypt = function privateEncrypt(key, buf) {
			return exports.publicEncrypt(key, buf, true);
		};
		exports.publicDecrypt = function publicDecrypt(key, buf) {
			return exports.privateDecrypt(key, buf, true);
		};
	}));
	//#endregion
	//#region ../../node_modules/randomfill/browser.js
	var require_browser = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist$2();
		init_dist$1();
		function oldBrowser() {
			throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11");
		}
		var safeBuffer = require_safe_buffer$4();
		var randombytes = require_browser$11();
		var Buffer = safeBuffer.Buffer;
		var kBufferMaxLength = safeBuffer.kMaxLength;
		var crypto = global.crypto || global.msCrypto;
		var kMaxUint32 = Math.pow(2, 32) - 1;
		function assertOffset(offset, length) {
			if (typeof offset !== "number" || offset !== offset) throw new TypeError("offset must be a number");
			if (offset > kMaxUint32 || offset < 0) throw new TypeError("offset must be a uint32");
			if (offset > kBufferMaxLength || offset > length) throw new RangeError("offset out of range");
		}
		function assertSize(size, offset, length) {
			if (typeof size !== "number" || size !== size) throw new TypeError("size must be a number");
			if (size > kMaxUint32 || size < 0) throw new TypeError("size must be a uint32");
			if (size + offset > length || size > kBufferMaxLength) throw new RangeError("buffer too small");
		}
		if (crypto && crypto.getRandomValues || !process$1.browser) {
			exports.randomFill = randomFill;
			exports.randomFillSync = randomFillSync;
		} else {
			exports.randomFill = oldBrowser;
			exports.randomFillSync = oldBrowser;
		}
		function randomFill(buf, offset, size, cb) {
			if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");
			if (typeof offset === "function") {
				cb = offset;
				offset = 0;
				size = buf.length;
			} else if (typeof size === "function") {
				cb = size;
				size = buf.length - offset;
			} else if (typeof cb !== "function") throw new TypeError("\"cb\" argument must be a function");
			assertOffset(offset, buf.length);
			assertSize(size, offset, buf.length);
			return actualFill(buf, offset, size, cb);
		}
		function actualFill(buf, offset, size, cb) {
			if (process$1.browser) {
				var ourBuf = buf.buffer;
				var uint = new Uint8Array(ourBuf, offset, size);
				crypto.getRandomValues(uint);
				if (cb) {
					process$1.nextTick(function() {
						cb(null, buf);
					});
					return;
				}
				return buf;
			}
			if (cb) {
				randombytes(size, function(err, bytes) {
					if (err) return cb(err);
					bytes.copy(buf, offset);
					cb(null, buf);
				});
				return;
			}
			randombytes(size).copy(buf, offset);
			return buf;
		}
		function randomFillSync(buf, offset, size) {
			if (typeof offset === "undefined") offset = 0;
			if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");
			assertOffset(offset, buf.length);
			if (size === void 0) size = buf.length - offset;
			assertSize(size, offset, buf.length);
			return actualFill(buf, offset, size);
		}
	}));
	//#endregion
	//#region ../../node_modules/crypto-browserify/index.js
	var require_crypto_browserify = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require_browser$11();
		exports.createHash = exports.Hash = require_browser$9();
		exports.createHmac = exports.Hmac = require_browser$8();
		var algos = require_algos();
		var algoKeys = Object.keys(algos);
		var hashes = [
			"sha1",
			"sha224",
			"sha256",
			"sha384",
			"sha512",
			"md5",
			"rmd160"
		].concat(algoKeys);
		exports.getHashes = function() {
			return hashes;
		};
		var p = require_browser$7();
		exports.pbkdf2 = p.pbkdf2;
		exports.pbkdf2Sync = p.pbkdf2Sync;
		var aes = require_browser$5();
		exports.Cipher = aes.Cipher;
		exports.createCipher = aes.createCipher;
		exports.Cipheriv = aes.Cipheriv;
		exports.createCipheriv = aes.createCipheriv;
		exports.Decipher = aes.Decipher;
		exports.createDecipher = aes.createDecipher;
		exports.Decipheriv = aes.Decipheriv;
		exports.createDecipheriv = aes.createDecipheriv;
		exports.getCiphers = aes.getCiphers;
		exports.listCiphers = aes.listCiphers;
		var dh = require_browser$4();
		exports.DiffieHellmanGroup = dh.DiffieHellmanGroup;
		exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup;
		exports.getDiffieHellman = dh.getDiffieHellman;
		exports.createDiffieHellman = dh.createDiffieHellman;
		exports.DiffieHellman = dh.DiffieHellman;
		var sign = require_browser$3();
		exports.createSign = sign.createSign;
		exports.Sign = sign.Sign;
		exports.createVerify = sign.createVerify;
		exports.Verify = sign.Verify;
		exports.createECDH = require_browser$2();
		var publicEncrypt = require_browser$1();
		exports.publicEncrypt = publicEncrypt.publicEncrypt;
		exports.privateEncrypt = publicEncrypt.privateEncrypt;
		exports.publicDecrypt = publicEncrypt.publicDecrypt;
		exports.privateDecrypt = publicEncrypt.privateDecrypt;
		var rf = require_browser();
		exports.randomFill = rf.randomFill;
		exports.randomFillSync = rf.randomFillSync;
		exports.createCredentials = function() {
			throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify");
		};
		exports.constants = {
			DH_CHECK_P_NOT_SAFE_PRIME: 2,
			DH_CHECK_P_NOT_PRIME: 1,
			DH_UNABLE_TO_CHECK_GENERATOR: 4,
			DH_NOT_SUITABLE_GENERATOR: 8,
			NPN_ENABLED: 1,
			ALPN_ENABLED: 1,
			RSA_PKCS1_PADDING: 1,
			RSA_SSLV23_PADDING: 2,
			RSA_NO_PADDING: 3,
			RSA_PKCS1_OAEP_PADDING: 4,
			RSA_X931_PADDING: 5,
			RSA_PKCS1_PSS_PADDING: 6,
			POINT_CONVERSION_COMPRESSED: 2,
			POINT_CONVERSION_UNCOMPRESSED: 4,
			POINT_CONVERSION_HYBRID: 6
		};
	}));
	//#endregion
	//#region ../loot-core/src/shared/normalisation.ts
	var import_sql_wasm = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		init_dist$1();
		var initSqlJsPromise = void 0;
		var initSqlJs = function(moduleConfig) {
			if (initSqlJsPromise) return initSqlJsPromise;
			initSqlJsPromise = new Promise(function(resolveModule, reject) {
				var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {};
				var originalOnAbortFunction = Module["onAbort"];
				Module["onAbort"] = function(errorThatCausedAbort) {
					reject(new Error(errorThatCausedAbort));
					if (originalOnAbortFunction) originalOnAbortFunction(errorThatCausedAbort);
				};
				Module["postRun"] = Module["postRun"] || [];
				Module["postRun"].push(function() {
					resolveModule(Module);
				});
				module = void 0;
				var Module;
				Module || (Module = typeof Module !== "undefined" ? Module : {});
				Module.onRuntimeInitialized = function() {
					function a(h, n) {
						this.Qa = h;
						this.db = n;
						this.Pa = 1;
						this.wb = [];
					}
					function b(h, n) {
						this.db = n;
						n = d(h) + 1;
						this.hb = aa(n);
						if (null === this.hb) throw Error("Unable to allocate memory for the SQL string");
						p(h, u, this.hb, n);
						this.sb = this.hb;
						this.eb = this.Mb = null;
					}
					function c(h, { filename: n = !1 } = {}) {
						!1 === n ? (this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0), this.Xc = !0, null != h && w.zb("/", this.filename, h, !0, !0)) : this.filename = h;
						this.handleError(g(this.filename, e));
						this.db = z(e, "i32");
						Cb(this.db);
						this.nb = {};
						this.Xa = {};
					}
					var e = C(4), f = Module.cwrap, g = f("sqlite3_open", "number", ["string", "number"]), k = f("sqlite3_close_v2", "number", ["number"]), l = f("sqlite3_exec", "number", [
						"number",
						"string",
						"number",
						"number",
						"number"
					]), q = f("sqlite3_changes", "number", ["number"]), m = f("sqlite3_prepare_v2", "number", [
						"number",
						"string",
						"number",
						"number",
						"number"
					]), r = f("sqlite3_sql", "string", ["number"]), x = f("sqlite3_normalized_sql", "string", ["number"]), B = f("sqlite3_prepare_v2", "number", [
						"number",
						"number",
						"number",
						"number",
						"number"
					]), E = f("sqlite3_bind_text", "number", [
						"number",
						"number",
						"number",
						"number",
						"number"
					]), A = f("sqlite3_bind_blob", "number", [
						"number",
						"number",
						"number",
						"number",
						"number"
					]), J = f("sqlite3_bind_double", "number", [
						"number",
						"number",
						"number"
					]), Z = f("sqlite3_bind_int", "number", [
						"number",
						"number",
						"number"
					]), U = f("sqlite3_bind_parameter_index", "number", ["number", "string"]), Ka = f("sqlite3_step", "number", ["number"]), G = f("sqlite3_errmsg", "string", ["number"]), Db = f("sqlite3_column_count", "number", ["number"]), Eb = f("sqlite3_data_count", "number", ["number"]), Fb = f("sqlite3_column_double", "number", ["number", "number"]), Gb = f("sqlite3_column_text", "string", ["number", "number"]), Hb = f("sqlite3_column_blob", "number", ["number", "number"]), Ib = f("sqlite3_column_bytes", "number", ["number", "number"]), Jb = f("sqlite3_column_type", "number", ["number", "number"]), Kb = f("sqlite3_column_name", "string", ["number", "number"]), Lb = f("sqlite3_reset", "number", ["number"]), Mb = f("sqlite3_clear_bindings", "number", ["number"]), Nb = f("sqlite3_finalize", "number", ["number"]), Ob = f("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), Pb = f("sqlite3_value_type", "number", ["number"]), Qb = f("sqlite3_value_bytes", "number", ["number"]), Rb = f("sqlite3_value_text", "string", ["number"]), Sb = f("sqlite3_value_blob", "number", ["number"]), Tb = f("sqlite3_value_double", "number", ["number"]), Ub = f("sqlite3_result_double", "", ["number", "number"]), db = f("sqlite3_result_null", "", ["number"]), Vb = f("sqlite3_result_text", "", [
						"number",
						"string",
						"number",
						"number"
					]), Wb = f("sqlite3_result_blob", "", [
						"number",
						"number",
						"number",
						"number"
					]), Xb = f("sqlite3_result_int", "", ["number", "number"]), eb = f("sqlite3_result_error", "", [
						"number",
						"string",
						"number"
					]), Cb = f("RegisterExtensionFunctions", "number", ["number"]);
					a.prototype.bind = function(h) {
						if (!this.Qa) throw "Statement closed";
						this.reset();
						return Array.isArray(h) ? this.vc(h) : null != h && "object" === typeof h ? this.wc(h) : !0;
					};
					a.prototype.step = function() {
						if (!this.Qa) throw "Statement closed";
						this.Pa = 1;
						var h = Ka(this.Qa);
						switch (h) {
							case 100: return !0;
							case 101: return !1;
							default: throw this.db.handleError(h);
						}
					};
					a.prototype.Pc = function(h) {
						h ?? (h = this.Pa, this.Pa += 1);
						return Fb(this.Qa, h);
					};
					a.prototype.Qc = function(h) {
						h ?? (h = this.Pa, this.Pa += 1);
						return Gb(this.Qa, h);
					};
					a.prototype.getBlob = function(h) {
						h ?? (h = this.Pa, this.Pa += 1);
						var n = Ib(this.Qa, h);
						h = Hb(this.Qa, h);
						for (var t = new Uint8Array(n), v = 0; v < n; v += 1) t[v] = D[h + v];
						return t;
					};
					a.prototype.get = function(h) {
						null != h && this.bind(h) && this.step();
						h = [];
						for (var n = Eb(this.Qa), t = 0; t < n; t += 1) switch (Jb(this.Qa, t)) {
							case 1:
							case 2:
								h.push(this.Pc(t));
								break;
							case 3:
								h.push(this.Qc(t));
								break;
							case 4:
								h.push(this.getBlob(t));
								break;
							default: h.push(null);
						}
						return h;
					};
					a.prototype.getColumnNames = function() {
						for (var h = [], n = Db(this.Qa), t = 0; t < n; t += 1) h.push(Kb(this.Qa, t));
						return h;
					};
					a.prototype.getAsObject = function(h) {
						h = this.get(h);
						for (var n = this.getColumnNames(), t = {}, v = 0; v < n.length; v += 1) t[n[v]] = h[v];
						return t;
					};
					a.prototype.getSQL = function() {
						return r(this.Qa);
					};
					a.prototype.getNormalizedSQL = function() {
						return x(this.Qa);
					};
					a.prototype.run = function(h) {
						null != h && this.bind(h);
						this.step();
						return this.reset();
					};
					a.prototype.zc = function(h, n) {
						n ?? (n = this.Pa, this.Pa += 1);
						h = ba(h);
						var t = ca(h);
						this.wb.push(t);
						this.db.handleError(E(this.Qa, n, t, h.length - 1, 0));
					};
					a.prototype.uc = function(h, n) {
						n ?? (n = this.Pa, this.Pa += 1);
						var t = ca(h);
						this.wb.push(t);
						this.db.handleError(A(this.Qa, n, t, h.length, 0));
					};
					a.prototype.yc = function(h, n) {
						n ?? (n = this.Pa, this.Pa += 1);
						this.db.handleError((h === (h | 0) ? Z : J)(this.Qa, n, h));
					};
					a.prototype.xc = function(h) {
						h ?? (h = this.Pa, this.Pa += 1);
						A(this.Qa, h, 0, 0, 0);
					};
					a.prototype.Tb = function(h, n) {
						n ?? (n = this.Pa, this.Pa += 1);
						switch (typeof h) {
							case "string":
								this.zc(h, n);
								return;
							case "number":
							case "boolean":
								this.yc(h + 0, n);
								return;
							case "object":
								if (null === h) {
									this.xc(n);
									return;
								}
								if (null != h.length) {
									this.uc(h, n);
									return;
								}
						}
						throw "Wrong API use : tried to bind a value of an unknown type (" + h + ").";
					};
					a.prototype.wc = function(h) {
						var n = this;
						Object.keys(h).forEach(function(t) {
							var v = U(n.Qa, t);
							0 !== v && n.Tb(h[t], v);
						});
						return !0;
					};
					a.prototype.vc = function(h) {
						for (var n = 0; n < h.length; n += 1) this.Tb(h[n], n + 1);
						return !0;
					};
					a.prototype.reset = function() {
						return 0 === Mb(this.Qa) && 0 === Lb(this.Qa);
					};
					a.prototype.freemem = function() {
						for (var h; void 0 !== (h = this.wb.pop());) da(h);
					};
					a.prototype.free = function() {
						var h = 0 === Nb(this.Qa);
						delete this.db.nb[this.Qa];
						this.Qa = 0;
						return h;
					};
					b.prototype.next = function() {
						if (null === this.hb) return { done: !0 };
						null !== this.eb && (this.eb.free(), this.eb = null);
						if (!this.db.db) throw this.Bb(), Error("Database closed");
						var h = ha(), n = C(4);
						ia(e);
						ia(n);
						try {
							this.db.handleError(B(this.db.db, this.sb, -1, e, n));
							this.sb = z(n, "i32");
							var t = z(e, "i32");
							if (0 === t) return this.Bb(), { done: !0 };
							this.eb = new a(t, this.db);
							this.db.nb[t] = this.eb;
							return {
								value: this.eb,
								done: !1
							};
						} catch (v) {
							throw this.Mb = F(this.sb), this.Bb(), v;
						} finally {
							ja(h);
						}
					};
					b.prototype.Bb = function() {
						da(this.hb);
						this.hb = null;
					};
					b.prototype.getRemainingSQL = function() {
						return null !== this.Mb ? this.Mb : F(this.sb);
					};
					"function" === typeof Symbol && "symbol" === typeof Symbol.iterator && (b.prototype[Symbol.iterator] = function() {
						return this;
					});
					c.prototype.run = function(h, n) {
						if (!this.db) throw "Database closed";
						if (n) {
							h = this.prepare(h, n);
							try {
								h.step();
							} finally {
								h.free();
							}
						} else this.handleError(l(this.db, h, 0, 0, e));
						return this;
					};
					c.prototype.exec = function(h, n) {
						if (!this.db) throw "Database closed";
						var t = ha(), v = null;
						try {
							var y = d(h) + 1, N = C(y);
							p(h, D, N, y);
							var H = N;
							var ea = C(4);
							for (h = []; 0 !== z(H, "i8");) {
								ia(e);
								ia(ea);
								this.handleError(B(this.db, H, -1, e, ea));
								var fa = z(e, "i32");
								H = z(ea, "i32");
								if (0 !== fa) {
									y = null;
									v = new a(fa, this);
									for (null != n && v.bind(n); v.step();) null === y && (y = {
										columns: v.getColumnNames(),
										values: []
									}, h.push(y)), y.values.push(v.get());
									v.free();
								}
							}
							return h;
						} catch (I) {
							throw v && v.free(), I;
						} finally {
							ja(t);
						}
					};
					c.prototype.each = function(h, n, t, v) {
						"function" === typeof n && (v = t, t = n, n = void 0);
						h = this.prepare(h, n);
						try {
							for (; h.step();) t(h.getAsObject());
						} finally {
							h.free();
						}
						if ("function" === typeof v) return v();
					};
					c.prototype.prepare = function(h, n) {
						ia(e);
						this.handleError(m(this.db, h, -1, e, 0));
						h = z(e, "i32");
						if (0 === h) throw "Nothing to prepare";
						var t = new a(h, this);
						null != n && t.bind(n);
						return this.nb[h] = t;
					};
					c.prototype.iterateStatements = function(h) {
						return new b(h, this);
					};
					c.prototype["export"] = function() {
						Object.values(this.nb).forEach(function(n) {
							n.free();
						});
						Object.values(this.Xa).forEach(ka);
						this.Xa = {};
						this.handleError(k(this.db));
						var h = w.readFile(this.filename, { encoding: "binary" });
						this.handleError(g(this.filename, e));
						this.db = z(e, "i32");
						return h;
					};
					c.prototype.close = function() {
						null !== this.db && (Object.values(this.nb).forEach(function(h) {
							h.free();
						}), Object.values(this.Xa).forEach(ka), this.Xa = {}, this.handleError(k(this.db)), this.Xc && w.unlink("/" + this.filename), this.db = null);
					};
					c.prototype.handleError = function(h) {
						if (0 === h) return null;
						h = G(this.db);
						throw Error(h);
					};
					c.prototype.getRowsModified = function() {
						return q(this.db);
					};
					c.prototype.create_function = function(h, n) {
						Object.prototype.hasOwnProperty.call(this.Xa, h) && (ka(this.Xa[h]), delete this.Xa[h]);
						var t = la(function(v, y, N) {
							for (var H, ea = [], fa = 0; fa < y; fa += 1) {
								var I = z(N + 4 * fa, "i32"), S = Pb(I);
								if (1 === S || 2 === S) I = Tb(I);
								else if (3 === S) I = Rb(I);
								else if (4 === S) {
									S = I;
									I = Qb(S);
									S = Sb(S);
									for (var fb = new Uint8Array(I), Aa = 0; Aa < I; Aa += 1) fb[Aa] = D[S + Aa];
									I = fb;
								} else I = null;
								ea.push(I);
							}
							try {
								H = n.apply(null, ea);
							} catch (Yb) {
								eb(v, Yb, -1);
								return;
							}
							switch (typeof H) {
								case "boolean":
									Xb(v, H ? 1 : 0);
									break;
								case "number":
									Ub(v, H);
									break;
								case "string":
									Vb(v, H, -1, -1);
									break;
								case "object":
									null === H ? db(v) : null != H.length ? (y = ca(H), Wb(v, y, H.length, -1), da(y)) : eb(v, "Wrong API use : tried to return a value of an unknown type (" + H + ").", -1);
									break;
								default: db(v);
							}
						}, "viii");
						this.Xa[h] = t;
						this.handleError(Ob(this.db, h, n.length, 1, 0, t, 0, 0, 0));
						return this;
					};
					Module.Database = c;
					var ra = /* @__PURE__ */ new Map();
					Module.register_for_idb = (h) => {
						let n = la(function(y, N) {
							y = ra.get(y);
							return h.lock(y, N) ? 0 : 5;
						}, "iii"), t = la(function(y, N) {
							y = ra.get(y);
							h.unlock(y, N);
							return 0;
						}, "iii"), v = la(function(y, N) {
							y = F(y);
							ra.set(N, y);
						}, "vii");
						Module._register_for_idb(n, t, v);
					};
					Module.cleanup_file = (h) => {
						let n = [...ra.entries()].find((t) => t[1] === h);
						ra.delete(n[0]);
					};
					Module.reset_filesystem = () => {
						w.root = null;
						w.lc();
					};
				};
				var ma = {}, K;
				for (K in Module) Module.hasOwnProperty(K) && (ma[K] = Module[K]);
				var na = "./this.program", oa = "object" === typeof window, pa = "function" === typeof importScripts, qa = "object" === typeof process$1 && "object" === typeof process$1.versions && "string" === typeof process$1.versions.node, L = "", sa, ta, ua, va, wa;
				if (qa) L = pa ? require_path_browserify().dirname(L) + "/" : __dirname + "/", sa = function(a, b) {
					va || (va = (init_empty(), __toCommonJS(empty_exports)));
					wa || (wa = require_path_browserify());
					a = wa.normalize(a);
					return va.readFileSync(a, b ? null : "utf8");
				}, ua = function(a) {
					a = sa(a, !0);
					a.buffer || (a = new Uint8Array(a));
					assert(a.buffer);
					return a;
				}, ta = function(a, b, c) {
					va || (va = (init_empty(), __toCommonJS(empty_exports)));
					wa || (wa = require_path_browserify());
					a = wa.normalize(a);
					va.readFile(a, function(e, f) {
						e ? c(e) : b(f.buffer);
					});
				}, 1 < process$1.argv.length && (na = process$1.argv[1].replace(/\\/g, "/")), process$1.argv.slice(2), "undefined" !== typeof module && (module.exports = Module), Module.inspect = function() {
					return "[Emscripten Module object]";
				};
				else if (oa || pa) pa ? L = self.location.href : "undefined" !== typeof document && document.currentScript && (L = document.currentScript.src), L = 0 !== L.indexOf("blob:") ? L.substr(0, L.lastIndexOf("/") + 1) : "", sa = function(a) {
					var b = new XMLHttpRequest();
					b.open("GET", a, !1);
					b.send(null);
					return b.responseText;
				}, pa && (ua = function(a) {
					var b = new XMLHttpRequest();
					b.open("GET", a, !1);
					b.responseType = "arraybuffer";
					b.send(null);
					return new Uint8Array(b.response);
				}), ta = function(a, b, c) {
					var e = new XMLHttpRequest();
					e.open("GET", a, !0);
					e.responseType = "arraybuffer";
					e.onload = function() {
						200 == e.status || 0 == e.status && e.response ? b(e.response) : c();
					};
					e.onerror = c;
					e.send(null);
				};
				var xa = Module.print || console.log.bind(console), M = Module.printErr || console.warn.bind(console);
				for (K in ma) ma.hasOwnProperty(K) && (Module[K] = ma[K]);
				ma = null;
				Module.thisProgram && (na = Module.thisProgram);
				var ya = [], za;
				function ka(a) {
					za.delete(O.get(a));
					ya.push(a);
				}
				function la(a, b) {
					if (!za) {
						za = /* @__PURE__ */ new WeakMap();
						for (var c = 0; c < O.length; c++) {
							var e = O.get(c);
							e && za.set(e, c);
						}
					}
					if (za.has(a)) a = za.get(a);
					else {
						if (ya.length) c = ya.pop();
						else {
							try {
								O.grow(1);
							} catch (l) {
								if (!(l instanceof RangeError)) throw l;
								throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";
							}
							c = O.length - 1;
						}
						try {
							O.set(c, a);
						} catch (l) {
							if (!(l instanceof TypeError)) throw l;
							if ("function" === typeof WebAssembly.Function) {
								var f = {
									i: "i32",
									j: "i64",
									f: "f32",
									d: "f64"
								}, g = {
									parameters: [],
									results: "v" == b[0] ? [] : [f[b[0]]]
								};
								for (e = 1; e < b.length; ++e) g.parameters.push(f[b[e]]);
								b = new WebAssembly.Function(g, a);
							} else {
								f = [
									1,
									0,
									1,
									96
								];
								g = b.slice(0, 1);
								b = b.slice(1);
								var k = {
									i: 127,
									j: 126,
									f: 125,
									d: 124
								};
								f.push(b.length);
								for (e = 0; e < b.length; ++e) f.push(k[b[e]]);
								"v" == g ? f.push(0) : f = f.concat([1, k[g]]);
								f[1] = f.length - 2;
								b = new Uint8Array([
									0,
									97,
									115,
									109,
									1,
									0,
									0,
									0
								].concat(f, [
									2,
									7,
									1,
									1,
									101,
									1,
									102,
									0,
									0,
									7,
									5,
									1,
									1,
									102,
									0,
									0
								]));
								b = new WebAssembly.Module(b);
								b = new WebAssembly.Instance(b, { e: { f: a } }).exports.f;
							}
							O.set(c, b);
						}
						za.set(a, c);
						a = c;
					}
					return a;
				}
				var Ba;
				Module.wasmBinary && (Ba = Module.wasmBinary);
				Module.noExitRuntime;
				"object" !== typeof WebAssembly && P("no native wasm support detected");
				function ia(a) {
					var b = "i32";
					"*" === b.charAt(b.length - 1) && (b = "i32");
					switch (b) {
						case "i1":
							D[a >> 0] = 0;
							break;
						case "i8":
							D[a >> 0] = 0;
							break;
						case "i16":
							Ca[a >> 1] = 0;
							break;
						case "i32":
							Q[a >> 2] = 0;
							break;
						case "i64":
							R = [0, (T = 0, 1 <= +Math.abs(T) ? 0 < T ? (Math.min(+Math.floor(T / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((T - +(~~T >>> 0)) / 4294967296) >>> 0 : 0)];
							Q[a >> 2] = R[0];
							Q[a + 4 >> 2] = R[1];
							break;
						case "float":
							Da[a >> 2] = 0;
							break;
						case "double":
							Ea[a >> 3] = 0;
							break;
						default: P("invalid type for setValue: " + b);
					}
				}
				function z(a, b) {
					b = b || "i8";
					"*" === b.charAt(b.length - 1) && (b = "i32");
					switch (b) {
						case "i1": return D[a >> 0];
						case "i8": return D[a >> 0];
						case "i16": return Ca[a >> 1];
						case "i32": return Q[a >> 2];
						case "i64": return Q[a >> 2];
						case "float": return Da[a >> 2];
						case "double": return Ea[a >> 3];
						default: P("invalid type for getValue: " + b);
					}
					return null;
				}
				var Fa, Ga = !1;
				function assert(a, b) {
					a || P("Assertion failed: " + b);
				}
				function Ha(a) {
					var b = Module["_" + a];
					assert(b, "Cannot call unknown function " + a + ", make sure it is exported");
					return b;
				}
				function Ia(a, b, c, e) {
					var f = {
						string: function(m) {
							var r = 0;
							if (null !== m && void 0 !== m && 0 !== m) {
								var x = (m.length << 2) + 1;
								r = C(x);
								p(m, u, r, x);
							}
							return r;
						},
						array: function(m) {
							var r = C(m.length);
							D.set(m, r);
							return r;
						}
					}, g = Ha(a), k = [];
					a = 0;
					if (e) for (var l = 0; l < e.length; l++) {
						var q = f[c[l]];
						q ? (0 === a && (a = ha()), k[l] = q(e[l])) : k[l] = e[l];
					}
					c = g.apply(null, k);
					c = function(m) {
						return "string" === b ? F(m) : "boolean" === b ? !!m : m;
					}(c);
					0 !== a && ja(a);
					return c;
				}
				var Ja = 0, La = 1;
				function ca(a) {
					var b = Ja == La ? C(a.length) : aa(a.length);
					a.subarray || a.slice ? u.set(a, b) : u.set(new Uint8Array(a), b);
					return b;
				}
				var Ma = "undefined" !== typeof TextDecoder ? new TextDecoder("utf8") : void 0;
				function Na(a, b, c) {
					var e = b + c;
					for (c = b; a[c] && !(c >= e);) ++c;
					if (16 < c - b && a.subarray && Ma) return Ma.decode(a.subarray(b, c));
					for (e = ""; b < c;) {
						var f = a[b++];
						if (f & 128) {
							var g = a[b++] & 63;
							if (192 == (f & 224)) e += String.fromCharCode((f & 31) << 6 | g);
							else {
								var k = a[b++] & 63;
								f = 224 == (f & 240) ? (f & 15) << 12 | g << 6 | k : (f & 7) << 18 | g << 12 | k << 6 | a[b++] & 63;
								65536 > f ? e += String.fromCharCode(f) : (f -= 65536, e += String.fromCharCode(55296 | f >> 10, 56320 | f & 1023));
							}
						} else e += String.fromCharCode(f);
					}
					return e;
				}
				function F(a, b) {
					return a ? Na(u, a, b) : "";
				}
				function p(a, b, c, e) {
					if (!(0 < e)) return 0;
					var f = c;
					e = c + e - 1;
					for (var g = 0; g < a.length; ++g) {
						var k = a.charCodeAt(g);
						if (55296 <= k && 57343 >= k) {
							var l = a.charCodeAt(++g);
							k = 65536 + ((k & 1023) << 10) | l & 1023;
						}
						if (127 >= k) {
							if (c >= e) break;
							b[c++] = k;
						} else {
							if (2047 >= k) {
								if (c + 1 >= e) break;
								b[c++] = 192 | k >> 6;
							} else {
								if (65535 >= k) {
									if (c + 2 >= e) break;
									b[c++] = 224 | k >> 12;
								} else {
									if (c + 3 >= e) break;
									b[c++] = 240 | k >> 18;
									b[c++] = 128 | k >> 12 & 63;
								}
								b[c++] = 128 | k >> 6 & 63;
							}
							b[c++] = 128 | k & 63;
						}
					}
					b[c] = 0;
					return c - f;
				}
				function d(a) {
					for (var b = 0, c = 0; c < a.length; ++c) {
						var e = a.charCodeAt(c);
						55296 <= e && 57343 >= e && (e = 65536 + ((e & 1023) << 10) | a.charCodeAt(++c) & 1023);
						127 >= e ? ++b : b = 2047 >= e ? b + 2 : 65535 >= e ? b + 3 : b + 4;
					}
					return b;
				}
				function Oa(a) {
					var b = d(a) + 1, c = aa(b);
					c && p(a, D, c, b);
					return c;
				}
				var Pa, D, u, Ca, Q, Da, Ea;
				function Qa() {
					var a = Fa.buffer;
					Pa = a;
					Module.HEAP8 = D = new Int8Array(a);
					Module.HEAP16 = Ca = new Int16Array(a);
					Module.HEAP32 = Q = new Int32Array(a);
					Module.HEAPU8 = u = new Uint8Array(a);
					Module.HEAPU16 = new Uint16Array(a);
					Module.HEAPU32 = new Uint32Array(a);
					Module.HEAPF32 = Da = new Float32Array(a);
					Module.HEAPF64 = Ea = new Float64Array(a);
				}
				var O, Ra = [], Sa = [], Ta = [];
				function Ua() {
					var a = Module.preRun.shift();
					Ra.unshift(a);
				}
				var Va = 0, Wa = null, Xa = null;
				function Ya() {
					Va++;
					Module.monitorRunDependencies && Module.monitorRunDependencies(Va);
				}
				function Za() {
					Va--;
					Module.monitorRunDependencies && Module.monitorRunDependencies(Va);
					if (0 == Va && (null !== Wa && (clearInterval(Wa), Wa = null), Xa)) {
						var a = Xa;
						Xa = null;
						a();
					}
				}
				Module.preloadedImages = {};
				Module.preloadedAudios = {};
				function P(a) {
					if (Module.onAbort) Module.onAbort(a);
					M(a);
					Ga = !0;
					throw new WebAssembly.RuntimeError("abort(" + a + "). Build with -s ASSERTIONS=1 for more info.");
				}
				function $a() {
					return V.startsWith("data:application/octet-stream;base64,");
				}
				var V = "sql-wasm.wasm";
				if (!$a()) {
					var ab = V;
					V = Module.locateFile ? Module.locateFile(ab, L) : L + ab;
				}
				function bb() {
					var a = V;
					try {
						if (a == V && Ba) return new Uint8Array(Ba);
						if (ua) return ua(a);
						throw "both async and sync fetching of the wasm failed";
					} catch (b) {
						P(b);
					}
				}
				function cb() {
					if (!Ba && (oa || pa)) {
						if ("function" === typeof fetch && !V.startsWith("file://")) return fetch(V, { credentials: "same-origin" }).then(function(a) {
							if (!a.ok) throw "failed to load wasm binary file at '" + V + "'";
							return a.arrayBuffer();
						}).catch(function() {
							return bb();
						});
						if (ta) return new Promise(function(a, b) {
							ta(V, function(c) {
								a(new Uint8Array(c));
							}, b);
						});
					}
					return Promise.resolve().then(function() {
						return bb();
					});
				}
				var T, R;
				function gb(a) {
					for (; 0 < a.length;) {
						var b = a.shift();
						if ("function" == typeof b) b(Module);
						else {
							var c = b.pd;
							"number" === typeof c ? void 0 === b.yb ? O.get(c)() : O.get(c)(b.yb) : c(void 0 === b.yb ? null : b.yb);
						}
					}
				}
				function hb(a) {
					return a.replace(/\b_Z[\w\d_]+/g, function(b) {
						return b === b ? b : b + " [" + b + "]";
					});
				}
				function ib() {
					function a(k) {
						return (k = k.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? k[1] : "GMT";
					}
					if (!jb) {
						jb = !0;
						var b = (/* @__PURE__ */ new Date()).getFullYear(), c = new Date(b, 0, 1), e = new Date(b, 6, 1);
						b = c.getTimezoneOffset();
						var f = e.getTimezoneOffset(), g = Math.max(b, f);
						Q[kb() >> 2] = 60 * g;
						Q[lb() >> 2] = Number(b != f);
						c = a(c);
						e = a(e);
						c = Oa(c);
						e = Oa(e);
						f < b ? (Q[mb() >> 2] = c, Q[mb() + 4 >> 2] = e) : (Q[mb() >> 2] = e, Q[mb() + 4 >> 2] = c);
					}
				}
				var jb;
				function nb(a, b) {
					for (var c = 0, e = a.length - 1; 0 <= e; e--) {
						var f = a[e];
						"." === f ? a.splice(e, 1) : ".." === f ? (a.splice(e, 1), c++) : c && (a.splice(e, 1), c--);
					}
					if (b) for (; c; c--) a.unshift("..");
					return a;
				}
				function ob(a) {
					var b = "/" === a.charAt(0), c = "/" === a.substr(-1);
					(a = nb(a.split("/").filter(function(e) {
						return !!e;
					}), !b).join("/")) || b || (a = ".");
					a && c && (a += "/");
					return (b ? "/" : "") + a;
				}
				function pb(a) {
					var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
					a = b[0];
					b = b[1];
					if (!a && !b) return ".";
					b && (b = b.substr(0, b.length - 1));
					return a + b;
				}
				function W(a) {
					if ("/" === a) return "/";
					a = ob(a);
					a = a.replace(/\/$/, "");
					var b = a.lastIndexOf("/");
					return -1 === b ? a : a.substr(b + 1);
				}
				function qb(a, b) {
					return ob(a + "/" + b);
				}
				function rb() {
					if ("object" === typeof crypto && "function" === typeof crypto.getRandomValues) {
						var a = new Uint8Array(1);
						return function() {
							crypto.getRandomValues(a);
							return a[0];
						};
					}
					if (qa) try {
						var b = require_crypto_browserify();
						return function() {
							return b.randomBytes(1)[0];
						};
					} catch (c) {}
					return function() {
						P("randomDevice");
					};
				}
				function sb() {
					for (var a = "", b = !1, c = arguments.length - 1; -1 <= c && !b; c--) {
						b = 0 <= c ? arguments[c] : w.cwd();
						if ("string" !== typeof b) throw new TypeError("Arguments to path.resolve must be strings");
						if (!b) return "";
						a = b + "/" + a;
						b = "/" === b.charAt(0);
					}
					a = nb(a.split("/").filter(function(e) {
						return !!e;
					}), !b).join("/");
					return (b ? "/" : "") + a || ".";
				}
				function tb(a, b) {
					function c(k) {
						for (var l = 0; l < k.length && "" === k[l]; l++);
						for (var q = k.length - 1; 0 <= q && "" === k[q]; q--);
						return l > q ? [] : k.slice(l, q - l + 1);
					}
					a = sb(a).substr(1);
					b = sb(b).substr(1);
					a = c(a.split("/"));
					b = c(b.split("/"));
					for (var e = Math.min(a.length, b.length), f = e, g = 0; g < e; g++) if (a[g] !== b[g]) {
						f = g;
						break;
					}
					e = [];
					for (g = f; g < a.length; g++) e.push("..");
					e = e.concat(b.slice(f));
					return e.join("/");
				}
				var ub = [];
				function vb(a, b) {
					ub[a] = {
						input: [],
						output: [],
						gb: b
					};
					w.Qb(a, wb);
				}
				var wb = {
					open: function(a) {
						var b = ub[a.node.rdev];
						if (!b) throw new w.ErrnoError(43);
						a.tty = b;
						a.seekable = !1;
					},
					close: function(a) {
						a.tty.gb.flush(a.tty);
					},
					flush: function(a) {
						a.tty.gb.flush(a.tty);
					},
					read: function(a, b, c, e) {
						if (!a.tty || !a.tty.gb.cc) throw new w.ErrnoError(60);
						for (var f = 0, g = 0; g < e; g++) {
							try {
								var k = a.tty.gb.cc(a.tty);
							} catch (l) {
								throw new w.ErrnoError(29);
							}
							if (void 0 === k && 0 === f) throw new w.ErrnoError(6);
							if (null === k || void 0 === k) break;
							f++;
							b[c + g] = k;
						}
						f && (a.node.timestamp = Date.now());
						return f;
					},
					write: function(a, b, c, e) {
						if (!a.tty || !a.tty.gb.Nb) throw new w.ErrnoError(60);
						try {
							for (var f = 0; f < e; f++) a.tty.gb.Nb(a.tty, b[c + f]);
						} catch (g) {
							throw new w.ErrnoError(29);
						}
						e && (a.node.timestamp = Date.now());
						return f;
					}
				}, xb = {
					cc: function(a) {
						if (!a.input.length) {
							var b = null;
							if (qa) {
								var c = Buffer$1.alloc(256), e = 0;
								try {
									e = va.readSync(process$1.stdin.fd, c, 0, 256, null);
								} catch (f) {
									if (f.toString().includes("EOF")) e = 0;
									else throw f;
								}
								0 < e ? b = c.slice(0, e).toString("utf-8") : b = null;
							} else "undefined" != typeof window && "function" == typeof window.prompt ? (b = window.prompt("Input: "), null !== b && (b += "\n")) : "function" == typeof readline && (b = readline(), null !== b && (b += "\n"));
							if (!b) return null;
							a.input = ba(b, !0);
						}
						return a.input.shift();
					},
					Nb: function(a, b) {
						null === b || 10 === b ? (xa(Na(a.output, 0)), a.output = []) : 0 != b && a.output.push(b);
					},
					flush: function(a) {
						a.output && 0 < a.output.length && (xa(Na(a.output, 0)), a.output = []);
					}
				}, yb = {
					Nb: function(a, b) {
						null === b || 10 === b ? (M(Na(a.output, 0)), a.output = []) : 0 != b && a.output.push(b);
					},
					flush: function(a) {
						a.output && 0 < a.output.length && (M(Na(a.output, 0)), a.output = []);
					}
				};
				function zb(a) {
					a = 65536 * Math.ceil(a / 65536);
					var b = Ab(65536, a);
					if (!b) return 0;
					u.fill(0, b, b + a);
					return b;
				}
				var X = {
					Va: null,
					mount: function() {
						return X.createNode(null, "/", 16895, 0);
					},
					createNode: function(a, b, c, e) {
						if (w.Rc(c) || w.isFIFO(c)) throw new w.ErrnoError(63);
						X.Va || (X.Va = {
							dir: {
								node: {
									getattr: X.node_ops.getattr,
									setattr: X.node_ops.setattr,
									lookup: X.node_ops.lookup,
									mknod: X.node_ops.mknod,
									rename: X.node_ops.rename,
									unlink: X.node_ops.unlink,
									rmdir: X.node_ops.rmdir,
									readdir: X.node_ops.readdir,
									symlink: X.node_ops.symlink
								},
								stream: { llseek: X.stream_ops.llseek }
							},
							file: {
								node: {
									getattr: X.node_ops.getattr,
									setattr: X.node_ops.setattr
								},
								stream: {
									llseek: X.stream_ops.llseek,
									read: X.stream_ops.read,
									write: X.stream_ops.write,
									allocate: X.stream_ops.allocate,
									mmap: X.stream_ops.mmap,
									msync: X.stream_ops.msync
								}
							},
							link: {
								node: {
									getattr: X.node_ops.getattr,
									setattr: X.node_ops.setattr,
									readlink: X.node_ops.readlink
								},
								stream: {}
							},
							Vb: {
								node: {
									getattr: X.node_ops.getattr,
									setattr: X.node_ops.setattr
								},
								stream: w.Cc
							}
						});
						c = w.createNode(a, b, c, e);
						w.isDir(c.mode) ? (c.node_ops = X.Va.dir.node, c.stream_ops = X.Va.dir.stream, c.Na = {}) : w.isFile(c.mode) ? (c.node_ops = X.Va.file.node, c.stream_ops = X.Va.file.stream, c.Ra = 0, c.Na = null) : w.fb(c.mode) ? (c.node_ops = X.Va.link.node, c.stream_ops = X.Va.link.stream) : w.pb(c.mode) && (c.node_ops = X.Va.Vb.node, c.stream_ops = X.Va.Vb.stream);
						c.timestamp = Date.now();
						a && (a.Na[b] = c, a.timestamp = c.timestamp);
						return c;
					},
					qd: function(a) {
						return a.Na ? a.Na.subarray ? a.Na.subarray(0, a.Ra) : new Uint8Array(a.Na) : new Uint8Array(0);
					},
					Zb: function(a, b) {
						var c = a.Na ? a.Na.length : 0;
						c >= b || (b = Math.max(b, c * (1048576 > c ? 2 : 1.125) >>> 0), 0 != c && (b = Math.max(b, 256)), c = a.Na, a.Na = new Uint8Array(b), 0 < a.Ra && a.Na.set(c.subarray(0, a.Ra), 0));
					},
					gd: function(a, b) {
						if (a.Ra != b) if (0 == b) a.Na = null, a.Ra = 0;
						else {
							var c = a.Na;
							a.Na = new Uint8Array(b);
							c && a.Na.set(c.subarray(0, Math.min(b, a.Ra)));
							a.Ra = b;
						}
					},
					node_ops: {
						getattr: function(a) {
							var b = {};
							b.dev = w.pb(a.mode) ? a.id : 1;
							b.ino = a.id;
							b.mode = a.mode;
							b.nlink = 1;
							b.uid = 0;
							b.gid = 0;
							b.rdev = a.rdev;
							w.isDir(a.mode) ? b.size = 4096 : w.isFile(a.mode) ? b.size = a.Ra : w.fb(a.mode) ? b.size = a.link.length : b.size = 0;
							b.atime = new Date(a.timestamp);
							b.mtime = new Date(a.timestamp);
							b.ctime = new Date(a.timestamp);
							b.Ac = 4096;
							b.blocks = Math.ceil(b.size / b.Ac);
							return b;
						},
						setattr: function(a, b) {
							void 0 !== b.mode && (a.mode = b.mode);
							void 0 !== b.timestamp && (a.timestamp = b.timestamp);
							void 0 !== b.size && X.gd(a, b.size);
						},
						lookup: function() {
							throw w.Db[44];
						},
						mknod: function(a, b, c, e) {
							return X.createNode(a, b, c, e);
						},
						rename: function(a, b, c) {
							if (w.isDir(a.mode)) {
								try {
									var e = w.lookupNode(b, c);
								} catch (g) {}
								if (e) for (var f in e.Na) throw new w.ErrnoError(55);
							}
							delete a.parent.Na[a.name];
							a.parent.timestamp = Date.now();
							a.name = c;
							b.Na[c] = a;
							b.timestamp = a.parent.timestamp;
							a.parent = b;
						},
						unlink: function(a, b) {
							delete a.Na[b];
							a.timestamp = Date.now();
						},
						rmdir: function(a, b) {
							var c = w.lookupNode(a, b), e;
							for (e in c.Na) throw new w.ErrnoError(55);
							delete a.Na[b];
							a.timestamp = Date.now();
						},
						readdir: function(a) {
							var b = [".", ".."], c;
							for (c in a.Na) a.Na.hasOwnProperty(c) && b.push(c);
							return b;
						},
						symlink: function(a, b, c) {
							a = X.createNode(a, b, 41471, 0);
							a.link = c;
							return a;
						},
						readlink: function(a) {
							if (!w.fb(a.mode)) throw new w.ErrnoError(28);
							return a.link;
						}
					},
					stream_ops: {
						read: function(a, b, c, e, f) {
							var g = a.node.Na;
							if (f >= a.node.Ra) return 0;
							a = Math.min(a.node.Ra - f, e);
							if (8 < a && g.subarray) b.set(g.subarray(f, f + a), c);
							else for (e = 0; e < a; e++) b[c + e] = g[f + e];
							return a;
						},
						write: function(a, b, c, e, f, g) {
							b.buffer === D.buffer && (g = !1);
							if (!e) return 0;
							a = a.node;
							a.timestamp = Date.now();
							if (b.subarray && (!a.Na || a.Na.subarray)) {
								if (g) return a.Na = b.subarray(c, c + e), a.Ra = e;
								if (0 === a.Ra && 0 === f) return a.Na = b.slice(c, c + e), a.Ra = e;
								if (f + e <= a.Ra) return a.Na.set(b.subarray(c, c + e), f), e;
							}
							X.Zb(a, f + e);
							if (a.Na.subarray && b.subarray) a.Na.set(b.subarray(c, c + e), f);
							else for (g = 0; g < e; g++) a.Na[f + g] = b[c + g];
							a.Ra = Math.max(a.Ra, f + e);
							return e;
						},
						llseek: function(a, b, c) {
							1 === c ? b += a.position : 2 === c && w.isFile(a.node.mode) && (b += a.node.Ra);
							if (0 > b) throw new w.ErrnoError(28);
							return b;
						},
						allocate: function(a, b, c) {
							X.Zb(a.node, b + c);
							a.node.Ra = Math.max(a.node.Ra, b + c);
						},
						mmap: function(a, b, c, e, f, g) {
							if (0 !== b) throw new w.ErrnoError(28);
							if (!w.isFile(a.node.mode)) throw new w.ErrnoError(43);
							a = a.node.Na;
							if (g & 2 || a.buffer !== Pa) {
								if (0 < e || e + c < a.length) a.subarray ? a = a.subarray(e, e + c) : a = Array.prototype.slice.call(a, e, e + c);
								e = !0;
								c = zb(c);
								if (!c) throw new w.ErrnoError(48);
								D.set(a, c);
							} else e = !1, c = a.byteOffset;
							return {
								ed: c,
								vb: e
							};
						},
						msync: function(a, b, c, e, f) {
							if (!w.isFile(a.node.mode)) throw new w.ErrnoError(43);
							if (f & 2) return 0;
							X.stream_ops.write(a, b, 0, e, c, !1);
							return 0;
						}
					}
				};
				function Bb(a, b, c) {
					var e = "al " + a;
					ta(a, function(f) {
						assert(f, "Loading data file \"" + a + "\" failed (no arrayBuffer).");
						b(new Uint8Array(f));
						e && Za();
					}, function() {
						if (c) c();
						else throw "Loading data file \"" + a + "\" failed.";
					});
					e && Ya();
				}
				var w = {
					root: null,
					mb: [],
					Xb: {},
					streams: [],
					Zc: 1,
					Ua: null,
					Wb: "/",
					Hb: !1,
					hc: !0,
					Sa: {},
					nc: { kc: {
						qc: 1,
						rc: 2
					} },
					ErrnoError: null,
					Db: {},
					Lc: null,
					tb: 0,
					lookupPath: function(a, b) {
						a = sb(w.cwd(), a);
						b = b || {};
						if (!a) return {
							path: "",
							node: null
						};
						var c = {
							Cb: !0,
							Pb: 0
						}, e;
						for (e in c) void 0 === b[e] && (b[e] = c[e]);
						if (8 < b.Pb) throw new w.ErrnoError(32);
						a = nb(a.split("/").filter(function(k) {
							return !!k;
						}), !1);
						var f = w.root;
						c = "/";
						for (e = 0; e < a.length; e++) {
							var g = e === a.length - 1;
							if (g && b.parent) break;
							f = w.lookupNode(f, a[e]);
							c = qb(c, a[e]);
							w.ab(f) && (!g || g && b.Cb) && (f = f.lb.root);
							if (!g || b.Ta) {
								for (g = 0; w.fb(f.mode);) if (f = w.readlink(c), c = sb(pb(c), f), f = w.lookupPath(c, { Pb: b.Pb }).node, 40 < g++) throw new w.ErrnoError(32);
							}
						}
						return {
							path: c,
							node: f
						};
					},
					Ya: function(a) {
						for (var b;;) {
							if (w.isRoot(a)) return a = a.mount.jc, b ? "/" !== a[a.length - 1] ? a + "/" + b : a + b : a;
							b = b ? a.name + "/" + b : a.name;
							a = a.parent;
						}
					},
					Gb: function(a, b) {
						for (var c = 0, e = 0; e < b.length; e++) c = (c << 5) - c + b.charCodeAt(e) | 0;
						return (a + c >>> 0) % w.Ua.length;
					},
					ec: function(a) {
						var b = w.Gb(a.parent.id, a.name);
						a.cb = w.Ua[b];
						w.Ua[b] = a;
					},
					fc: function(a) {
						var b = w.Gb(a.parent.id, a.name);
						if (w.Ua[b] === a) w.Ua[b] = a.cb;
						else for (b = w.Ua[b]; b;) {
							if (b.cb === a) {
								b.cb = a.cb;
								break;
							}
							b = b.cb;
						}
					},
					lookupNode: function(a, b) {
						var c = w.Vc(a);
						if (c) throw new w.ErrnoError(c, a);
						for (c = w.Ua[w.Gb(a.id, b)]; c; c = c.cb) {
							var e = c.name;
							if (c.parent.id === a.id && e === b) return c;
						}
						return w.lookup(a, b);
					},
					createNode: function(a, b, c, e) {
						a = new w.FSNode(a, b, c, e);
						w.ec(a);
						return a;
					},
					Ab: function(a) {
						w.fc(a);
					},
					isRoot: function(a) {
						return a === a.parent;
					},
					ab: function(a) {
						return !!a.lb;
					},
					isFile: function(a) {
						return 32768 === (a & 61440);
					},
					isDir: function(a) {
						return 16384 === (a & 61440);
					},
					fb: function(a) {
						return 40960 === (a & 61440);
					},
					pb: function(a) {
						return 8192 === (a & 61440);
					},
					Rc: function(a) {
						return 24576 === (a & 61440);
					},
					isFIFO: function(a) {
						return 4096 === (a & 61440);
					},
					isSocket: function(a) {
						return 49152 === (a & 49152);
					},
					Mc: {
						r: 0,
						"r+": 2,
						w: 577,
						"w+": 578,
						a: 1089,
						"a+": 1090
					},
					Yc: function(a) {
						var b = w.Mc[a];
						if ("undefined" === typeof b) throw Error("Unknown file open mode: " + a);
						return b;
					},
					$b: function(a) {
						var b = [
							"r",
							"w",
							"rw"
						][a & 3];
						a & 512 && (b += "w");
						return b;
					},
					Za: function(a, b) {
						if (w.hc) return 0;
						if (!b.includes("r") || a.mode & 292) {
							if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) return 2;
						} else return 2;
						return 0;
					},
					Vc: function(a) {
						var b = w.Za(a, "x");
						return b ? b : a.node_ops.lookup ? 0 : 2;
					},
					Lb: function(a, b) {
						try {
							return w.lookupNode(a, b), 20;
						} catch (c) {}
						return w.Za(a, "wx");
					},
					qb: function(a, b, c) {
						try {
							var e = w.lookupNode(a, b);
						} catch (f) {
							return f.Oa;
						}
						if (a = w.Za(a, "wx")) return a;
						if (c) {
							if (!w.isDir(e.mode)) return 54;
							if (w.isRoot(e) || w.Ya(e) === w.cwd()) return 10;
						} else if (w.isDir(e.mode)) return 31;
						return 0;
					},
					Wc: function(a, b) {
						return a ? w.fb(a.mode) ? 32 : w.isDir(a.mode) && ("r" !== w.$b(b) || b & 512) ? 31 : w.Za(a, w.$b(b)) : 44;
					},
					oc: 4096,
					$c: function(a, b) {
						b = b || w.oc;
						for (a = a || 0; a <= b; a++) if (!w.streams[a]) return a;
						throw new w.ErrnoError(33);
					},
					$a: function(a) {
						return w.streams[a];
					},
					Jc: function(a, b, c) {
						w.ub || (w.ub = function() {}, w.ub.prototype = { object: {
							get: function() {
								return this.node;
							},
							set: function(g) {
								this.node = g;
							}
						} });
						var e = new w.ub(), f;
						for (f in a) e[f] = a[f];
						a = e;
						b = w.$c(b, c);
						a.fd = b;
						return w.streams[b] = a;
					},
					Dc: function(a) {
						w.streams[a] = null;
					},
					Cc: {
						open: function(a) {
							a.stream_ops = w.Oc(a.node.rdev).stream_ops;
							a.stream_ops.open && a.stream_ops.open(a);
						},
						llseek: function() {
							throw new w.ErrnoError(70);
						}
					},
					Kb: function(a) {
						return a >> 8;
					},
					sd: function(a) {
						return a & 255;
					},
					bb: function(a, b) {
						return a << 8 | b;
					},
					Qb: function(a, b) {
						w.Xb[a] = { stream_ops: b };
					},
					Oc: function(a) {
						return w.Xb[a];
					},
					bc: function(a) {
						var b = [];
						for (a = [a]; a.length;) {
							var c = a.pop();
							b.push(c);
							a.push.apply(a, c.mb);
						}
						return b;
					},
					mc: function(a, b) {
						function c(k) {
							w.tb--;
							return b(k);
						}
						function e(k) {
							if (k) {
								if (!e.Kc) return e.Kc = !0, c(k);
							} else ++g >= f.length && c(null);
						}
						"function" === typeof a && (b = a, a = !1);
						w.tb++;
						1 < w.tb && M("warning: " + w.tb + " FS.syncfs operations in flight at once, probably just doing extra work");
						var f = w.bc(w.root.mount), g = 0;
						f.forEach(function(k) {
							if (!k.type.mc) return e(null);
							k.type.mc(k, a, e);
						});
					},
					mount: function(a, b, c) {
						var e = "/" === c, f = !c;
						if (e && w.root) throw new w.ErrnoError(10);
						if (!e && !f) {
							var g = w.lookupPath(c, { Cb: !1 });
							c = g.path;
							g = g.node;
							if (w.ab(g)) throw new w.ErrnoError(10);
							if (!w.isDir(g.mode)) throw new w.ErrnoError(54);
						}
						b = {
							type: a,
							vd: b,
							jc: c,
							mb: []
						};
						a = a.mount(b);
						a.mount = b;
						b.root = a;
						e ? w.root = a : g && (g.lb = b, g.mount && g.mount.mb.push(b));
						return a;
					},
					yd: function(a) {
						a = w.lookupPath(a, { Cb: !1 });
						if (!w.ab(a.node)) throw new w.ErrnoError(28);
						a = a.node;
						var b = a.lb, c = w.bc(b);
						Object.keys(w.Ua).forEach(function(e) {
							for (e = w.Ua[e]; e;) {
								var f = e.cb;
								c.includes(e.mount) && w.Ab(e);
								e = f;
							}
						});
						a.lb = null;
						a.mount.mb.splice(a.mount.mb.indexOf(b), 1);
					},
					lookup: function(a, b) {
						return a.node_ops.lookup(a, b);
					},
					mknod: function(a, b, c) {
						var e = w.lookupPath(a, { parent: !0 }).node;
						a = W(a);
						if (!a || "." === a || ".." === a) throw new w.ErrnoError(28);
						var f = w.Lb(e, a);
						if (f) throw new w.ErrnoError(f);
						if (!e.node_ops.mknod) throw new w.ErrnoError(63);
						return e.node_ops.mknod(e, a, b, c);
					},
					create: function(a, b) {
						return w.mknod(a, (void 0 !== b ? b : 438) & 4095 | 32768, 0);
					},
					mkdir: function(a, b) {
						return w.mknod(a, (void 0 !== b ? b : 511) & 1023 | 16384, 0);
					},
					td: function(a, b) {
						a = a.split("/");
						for (var c = "", e = 0; e < a.length; ++e) if (a[e]) {
							c += "/" + a[e];
							try {
								w.mkdir(c, b);
							} catch (f) {
								if (20 != f.Oa) throw f;
							}
						}
					},
					rb: function(a, b, c) {
						"undefined" === typeof c && (c = b, b = 438);
						return w.mknod(a, b | 8192, c);
					},
					symlink: function(a, b) {
						if (!sb(a)) throw new w.ErrnoError(44);
						var c = w.lookupPath(b, { parent: !0 }).node;
						if (!c) throw new w.ErrnoError(44);
						b = W(b);
						var e = w.Lb(c, b);
						if (e) throw new w.ErrnoError(e);
						if (!c.node_ops.symlink) throw new w.ErrnoError(63);
						return c.node_ops.symlink(c, b, a);
					},
					rename: function(a, b) {
						var c = pb(a), e = pb(b), f = W(a), g = W(b);
						var k = w.lookupPath(a, { parent: !0 });
						var l = k.node;
						k = w.lookupPath(b, { parent: !0 });
						k = k.node;
						if (!l || !k) throw new w.ErrnoError(44);
						if (l.mount !== k.mount) throw new w.ErrnoError(75);
						var q = w.lookupNode(l, f);
						e = tb(a, e);
						if ("." !== e.charAt(0)) throw new w.ErrnoError(28);
						e = tb(b, c);
						if ("." !== e.charAt(0)) throw new w.ErrnoError(55);
						try {
							var m = w.lookupNode(k, g);
						} catch (r) {}
						if (q !== m) {
							c = w.isDir(q.mode);
							if (f = w.qb(l, f, c)) throw new w.ErrnoError(f);
							if (f = m ? w.qb(k, g, c) : w.Lb(k, g)) throw new w.ErrnoError(f);
							if (!l.node_ops.rename) throw new w.ErrnoError(63);
							if (w.ab(q) || m && w.ab(m)) throw new w.ErrnoError(10);
							if (k !== l && (f = w.Za(l, "w"))) throw new w.ErrnoError(f);
							try {
								w.Sa.willMovePath && w.Sa.willMovePath(a, b);
							} catch (r) {
								M("FS.trackingDelegate['willMovePath']('" + a + "', '" + b + "') threw an exception: " + r.message);
							}
							w.fc(q);
							try {
								l.node_ops.rename(q, k, g);
							} catch (r) {
								throw r;
							} finally {
								w.ec(q);
							}
							try {
								if (w.Sa.onMovePath) w.Sa.onMovePath(a, b);
							} catch (r) {
								M("FS.trackingDelegate['onMovePath']('" + a + "', '" + b + "') threw an exception: " + r.message);
							}
						}
					},
					rmdir: function(a) {
						var b = w.lookupPath(a, { parent: !0 }).node, c = W(a), e = w.lookupNode(b, c), f = w.qb(b, c, !0);
						if (f) throw new w.ErrnoError(f);
						if (!b.node_ops.rmdir) throw new w.ErrnoError(63);
						if (w.ab(e)) throw new w.ErrnoError(10);
						try {
							w.Sa.willDeletePath && w.Sa.willDeletePath(a);
						} catch (g) {
							M("FS.trackingDelegate['willDeletePath']('" + a + "') threw an exception: " + g.message);
						}
						b.node_ops.rmdir(b, c);
						w.Ab(e);
						try {
							if (w.Sa.onDeletePath) w.Sa.onDeletePath(a);
						} catch (g) {
							M("FS.trackingDelegate['onDeletePath']('" + a + "') threw an exception: " + g.message);
						}
					},
					readdir: function(a) {
						a = w.lookupPath(a, { Ta: !0 }).node;
						if (!a.node_ops.readdir) throw new w.ErrnoError(54);
						return a.node_ops.readdir(a);
					},
					unlink: function(a) {
						var b = w.lookupPath(a, { parent: !0 }).node, c = W(a), e = w.lookupNode(b, c), f = w.qb(b, c, !1);
						if (f) throw new w.ErrnoError(f);
						if (!b.node_ops.unlink) throw new w.ErrnoError(63);
						if (w.ab(e)) throw new w.ErrnoError(10);
						try {
							w.Sa.willDeletePath && w.Sa.willDeletePath(a);
						} catch (g) {
							M("FS.trackingDelegate['willDeletePath']('" + a + "') threw an exception: " + g.message);
						}
						b.node_ops.unlink(b, c);
						w.Ab(e);
						try {
							if (w.Sa.onDeletePath) w.Sa.onDeletePath(a);
						} catch (g) {
							M("FS.trackingDelegate['onDeletePath']('" + a + "') threw an exception: " + g.message);
						}
					},
					readlink: function(a) {
						a = w.lookupPath(a).node;
						if (!a) throw new w.ErrnoError(44);
						if (!a.node_ops.readlink) throw new w.ErrnoError(28);
						return sb(w.Ya(a.parent), a.node_ops.readlink(a));
					},
					stat: function(a, b) {
						a = w.lookupPath(a, { Ta: !b }).node;
						if (!a) throw new w.ErrnoError(44);
						if (!a.node_ops.getattr) throw new w.ErrnoError(63);
						return a.node_ops.getattr(a);
					},
					lstat: function(a) {
						return w.stat(a, !0);
					},
					chmod: function(a, b, c) {
						a = "string" === typeof a ? w.lookupPath(a, { Ta: !c }).node : a;
						if (!a.node_ops.setattr) throw new w.ErrnoError(63);
						a.node_ops.setattr(a, {
							mode: b & 4095 | a.mode & -4096,
							timestamp: Date.now()
						});
					},
					lchmod: function(a, b) {
						w.chmod(a, b, !0);
					},
					fchmod: function(a, b) {
						a = w.$a(a);
						if (!a) throw new w.ErrnoError(8);
						w.chmod(a.node, b);
					},
					chown: function(a, b, c, e) {
						a = "string" === typeof a ? w.lookupPath(a, { Ta: !e }).node : a;
						if (!a.node_ops.setattr) throw new w.ErrnoError(63);
						a.node_ops.setattr(a, { timestamp: Date.now() });
					},
					lchown: function(a, b, c) {
						w.chown(a, b, c, !0);
					},
					fchown: function(a, b, c) {
						a = w.$a(a);
						if (!a) throw new w.ErrnoError(8);
						w.chown(a.node, b, c);
					},
					truncate: function(a, b) {
						if (0 > b) throw new w.ErrnoError(28);
						a = "string" === typeof a ? w.lookupPath(a, { Ta: !0 }).node : a;
						if (!a.node_ops.setattr) throw new w.ErrnoError(63);
						if (w.isDir(a.mode)) throw new w.ErrnoError(31);
						if (!w.isFile(a.mode)) throw new w.ErrnoError(28);
						var c = w.Za(a, "w");
						if (c) throw new w.ErrnoError(c);
						a.node_ops.setattr(a, {
							size: b,
							timestamp: Date.now()
						});
					},
					Nc: function(a, b) {
						a = w.$a(a);
						if (!a) throw new w.ErrnoError(8);
						if (0 === (a.flags & 2097155)) throw new w.ErrnoError(28);
						w.truncate(a.node, b);
					},
					kd: function(a, b, c) {
						a = w.lookupPath(a, { Ta: !0 }).node;
						a.node_ops.setattr(a, { timestamp: Math.max(b, c) });
					},
					open: function(a, b, c, e, f) {
						if ("" === a) throw new w.ErrnoError(44);
						b = "string" === typeof b ? w.Yc(b) : b;
						c = b & 64 ? ("undefined" === typeof c ? 438 : c) & 4095 | 32768 : 0;
						if ("object" === typeof a) var g = a;
						else {
							a = ob(a);
							try {
								g = w.lookupPath(a, { Ta: !(b & 131072) }).node;
							} catch (l) {}
						}
						var k = !1;
						if (b & 64) if (g) {
							if (b & 128) throw new w.ErrnoError(20);
						} else g = w.mknod(a, c, 0), k = !0;
						if (!g) throw new w.ErrnoError(44);
						w.pb(g.mode) && (b &= -513);
						if (b & 65536 && !w.isDir(g.mode)) throw new w.ErrnoError(54);
						if (!k && (c = w.Wc(g, b))) throw new w.ErrnoError(c);
						b & 512 && w.truncate(g, 0);
						b &= -131713;
						e = w.Jc({
							node: g,
							path: w.Ya(g),
							flags: b,
							seekable: !0,
							position: 0,
							stream_ops: g.stream_ops,
							jd: [],
							error: !1
						}, e, f);
						e.stream_ops.open && e.stream_ops.open(e);
						!Module.logReadFiles || b & 1 || (w.Ob || (w.Ob = {}), a in w.Ob || (w.Ob[a] = 1, M("FS.trackingDelegate error on read file: " + a)));
						try {
							w.Sa.onOpenFile && (f = 0, 1 !== (b & 2097155) && (f |= w.nc.kc.qc), 0 !== (b & 2097155) && (f |= w.nc.kc.rc), w.Sa.onOpenFile(a, f));
						} catch (l) {
							M("FS.trackingDelegate['onOpenFile']('" + a + "', flags) threw an exception: " + l.message);
						}
						return e;
					},
					close: function(a) {
						if (w.kb(a)) throw new w.ErrnoError(8);
						a.Fb && (a.Fb = null);
						try {
							a.stream_ops.close && a.stream_ops.close(a);
						} catch (b) {
							throw b;
						} finally {
							w.Dc(a.fd);
						}
						a.fd = null;
					},
					kb: function(a) {
						return null === a.fd;
					},
					llseek: function(a, b, c) {
						if (w.kb(a)) throw new w.ErrnoError(8);
						if (!a.seekable || !a.stream_ops.llseek) throw new w.ErrnoError(70);
						if (0 != c && 1 != c && 2 != c) throw new w.ErrnoError(28);
						a.position = a.stream_ops.llseek(a, b, c);
						a.jd = [];
						return a.position;
					},
					read: function(a, b, c, e, f) {
						if (0 > e || 0 > f) throw new w.ErrnoError(28);
						if (w.kb(a)) throw new w.ErrnoError(8);
						if (1 === (a.flags & 2097155)) throw new w.ErrnoError(8);
						if (w.isDir(a.node.mode)) throw new w.ErrnoError(31);
						if (!a.stream_ops.read) throw new w.ErrnoError(28);
						var g = "undefined" !== typeof f;
						if (!g) f = a.position;
						else if (!a.seekable) throw new w.ErrnoError(70);
						b = a.stream_ops.read(a, b, c, e, f);
						g || (a.position += b);
						return b;
					},
					write: function(a, b, c, e, f, g) {
						if (0 > e || 0 > f) throw new w.ErrnoError(28);
						if (w.kb(a)) throw new w.ErrnoError(8);
						if (0 === (a.flags & 2097155)) throw new w.ErrnoError(8);
						if (w.isDir(a.node.mode)) throw new w.ErrnoError(31);
						if (!a.stream_ops.write) throw new w.ErrnoError(28);
						a.seekable && a.flags & 1024 && w.llseek(a, 0, 2);
						var k = "undefined" !== typeof f;
						if (!k) f = a.position;
						else if (!a.seekable) throw new w.ErrnoError(70);
						b = a.stream_ops.write(a, b, c, e, f, g);
						k || (a.position += b);
						try {
							if (a.path && w.Sa.onWriteToFile) w.Sa.onWriteToFile(a.path);
						} catch (l) {
							M("FS.trackingDelegate['onWriteToFile']('" + a.path + "') threw an exception: " + l.message);
						}
						return b;
					},
					allocate: function(a, b, c) {
						if (w.kb(a)) throw new w.ErrnoError(8);
						if (0 > b || 0 >= c) throw new w.ErrnoError(28);
						if (0 === (a.flags & 2097155)) throw new w.ErrnoError(8);
						if (!w.isFile(a.node.mode) && !w.isDir(a.node.mode)) throw new w.ErrnoError(43);
						if (!a.stream_ops.allocate) throw new w.ErrnoError(138);
						a.stream_ops.allocate(a, b, c);
					},
					mmap: function(a, b, c, e, f, g) {
						if (0 !== (f & 2) && 0 === (g & 2) && 2 !== (a.flags & 2097155)) throw new w.ErrnoError(2);
						if (1 === (a.flags & 2097155)) throw new w.ErrnoError(2);
						if (!a.stream_ops.mmap) throw new w.ErrnoError(43);
						return a.stream_ops.mmap(a, b, c, e, f, g);
					},
					msync: function(a, b, c, e, f) {
						return a && a.stream_ops.msync ? a.stream_ops.msync(a, b, c, e, f) : 0;
					},
					ud: function() {
						return 0;
					},
					ic: function(a, b, c) {
						if (!a.stream_ops.ic) throw new w.ErrnoError(59);
						return a.stream_ops.ic(a, b, c);
					},
					readFile: function(a, b) {
						b = b || {};
						b.flags = b.flags || 0;
						b.encoding = b.encoding || "binary";
						if ("utf8" !== b.encoding && "binary" !== b.encoding) throw Error("Invalid encoding type \"" + b.encoding + "\"");
						var c, e = w.open(a, b.flags);
						a = w.stat(a).size;
						var f = new Uint8Array(a);
						w.read(e, f, 0, a, 0);
						"utf8" === b.encoding ? c = Na(f, 0) : "binary" === b.encoding && (c = f);
						w.close(e);
						return c;
					},
					writeFile: function(a, b, c) {
						c = c || {};
						c.flags = c.flags || 577;
						a = w.open(a, c.flags, c.mode);
						if ("string" === typeof b) {
							var e = new Uint8Array(d(b) + 1);
							b = p(b, e, 0, e.length);
							w.write(a, e, 0, b, void 0, c.Bc);
						} else if (ArrayBuffer.isView(b)) w.write(a, b, 0, b.byteLength, void 0, c.Bc);
						else throw Error("Unsupported data type");
						w.close(a);
					},
					cwd: function() {
						return w.Wb;
					},
					chdir: function(a) {
						a = w.lookupPath(a, { Ta: !0 });
						if (null === a.node) throw new w.ErrnoError(44);
						if (!w.isDir(a.node.mode)) throw new w.ErrnoError(54);
						var b = w.Za(a.node, "x");
						if (b) throw new w.ErrnoError(b);
						w.Wb = a.path;
					},
					Fc: function() {
						w.mkdir("/tmp");
						w.mkdir("/home");
						w.mkdir("/home/web_user");
					},
					Ec: function() {
						w.mkdir("/dev");
						w.Qb(w.bb(1, 3), {
							read: function() {
								return 0;
							},
							write: function(b, c, e, f) {
								return f;
							}
						});
						w.rb("/dev/null", w.bb(1, 3));
						vb(w.bb(5, 0), xb);
						vb(w.bb(6, 0), yb);
						w.rb("/dev/tty", w.bb(5, 0));
						w.rb("/dev/tty1", w.bb(6, 0));
						var a = rb();
						w.Wa("/dev", "random", a);
						w.Wa("/dev", "urandom", a);
						w.mkdir("/dev/shm");
						w.mkdir("/dev/shm/tmp");
					},
					Hc: function() {
						w.mkdir("/proc");
						var a = w.mkdir("/proc/self");
						w.mkdir("/proc/self/fd");
						w.mount({ mount: function() {
							var b = w.createNode(a, "fd", 16895, 73);
							b.node_ops = { lookup: function(c, e) {
								var f = w.$a(+e);
								if (!f) throw new w.ErrnoError(8);
								c = {
									parent: null,
									mount: { jc: "fake" },
									node_ops: { readlink: function() {
										return f.path;
									} }
								};
								return c.parent = c;
							} };
							return b;
						} }, {}, "/proc/self/fd");
					},
					Ic: function() {
						Module.stdin ? w.Wa("/dev", "stdin", Module.stdin) : w.symlink("/dev/tty", "/dev/stdin");
						Module.stdout ? w.Wa("/dev", "stdout", null, Module.stdout) : w.symlink("/dev/tty", "/dev/stdout");
						Module.stderr ? w.Wa("/dev", "stderr", null, Module.stderr) : w.symlink("/dev/tty1", "/dev/stderr");
						w.open("/dev/stdin", 0);
						w.open("/dev/stdout", 1);
						w.open("/dev/stderr", 1);
					},
					Yb: function() {
						w.ErrnoError || (w.ErrnoError = function(a, b) {
							this.node = b;
							this.hd = function(c) {
								this.Oa = c;
							};
							this.hd(a);
							this.message = "FS error";
						}, w.ErrnoError.prototype = Error(), w.ErrnoError.prototype.constructor = w.ErrnoError, [44].forEach(function(a) {
							w.Db[a] = new w.ErrnoError(a);
							w.Db[a].stack = "<generic error, no stack>";
						}));
					},
					lc: function() {
						w.Yb();
						w.Ua = Array(4096);
						w.mount(X, {}, "/");
						w.Fc();
						w.Ec();
						w.Hc();
						w.Lc = { MEMFS: X };
					},
					jb: function(a, b, c) {
						w.jb.Hb = !0;
						w.Yb();
						Module.stdin = a || Module.stdin;
						Module.stdout = b || Module.stdout;
						Module.stderr = c || Module.stderr;
						w.Ic();
					},
					wd: function() {
						w.jb.Hb = !1;
						var a = Module._fflush;
						a && a(0);
						for (a = 0; a < w.streams.length; a++) {
							var b = w.streams[a];
							b && w.close(b);
						}
					},
					Eb: function(a, b) {
						var c = 0;
						a && (c |= 365);
						b && (c |= 146);
						return c;
					},
					od: function(a, b) {
						a = w.xb(a, b);
						return a.exists ? a.object : null;
					},
					xb: function(a, b) {
						try {
							var c = w.lookupPath(a, { Ta: !b });
							a = c.path;
						} catch (f) {}
						var e = {
							isRoot: !1,
							exists: !1,
							error: 0,
							name: null,
							path: null,
							object: null,
							ad: !1,
							cd: null,
							bd: null
						};
						try {
							c = w.lookupPath(a, { parent: !0 }), e.ad = !0, e.cd = c.path, e.bd = c.node, e.name = W(a), c = w.lookupPath(a, { Ta: !b }), e.exists = !0, e.path = c.path, e.object = c.node, e.name = c.node.name, e.isRoot = "/" === c.path;
						} catch (f) {
							e.error = f.Oa;
						}
						return e;
					},
					md: function(a, b) {
						a = "string" === typeof a ? a : w.Ya(a);
						for (b = b.split("/").reverse(); b.length;) {
							var c = b.pop();
							if (c) {
								var e = qb(a, c);
								try {
									w.mkdir(e);
								} catch (f) {}
								a = e;
							}
						}
						return e;
					},
					Gc: function(a, b, c, e, f) {
						a = qb("string" === typeof a ? a : w.Ya(a), b);
						return w.create(a, w.Eb(e, f));
					},
					zb: function(a, b, c, e, f, g) {
						a = b ? qb("string" === typeof a ? a : w.Ya(a), b) : a;
						e = w.Eb(e, f);
						f = w.create(a, e);
						if (c) {
							if ("string" === typeof c) {
								a = Array(c.length);
								b = 0;
								for (var k = c.length; b < k; ++b) a[b] = c.charCodeAt(b);
								c = a;
							}
							w.chmod(f, e | 146);
							a = w.open(f, 577);
							w.write(a, c, 0, c.length, 0, g);
							w.close(a);
							w.chmod(f, e);
						}
						return f;
					},
					Wa: function(a, b, c, e) {
						a = qb("string" === typeof a ? a : w.Ya(a), b);
						b = w.Eb(!!c, !!e);
						w.Wa.Kb || (w.Wa.Kb = 64);
						var f = w.bb(w.Wa.Kb++, 0);
						w.Qb(f, {
							open: function(g) {
								g.seekable = !1;
							},
							close: function() {
								e && e.buffer && e.buffer.length && e(10);
							},
							read: function(g, k, l, q) {
								for (var m = 0, r = 0; r < q; r++) {
									try {
										var x = c();
									} catch (B) {
										throw new w.ErrnoError(29);
									}
									if (void 0 === x && 0 === m) throw new w.ErrnoError(6);
									if (null === x || void 0 === x) break;
									m++;
									k[l + r] = x;
								}
								m && (g.node.timestamp = Date.now());
								return m;
							},
							write: function(g, k, l, q) {
								for (var m = 0; m < q; m++) try {
									e(k[l + m]);
								} catch (r) {
									throw new w.ErrnoError(29);
								}
								q && (g.node.timestamp = Date.now());
								return m;
							}
						});
						return w.rb(a, b, f);
					},
					ac: function(a) {
						if (a.Ib || a.Sc || a.link || a.Na) return !0;
						if ("undefined" !== typeof XMLHttpRequest) throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
						if (sa) try {
							a.Na = ba(sa(a.url), !0), a.Ra = a.Na.length;
						} catch (b) {
							throw new w.ErrnoError(29);
						}
						else throw Error("Cannot load without read() or XMLHttpRequest.");
					},
					ld: function(a, b, c, e, f) {
						function g() {
							this.Jb = !1;
							this.ob = [];
						}
						g.prototype.get = function(m) {
							if (!(m > this.length - 1 || 0 > m)) {
								var r = m % this.chunkSize;
								return this.dc(m / this.chunkSize | 0)[r];
							}
						};
						g.prototype.pc = function(m) {
							this.dc = m;
						};
						g.prototype.Ub = function() {
							var m = new XMLHttpRequest();
							m.open("HEAD", c, !1);
							m.send(null);
							if (!(200 <= m.status && 300 > m.status || 304 === m.status)) throw Error("Couldn't load " + c + ". Status: " + m.status);
							var r = Number(m.getResponseHeader("Content-length")), x, B = (x = m.getResponseHeader("Accept-Ranges")) && "bytes" === x;
							m = (x = m.getResponseHeader("Content-Encoding")) && "gzip" === x;
							var E = 1048576;
							B || (E = r);
							var A = this;
							A.pc(function(J) {
								var Z = J * E, U = (J + 1) * E - 1;
								U = Math.min(U, r - 1);
								if ("undefined" === typeof A.ob[J]) {
									var Ka = A.ob;
									if (Z > U) throw Error("invalid range (" + Z + ", " + U + ") or no bytes requested!");
									if (U > r - 1) throw Error("only " + r + " bytes available! programmer error!");
									var G = new XMLHttpRequest();
									G.open("GET", c, !1);
									r !== E && G.setRequestHeader("Range", "bytes=" + Z + "-" + U);
									"undefined" != typeof Uint8Array && (G.responseType = "arraybuffer");
									G.overrideMimeType && G.overrideMimeType("text/plain; charset=x-user-defined");
									G.send(null);
									if (!(200 <= G.status && 300 > G.status || 304 === G.status)) throw Error("Couldn't load " + c + ". Status: " + G.status);
									Z = void 0 !== G.response ? new Uint8Array(G.response || []) : ba(G.responseText || "", !0);
									Ka[J] = Z;
								}
								if ("undefined" === typeof A.ob[J]) throw Error("doXHR failed!");
								return A.ob[J];
							});
							if (m || !r) E = r = 1, E = r = this.dc(0).length, xa("LazyFiles on gzip forces download of the whole file when length is accessed");
							this.tc = r;
							this.sc = E;
							this.Jb = !0;
						};
						if ("undefined" !== typeof XMLHttpRequest) {
							if (!pa) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
							var k = new g();
							Object.defineProperties(k, {
								length: { get: function() {
									this.Jb || this.Ub();
									return this.tc;
								} },
								chunkSize: { get: function() {
									this.Jb || this.Ub();
									return this.sc;
								} }
							});
							k = {
								Ib: !1,
								Na: k
							};
						} else k = {
							Ib: !1,
							url: c
						};
						var l = w.Gc(a, b, k, e, f);
						k.Na ? l.Na = k.Na : k.url && (l.Na = null, l.url = k.url);
						Object.defineProperties(l, { Ra: { get: function() {
							return this.Na.length;
						} } });
						var q = {};
						Object.keys(l.stream_ops).forEach(function(m) {
							var r = l.stream_ops[m];
							q[m] = function() {
								w.ac(l);
								return r.apply(null, arguments);
							};
						});
						q.read = function(m, r, x, B, E) {
							w.ac(l);
							m = m.node.Na;
							if (E >= m.length) return 0;
							B = Math.min(m.length - E, B);
							if (m.slice) for (var A = 0; A < B; A++) r[x + A] = m[E + A];
							else for (A = 0; A < B; A++) r[x + A] = m.get(E + A);
							return B;
						};
						l.stream_ops = q;
						return l;
					},
					nd: function(a, b, c, e, f, g, k, l, q, m) {
						function r(B) {
							function E(J) {
								m && m();
								l || w.zb(a, b, J, e, f, q);
								g && g();
								Za();
							}
							var A = !1;
							Module.preloadPlugins.forEach(function(J) {
								!A && J.canHandle(x) && (J.handle(B, x, E, function() {
									k && k();
									Za();
								}), A = !0);
							});
							A || E(B);
						}
						Zb.jb();
						var x = b ? sb(qb(a, b)) : a;
						Ya();
						"string" == typeof c ? Bb(c, function(B) {
							r(B);
						}, k) : r(c);
					},
					indexedDB: function() {
						return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
					},
					Rb: function() {
						return "EM_FS_" + window.location.pathname;
					},
					Sb: 20,
					ib: "FILE_DATA",
					xd: function(a, b, c) {
						b = b || function() {};
						c = c || function() {};
						var e = w.indexedDB();
						try {
							var f = e.open(w.Rb(), w.Sb);
						} catch (g) {
							return c(g);
						}
						f.onupgradeneeded = function() {
							xa("creating db");
							f.result.createObjectStore(w.ib);
						};
						f.onsuccess = function() {
							var g = f.result.transaction([w.ib], "readwrite"), k = g.objectStore(w.ib), l = 0, q = 0, m = a.length;
							a.forEach(function(r) {
								r = k.put(w.xb(r).object.Na, r);
								r.onsuccess = function() {
									l++;
									l + q == m && (0 == q ? b() : c());
								};
								r.onerror = function() {
									q++;
									l + q == m && (0 == q ? b() : c());
								};
							});
							g.onerror = c;
						};
						f.onerror = c;
					},
					rd: function(a, b, c) {
						b = b || function() {};
						c = c || function() {};
						var e = w.indexedDB();
						try {
							var f = e.open(w.Rb(), w.Sb);
						} catch (g) {
							return c(g);
						}
						f.onupgradeneeded = c;
						f.onsuccess = function() {
							var g = f.result;
							try {
								var k = g.transaction([w.ib], "readonly");
							} catch (x) {
								c(x);
								return;
							}
							var l = k.objectStore(w.ib), q = 0, m = 0, r = a.length;
							a.forEach(function(x) {
								var B = l.get(x);
								B.onsuccess = function() {
									w.xb(x).exists && w.unlink(x);
									w.zb(pb(x), W(x), B.result, !0, !0, !0);
									q++;
									q + m == r && (0 == m ? b() : c());
								};
								B.onerror = function() {
									m++;
									q + m == r && (0 == m ? b() : c());
								};
							});
							k.onerror = c;
						};
						f.onerror = c;
					}
				}, $b = {};
				function ac(a, b, c) {
					try {
						var e = a(b);
					} catch (f) {
						if (f && f.node && ob(b) !== ob(w.Ya(f.node))) return -54;
						throw f;
					}
					Q[c >> 2] = e.dev;
					Q[c + 4 >> 2] = 0;
					Q[c + 8 >> 2] = e.ino;
					Q[c + 12 >> 2] = e.mode;
					Q[c + 16 >> 2] = e.nlink;
					Q[c + 20 >> 2] = e.uid;
					Q[c + 24 >> 2] = e.gid;
					Q[c + 28 >> 2] = e.rdev;
					Q[c + 32 >> 2] = 0;
					R = [e.size >>> 0, (T = e.size, 1 <= +Math.abs(T) ? 0 < T ? (Math.min(+Math.floor(T / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((T - +(~~T >>> 0)) / 4294967296) >>> 0 : 0)];
					Q[c + 40 >> 2] = R[0];
					Q[c + 44 >> 2] = R[1];
					Q[c + 48 >> 2] = 4096;
					Q[c + 52 >> 2] = e.blocks;
					Q[c + 56 >> 2] = e.atime.getTime() / 1e3 | 0;
					Q[c + 60 >> 2] = 0;
					Q[c + 64 >> 2] = e.mtime.getTime() / 1e3 | 0;
					Q[c + 68 >> 2] = 0;
					Q[c + 72 >> 2] = e.ctime.getTime() / 1e3 | 0;
					Q[c + 76 >> 2] = 0;
					R = [e.ino >>> 0, (T = e.ino, 1 <= +Math.abs(T) ? 0 < T ? (Math.min(+Math.floor(T / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((T - +(~~T >>> 0)) / 4294967296) >>> 0 : 0)];
					Q[c + 80 >> 2] = R[0];
					Q[c + 84 >> 2] = R[1];
					return 0;
				}
				var bc = void 0;
				function cc() {
					bc += 4;
					return Q[bc - 4 >> 2];
				}
				function Y(a) {
					a = w.$a(a);
					if (!a) throw new w.ErrnoError(8);
					return a;
				}
				var dc = qa ? function() {
					var a = process$1.hrtime();
					return 1e3 * a[0] + a[1] / 1e6;
				} : function() {
					return performance.now();
				};
				var ec = {};
				function fc() {
					if (!gc) {
						var a = {
							USER: "web_user",
							LOGNAME: "web_user",
							PATH: "/",
							PWD: "/",
							HOME: "/home/web_user",
							LANG: ("object" === typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8",
							_: na || "./this.program"
						}, b;
						for (b in ec) void 0 === ec[b] ? delete a[b] : a[b] = ec[b];
						var c = [];
						for (b in a) c.push(b + "=" + a[b]);
						gc = c;
					}
					return gc;
				}
				var gc;
				function hc(a, b, c, e) {
					a || (a = this);
					this.parent = a;
					this.mount = a.mount;
					this.lb = null;
					this.id = w.Zc++;
					this.name = b;
					this.mode = c;
					this.node_ops = {};
					this.stream_ops = {};
					this.rdev = e;
				}
				Object.defineProperties(hc.prototype, {
					read: {
						get: function() {
							return 365 === (this.mode & 365);
						},
						set: function(a) {
							a ? this.mode |= 365 : this.mode &= -366;
						}
					},
					write: {
						get: function() {
							return 146 === (this.mode & 146);
						},
						set: function(a) {
							a ? this.mode |= 146 : this.mode &= -147;
						}
					},
					Sc: { get: function() {
						return w.isDir(this.mode);
					} },
					Ib: { get: function() {
						return w.pb(this.mode);
					} }
				});
				w.FSNode = hc;
				w.lc();
				var Zb;
				function ba(a, b) {
					var c = Array(d(a) + 1);
					a = p(a, c, 0, c.length);
					b && (c.length = a);
					return c;
				}
				var jc = {
					a: function(a, b, c, e) {
						P("Assertion failed: " + F(a) + ", at: " + [
							b ? F(b) : "unknown filename",
							c,
							e ? F(e) : "unknown function"
						]);
					},
					u: function(a, b) {
						ib();
						a = /* @__PURE__ */ new Date(1e3 * Q[a >> 2]);
						Q[b >> 2] = a.getSeconds();
						Q[b + 4 >> 2] = a.getMinutes();
						Q[b + 8 >> 2] = a.getHours();
						Q[b + 12 >> 2] = a.getDate();
						Q[b + 16 >> 2] = a.getMonth();
						Q[b + 20 >> 2] = a.getFullYear() - 1900;
						Q[b + 24 >> 2] = a.getDay();
						var c = new Date(a.getFullYear(), 0, 1);
						Q[b + 28 >> 2] = (a.getTime() - c.getTime()) / 864e5 | 0;
						Q[b + 36 >> 2] = -(60 * a.getTimezoneOffset());
						var e = new Date(a.getFullYear(), 6, 1).getTimezoneOffset();
						c = c.getTimezoneOffset();
						a = (e != c && a.getTimezoneOffset() == Math.min(c, e)) | 0;
						Q[b + 32 >> 2] = a;
						a = Q[mb() + (a ? 4 : 0) >> 2];
						Q[b + 40 >> 2] = a;
						return b;
					},
					m: function(a, b) {
						try {
							a = F(a);
							if (b & -8) var c = -28;
							else {
								var e;
								(e = w.lookupPath(a, { Ta: !0 }).node) ? (a = "", b & 4 && (a += "r"), b & 2 && (a += "w"), b & 1 && (a += "x"), c = a && w.Za(e, a) ? -2 : 0) : c = -44;
							}
							return c;
						} catch (f) {
							return "undefined" !== typeof w && f instanceof w.ErrnoError || P(f), -f.Oa;
						}
					},
					A: function(a, b) {
						try {
							return a = F(a), w.chmod(a, b), 0;
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), -c.Oa;
						}
					},
					H: function(a, b, c) {
						try {
							return a = F(a), w.chown(a, b, c), 0;
						} catch (e) {
							return "undefined" !== typeof w && e instanceof w.ErrnoError || P(e), -e.Oa;
						}
					},
					B: function(a, b) {
						try {
							return w.fchmod(a, b), 0;
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), -c.Oa;
						}
					},
					I: function(a, b, c) {
						try {
							return w.fchown(a, b, c), 0;
						} catch (e) {
							return "undefined" !== typeof w && e instanceof w.ErrnoError || P(e), -e.Oa;
						}
					},
					b: function(a, b, c) {
						bc = c;
						try {
							var e = Y(a);
							switch (b) {
								case 0:
									var f = cc();
									return 0 > f ? -28 : w.open(e.path, e.flags, 0, f).fd;
								case 1:
								case 2: return 0;
								case 3: return e.flags;
								case 4: return f = cc(), e.flags |= f, 0;
								case 12: return f = cc(), Ca[f + 0 >> 1] = 2, 0;
								case 13:
								case 14: return 0;
								case 16:
								case 8: return -28;
								case 9: return Q[ic() >> 2] = 28, -1;
								default: return -28;
							}
						} catch (g) {
							return "undefined" !== typeof w && g instanceof w.ErrnoError || P(g), -g.Oa;
						}
					},
					E: function(a, b) {
						try {
							var c = Y(a);
							return ac(w.stat, c.path, b);
						} catch (e) {
							return "undefined" !== typeof w && e instanceof w.ErrnoError || P(e), -e.Oa;
						}
					},
					n: function(a, b, c) {
						try {
							return w.Nc(a, c), 0;
						} catch (e) {
							return "undefined" !== typeof w && e instanceof w.ErrnoError || P(e), -e.Oa;
						}
					},
					l: function(a, b) {
						try {
							if (0 === b) return -28;
							var c = w.cwd();
							if (b < d(c) + 1) return -68;
							p(c, u, a, b);
							return a;
						} catch (e) {
							return "undefined" !== typeof w && e instanceof w.ErrnoError || P(e), -e.Oa;
						}
					},
					G: function() {
						return 0;
					},
					d: function() {
						return 42;
					},
					z: function(a, b) {
						try {
							return a = F(a), ac(w.lstat, a, b);
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), -c.Oa;
						}
					},
					C: function(a, b) {
						try {
							return a = F(a), a = ob(a), "/" === a[a.length - 1] && (a = a.substr(0, a.length - 1)), w.mkdir(a, b, 0), 0;
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), -c.Oa;
						}
					},
					y: function(a, b, c, e, f, g) {
						try {
							a: {
								g <<= 12;
								var k = !1;
								if (0 !== (e & 16) && 0 !== a % 65536) var l = -28;
								else {
									if (0 !== (e & 32)) {
										var q = zb(b);
										if (!q) {
											l = -48;
											break a;
										}
										k = !0;
									} else {
										var m = w.$a(f);
										if (!m) {
											l = -8;
											break a;
										}
										var r = w.mmap(m, a, b, g, c, e);
										q = r.ed;
										k = r.vb;
									}
									$b[q] = {
										Uc: q,
										Tc: b,
										vb: k,
										fd: f,
										dd: c,
										flags: e,
										offset: g
									};
									l = q;
								}
							}
							return l;
						} catch (x) {
							return "undefined" !== typeof w && x instanceof w.ErrnoError || P(x), -x.Oa;
						}
					},
					x: function(a, b) {
						try {
							var c = $b[a];
							if (0 !== b && c) {
								if (b === c.Tc) {
									var e = w.$a(c.fd);
									if (e && c.dd & 2) {
										var f = c.flags, g = c.offset, k = u.slice(a, a + b);
										w.msync(e, k, g, b, f);
									}
									$b[a] = null;
									c.vb && da(c.Uc);
								}
								var l = 0;
							} else l = -28;
							return l;
						} catch (q) {
							return "undefined" !== typeof w && q instanceof w.ErrnoError || P(q), -q.Oa;
						}
					},
					w: function(a, b, c) {
						bc = c;
						try {
							var e = F(a), f = c ? cc() : 0;
							return w.open(e, b, f).fd;
						} catch (g) {
							return "undefined" !== typeof w && g instanceof w.ErrnoError || P(g), -g.Oa;
						}
					},
					J: function(a, b, c) {
						try {
							a = F(a);
							if (0 >= c) var e = -28;
							else {
								var f = w.readlink(a), g = Math.min(c, d(f)), k = D[b + g];
								p(f, u, b, c + 1);
								D[b + g] = k;
								e = g;
							}
							return e;
						} catch (l) {
							return "undefined" !== typeof w && l instanceof w.ErrnoError || P(l), -l.Oa;
						}
					},
					F: function(a) {
						try {
							return a = F(a), w.rmdir(a), 0;
						} catch (b) {
							return "undefined" !== typeof w && b instanceof w.ErrnoError || P(b), -b.Oa;
						}
					},
					e: function(a, b) {
						try {
							return a = F(a), ac(w.stat, a, b);
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), -c.Oa;
						}
					},
					i: function(a) {
						try {
							return a = F(a), w.unlink(a), 0;
						} catch (b) {
							return "undefined" !== typeof w && b instanceof w.ErrnoError || P(b), -b.Oa;
						}
					},
					v: function() {
						return 2147483648;
					},
					p: function(a, b, c) {
						u.copyWithin(a, b, b + c);
					},
					c: function(a) {
						var b = u.length;
						a >>>= 0;
						if (2147483648 < a) return !1;
						for (var c = 1; 4 >= c; c *= 2) {
							var e = b * (1 + .2 / c);
							e = Math.min(e, a + 100663296);
							e = Math.max(a, e);
							0 < e % 65536 && (e += 65536 - e % 65536);
							a: {
								try {
									Fa.grow(Math.min(2147483648, e) - Pa.byteLength + 65535 >>> 16);
									Qa();
									var f = 1;
									break a;
								} catch (g) {}
								f = void 0;
							}
							if (f) return !0;
						}
						return !1;
					},
					t: function(a) {
						for (var b = dc(); dc() - b < a;);
					},
					r: function(a, b) {
						try {
							var c = 0;
							fc().forEach(function(e, f) {
								var g = b + c;
								f = Q[a + 4 * f >> 2] = g;
								for (g = 0; g < e.length; ++g) D[f++ >> 0] = e.charCodeAt(g);
								D[f >> 0] = 0;
								c += e.length + 1;
							});
							return 0;
						} catch (e) {
							return "undefined" !== typeof w && e instanceof w.ErrnoError || P(e), e.Oa;
						}
					},
					s: function(a, b) {
						try {
							var c = fc();
							Q[a >> 2] = c.length;
							var e = 0;
							c.forEach(function(f) {
								e += f.length + 1;
							});
							Q[b >> 2] = e;
							return 0;
						} catch (f) {
							return "undefined" !== typeof w && f instanceof w.ErrnoError || P(f), f.Oa;
						}
					},
					f: function(a) {
						try {
							var b = Y(a);
							w.close(b);
							return 0;
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), c.Oa;
						}
					},
					q: function(a, b) {
						try {
							var c = Y(a), e = c.tty ? 2 : w.isDir(c.mode) ? 3 : w.fb(c.mode) ? 7 : 4;
							D[b >> 0] = e;
							return 0;
						} catch (f) {
							return "undefined" !== typeof w && f instanceof w.ErrnoError || P(f), f.Oa;
						}
					},
					j: function(a, b, c, e) {
						try {
							a: {
								for (var f = Y(a), g = a = 0; g < c; g++) {
									var k = Q[b + (8 * g + 4) >> 2], l = w.read(f, D, Q[b + 8 * g >> 2], k, void 0);
									if (0 > l) {
										var q = -1;
										break a;
									}
									a += l;
									if (l < k) break;
								}
								q = a;
							}
							Q[e >> 2] = q;
							return 0;
						} catch (m) {
							return "undefined" !== typeof w && m instanceof w.ErrnoError || P(m), m.Oa;
						}
					},
					o: function(a, b, c, e, f) {
						try {
							var g = Y(a);
							a = 4294967296 * c + (b >>> 0);
							if (-9007199254740992 >= a || 9007199254740992 <= a) return -61;
							w.llseek(g, a, e);
							R = [g.position >>> 0, (T = g.position, 1 <= +Math.abs(T) ? 0 < T ? (Math.min(+Math.floor(T / 4294967296), 4294967295) | 0) >>> 0 : ~~+Math.ceil((T - +(~~T >>> 0)) / 4294967296) >>> 0 : 0)];
							Q[f >> 2] = R[0];
							Q[f + 4 >> 2] = R[1];
							g.Fb && 0 === a && 0 === e && (g.Fb = null);
							return 0;
						} catch (k) {
							return "undefined" !== typeof w && k instanceof w.ErrnoError || P(k), k.Oa;
						}
					},
					k: function(a) {
						try {
							var b = Y(a);
							return b.stream_ops && b.stream_ops.fsync ? -b.stream_ops.fsync(b) : 0;
						} catch (c) {
							return "undefined" !== typeof w && c instanceof w.ErrnoError || P(c), c.Oa;
						}
					},
					g: function(a, b, c, e) {
						try {
							a: {
								for (var f = Y(a), g = a = 0; g < c; g++) {
									var k = w.write(f, D, Q[b + 8 * g >> 2], Q[b + (8 * g + 4) >> 2], void 0);
									if (0 > k) {
										var l = -1;
										break a;
									}
									a += k;
								}
								l = a;
							}
							Q[e >> 2] = l;
							return 0;
						} catch (q) {
							return "undefined" !== typeof w && q instanceof w.ErrnoError || P(q), q.Oa;
						}
					},
					h: function(a) {
						var b = Date.now();
						Q[a >> 2] = b / 1e3 | 0;
						Q[a + 4 >> 2] = b % 1e3 * 1e3 | 0;
						return 0;
					},
					K: function(a) {
						var b = Date.now() / 1e3 | 0;
						a && (Q[a >> 2] = b);
						return b;
					},
					D: function(a, b) {
						if (b) {
							var c = b + 8;
							b = 1e3 * Q[c >> 2];
							b += Q[c + 4 >> 2] / 1e3;
						} else b = Date.now();
						a = F(a);
						try {
							w.kd(a, b, b);
							var e = 0;
						} catch (f) {
							if (!(f instanceof w.ErrnoError)) {
								b: {
									e = Error();
									if (!e.stack) {
										try {
											throw Error();
										} catch (g) {
											e = g;
										}
										if (!e.stack) {
											e = "(no stack trace available)";
											break b;
										}
									}
									e = e.stack.toString();
								}
								Module.extraStackTrace && (e += "\n" + Module.extraStackTrace());
								e = hb(e);
								throw f + " : " + e;
							}
							e = f.Oa;
							Q[ic() >> 2] = e;
							e = -1;
						}
						return e;
					}
				};
				(function() {
					function a(f) {
						Module.asm = f.exports;
						Fa = Module.asm.L;
						Qa();
						O = Module.asm.Da;
						Sa.unshift(Module.asm.M);
						Za();
					}
					function b(f) {
						a(f.instance);
					}
					function c(f) {
						return cb().then(function(g) {
							return WebAssembly.instantiate(g, e);
						}).then(f, function(g) {
							M("failed to asynchronously prepare wasm: " + g);
							P(g);
						});
					}
					var e = { a: jc };
					Ya();
					if (Module.instantiateWasm) try {
						return Module.instantiateWasm(e, a);
					} catch (f) {
						return M("Module.instantiateWasm callback failed with error: " + f), !1;
					}
					(function() {
						return Ba || "function" !== typeof WebAssembly.instantiateStreaming || $a() || V.startsWith("file://") || "function" !== typeof fetch ? c(b) : fetch(V, { credentials: "same-origin" }).then(function(f) {
							return WebAssembly.instantiateStreaming(f, e).then(b, function(g) {
								M("wasm streaming compile failed: " + g);
								M("falling back to ArrayBuffer instantiation");
								return c(b);
							});
						});
					})();
					return {};
				})();
				Module.___wasm_call_ctors = function() {
					return (Module.___wasm_call_ctors = Module.asm.M).apply(null, arguments);
				};
				Module._sqlite3_vfs_find = function() {
					return (Module._sqlite3_vfs_find = Module.asm.N).apply(null, arguments);
				};
				Module._sqlite3_free = function() {
					return (Module._sqlite3_free = Module.asm.O).apply(null, arguments);
				};
				var ic = Module.___errno_location = function() {
					return (ic = Module.___errno_location = Module.asm.P).apply(null, arguments);
				};
				Module._sqlite3_finalize = function() {
					return (Module._sqlite3_finalize = Module.asm.Q).apply(null, arguments);
				};
				Module._sqlite3_reset = function() {
					return (Module._sqlite3_reset = Module.asm.R).apply(null, arguments);
				};
				Module._sqlite3_clear_bindings = function() {
					return (Module._sqlite3_clear_bindings = Module.asm.S).apply(null, arguments);
				};
				Module._sqlite3_value_blob = function() {
					return (Module._sqlite3_value_blob = Module.asm.T).apply(null, arguments);
				};
				Module._sqlite3_value_text = function() {
					return (Module._sqlite3_value_text = Module.asm.U).apply(null, arguments);
				};
				Module._sqlite3_value_bytes = function() {
					return (Module._sqlite3_value_bytes = Module.asm.V).apply(null, arguments);
				};
				Module._sqlite3_value_double = function() {
					return (Module._sqlite3_value_double = Module.asm.W).apply(null, arguments);
				};
				Module._sqlite3_value_int = function() {
					return (Module._sqlite3_value_int = Module.asm.X).apply(null, arguments);
				};
				Module._sqlite3_value_type = function() {
					return (Module._sqlite3_value_type = Module.asm.Y).apply(null, arguments);
				};
				Module._sqlite3_result_blob = function() {
					return (Module._sqlite3_result_blob = Module.asm.Z).apply(null, arguments);
				};
				Module._sqlite3_result_double = function() {
					return (Module._sqlite3_result_double = Module.asm._).apply(null, arguments);
				};
				Module._sqlite3_result_error = function() {
					return (Module._sqlite3_result_error = Module.asm.$).apply(null, arguments);
				};
				Module._sqlite3_result_int = function() {
					return (Module._sqlite3_result_int = Module.asm.aa).apply(null, arguments);
				};
				Module._sqlite3_result_int64 = function() {
					return (Module._sqlite3_result_int64 = Module.asm.ba).apply(null, arguments);
				};
				Module._sqlite3_result_null = function() {
					return (Module._sqlite3_result_null = Module.asm.ca).apply(null, arguments);
				};
				Module._sqlite3_result_text = function() {
					return (Module._sqlite3_result_text = Module.asm.da).apply(null, arguments);
				};
				Module._sqlite3_step = function() {
					return (Module._sqlite3_step = Module.asm.ea).apply(null, arguments);
				};
				Module._sqlite3_column_count = function() {
					return (Module._sqlite3_column_count = Module.asm.fa).apply(null, arguments);
				};
				Module._sqlite3_data_count = function() {
					return (Module._sqlite3_data_count = Module.asm.ga).apply(null, arguments);
				};
				Module._sqlite3_column_blob = function() {
					return (Module._sqlite3_column_blob = Module.asm.ha).apply(null, arguments);
				};
				Module._sqlite3_column_bytes = function() {
					return (Module._sqlite3_column_bytes = Module.asm.ia).apply(null, arguments);
				};
				Module._sqlite3_column_double = function() {
					return (Module._sqlite3_column_double = Module.asm.ja).apply(null, arguments);
				};
				Module._sqlite3_column_text = function() {
					return (Module._sqlite3_column_text = Module.asm.ka).apply(null, arguments);
				};
				Module._sqlite3_column_type = function() {
					return (Module._sqlite3_column_type = Module.asm.la).apply(null, arguments);
				};
				Module._sqlite3_column_name = function() {
					return (Module._sqlite3_column_name = Module.asm.ma).apply(null, arguments);
				};
				Module._sqlite3_bind_blob = function() {
					return (Module._sqlite3_bind_blob = Module.asm.na).apply(null, arguments);
				};
				Module._sqlite3_bind_double = function() {
					return (Module._sqlite3_bind_double = Module.asm.oa).apply(null, arguments);
				};
				Module._sqlite3_bind_int = function() {
					return (Module._sqlite3_bind_int = Module.asm.pa).apply(null, arguments);
				};
				Module._sqlite3_bind_text = function() {
					return (Module._sqlite3_bind_text = Module.asm.qa).apply(null, arguments);
				};
				Module._sqlite3_bind_parameter_index = function() {
					return (Module._sqlite3_bind_parameter_index = Module.asm.ra).apply(null, arguments);
				};
				Module._sqlite3_sql = function() {
					return (Module._sqlite3_sql = Module.asm.sa).apply(null, arguments);
				};
				Module._sqlite3_normalized_sql = function() {
					return (Module._sqlite3_normalized_sql = Module.asm.ta).apply(null, arguments);
				};
				Module._sqlite3_errmsg = function() {
					return (Module._sqlite3_errmsg = Module.asm.ua).apply(null, arguments);
				};
				Module._sqlite3_exec = function() {
					return (Module._sqlite3_exec = Module.asm.va).apply(null, arguments);
				};
				Module._sqlite3_prepare_v2 = function() {
					return (Module._sqlite3_prepare_v2 = Module.asm.wa).apply(null, arguments);
				};
				Module._sqlite3_changes = function() {
					return (Module._sqlite3_changes = Module.asm.xa).apply(null, arguments);
				};
				Module._sqlite3_close_v2 = function() {
					return (Module._sqlite3_close_v2 = Module.asm.ya).apply(null, arguments);
				};
				Module._sqlite3_create_function_v2 = function() {
					return (Module._sqlite3_create_function_v2 = Module.asm.za).apply(null, arguments);
				};
				Module._sqlite3_open = function() {
					return (Module._sqlite3_open = Module.asm.Aa).apply(null, arguments);
				};
				var aa = Module._malloc = function() {
					return (aa = Module._malloc = Module.asm.Ba).apply(null, arguments);
				}, da = Module._free = function() {
					return (da = Module._free = Module.asm.Ca).apply(null, arguments);
				};
				Module._RegisterExtensionFunctions = function() {
					return (Module._RegisterExtensionFunctions = Module.asm.Ea).apply(null, arguments);
				};
				Module._register_for_idb = function() {
					return (Module._register_for_idb = Module.asm.Fa).apply(null, arguments);
				};
				var mb = Module.__get_tzname = function() {
					return (mb = Module.__get_tzname = Module.asm.Ga).apply(null, arguments);
				}, lb = Module.__get_daylight = function() {
					return (lb = Module.__get_daylight = Module.asm.Ha).apply(null, arguments);
				}, kb = Module.__get_timezone = function() {
					return (kb = Module.__get_timezone = Module.asm.Ia).apply(null, arguments);
				}, ha = Module.stackSave = function() {
					return (ha = Module.stackSave = Module.asm.Ja).apply(null, arguments);
				}, ja = Module.stackRestore = function() {
					return (ja = Module.stackRestore = Module.asm.Ka).apply(null, arguments);
				}, C = Module.stackAlloc = function() {
					return (C = Module.stackAlloc = Module.asm.La).apply(null, arguments);
				}, Ab = Module._memalign = function() {
					return (Ab = Module._memalign = Module.asm.Ma).apply(null, arguments);
				};
				Module.cwrap = function(a, b, c, e) {
					c = c || [];
					var f = c.every(function(g) {
						return "number" === g;
					});
					return "string" !== b && f && !e ? Ha(a) : function() {
						return Ia(a, b, c, arguments);
					};
				};
				Module.UTF8ToString = F;
				Module.FS = w;
				Module.stackSave = ha;
				Module.stackRestore = ja;
				Module.stackAlloc = C;
				var kc;
				Xa = function lc() {
					kc || mc();
					kc || (Xa = lc);
				};
				function mc() {
					function a() {
						if (!kc && (kc = !0, Module.calledRun = !0, !Ga)) {
							Module.noFSInit || w.jb.Hb || w.jb();
							w.hc = !1;
							gb(Sa);
							if (Module.onRuntimeInitialized) Module.onRuntimeInitialized();
							if (Module.postRun) for ("function" == typeof Module.postRun && (Module.postRun = [Module.postRun]); Module.postRun.length;) {
								var b = Module.postRun.shift();
								Ta.unshift(b);
							}
							gb(Ta);
						}
					}
					if (!(0 < Va)) {
						if (Module.preRun) for ("function" == typeof Module.preRun && (Module.preRun = [Module.preRun]); Module.preRun.length;) Ua();
						gb(Ra);
						0 < Va || (Module.setStatus ? (Module.setStatus("Running..."), setTimeout(function() {
							setTimeout(function() {
								Module.setStatus("");
							}, 1);
							a();
						}, 1)) : a());
					}
				}
				Module.run = mc;
				if (Module.preInit) for ("function" == typeof Module.preInit && (Module.preInit = [Module.preInit]); 0 < Module.preInit.length;) Module.preInit.pop()();
				mc();
				return Module;
			});
			return initSqlJsPromise;
		};
		if (typeof exports === "object" && typeof module === "object") {
			module.exports = initSqlJs;
			module.exports.default = initSqlJs;
		} else if (typeof define === "function" && define["amd"]) define([], function() {
			return initSqlJs;
		});
		else if (typeof exports === "object") exports["Module"] = initSqlJs;
	})))());
	var iMap = {
		ł: "l",
		ø: "o",
		ß: "ss",
		œ: "oe"
	};
	var iRegex = new RegExp(Object.keys(iMap).join("|"), "g");
	function getNormalisedString(value) {
		return value.toLowerCase().replace(iRegex, (m) => iMap[m]).normalize("NFD").replace(/\p{Diacritic}/gu, "");
	}
	//#endregion
	//#region ../loot-core/src/platform/server/sqlite/normalise.ts
	function normalise(value) {
		if (!value) return null;
		return getNormalisedString(value);
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/assertClassBrand.js
	function _assertClassBrand(e, t, n) {
		if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
		throw new TypeError("Private element is not present on this object");
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/checkPrivateRedeclaration.js
	function _checkPrivateRedeclaration(e, t) {
		if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/classPrivateMethodInitSpec.js
	function _classPrivateMethodInitSpec(e, a) {
		_checkPrivateRedeclaration(e, a), a.add(e);
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/classPrivateFieldInitSpec.js
	function _classPrivateFieldInitSpec(e, t, a) {
		_checkPrivateRedeclaration(e, t), t.set(e, a);
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/classPrivateFieldGet2.js
	function _classPrivateFieldGet2(s, a) {
		return s.get(_assertClassBrand(s, a));
	}
	//#endregion
	//#region \0@oxc-project+runtime@0.124.0/helpers/classPrivateFieldSet2.js
	function _classPrivateFieldSet2(s, a, r) {
		return s.set(_assertClassBrand(s, a), r), r;
	}
	//#endregion
	//#region ../../node_modules/lru-cache/dist/esm/browser/index.min.js
	init_dist$1();
	var _u, _o, _o2, _u2, _w, _D, _S, _M, _U, _m, _n, _b, _s, _i, _t, _a, _c, _l, _h, _y, _r, _2, _F, _d, _g, _T, _W, _f, _j, _u_brand, _x, _E, _N, _p, _R, _I, _k;
	var _Symbol$toStringTag, _Symbol$iterator;
	var C = { hasSubscribers: !1 }, S = C, W = C, D = () => S.hasSubscribers || W.hasSubscribers, I = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date, U = /* @__PURE__ */ new Set(), L = typeof process$1 == "object" && process$1 ? process$1 : {}, G = (u, e, t, i) => {
		typeof L.emitWarning == "function" ? L.emitWarning(u, e, t, i) : console.error(`[${t}] ${e}: ${u}`);
	}, P = (u) => !U.has(u), F = (u) => !!u && u === Math.floor(u) && u > 0 && isFinite(u), j = (u) => F(u) ? u <= Math.pow(2, 8) ? Uint8Array : u <= Math.pow(2, 16) ? Uint16Array : u <= Math.pow(2, 32) ? Uint32Array : u <= Number.MAX_SAFE_INTEGER ? O : null : null, O = class extends Array {
		constructor(e) {
			super(e), this.fill(0);
		}
	}, R = (_u = class u {
		static create(e) {
			let t = j(e);
			if (!t) return [];
			_o._ = _assertClassBrand(_u, u, !0);
			let i = new u(e, t);
			return _o._ = _assertClassBrand(_u, u, !1), i;
		}
		constructor(e, t) {
			_defineProperty(this, "heap", void 0);
			_defineProperty(this, "length", void 0);
			if (!_assertClassBrand(_u, u, _o)._) throw new TypeError("instantiate Stack using Stack.create(n)");
			this.heap = new t(e), this.length = 0;
		}
		push(e) {
			this.heap[this.length++] = e;
		}
		pop() {
			return this.heap[--this.length];
		}
	}, _o = { _: !1 }, _u), M$1 = (_o2 = /* @__PURE__ */ new WeakMap(), _u2 = /* @__PURE__ */ new WeakMap(), _w = /* @__PURE__ */ new WeakMap(), _D = /* @__PURE__ */ new WeakMap(), _S = /* @__PURE__ */ new WeakMap(), _M = /* @__PURE__ */ new WeakMap(), _U = /* @__PURE__ */ new WeakMap(), _m = /* @__PURE__ */ new WeakMap(), _n = /* @__PURE__ */ new WeakMap(), _b = /* @__PURE__ */ new WeakMap(), _s = /* @__PURE__ */ new WeakMap(), _i = /* @__PURE__ */ new WeakMap(), _t = /* @__PURE__ */ new WeakMap(), _a = /* @__PURE__ */ new WeakMap(), _c = /* @__PURE__ */ new WeakMap(), _l = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), _y = /* @__PURE__ */ new WeakMap(), _r = /* @__PURE__ */ new WeakMap(), _2 = /* @__PURE__ */ new WeakMap(), _F = /* @__PURE__ */ new WeakMap(), _d = /* @__PURE__ */ new WeakMap(), _g = /* @__PURE__ */ new WeakMap(), _T = /* @__PURE__ */ new WeakMap(), _W = /* @__PURE__ */ new WeakMap(), _f = /* @__PURE__ */ new WeakMap(), _j = /* @__PURE__ */ new WeakMap(), _u_brand = /* @__PURE__ */ new WeakSet(), _x = /* @__PURE__ */ new WeakMap(), _E = /* @__PURE__ */ new WeakMap(), _N = /* @__PURE__ */ new WeakMap(), _p = /* @__PURE__ */ new WeakMap(), _R = /* @__PURE__ */ new WeakMap(), _I = /* @__PURE__ */ new WeakMap(), _k = /* @__PURE__ */ new WeakMap(), _Symbol$iterator = Symbol.iterator, _Symbol$toStringTag = Symbol.toStringTag, class u {
		get perf() {
			return _classPrivateFieldGet2(_m, this);
		}
		static unsafeExposeInternals(e) {
			return {
				starts: _classPrivateFieldGet2(_F, e),
				ttls: _classPrivateFieldGet2(_d, e),
				autopurgeTimers: _classPrivateFieldGet2(_g, e),
				sizes: _classPrivateFieldGet2(_2, e),
				keyMap: _classPrivateFieldGet2(_s, e),
				keyList: _classPrivateFieldGet2(_i, e),
				valList: _classPrivateFieldGet2(_t, e),
				next: _classPrivateFieldGet2(_a, e),
				prev: _classPrivateFieldGet2(_c, e),
				get head() {
					return _classPrivateFieldGet2(_l, e);
				},
				get tail() {
					return _classPrivateFieldGet2(_h, e);
				},
				free: _classPrivateFieldGet2(_y, e),
				isBackgroundFetch: (t) => _assertClassBrand(_u_brand, e, _e).call(e, t),
				backgroundFetch: (t, i, s, n) => _assertClassBrand(_u_brand, e, _P).call(e, t, i, s, n),
				moveToTail: (t) => _assertClassBrand(_u_brand, e, _L).call(e, t),
				indexes: (t) => _assertClassBrand(_u_brand, e, _A).call(e, t),
				rindexes: (t) => _assertClassBrand(_u_brand, e, _z).call(e, t),
				isStale: (t) => _classPrivateFieldGet2(_p, e).call(e, t)
			};
		}
		get max() {
			return _classPrivateFieldGet2(_o2, this);
		}
		get maxSize() {
			return _classPrivateFieldGet2(_u2, this);
		}
		get calculatedSize() {
			return _classPrivateFieldGet2(_b, this);
		}
		get size() {
			return _classPrivateFieldGet2(_n, this);
		}
		get fetchMethod() {
			return _classPrivateFieldGet2(_M, this);
		}
		get memoMethod() {
			return _classPrivateFieldGet2(_U, this);
		}
		get dispose() {
			return _classPrivateFieldGet2(_w, this);
		}
		get onInsert() {
			return _classPrivateFieldGet2(_D, this);
		}
		get disposeAfter() {
			return _classPrivateFieldGet2(_S, this);
		}
		constructor(e) {
			_classPrivateMethodInitSpec(this, _u_brand);
			_classPrivateFieldInitSpec(this, _o2, void 0);
			_classPrivateFieldInitSpec(this, _u2, void 0);
			_classPrivateFieldInitSpec(this, _w, void 0);
			_classPrivateFieldInitSpec(this, _D, void 0);
			_classPrivateFieldInitSpec(this, _S, void 0);
			_classPrivateFieldInitSpec(this, _M, void 0);
			_classPrivateFieldInitSpec(this, _U, void 0);
			_classPrivateFieldInitSpec(this, _m, void 0);
			_defineProperty(this, "ttl", void 0);
			_defineProperty(this, "ttlResolution", void 0);
			_defineProperty(this, "ttlAutopurge", void 0);
			_defineProperty(this, "updateAgeOnGet", void 0);
			_defineProperty(this, "updateAgeOnHas", void 0);
			_defineProperty(this, "allowStale", void 0);
			_defineProperty(this, "noDisposeOnSet", void 0);
			_defineProperty(this, "noUpdateTTL", void 0);
			_defineProperty(this, "maxEntrySize", void 0);
			_defineProperty(this, "sizeCalculation", void 0);
			_defineProperty(this, "noDeleteOnFetchRejection", void 0);
			_defineProperty(this, "noDeleteOnStaleGet", void 0);
			_defineProperty(this, "allowStaleOnFetchAbort", void 0);
			_defineProperty(this, "allowStaleOnFetchRejection", void 0);
			_defineProperty(this, "ignoreFetchAbort", void 0);
			_classPrivateFieldInitSpec(this, _n, void 0);
			_classPrivateFieldInitSpec(this, _b, void 0);
			_classPrivateFieldInitSpec(this, _s, void 0);
			_classPrivateFieldInitSpec(this, _i, void 0);
			_classPrivateFieldInitSpec(this, _t, void 0);
			_classPrivateFieldInitSpec(this, _a, void 0);
			_classPrivateFieldInitSpec(this, _c, void 0);
			_classPrivateFieldInitSpec(this, _l, void 0);
			_classPrivateFieldInitSpec(this, _h, void 0);
			_classPrivateFieldInitSpec(this, _y, void 0);
			_classPrivateFieldInitSpec(this, _r, void 0);
			_classPrivateFieldInitSpec(this, _2, void 0);
			_classPrivateFieldInitSpec(this, _F, void 0);
			_classPrivateFieldInitSpec(this, _d, void 0);
			_classPrivateFieldInitSpec(this, _g, void 0);
			_classPrivateFieldInitSpec(this, _T, void 0);
			_classPrivateFieldInitSpec(this, _W, void 0);
			_classPrivateFieldInitSpec(this, _f, void 0);
			_classPrivateFieldInitSpec(this, _j, void 0);
			_classPrivateFieldInitSpec(this, _x, () => {});
			_classPrivateFieldInitSpec(this, _E, () => {});
			_classPrivateFieldInitSpec(this, _N, () => {});
			_classPrivateFieldInitSpec(this, _p, () => !1);
			_classPrivateFieldInitSpec(this, _R, (e) => {});
			_classPrivateFieldInitSpec(this, _I, (e, t, i) => {});
			_classPrivateFieldInitSpec(this, _k, (e, t, i, s) => {
				if (i || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
				return 0;
			});
			_defineProperty(this, _Symbol$toStringTag, "LRUCache");
			let { max: t = 0, ttl: i, ttlResolution: s = 1, ttlAutopurge: n, updateAgeOnGet: o, updateAgeOnHas: r, allowStale: h, dispose: l, onInsert: c, disposeAfter: f, noDisposeOnSet: g, noUpdateTTL: p, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation: y, fetchMethod: a, memoMethod: m, noDeleteOnFetchRejection: _, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: d, allowStaleOnFetchAbort: A, ignoreFetchAbort: z, perf: x } = e;
			if (x !== void 0 && typeof x?.now != "function") throw new TypeError("perf option must have a now() method if specified");
			if (_classPrivateFieldSet2(_m, this, x ?? I), t !== 0 && !F(t)) throw new TypeError("max option must be a nonnegative integer");
			let v = t ? j(t) : Array;
			if (!v) throw new Error("invalid max value: " + t);
			if (_classPrivateFieldSet2(_o2, this, t), _classPrivateFieldSet2(_u2, this, T), this.maxEntrySize = w || _classPrivateFieldGet2(_u2, this), this.sizeCalculation = y, this.sizeCalculation) {
				if (!_classPrivateFieldGet2(_u2, this) && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
				if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
			}
			if (m !== void 0 && typeof m != "function") throw new TypeError("memoMethod must be a function if defined");
			if (_classPrivateFieldSet2(_U, this, m), a !== void 0 && typeof a != "function") throw new TypeError("fetchMethod must be a function if specified");
			if (_classPrivateFieldSet2(_M, this, a), _classPrivateFieldSet2(_W, this, !!a), _classPrivateFieldSet2(_s, this, /* @__PURE__ */ new Map()), _classPrivateFieldSet2(_i, this, Array.from({ length: t }).fill(void 0)), _classPrivateFieldSet2(_t, this, Array.from({ length: t }).fill(void 0)), _classPrivateFieldSet2(_a, this, new v(t)), _classPrivateFieldSet2(_c, this, new v(t)), _classPrivateFieldSet2(_l, this, 0), _classPrivateFieldSet2(_h, this, 0), _classPrivateFieldSet2(_y, this, R.create(t)), _classPrivateFieldSet2(_n, this, 0), _classPrivateFieldSet2(_b, this, 0), typeof l == "function" && _classPrivateFieldSet2(_w, this, l), typeof c == "function" && _classPrivateFieldSet2(_D, this, c), typeof f == "function" ? (_classPrivateFieldSet2(_S, this, f), _classPrivateFieldSet2(_r, this, [])) : (_classPrivateFieldSet2(_S, this, void 0), _classPrivateFieldSet2(_r, this, void 0)), _classPrivateFieldSet2(_T, this, !!_classPrivateFieldGet2(_w, this)), _classPrivateFieldSet2(_j, this, !!_classPrivateFieldGet2(_D, this)), _classPrivateFieldSet2(_f, this, !!_classPrivateFieldGet2(_S, this)), this.noDisposeOnSet = !!g, this.noUpdateTTL = !!p, this.noDeleteOnFetchRejection = !!_, this.allowStaleOnFetchRejection = !!d, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!z, this.maxEntrySize !== 0) {
				if (_classPrivateFieldGet2(_u2, this) !== 0 && !F(_classPrivateFieldGet2(_u2, this))) throw new TypeError("maxSize must be a positive integer if specified");
				if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
				_assertClassBrand(_u_brand, this, _X).call(this);
			}
			if (this.allowStale = !!h, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o, this.updateAgeOnHas = !!r, this.ttlResolution = F(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n, this.ttl = i || 0, this.ttl) {
				if (!F(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
				_assertClassBrand(_u_brand, this, _H).call(this);
			}
			if (_classPrivateFieldGet2(_o2, this) === 0 && this.ttl === 0 && _classPrivateFieldGet2(_u2, this) === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
			if (!this.ttlAutopurge && !_classPrivateFieldGet2(_o2, this) && !_classPrivateFieldGet2(_u2, this)) {
				let E = "LRU_CACHE_UNBOUNDED";
				P(E) && (U.add(E), G("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, u));
			}
		}
		getRemainingTTL(e) {
			return _classPrivateFieldGet2(_s, this).has(e) ? Infinity : 0;
		}
		*entries() {
			for (let e of _assertClassBrand(_u_brand, this, _A).call(this)) _classPrivateFieldGet2(_t, this)[e] !== void 0 && _classPrivateFieldGet2(_i, this)[e] !== void 0 && !_assertClassBrand(_u_brand, this, _e).call(this, _classPrivateFieldGet2(_t, this)[e]) && (yield [_classPrivateFieldGet2(_i, this)[e], _classPrivateFieldGet2(_t, this)[e]]);
		}
		*rentries() {
			for (let e of _assertClassBrand(_u_brand, this, _z).call(this)) _classPrivateFieldGet2(_t, this)[e] !== void 0 && _classPrivateFieldGet2(_i, this)[e] !== void 0 && !_assertClassBrand(_u_brand, this, _e).call(this, _classPrivateFieldGet2(_t, this)[e]) && (yield [_classPrivateFieldGet2(_i, this)[e], _classPrivateFieldGet2(_t, this)[e]]);
		}
		*keys() {
			for (let e of _assertClassBrand(_u_brand, this, _A).call(this)) {
				let t = _classPrivateFieldGet2(_i, this)[e];
				t !== void 0 && !_assertClassBrand(_u_brand, this, _e).call(this, _classPrivateFieldGet2(_t, this)[e]) && (yield t);
			}
		}
		*rkeys() {
			for (let e of _assertClassBrand(_u_brand, this, _z).call(this)) {
				let t = _classPrivateFieldGet2(_i, this)[e];
				t !== void 0 && !_assertClassBrand(_u_brand, this, _e).call(this, _classPrivateFieldGet2(_t, this)[e]) && (yield t);
			}
		}
		*values() {
			for (let e of _assertClassBrand(_u_brand, this, _A).call(this)) _classPrivateFieldGet2(_t, this)[e] !== void 0 && !_assertClassBrand(_u_brand, this, _e).call(this, _classPrivateFieldGet2(_t, this)[e]) && (yield _classPrivateFieldGet2(_t, this)[e]);
		}
		*rvalues() {
			for (let e of _assertClassBrand(_u_brand, this, _z).call(this)) _classPrivateFieldGet2(_t, this)[e] !== void 0 && !_assertClassBrand(_u_brand, this, _e).call(this, _classPrivateFieldGet2(_t, this)[e]) && (yield _classPrivateFieldGet2(_t, this)[e]);
		}
		[_Symbol$iterator]() {
			return this.entries();
		}
		find(e, t = {}) {
			for (let i of _assertClassBrand(_u_brand, this, _A).call(this)) {
				let s = _classPrivateFieldGet2(_t, this)[i], n = _assertClassBrand(_u_brand, this, _e).call(this, s) ? s.__staleWhileFetching : s;
				if (n !== void 0 && e(n, _classPrivateFieldGet2(_i, this)[i], this)) return _assertClassBrand(_u_brand, this, _C).call(this, _classPrivateFieldGet2(_i, this)[i], t);
			}
		}
		forEach(e, t = this) {
			for (let i of _assertClassBrand(_u_brand, this, _A).call(this)) {
				let s = _classPrivateFieldGet2(_t, this)[i], n = _assertClassBrand(_u_brand, this, _e).call(this, s) ? s.__staleWhileFetching : s;
				n !== void 0 && e.call(t, n, _classPrivateFieldGet2(_i, this)[i], this);
			}
		}
		rforEach(e, t = this) {
			for (let i of _assertClassBrand(_u_brand, this, _z).call(this)) {
				let s = _classPrivateFieldGet2(_t, this)[i], n = _assertClassBrand(_u_brand, this, _e).call(this, s) ? s.__staleWhileFetching : s;
				n !== void 0 && e.call(t, n, _classPrivateFieldGet2(_i, this)[i], this);
			}
		}
		purgeStale() {
			let e = !1;
			for (let t of _assertClassBrand(_u_brand, this, _z).call(this, { allowStale: !0 })) _classPrivateFieldGet2(_p, this).call(this, t) && (_assertClassBrand(_u_brand, this, _v).call(this, _classPrivateFieldGet2(_i, this)[t], "expire"), e = !0);
			return e;
		}
		info(e) {
			let t = _classPrivateFieldGet2(_s, this).get(e);
			if (t === void 0) return;
			let i = _classPrivateFieldGet2(_t, this)[t], s = _assertClassBrand(_u_brand, this, _e).call(this, i) ? i.__staleWhileFetching : i;
			if (s === void 0) return;
			let n = { value: s };
			if (_classPrivateFieldGet2(_d, this) && _classPrivateFieldGet2(_F, this)) {
				let o = _classPrivateFieldGet2(_d, this)[t], r = _classPrivateFieldGet2(_F, this)[t];
				if (o && r) n.ttl = o - (_classPrivateFieldGet2(_m, this).now() - r), n.start = Date.now();
			}
			return _classPrivateFieldGet2(_2, this) && (n.size = _classPrivateFieldGet2(_2, this)[t]), n;
		}
		dump() {
			let e = [];
			for (let t of _assertClassBrand(_u_brand, this, _A).call(this, { allowStale: !0 })) {
				let i = _classPrivateFieldGet2(_i, this)[t], s = _classPrivateFieldGet2(_t, this)[t], n = _assertClassBrand(_u_brand, this, _e).call(this, s) ? s.__staleWhileFetching : s;
				if (n === void 0 || i === void 0) continue;
				let o = { value: n };
				if (_classPrivateFieldGet2(_d, this) && _classPrivateFieldGet2(_F, this)) {
					o.ttl = _classPrivateFieldGet2(_d, this)[t];
					let r = _classPrivateFieldGet2(_m, this).now() - _classPrivateFieldGet2(_F, this)[t];
					o.start = Math.floor(Date.now() - r);
				}
				_classPrivateFieldGet2(_2, this) && (o.size = _classPrivateFieldGet2(_2, this)[t]), e.unshift([i, o]);
			}
			return e;
		}
		load(e) {
			this.clear();
			for (let [t, i] of e) {
				if (i.start) {
					let s = Date.now() - i.start;
					i.start = _classPrivateFieldGet2(_m, this).now() - s;
				}
				_assertClassBrand(_u_brand, this, _O).call(this, t, i.value, i);
			}
		}
		set(e, t, i = {}) {
			let { status: s = S.hasSubscribers ? {} : void 0 } = i;
			i.status = s, s && (s.op = "set", s.key = e, t !== void 0 && (s.value = t));
			let n = _assertClassBrand(_u_brand, this, _O).call(this, e, t, i);
			return s && S.hasSubscribers && S.publish(s), n;
		}
		pop() {
			try {
				for (; _classPrivateFieldGet2(_n, this);) {
					let e = _classPrivateFieldGet2(_t, this)[_classPrivateFieldGet2(_l, this)];
					if (_assertClassBrand(_u_brand, this, _G).call(this, !0), _assertClassBrand(_u_brand, this, _e).call(this, e)) {
						if (e.__staleWhileFetching) return e.__staleWhileFetching;
					} else if (e !== void 0) return e;
				}
			} finally {
				if (_classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)) {
					let e = _classPrivateFieldGet2(_r, this), t;
					for (; t = e?.shift();) _classPrivateFieldGet2(_S, this)?.call(this, ...t);
				}
			}
		}
		has(e, t = {}) {
			let { status: i = S.hasSubscribers ? {} : void 0 } = t;
			t.status = i, i && (i.op = "has", i.key = e);
			let s = _assertClassBrand(_u_brand, this, _Y).call(this, e, t);
			return S.hasSubscribers && S.publish(i), s;
		}
		peek(e, t = {}) {
			let { status: i = D() ? {} : void 0 } = t;
			i && (i.op = "peek", i.key = e), t.status = i;
			let s = _assertClassBrand(_u_brand, this, _J).call(this, e, t);
			return S.hasSubscribers && S.publish(i), s;
		}
		fetch(e, t = {}) {
			let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
			t.status = s, s && t.context && (s.context = t.context);
			let n = _assertClassBrand(_u_brand, this, _B).call(this, e, t);
			return s && D() && i && (s.trace = !0, W.tracePromise(() => n, s).catch(() => {})), n;
		}
		forceFetch(e, t = {}) {
			let i = W.hasSubscribers, { status: s = D() ? {} : void 0 } = t;
			t.status = s, s && t.context && (s.context = t.context);
			let n = _assertClassBrand(_u_brand, this, _K).call(this, e, t);
			return s && D() && i && (s.trace = !0, W.tracePromise(() => n, s).catch(() => {})), n;
		}
		memo(e, t = {}) {
			let { status: i = S.hasSubscribers ? {} : void 0 } = t;
			t.status = i, i && (i.op = "memo", i.key = e, t.context && (i.context = t.context));
			let s = _assertClassBrand(_u_brand, this, _Q).call(this, e, t);
			return i && (i.value = s), S.hasSubscribers && S.publish(i), s;
		}
		get(e, t = {}) {
			let { status: i = S.hasSubscribers ? {} : void 0 } = t;
			t.status = i, i && (i.op = "get", i.key = e);
			let s = _assertClassBrand(_u_brand, this, _C).call(this, e, t);
			return i && (s !== void 0 && (i.value = s), S.hasSubscribers && S.publish(i)), s;
		}
		delete(e) {
			return _assertClassBrand(_u_brand, this, _v).call(this, e, "delete");
		}
		clear() {
			return _assertClassBrand(_u_brand, this, _q).call(this, "delete");
		}
	});
	function _H() {
		let e = new O(_classPrivateFieldGet2(_o2, this)), t = new O(_classPrivateFieldGet2(_o2, this));
		_classPrivateFieldSet2(_d, this, e), _classPrivateFieldSet2(_F, this, t);
		let i = this.ttlAutopurge ? Array.from({ length: _classPrivateFieldGet2(_o2, this) }) : void 0;
		_classPrivateFieldSet2(_g, this, i), _classPrivateFieldSet2(_N, this, (r, h, l = _classPrivateFieldGet2(_m, this).now()) => {
			t[r] = h !== 0 ? l : 0, e[r] = h, s(r, h);
		}), _classPrivateFieldSet2(_x, this, (r) => {
			t[r] = e[r] !== 0 ? _classPrivateFieldGet2(_m, this).now() : 0, s(r, e[r]);
		});
		let s = this.ttlAutopurge ? (r, h) => {
			if (i?.[r] && (clearTimeout(i[r]), i[r] = void 0), h && h !== 0 && i) {
				let l = setTimeout(() => {
					_classPrivateFieldGet2(_p, this).call(this, r) && _assertClassBrand(_u_brand, this, _v).call(this, _classPrivateFieldGet2(_i, this)[r], "expire");
				}, h + 1);
				l.unref && l.unref(), i[r] = l;
			}
		} : () => {};
		_classPrivateFieldSet2(_E, this, (r, h) => {
			if (e[h]) {
				let l = e[h], c = t[h];
				if (!l || !c) return;
				r.ttl = l, r.start = c, r.now = n || o();
				r.remainingTTL = l - (r.now - c);
			}
		});
		let n = 0, o = () => {
			let r = _classPrivateFieldGet2(_m, this).now();
			if (this.ttlResolution > 0) {
				n = r;
				let h = setTimeout(() => n = 0, this.ttlResolution);
				h.unref && h.unref();
			}
			return r;
		};
		this.getRemainingTTL = (r) => {
			let h = _classPrivateFieldGet2(_s, this).get(r);
			if (h === void 0) return 0;
			let l = e[h], c = t[h];
			if (!l || !c) return Infinity;
			return l - ((n || o()) - c);
		}, _classPrivateFieldSet2(_p, this, (r) => {
			let h = t[r], l = e[r];
			return !!l && !!h && (n || o()) - h > l;
		});
	}
	function _X() {
		let e = new O(_classPrivateFieldGet2(_o2, this));
		_classPrivateFieldSet2(_b, this, 0), _classPrivateFieldSet2(_2, this, e), _classPrivateFieldSet2(_R, this, (t) => {
			_classPrivateFieldSet2(_b, this, _classPrivateFieldGet2(_b, this) - e[t]), e[t] = 0;
		}), _classPrivateFieldSet2(_k, this, (t, i, s, n) => {
			if (_assertClassBrand(_u_brand, this, _e).call(this, i)) return 0;
			if (!F(s)) if (n) {
				if (typeof n != "function") throw new TypeError("sizeCalculation must be a function");
				if (s = n(i, t), !F(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
			} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
			return s;
		}), _classPrivateFieldSet2(_I, this, (t, i, s) => {
			if (e[t] = i, _classPrivateFieldGet2(_u2, this)) {
				let n = _classPrivateFieldGet2(_u2, this) - e[t];
				for (; _classPrivateFieldGet2(_b, this) > n;) _assertClassBrand(_u_brand, this, _G).call(this, !0);
			}
			_classPrivateFieldSet2(_b, this, _classPrivateFieldGet2(_b, this) + e[t]), s && (s.entrySize = i, s.totalCalculatedSize = _classPrivateFieldGet2(_b, this));
		});
	}
	function* _A({ allowStale: e = this.allowStale } = {}) {
		if (_classPrivateFieldGet2(_n, this)) for (let t = _classPrivateFieldGet2(_h, this); _assertClassBrand(_u_brand, this, _V).call(this, t) && ((e || !_classPrivateFieldGet2(_p, this).call(this, t)) && (yield t), t !== _classPrivateFieldGet2(_l, this));) t = _classPrivateFieldGet2(_c, this)[t];
	}
	function* _z({ allowStale: e = this.allowStale } = {}) {
		if (_classPrivateFieldGet2(_n, this)) for (let t = _classPrivateFieldGet2(_l, this); _assertClassBrand(_u_brand, this, _V).call(this, t) && ((e || !_classPrivateFieldGet2(_p, this).call(this, t)) && (yield t), t !== _classPrivateFieldGet2(_h, this));) t = _classPrivateFieldGet2(_a, this)[t];
	}
	function _V(e) {
		return e !== void 0 && _classPrivateFieldGet2(_s, this).get(_classPrivateFieldGet2(_i, this)[e]) === e;
	}
	function _O(e, t, i = {}) {
		var _this$n;
		let { ttl: s = this.ttl, start: n, noDisposeOnSet: o = this.noDisposeOnSet, sizeCalculation: r = this.sizeCalculation, status: h } = i;
		if (t === void 0) return h && (h.set = "deleted"), this.delete(e), this;
		let { noUpdateTTL: l = this.noUpdateTTL } = i;
		h && !_assertClassBrand(_u_brand, this, _e).call(this, t) && (h.value = t);
		let c = _classPrivateFieldGet2(_k, this).call(this, e, t, i.size || 0, r, h);
		if (this.maxEntrySize && c > this.maxEntrySize) return _assertClassBrand(_u_brand, this, _v).call(this, e, "set"), h && (h.set = "miss", h.maxEntrySizeExceeded = !0), this;
		let f = _classPrivateFieldGet2(_n, this) === 0 ? void 0 : _classPrivateFieldGet2(_s, this).get(e);
		if (f === void 0) f = _classPrivateFieldGet2(_n, this) === 0 ? _classPrivateFieldGet2(_h, this) : _classPrivateFieldGet2(_y, this).length !== 0 ? _classPrivateFieldGet2(_y, this).pop() : _classPrivateFieldGet2(_n, this) === _classPrivateFieldGet2(_o2, this) ? _assertClassBrand(_u_brand, this, _G).call(this, !1) : _classPrivateFieldGet2(_n, this), _classPrivateFieldGet2(_i, this)[f] = e, _classPrivateFieldGet2(_t, this)[f] = t, _classPrivateFieldGet2(_s, this).set(e, f), _classPrivateFieldGet2(_a, this)[_classPrivateFieldGet2(_h, this)] = f, _classPrivateFieldGet2(_c, this)[f] = _classPrivateFieldGet2(_h, this), _classPrivateFieldSet2(_h, this, f), _classPrivateFieldSet2(_n, this, (_this$n = _classPrivateFieldGet2(_n, this), _this$n++, _this$n)), _classPrivateFieldGet2(_I, this).call(this, f, c, h), h && (h.set = "add"), l = !1, _classPrivateFieldGet2(_j, this) && _classPrivateFieldGet2(_D, this)?.call(this, t, e, "add");
		else {
			_assertClassBrand(_u_brand, this, _L).call(this, f);
			let g = _classPrivateFieldGet2(_t, this)[f];
			if (t !== g) {
				if (_classPrivateFieldGet2(_W, this) && _assertClassBrand(_u_brand, this, _e).call(this, g)) {
					g.__abortController.abort(/* @__PURE__ */ new Error("replaced"));
					let { __staleWhileFetching: p } = g;
					p !== void 0 && !o && (_classPrivateFieldGet2(_T, this) && _classPrivateFieldGet2(_w, this)?.call(this, p, e, "set"), _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)?.push([
						p,
						e,
						"set"
					]));
				} else o || (_classPrivateFieldGet2(_T, this) && _classPrivateFieldGet2(_w, this)?.call(this, g, e, "set"), _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)?.push([
					g,
					e,
					"set"
				]));
				if (_classPrivateFieldGet2(_R, this).call(this, f), _classPrivateFieldGet2(_I, this).call(this, f, c, h), _classPrivateFieldGet2(_t, this)[f] = t, h) {
					h.set = "replace";
					let p = g && _assertClassBrand(_u_brand, this, _e).call(this, g) ? g.__staleWhileFetching : g;
					p !== void 0 && (h.oldValue = p);
				}
			} else h && (h.set = "update");
			_classPrivateFieldGet2(_j, this) && this.onInsert?.(t, e, t === g ? "update" : "replace");
		}
		if (s !== 0 && !_classPrivateFieldGet2(_d, this) && _assertClassBrand(_u_brand, this, _H).call(this), _classPrivateFieldGet2(_d, this) && (l || _classPrivateFieldGet2(_N, this).call(this, f, s, n), h && _classPrivateFieldGet2(_E, this).call(this, h, f)), !o && _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)) {
			let g = _classPrivateFieldGet2(_r, this), p;
			for (; p = g?.shift();) _classPrivateFieldGet2(_S, this)?.call(this, ...p);
		}
		return this;
	}
	function _G(e) {
		var _this$n3;
		let t = _classPrivateFieldGet2(_l, this), i = _classPrivateFieldGet2(_i, this)[t], s = _classPrivateFieldGet2(_t, this)[t];
		return _classPrivateFieldGet2(_W, this) && _assertClassBrand(_u_brand, this, _e).call(this, s) ? s.__abortController.abort(/* @__PURE__ */ new Error("evicted")) : (_classPrivateFieldGet2(_T, this) || _classPrivateFieldGet2(_f, this)) && (_classPrivateFieldGet2(_T, this) && _classPrivateFieldGet2(_w, this)?.call(this, s, i, "evict"), _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)?.push([
			s,
			i,
			"evict"
		])), _classPrivateFieldGet2(_R, this).call(this, t), _classPrivateFieldGet2(_g, this)?.[t] && (clearTimeout(_classPrivateFieldGet2(_g, this)[t]), _classPrivateFieldGet2(_g, this)[t] = void 0), e && (_classPrivateFieldGet2(_i, this)[t] = void 0, _classPrivateFieldGet2(_t, this)[t] = void 0, _classPrivateFieldGet2(_y, this).push(t)), _classPrivateFieldGet2(_n, this) === 1 ? (_classPrivateFieldSet2(_l, this, _classPrivateFieldSet2(_h, this, 0)), _classPrivateFieldGet2(_y, this).length = 0) : _classPrivateFieldSet2(_l, this, _classPrivateFieldGet2(_a, this)[t]), _classPrivateFieldGet2(_s, this).delete(i), _classPrivateFieldSet2(_n, this, (_this$n3 = _classPrivateFieldGet2(_n, this), _this$n3--, _this$n3)), t;
	}
	function _Y(e, t = {}) {
		let { updateAgeOnHas: i = this.updateAgeOnHas, status: s } = t, n = _classPrivateFieldGet2(_s, this).get(e);
		if (n !== void 0) {
			let o = _classPrivateFieldGet2(_t, this)[n];
			if (_assertClassBrand(_u_brand, this, _e).call(this, o) && o.__staleWhileFetching === void 0) return !1;
			if (_classPrivateFieldGet2(_p, this).call(this, n)) s && (s.has = "stale", _classPrivateFieldGet2(_E, this).call(this, s, n));
			else return i && _classPrivateFieldGet2(_x, this).call(this, n), s && (s.has = "hit", _classPrivateFieldGet2(_E, this).call(this, s, n)), !0;
		} else s && (s.has = "miss");
		return !1;
	}
	function _J(e, t) {
		let { status: i, allowStale: s = this.allowStale } = t, n = _classPrivateFieldGet2(_s, this).get(e);
		if (n === void 0 || !s && _classPrivateFieldGet2(_p, this).call(this, n)) {
			i && (i.peek = n === void 0 ? "miss" : "stale");
			return;
		}
		let o = _classPrivateFieldGet2(_t, this)[n], r = _assertClassBrand(_u_brand, this, _e).call(this, o) ? o.__staleWhileFetching : o;
		return i && (r !== void 0 ? (i.peek = "hit", i.value = r) : i.peek = "miss"), r;
	}
	function _P(e, t, i, s) {
		let n = t === void 0 ? void 0 : _classPrivateFieldGet2(_t, this)[t];
		if (_assertClassBrand(_u_brand, this, _e).call(this, n)) return n;
		let o = new AbortController(), { signal: r } = i;
		r?.addEventListener("abort", () => o.abort(r.reason), { signal: o.signal });
		let h = {
			signal: o.signal,
			options: i,
			context: s
		}, l = (w, y = !1) => {
			let { aborted: a } = o.signal, m = i.ignoreFetchAbort && w !== void 0, _ = i.ignoreFetchAbort || !!(i.allowStaleOnFetchAbort && w !== void 0);
			if (i.status && (a && !y ? (i.status.fetchAborted = !0, i.status.fetchError = o.signal.reason, m && (i.status.fetchAbortIgnored = !0)) : i.status.fetchResolved = !0), a && !m && !y) return f(o.signal.reason, _);
			let b = p, d = _classPrivateFieldGet2(_t, this)[t];
			return (d === p || d === void 0 && m && y) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? _classPrivateFieldGet2(_t, this)[t] = b.__staleWhileFetching : _assertClassBrand(_u_brand, this, _v).call(this, e, "fetch") : (i.status && (i.status.fetchUpdated = !0), _assertClassBrand(_u_brand, this, _O).call(this, e, w, h.options))), w;
		}, c = (w) => (i.status && (i.status.fetchRejected = !0, i.status.fetchError = w), f(w, !1)), f = (w, y) => {
			let { aborted: a } = o.signal, m = a && i.allowStaleOnFetchAbort, _ = m || i.allowStaleOnFetchRejection, b = _ || i.noDeleteOnFetchRejection, d = p;
			if (_classPrivateFieldGet2(_t, this)[t] === p && (!b || !y && d.__staleWhileFetching === void 0 ? _assertClassBrand(_u_brand, this, _v).call(this, e, "fetch") : m || (_classPrivateFieldGet2(_t, this)[t] = d.__staleWhileFetching)), _) return i.status && d.__staleWhileFetching !== void 0 && (i.status.returnedStale = !0), d.__staleWhileFetching;
			if (d.__returned === d) throw w;
		}, g = (w, y) => {
			let a = _classPrivateFieldGet2(_M, this)?.call(this, e, n, h);
			a && a instanceof Promise && a.then((m) => w(m === void 0 ? void 0 : m), y), o.signal.addEventListener("abort", () => {
				(!i.ignoreFetchAbort || i.allowStaleOnFetchAbort) && (w(void 0), i.allowStaleOnFetchAbort && (w = (m) => l(m, !0)));
			});
		};
		i.status && (i.status.fetchDispatched = !0);
		let p = new Promise(g).then(l, c), T = Object.assign(p, {
			__abortController: o,
			__staleWhileFetching: n,
			__returned: void 0
		});
		return t === void 0 ? (_assertClassBrand(_u_brand, this, _O).call(this, e, T, {
			...h.options,
			status: void 0
		}), t = _classPrivateFieldGet2(_s, this).get(e)) : _classPrivateFieldGet2(_t, this)[t] = T, T;
	}
	function _e(e) {
		if (!_classPrivateFieldGet2(_W, this)) return !1;
		let t = e;
		return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
	}
	async function _B(e, t = {}) {
		let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, ttl: o = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h = 0, sizeCalculation: l = this.sizeCalculation, noUpdateTTL: c = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: g = this.allowStaleOnFetchRejection, ignoreFetchAbort: p = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh: y = !1, status: a, signal: m } = t;
		if (a && (a.op = "fetch", a.key = e, y && (a.forceRefresh = !0)), !_classPrivateFieldGet2(_W, this)) return a && (a.fetch = "get"), _assertClassBrand(_u_brand, this, _C).call(this, e, {
			allowStale: i,
			updateAgeOnGet: s,
			noDeleteOnStaleGet: n,
			status: a
		});
		let _ = {
			allowStale: i,
			updateAgeOnGet: s,
			noDeleteOnStaleGet: n,
			ttl: o,
			noDisposeOnSet: r,
			size: h,
			sizeCalculation: l,
			noUpdateTTL: c,
			noDeleteOnFetchRejection: f,
			allowStaleOnFetchRejection: g,
			allowStaleOnFetchAbort: T,
			ignoreFetchAbort: p,
			status: a,
			signal: m
		}, b = _classPrivateFieldGet2(_s, this).get(e);
		if (b === void 0) {
			a && (a.fetch = "miss");
			let d = _assertClassBrand(_u_brand, this, _P).call(this, e, b, _, w);
			return d.__returned = d;
		} else {
			let d = _classPrivateFieldGet2(_t, this)[b];
			if (_assertClassBrand(_u_brand, this, _e).call(this, d)) {
				let E = i && d.__staleWhileFetching !== void 0;
				return a && (a.fetch = "inflight", E && (a.returnedStale = !0)), E ? d.__staleWhileFetching : d.__returned = d;
			}
			let A = _classPrivateFieldGet2(_p, this).call(this, b);
			if (!y && !A) return a && (a.fetch = "hit"), _assertClassBrand(_u_brand, this, _L).call(this, b), s && _classPrivateFieldGet2(_x, this).call(this, b), a && _classPrivateFieldGet2(_E, this).call(this, a, b), d;
			let z = _assertClassBrand(_u_brand, this, _P).call(this, e, b, _, w), v = z.__staleWhileFetching !== void 0 && i;
			return a && (a.fetch = A ? "stale" : "refresh", v && A && (a.returnedStale = !0)), v ? z.__staleWhileFetching : z.__returned = z;
		}
	}
	async function _K(e, t = {}) {
		let i = await _assertClassBrand(_u_brand, this, _B).call(this, e, t);
		if (i === void 0) throw new Error("fetch() returned undefined");
		return i;
	}
	function _Q(e, t = {}) {
		let i = _classPrivateFieldGet2(_U, this);
		if (!i) throw new Error("no memoMethod provided to constructor");
		let { context: s, status: n, forceRefresh: o, ...r } = t;
		n && o && (n.forceRefresh = !0);
		let h = _assertClassBrand(_u_brand, this, _C).call(this, e, r), l = o || h === void 0;
		if (n && (n.memo = l ? "miss" : "hit", l || (n.value = h)), !l) return h;
		let c = i(e, h, {
			options: r,
			context: s
		});
		return n && (n.value = c), _assertClassBrand(_u_brand, this, _O).call(this, e, c, r), c;
	}
	function _C(e, t = {}) {
		let { allowStale: i = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n = this.noDeleteOnStaleGet, status: o } = t, r = _classPrivateFieldGet2(_s, this).get(e);
		if (r === void 0) {
			o && (o.get = "miss");
			return;
		}
		let h = _classPrivateFieldGet2(_t, this)[r], l = _assertClassBrand(_u_brand, this, _e).call(this, h);
		return o && _classPrivateFieldGet2(_E, this).call(this, o, r), _classPrivateFieldGet2(_p, this).call(this, r) ? l ? (o && (o.get = "stale-fetching"), i && h.__staleWhileFetching !== void 0 ? (o && (o.returnedStale = !0), h.__staleWhileFetching) : void 0) : (n || _assertClassBrand(_u_brand, this, _v).call(this, e, "expire"), o && (o.get = "stale"), i ? (o && (o.returnedStale = !0), h) : void 0) : (o && (o.get = l ? "fetching" : "hit"), _assertClassBrand(_u_brand, this, _L).call(this, r), s && _classPrivateFieldGet2(_x, this).call(this, r), l ? h.__staleWhileFetching : h);
	}
	function _$(e, t) {
		_classPrivateFieldGet2(_c, this)[t] = e, _classPrivateFieldGet2(_a, this)[e] = t;
	}
	function _L(e) {
		e !== _classPrivateFieldGet2(_h, this) && (e === _classPrivateFieldGet2(_l, this) ? _classPrivateFieldSet2(_l, this, _classPrivateFieldGet2(_a, this)[e]) : _assertClassBrand(_u_brand, this, _$).call(this, _classPrivateFieldGet2(_c, this)[e], _classPrivateFieldGet2(_a, this)[e]), _assertClassBrand(_u_brand, this, _$).call(this, _classPrivateFieldGet2(_h, this), e), _classPrivateFieldSet2(_h, this, e));
	}
	function _v(e, t) {
		S.hasSubscribers && S.publish({
			op: "delete",
			delete: t,
			key: e
		});
		let i = !1;
		if (_classPrivateFieldGet2(_n, this) !== 0) {
			let s = _classPrivateFieldGet2(_s, this).get(e);
			if (s !== void 0) if (_classPrivateFieldGet2(_g, this)?.[s] && (clearTimeout(_classPrivateFieldGet2(_g, this)?.[s]), _classPrivateFieldGet2(_g, this)[s] = void 0), i = !0, _classPrivateFieldGet2(_n, this) === 1) _assertClassBrand(_u_brand, this, _q).call(this, t);
			else {
				var _this$n5;
				_classPrivateFieldGet2(_R, this).call(this, s);
				let n = _classPrivateFieldGet2(_t, this)[s];
				if (_assertClassBrand(_u_brand, this, _e).call(this, n) ? n.__abortController.abort(/* @__PURE__ */ new Error("deleted")) : (_classPrivateFieldGet2(_T, this) || _classPrivateFieldGet2(_f, this)) && (_classPrivateFieldGet2(_T, this) && _classPrivateFieldGet2(_w, this)?.call(this, n, e, t), _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)?.push([
					n,
					e,
					t
				])), _classPrivateFieldGet2(_s, this).delete(e), _classPrivateFieldGet2(_i, this)[s] = void 0, _classPrivateFieldGet2(_t, this)[s] = void 0, s === _classPrivateFieldGet2(_h, this)) _classPrivateFieldSet2(_h, this, _classPrivateFieldGet2(_c, this)[s]);
				else if (s === _classPrivateFieldGet2(_l, this)) _classPrivateFieldSet2(_l, this, _classPrivateFieldGet2(_a, this)[s]);
				else {
					let o = _classPrivateFieldGet2(_c, this)[s];
					_classPrivateFieldGet2(_a, this)[o] = _classPrivateFieldGet2(_a, this)[s];
					let r = _classPrivateFieldGet2(_a, this)[s];
					_classPrivateFieldGet2(_c, this)[r] = _classPrivateFieldGet2(_c, this)[s];
				}
				_classPrivateFieldSet2(_n, this, (_this$n5 = _classPrivateFieldGet2(_n, this), _this$n5--, _this$n5)), _classPrivateFieldGet2(_y, this).push(s);
			}
		}
		if (_classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)?.length) {
			let s = _classPrivateFieldGet2(_r, this), n;
			for (; n = s?.shift();) _classPrivateFieldGet2(_S, this)?.call(this, ...n);
		}
		return i;
	}
	function _q(e) {
		for (let t of _assertClassBrand(_u_brand, this, _z).call(this, { allowStale: !0 })) {
			let i = _classPrivateFieldGet2(_t, this)[t];
			if (_assertClassBrand(_u_brand, this, _e).call(this, i)) i.__abortController.abort(/* @__PURE__ */ new Error("deleted"));
			else {
				let s = _classPrivateFieldGet2(_i, this)[t];
				_classPrivateFieldGet2(_T, this) && _classPrivateFieldGet2(_w, this)?.call(this, i, s, e), _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)?.push([
					i,
					s,
					e
				]);
			}
		}
		if (_classPrivateFieldGet2(_s, this).clear(), _classPrivateFieldGet2(_t, this).fill(void 0), _classPrivateFieldGet2(_i, this).fill(void 0), _classPrivateFieldGet2(_d, this) && _classPrivateFieldGet2(_F, this)) {
			_classPrivateFieldGet2(_d, this).fill(0), _classPrivateFieldGet2(_F, this).fill(0);
			for (let t of _classPrivateFieldGet2(_g, this) ?? []) t !== void 0 && clearTimeout(t);
			_classPrivateFieldGet2(_g, this)?.fill(void 0);
		}
		if (_classPrivateFieldGet2(_2, this) && _classPrivateFieldGet2(_2, this).fill(0), _classPrivateFieldSet2(_l, this, 0), _classPrivateFieldSet2(_h, this, 0), _classPrivateFieldGet2(_y, this).length = 0, _classPrivateFieldSet2(_b, this, 0), _classPrivateFieldSet2(_n, this, 0), _classPrivateFieldGet2(_f, this) && _classPrivateFieldGet2(_r, this)) {
			let t = _classPrivateFieldGet2(_r, this), i;
			for (; i = t?.shift();) _classPrivateFieldGet2(_S, this)?.call(this, ...i);
		}
	}
	//#endregion
	//#region ../loot-core/src/platform/server/sqlite/unicodeLike.ts
	var likePatternCache = new M$1({ max: 500 });
	var REGEX_SPECIAL = /[.*+^${}()|[\]\\?]/g;
	function likePatternToRegex(pattern) {
		let regexStr = "";
		let i = 0;
		while (i < pattern.length) {
			const ch = pattern[i];
			if (ch === "\\" && i + 1 < pattern.length) {
				const next = pattern[i + 1];
				if (next === "%" || next === "?" || next === "\\") {
					regexStr += next.replace(REGEX_SPECIAL, "\\$&");
					i += 2;
					continue;
				}
			}
			if (ch === "%") regexStr += ".*";
			else if (ch === "?") regexStr += ".";
			else regexStr += ch.replace(REGEX_SPECIAL, "\\$&");
			i++;
		}
		return new RegExp(regexStr, "i");
	}
	function unicodeLike(pattern, value) {
		if (!pattern) return 0;
		if (!value) value = "";
		let cachedRegExp = likePatternCache.get(pattern);
		if (!cachedRegExp) {
			cachedRegExp = likePatternToRegex(pattern);
			likePatternCache.set(pattern, cachedRegExp);
		}
		return cachedRegExp.test(value) ? 1 : 0;
	}
	//#endregion
	//#region ../loot-core/src/platform/server/sqlite/index.ts
	var SQL = null;
	async function init$3({ baseURL = "/" } = {}) {
		return new Promise((resolve, reject) => {
			(0, import_sql_wasm.default)({ locateFile: (file) => baseURL + file }).then((sql) => {
				SQL = sql;
				resolve(void 0);
			}, (err) => {
				reject(err);
			});
		});
	}
	function _getModule() {
		if (SQL == null) throw new Error("_getModule: sql.js must be initialized first");
		return SQL;
	}
	function verifyParamTypes(sql, arr = []) {
		arr.forEach((val) => {
			if (typeof val !== "string" && typeof val !== "number" && val !== null) throw new Error("Invalid field type " + val + " for sql " + sql);
		});
	}
	function prepare(db, sql) {
		return db.prepare(sql);
	}
	function runQuery$1(db, sql, params = [], fetchAll = false) {
		if (params) verifyParamTypes(sql, params);
		const stmt = typeof sql === "string" ? db.prepare(sql) : sql;
		if (fetchAll) try {
			stmt.bind(params);
			const rows = [];
			while (stmt.step()) rows.push(stmt.getAsObject());
			if (typeof sql === "string") stmt.free();
			else stmt.reset();
			return rows;
		} catch (e) {
			logger.log(sql);
			throw e;
		}
		else {
			stmt.run(params);
			return { changes: db.getRowsModified() };
		}
	}
	function execQuery$2(db, sql) {
		db.exec(sql);
	}
	var transactionDepth = 0;
	function transaction$1(db, fn) {
		let before, after, undo;
		if (transactionDepth > 0) {
			before = "SAVEPOINT __actual_sp";
			after = "RELEASE __actual_sp";
			undo = "ROLLBACK TO __actual_sp";
		} else {
			before = "BEGIN";
			after = "COMMIT";
			undo = "ROLLBACK";
		}
		execQuery$2(db, before);
		transactionDepth++;
		try {
			fn();
			execQuery$2(db, after);
		} catch (ex) {
			execQuery$2(db, undo);
			if (undo !== "ROLLBACK") execQuery$2(db, after);
			throw ex;
		} finally {
			transactionDepth--;
		}
	}
	async function asyncTransaction$1(db, fn) {
		if (transactionDepth === 0) db.exec("BEGIN TRANSACTION");
		transactionDepth++;
		try {
			await fn();
		} finally {
			transactionDepth--;
			if (transactionDepth === 0) db.exec("COMMIT");
		}
	}
	function regexp(regex, text) {
		return new RegExp(regex).test(text || "") ? 1 : 0;
	}
	async function openDatabase$1(pathOrBuffer) {
		let db = null;
		if (pathOrBuffer) if (typeof pathOrBuffer !== "string") db = new SQL.Database(pathOrBuffer);
		else {
			const path = pathOrBuffer;
			if (path !== ":memory:") {
				if (typeof SharedArrayBuffer === "undefined") {
					const stream = SQL.FS.open(SQL.FS.readlink(path), "a+");
					await stream.node.contents.readIfFallback();
					SQL.FS.close(stream);
				}
				db = new SQL.Database(path.includes("/blocked") ? path : SQL.FS.readlink(path), { filename: true });
				db.exec(`
          PRAGMA journal_mode=MEMORY;
          PRAGMA cache_size=-10000;
        `);
			}
		}
		if (db === null) db = new SQL.Database();
		db.create_function("UNICODE_LOWER", (arg) => arg?.toLowerCase());
		db.create_function("UNICODE_UPPER", (arg) => arg?.toUpperCase());
		db.create_function("UNICODE_LIKE", unicodeLike);
		db.create_function("REGEXP", regexp);
		db.create_function("NORMALISE", normalise);
		return db;
	}
	function closeDatabase$1(db) {
		db.close();
	}
	async function exportDatabase(db) {
		return db.export();
	}
	//#endregion
	//#region ../loot-core/src/platform/server/fs/shared.ts
	var documentDir;
	var _setDocumentDir = (dir) => documentDir = dir;
	var getDocumentDir = () => {
		if (!documentDir) throw new Error("Document directory is not set");
		return documentDir;
	};
	var getBudgetDir = (id) => {
		if (!id) throw new Error("getDocumentDir: id is falsy: " + id);
		if (id.match(/[^A-Za-z0-9\-_]/)) throw new Error(`Invalid budget id "${id}". Check the id of your budget in the Advanced section of the settings page.`);
		return join$1(getDocumentDir(), id);
	};
	//#endregion
	//#region ../loot-core/src/platform/server/fs/index.ts
	var fs_exports = /* @__PURE__ */ __exportAll({
		_setDocumentDir: () => _setDocumentDir,
		basename: () => basename,
		bundledDatabasePath: () => bundledDatabasePath,
		copyFile: () => copyFile,
		demoBudgetPath: () => demoBudgetPath,
		exists: () => exists$1,
		getBudgetDir: () => getBudgetDir,
		getDataDir: () => getDataDir,
		getDocumentDir: () => getDocumentDir,
		getModifiedTime: () => getModifiedTime,
		init: () => init$2,
		join: () => join$1,
		listDir: () => listDir,
		migrationsPath: () => migrationsPath,
		mkdir: () => mkdir,
		pathToId: () => pathToId,
		readFile: () => readFile,
		removeDir: () => removeDir,
		removeDirRecursively: () => removeDirRecursively,
		removeFile: () => removeFile$1,
		size: () => size,
		writeFile: () => writeFile
	});
	init_dist$1();
	var FS = null;
	var BFS = null;
	var bundledDatabasePath = "/default-db.sqlite";
	var migrationsPath = "/migrations";
	var demoBudgetPath = "/demo-budget";
	var getDataDir = () => "/";
	var pathToId = function(filepath) {
		return filepath.replace(/^\//, "").replace(/\//g, "-");
	};
	function _exists(filepath) {
		try {
			FS.readlink(filepath);
			return true;
		} catch {}
		try {
			FS.stat(filepath);
			return true;
		} catch {}
		return false;
	}
	function _mkdirRecursively(dir) {
		const parts = dir.split("/").filter((str) => str !== "");
		let path = "";
		for (const part of parts) {
			path += "/" + part;
			if (!_exists(path)) FS.mkdir(path);
		}
	}
	function _createFile(filepath) {
		if (filepath.startsWith("/documents")) if (filepath.endsWith(".sqlite")) {
			if (!_exists(filepath)) FS.symlink("/blocked/" + pathToId(filepath), filepath);
		} else FS.writeFile(filepath, "!$@) this should never read !$@)");
		return filepath;
	}
	async function _readFile(filepath, opts) {
		if (filepath.startsWith("/documents") && !filepath.endsWith(".sqlite")) {
			if (!_exists(filepath)) throw new Error("File does not exist: " + filepath);
			const { store } = getStore(await getDatabase$1(), "files");
			const item = await get$4(store, filepath);
			if (item == null) throw new Error("File does not exist: " + filepath);
			if (opts?.encoding === "utf8" && ArrayBuffer.isView(item.contents)) return String.fromCharCode.apply(null, new Uint16Array(item.contents.buffer));
			return item.contents;
		} else if (opts?.encoding === "utf8") return FS.readFile(resolveLink(filepath), { encoding: "utf8" });
		else if (opts?.encoding === "binary") return FS.readFile(resolveLink(filepath), { encoding: "binary" });
		else return FS.readFile(resolveLink(filepath));
	}
	function resolveLink(path) {
		try {
			const { node } = FS.lookupPath(path, { follow: false });
			return node.link ? FS.readlink(path) : path;
		} catch {
			return path;
		}
	}
	async function _writeFile(filepath, contents) {
		if (contents instanceof ArrayBuffer) contents = new Uint8Array(contents);
		else if (ArrayBuffer.isView(contents)) contents = new Uint8Array(contents.buffer);
		_createFile(filepath);
		if (filepath.startsWith("/documents")) {
			const isDb = filepath.endsWith(".sqlite");
			const { store } = getStore(await getDatabase$1(), "files");
			if (isDb) {
				await set(store, {
					filepath,
					contents: ""
				});
				await Promise.resolve();
				FS.writeFile(resolveLink(filepath), contents);
			} else await set(store, {
				filepath,
				contents
			});
		} else FS.writeFile(resolveLink(filepath), contents);
		return true;
	}
	async function _copySqlFile(frompath, topath) {
		_createFile(topath);
		const { store } = getStore(await getDatabase$1(), "files");
		await set(store, {
			filepath: topath,
			contents: ""
		});
		const fromDbPath = pathToId((await get$4(store, frompath)).filepath);
		const toDbPath = pathToId(topath);
		const fromfile = BFS.backend.createFile(fromDbPath);
		const tofile = BFS.backend.createFile(toDbPath);
		try {
			fromfile.open();
			tofile.open();
			const fileSize = fromfile.meta.size;
			const blockSize = fromfile.meta.blockSize;
			const buffer = new ArrayBuffer(blockSize);
			const bufferView = new Uint8Array(buffer);
			for (let i = 0; i < fileSize; i += blockSize) {
				const bytesToRead = Math.min(blockSize, fileSize - i);
				fromfile.read(bufferView, 0, bytesToRead, i);
				tofile.write(bufferView, 0, bytesToRead, i);
			}
		} catch (error) {
			tofile.close();
			fromfile.close();
			await _removeFile(toDbPath);
			logger.error("Failed to copy database file", error);
			return false;
		} finally {
			tofile.close();
			fromfile.close();
		}
		return true;
	}
	async function _removeFile(filepath) {
		if (filepath.startsWith("/documents")) {
			const isDb = filepath.endsWith(".sqlite");
			const { store } = getStore(await getDatabase$1(), "files");
			await del$1(store, filepath);
			if (isDb) {
				const linked = resolveLink(filepath);
				if (_exists(linked)) FS.unlink(linked);
			}
		}
		FS.unlink(filepath);
	}
	async function populateDefaultFilesystem() {
		const files = (await (await fetch("/data-file-index.txt")).text()).split("\n").map((name) => name.trim()).filter((name) => name !== "");
		const fetchFile = (url) => fetch(url).then((res) => res.arrayBuffer());
		await mkdir("/migrations");
		await mkdir("/demo-budget");
		await Promise.all(files.map(async (file) => {
			const contents = await fetchFile("/data/" + file);
			await _writeFile("/" + file, contents);
		}));
	}
	var populateFileHierarchy = async function() {
		const { store } = getStore(await getDatabase$1(), "files");
		const req = store.getAllKeys();
		const paths = await new Promise((resolve, reject) => {
			req.onsuccess = (e) => resolve(e.target.result);
			req.onerror = (e) => reject(e);
		});
		for (const path of paths) {
			_mkdirRecursively(basename(path));
			_createFile(path);
		}
	};
	var init$2 = async function() {
		const Module = _getModule();
		FS = Module.FS;
		FS.mkdir("/uploads");
		FS.mkdir("/documents");
		FS.mkdir("/blocked");
		if (process$1.env.NODE_ENV !== "test") {
			const backend = new IndexedDBBackend(() => {
				send$1("fallback-write-error");
			});
			BFS = new SQLiteFS(FS, backend);
			Module.register_for_idb(BFS);
			FS.mount(BFS, {}, "/blocked");
			await populateDefaultFilesystem();
		}
		await populateFileHierarchy();
	};
	var basename = function(filepath) {
		return filepath.split("/").slice(0, -1).join("/");
	};
	var listDir = async function(filepath) {
		return FS.readdir(filepath).filter((p) => p !== "." && p !== "..");
	};
	var exists$1 = async function(filepath) {
		return _exists(filepath);
	};
	var mkdir = async function(filepath) {
		FS.mkdir(filepath);
	};
	var size = async function(filepath) {
		return FS.stat(resolveLink(filepath)).size;
	};
	var copyFile = async function(frompath, topath) {
		let result = false;
		try {
			result = await _writeFile(topath, await _readFile(frompath));
		} catch (error) {
			if (frompath.endsWith(".sqlite") || topath.endsWith(".sqlite")) try {
				result = await _copySqlFile(frompath, topath);
			} catch (secondError) {
				throw new Error(`Failed to copy SQL file from ${frompath} to ${topath}: ${secondError.message}`);
			}
			else throw error;
		}
		return result;
	};
	async function readFile(filepath, encoding = "utf8") {
		if (encoding === "utf8") return _readFile(filepath, { encoding });
		return _readFile(filepath, { encoding });
	}
	var writeFile = async function(filepath, contents) {
		return _writeFile(filepath, contents);
	};
	var removeFile$1 = async function(filepath) {
		return _removeFile(filepath);
	};
	var removeDir = async function(filepath) {
		FS.rmdir(filepath);
	};
	var removeDirRecursively = async function(dirpath) {
		if (await exists$1(dirpath)) {
			for (const file of await listDir(dirpath)) {
				const fullpath = join$1(dirpath, file);
				const attr = FS.stat(fullpath, true);
				if (FS.isDir(attr.mode)) await removeDirRecursively(fullpath);
				else await removeFile$1(fullpath);
			}
			await removeDir(dirpath);
		}
	};
	var getModifiedTime = async (_filepath) => {
		throw new Error("getModifiedTime not supported on the web (only used for backups)");
	};
	//#endregion
	//#region ../loot-core/src/shared/query.ts
	var Query = class Query {
		constructor(state) {
			_defineProperty(this, "state", void 0);
			this.state = {
				tableOptions: state.tableOptions || {},
				filterExpressions: state.filterExpressions || [],
				selectExpressions: state.selectExpressions || [],
				groupExpressions: state.groupExpressions || [],
				orderExpressions: state.orderExpressions || [],
				calculation: false,
				rawMode: false,
				withDead: false,
				validateRefs: true,
				limit: null,
				offset: null,
				...state
			};
		}
		filter(expr) {
			return new Query({
				...this.state,
				filterExpressions: [...this.state.filterExpressions, expr]
			});
		}
		unfilter(exprs) {
			if (!exprs) return new Query({
				...this.state,
				filterExpressions: []
			});
			const exprSet = new Set(exprs);
			return new Query({
				...this.state,
				filterExpressions: this.state.filterExpressions.filter((expr) => !exprSet.has(Object.keys(expr)[0]))
			});
		}
		select(exprs = []) {
			if (!Array.isArray(exprs)) exprs = [exprs];
			return new Query({
				...this.state,
				selectExpressions: exprs,
				calculation: false
			});
		}
		calculate(expr) {
			return new Query({
				...this.state,
				selectExpressions: [{ result: expr }],
				calculation: true
			});
		}
		groupBy(exprs) {
			if (!Array.isArray(exprs)) exprs = [exprs];
			return new Query({
				...this.state,
				groupExpressions: [...this.state.groupExpressions, ...exprs]
			});
		}
		orderBy(exprs) {
			if (!Array.isArray(exprs)) exprs = [exprs];
			return new Query({
				...this.state,
				orderExpressions: [...this.state.orderExpressions, ...exprs]
			});
		}
		limit(num) {
			return new Query({
				...this.state,
				limit: num
			});
		}
		offset(num) {
			return new Query({
				...this.state,
				offset: num
			});
		}
		raw() {
			return new Query({
				...this.state,
				rawMode: true
			});
		}
		withDead() {
			return new Query({
				...this.state,
				withDead: true
			});
		}
		withoutValidatedRefs() {
			return new Query({
				...this.state,
				validateRefs: false
			});
		}
		options(opts) {
			return new Query({
				...this.state,
				tableOptions: opts
			});
		}
		reset() {
			return q(this.state.table);
		}
		serialize() {
			return this.state;
		}
		serializeAsString() {
			return JSON.stringify(this.serialize());
		}
	};
	function q(table) {
		return new Query({ table });
	}
	//#endregion
	//#region ../../node_modules/date-fns/constants.js
	/**
	* @constant
	* @name daysInYear
	* @summary Days in 1 year.
	*
	* @description
	* How many days in a year.
	*
	* One years equals 365.2425 days according to the formula:
	*
	* > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
	* > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
	*/
	var daysInYear = 365.2425;
	-(Math.pow(10, 8) * 24 * 60 * 60 * 1e3);
	/**
	* @constant
	* @name millisecondsInWeek
	* @summary Milliseconds in 1 week.
	*/
	var millisecondsInWeek = 6048e5;
	/**
	* @constant
	* @name millisecondsInDay
	* @summary Milliseconds in 1 day.
	*/
	var millisecondsInDay = 864e5;
	/**
	* @constant
	* @name millisecondsInMinute
	* @summary Milliseconds in 1 minute
	*/
	var millisecondsInMinute = 6e4;
	/**
	* @constant
	* @name millisecondsInHour
	* @summary Milliseconds in 1 hour
	*/
	var millisecondsInHour = 36e5;
	/**
	* @constant
	* @name millisecondsInSecond
	* @summary Milliseconds in 1 second
	*/
	var millisecondsInSecond = 1e3;
	/**
	* @constant
	* @name secondsInDay
	* @summary Seconds in 1 day.
	*/
	var secondsInDay = 3600 * 24;
	secondsInDay * 7;
	secondsInDay * daysInYear / 12 * 3;
	/**
	* @constant
	* @name constructFromSymbol
	* @summary Symbol enabling Date extensions to inherit properties from the reference date.
	*
	* The symbol is used to enable the `constructFrom` function to construct a date
	* using a reference date and a value. It allows to transfer extra properties
	* from the reference date to the new date. It's useful for extensions like
	* [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
	* a constructor argument.
	*/
	var constructFromSymbol = Symbol.for("constructDateFrom");
	//#endregion
	//#region ../../node_modules/date-fns/constructFrom.js
	/**
	* @name constructFrom
	* @category Generic Helpers
	* @summary Constructs a date using the reference date and the value
	*
	* @description
	* The function constructs a new date using the constructor from the reference
	* date and the given value. It helps to build generic functions that accept
	* date extensions.
	*
	* It defaults to `Date` if the passed reference date is a number or a string.
	*
	* Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
	* enabling to transfer extra properties from the reference date to the new date.
	* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
	* that accept a time zone as a constructor argument.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	*
	* @param date - The reference date to take constructor from
	* @param value - The value to create the date
	*
	* @returns Date initialized using the given date and value
	*
	* @example
	* import { constructFrom } from "./constructFrom/date-fns";
	*
	* // A function that clones a date preserving the original type
	* function cloneDate<DateType extends Date>(date: DateType): DateType {
	*   return constructFrom(
	*     date, // Use constructor from the given date
	*     date.getTime() // Use the date value to create a new date
	*   );
	* }
	*/
	function constructFrom(date, value) {
		if (typeof date === "function") return date(value);
		if (date && typeof date === "object" && constructFromSymbol in date) return date[constructFromSymbol](value);
		if (date instanceof Date) return new date.constructor(value);
		return new Date(value);
	}
	//#endregion
	//#region ../../node_modules/date-fns/toDate.js
	/**
	* @name toDate
	* @category Common Helpers
	* @summary Convert the given argument to an instance of Date.
	*
	* @description
	* Convert the given argument to an instance of Date.
	*
	* If the argument is an instance of Date, the function returns its clone.
	*
	* If the argument is a number, it is treated as a timestamp.
	*
	* If the argument is none of the above, the function returns Invalid Date.
	*
	* Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
	* enabling to transfer extra properties from the reference date to the new date.
	* It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
	* that accept a time zone as a constructor argument.
	*
	* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param argument - The value to convert
	*
	* @returns The parsed date in the local time zone
	*
	* @example
	* // Clone the date:
	* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
	* //=> Tue Feb 11 2014 11:30:30
	*
	* @example
	* // Convert the timestamp to date:
	* const result = toDate(1392098430000)
	* //=> Tue Feb 11 2014 11:30:30
	*/
	function toDate(argument, context) {
		return constructFrom(context || argument, argument);
	}
	//#endregion
	//#region ../../node_modules/date-fns/addDays.js
	/**
	* The {@link addDays} function options.
	*/
	/**
	* @name addDays
	* @category Day Helpers
	* @summary Add the specified number of days to the given date.
	*
	* @description
	* Add the specified number of days to the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of days to be added.
	* @param options - An object with options
	*
	* @returns The new date with the days added
	*
	* @example
	* // Add 10 days to 1 September 2014:
	* const result = addDays(new Date(2014, 8, 1), 10)
	* //=> Thu Sep 11 2014 00:00:00
	*/
	function addDays$1(date, amount, options) {
		const _date = toDate(date, options?.in);
		if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
		if (!amount) return _date;
		_date.setDate(_date.getDate() + amount);
		return _date;
	}
	//#endregion
	//#region ../../node_modules/date-fns/addMonths.js
	/**
	* The {@link addMonths} function options.
	*/
	/**
	* @name addMonths
	* @category Month Helpers
	* @summary Add the specified number of months to the given date.
	*
	* @description
	* Add the specified number of months to the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of months to be added.
	* @param options - The options object
	*
	* @returns The new date with the months added
	*
	* @example
	* // Add 5 months to 1 September 2014:
	* const result = addMonths(new Date(2014, 8, 1), 5)
	* //=> Sun Feb 01 2015 00:00:00
	*
	* // Add one month to 30 January 2023:
	* const result = addMonths(new Date(2023, 0, 30), 1)
	* //=> Tue Feb 28 2023 00:00:00
	*/
	function addMonths$1(date, amount, options) {
		const _date = toDate(date, options?.in);
		if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
		if (!amount) return _date;
		const dayOfMonth = _date.getDate();
		const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
		endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
		if (dayOfMonth >= endOfDesiredMonth.getDate()) return endOfDesiredMonth;
		else {
			_date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
			return _date;
		}
	}
	//#endregion
	//#region ../../node_modules/date-fns/isWeekend.js
	/**
	* The {@link isWeekend} function options.
	*/
	/**
	* @name isWeekend
	* @category Weekday Helpers
	* @summary Does the given date fall on a weekend?
	*
	* @description
	* Does the given date fall on a weekend? A weekend is either Saturday (`6`) or Sunday (`0`).
	*
	* @param date - The date to check
	* @param options - An object with options
	*
	* @returns The date falls on a weekend
	*
	* @example
	* // Does 5 October 2014 fall on a weekend?
	* const result = isWeekend(new Date(2014, 9, 5))
	* //=> true
	*/
	function isWeekend(date, options) {
		const day = toDate(date, options?.in).getDay();
		return day === 0 || day === 6;
	}
	//#endregion
	//#region ../../node_modules/date-fns/_lib/defaultOptions.js
	var defaultOptions = {};
	function getDefaultOptions$1() {
		return defaultOptions;
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfWeek.js
	/**
	* The {@link startOfWeek} function options.
	*/
	/**
	* @name startOfWeek
	* @category Week Helpers
	* @summary Return the start of a week for the given date.
	*
	* @description
	* Return the start of a week for the given date.
	* The result will be in the local timezone.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - An object with options
	*
	* @returns The start of a week
	*
	* @example
	* // The start of a week for 2 September 2014 11:55:00:
	* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
	* //=> Sun Aug 31 2014 00:00:00
	*
	* @example
	* // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
	* const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
	* //=> Mon Sep 01 2014 00:00:00
	*/
	function startOfWeek(date, options) {
		const defaultOptions = getDefaultOptions$1();
		const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
		const _date = toDate(date, options?.in);
		const day = _date.getDay();
		const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
		_date.setDate(_date.getDate() - diff);
		_date.setHours(0, 0, 0, 0);
		return _date;
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfISOWeek.js
	/**
	* The {@link startOfISOWeek} function options.
	*/
	/**
	* @name startOfISOWeek
	* @category ISO Week Helpers
	* @summary Return the start of an ISO week for the given date.
	*
	* @description
	* Return the start of an ISO week for the given date.
	* The result will be in the local timezone.
	*
	* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - An object with options
	*
	* @returns The start of an ISO week
	*
	* @example
	* // The start of an ISO week for 2 September 2014 11:55:00:
	* const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
	* //=> Mon Sep 01 2014 00:00:00
	*/
	function startOfISOWeek(date, options) {
		return startOfWeek(date, {
			...options,
			weekStartsOn: 1
		});
	}
	//#endregion
	//#region ../../node_modules/date-fns/getISOWeekYear.js
	/**
	* The {@link getISOWeekYear} function options.
	*/
	/**
	* @name getISOWeekYear
	* @category ISO Week-Numbering Year Helpers
	* @summary Get the ISO week-numbering year of the given date.
	*
	* @description
	* Get the ISO week-numbering year of the given date,
	* which always starts 3 days before the year's first Thursday.
	*
	* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
	*
	* @param date - The given date
	*
	* @returns The ISO week-numbering year
	*
	* @example
	* // Which ISO-week numbering year is 2 January 2005?
	* const result = getISOWeekYear(new Date(2005, 0, 2))
	* //=> 2004
	*/
	function getISOWeekYear(date, options) {
		const _date = toDate(date, options?.in);
		const year = _date.getFullYear();
		const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
		fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
		fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
		const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
		const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
		fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
		fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
		const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
		if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
		else if (_date.getTime() >= startOfThisYear.getTime()) return year;
		else return year - 1;
	}
	//#endregion
	//#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
	/**
	* Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
	* They usually appear for dates that denote time before the timezones were introduced
	* (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
	* and GMT+01:00:00 after that date)
	*
	* Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
	* which would lead to incorrect calculations.
	*
	* This function returns the timezone offset in milliseconds that takes seconds in account.
	*/
	function getTimezoneOffsetInMilliseconds(date) {
		const _date = toDate(date);
		const utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
		utcDate.setUTCFullYear(_date.getFullYear());
		return +date - +utcDate;
	}
	//#endregion
	//#region ../../node_modules/date-fns/_lib/normalizeDates.js
	function normalizeDates(context, ...dates) {
		const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === "object"));
		return dates.map(normalize);
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfDay.js
	/**
	* The {@link startOfDay} function options.
	*/
	/**
	* @name startOfDay
	* @category Day Helpers
	* @summary Return the start of a day for the given date.
	*
	* @description
	* Return the start of a day for the given date.
	* The result will be in the local timezone.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - The options
	*
	* @returns The start of a day
	*
	* @example
	* // The start of a day for 2 September 2014 11:55:00:
	* const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
	* //=> Tue Sep 02 2014 00:00:00
	*/
	function startOfDay(date, options) {
		const _date = toDate(date, options?.in);
		_date.setHours(0, 0, 0, 0);
		return _date;
	}
	//#endregion
	//#region ../../node_modules/date-fns/differenceInCalendarDays.js
	/**
	* The {@link differenceInCalendarDays} function options.
	*/
	/**
	* @name differenceInCalendarDays
	* @category Day Helpers
	* @summary Get the number of calendar days between the given dates.
	*
	* @description
	* Get the number of calendar days between the given dates. This means that the times are removed
	* from the dates and then the difference in days is calculated.
	*
	* @param laterDate - The later date
	* @param earlierDate - The earlier date
	* @param options - The options object
	*
	* @returns The number of calendar days
	*
	* @example
	* // How many calendar days are between
	* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
	* const result = differenceInCalendarDays(
	*   new Date(2012, 6, 2, 0, 0),
	*   new Date(2011, 6, 2, 23, 0)
	* )
	* //=> 366
	* // How many calendar days are between
	* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
	* const result = differenceInCalendarDays(
	*   new Date(2011, 6, 3, 0, 1),
	*   new Date(2011, 6, 2, 23, 59)
	* )
	* //=> 1
	*/
	function differenceInCalendarDays$1(laterDate, earlierDate, options) {
		const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
		const laterStartOfDay = startOfDay(laterDate_);
		const earlierStartOfDay = startOfDay(earlierDate_);
		const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
		const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
		return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfISOWeekYear.js
	/**
	* The {@link startOfISOWeekYear} function options.
	*/
	/**
	* @name startOfISOWeekYear
	* @category ISO Week-Numbering Year Helpers
	* @summary Return the start of an ISO week-numbering year for the given date.
	*
	* @description
	* Return the start of an ISO week-numbering year,
	* which always starts 3 days before the year's first Thursday.
	* The result will be in the local timezone.
	*
	* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - An object with options
	*
	* @returns The start of an ISO week-numbering year
	*
	* @example
	* // The start of an ISO week-numbering year for 2 July 2005:
	* const result = startOfISOWeekYear(new Date(2005, 6, 2))
	* //=> Mon Jan 03 2005 00:00:00
	*/
	function startOfISOWeekYear(date, options) {
		const year = getISOWeekYear(date, options);
		const fourthOfJanuary = constructFrom(options?.in || date, 0);
		fourthOfJanuary.setFullYear(year, 0, 4);
		fourthOfJanuary.setHours(0, 0, 0, 0);
		return startOfISOWeek(fourthOfJanuary);
	}
	//#endregion
	//#region ../../node_modules/date-fns/addWeeks.js
	/**
	* The {@link addWeeks} function options.
	*/
	/**
	* @name addWeeks
	* @category Week Helpers
	* @summary Add the specified number of weeks to the given date.
	*
	* @description
	* Add the specified number of weeks to the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of weeks to be added.
	* @param options - An object with options
	*
	* @returns The new date with the weeks added
	*
	* @example
	* // Add 4 weeks to 1 September 2014:
	* const result = addWeeks(new Date(2014, 8, 1), 4)
	* //=> Mon Sep 29 2014 00:00:00
	*/
	function addWeeks$1(date, amount, options) {
		return addDays$1(date, amount * 7, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/addYears.js
	/**
	* The {@link addYears} function options.
	*/
	/**
	* @name addYears
	* @category Year Helpers
	* @summary Add the specified number of years to the given date.
	*
	* @description
	* Add the specified number of years to the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type.
	*
	* @param date - The date to be changed
	* @param amount - The amount of years to be added.
	* @param options - The options
	*
	* @returns The new date with the years added
	*
	* @example
	* // Add 5 years to 1 September 2014:
	* const result = addYears(new Date(2014, 8, 1), 5)
	* //=> Sun Sep 01 2019 00:00:00
	*/
	function addYears(date, amount, options) {
		return addMonths$1(date, amount * 12, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/max.js
	/**
	* The {@link max} function options.
	*/
	/**
	* @name max
	* @category Common Helpers
	* @summary Return the latest of the given dates.
	*
	* @description
	* Return the latest of the given dates.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param dates - The dates to compare
	*
	* @returns The latest of the dates
	*
	* @example
	* // Which of these dates is the latest?
	* const result = max([
	*   new Date(1989, 6, 10),
	*   new Date(1987, 1, 11),
	*   new Date(1995, 6, 2),
	*   new Date(1990, 0, 1)
	* ])
	* //=> Sun Jul 02 1995 00:00:00
	*/
	function max(dates, options) {
		let result;
		let context = options?.in;
		dates.forEach((date) => {
			if (!context && typeof date === "object") context = constructFrom.bind(null, date);
			const date_ = toDate(date, context);
			if (!result || result < date_ || isNaN(+date_)) result = date_;
		});
		return constructFrom(context, result || NaN);
	}
	//#endregion
	//#region ../../node_modules/date-fns/isDate.js
	/**
	* @name isDate
	* @category Common Helpers
	* @summary Is the given value a date?
	*
	* @description
	* Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
	*
	* @param value - The value to check
	*
	* @returns True if the given value is a date
	*
	* @example
	* // For a valid date:
	* const result = isDate(new Date())
	* //=> true
	*
	* @example
	* // For an invalid date:
	* const result = isDate(new Date(NaN))
	* //=> true
	*
	* @example
	* // For some value:
	* const result = isDate('2014-02-31')
	* //=> false
	*
	* @example
	* // For an object:
	* const result = isDate({})
	* //=> false
	*/
	function isDate(value) {
		return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
	}
	//#endregion
	//#region ../../node_modules/date-fns/isValid.js
	/**
	* @name isValid
	* @category Common Helpers
	* @summary Is the given date valid?
	*
	* @description
	* Returns false if argument is Invalid Date and true otherwise.
	* Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
	* Invalid Date is a Date, whose time value is NaN.
	*
	* Time value of Date: http://es5.github.io/#x15.9.1.1
	*
	* @param date - The date to check
	*
	* @returns The date is valid
	*
	* @example
	* // For the valid date:
	* const result = isValid(new Date(2014, 1, 31))
	* //=> true
	*
	* @example
	* // For the value, convertible into a date:
	* const result = isValid(1393804800000)
	* //=> true
	*
	* @example
	* // For the invalid date:
	* const result = isValid(new Date(''))
	* //=> false
	*/
	function isValid(date) {
		return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
	}
	//#endregion
	//#region ../../node_modules/date-fns/differenceInCalendarMonths.js
	/**
	* The {@link differenceInCalendarMonths} function options.
	*/
	/**
	* @name differenceInCalendarMonths
	* @category Month Helpers
	* @summary Get the number of calendar months between the given dates.
	*
	* @description
	* Get the number of calendar months between the given dates.
	*
	* @param laterDate - The later date
	* @param earlierDate - The earlier date
	* @param options - An object with options
	*
	* @returns The number of calendar months
	*
	* @example
	* // How many calendar months are between 31 January 2014 and 1 September 2014?
	* const result = differenceInCalendarMonths(
	*   new Date(2014, 8, 1),
	*   new Date(2014, 0, 31)
	* )
	* //=> 8
	*/
	function differenceInCalendarMonths$1(laterDate, earlierDate, options) {
		const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
		const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();
		const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();
		return yearsDiff * 12 + monthsDiff;
	}
	//#endregion
	//#region ../../node_modules/date-fns/differenceInDays.js
	/**
	* The {@link differenceInDays} function options.
	*/
	/**
	* @name differenceInDays
	* @category Day Helpers
	* @summary Get the number of full days between the given dates.
	*
	* @description
	* Get the number of full day periods between two dates. Fractional days are
	* truncated towards zero.
	*
	* One "full day" is the distance between a local time in one day to the same
	* local time on the next or previous day. A full day can sometimes be less than
	* or more than 24 hours if a daylight savings change happens between two dates.
	*
	* To ignore DST and only measure exact 24-hour periods, use this instead:
	* `Math.trunc(differenceInHours(dateLeft, dateRight)/24)|0`.
	*
	* @param laterDate - The later date
	* @param earlierDate - The earlier date
	* @param options - An object with options
	*
	* @returns The number of full days according to the local timezone
	*
	* @example
	* // How many full days are between
	* // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
	* const result = differenceInDays(
	*   new Date(2012, 6, 2, 0, 0),
	*   new Date(2011, 6, 2, 23, 0)
	* )
	* //=> 365
	*
	* @example
	* // How many full days are between
	* // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
	* const result = differenceInDays(
	*   new Date(2011, 6, 3, 0, 1),
	*   new Date(2011, 6, 2, 23, 59)
	* )
	* //=> 0
	*
	* @example
	* // How many full days are between
	* // 1 March 2020 0:00 and 1 June 2020 0:00 ?
	* // Note: because local time is used, the
	* // result will always be 92 days, even in
	* // time zones where DST starts and the
	* // period has only 92*24-1 hours.
	* const result = differenceInDays(
	*   new Date(2020, 5, 1),
	*   new Date(2020, 2, 1)
	* )
	* //=> 92
	*/
	function differenceInDays(laterDate, earlierDate, options) {
		const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
		const sign = compareLocalAsc(laterDate_, earlierDate_);
		const difference = Math.abs(differenceInCalendarDays$1(laterDate_, earlierDate_));
		laterDate_.setDate(laterDate_.getDate() - sign * difference);
		const result = sign * (difference - Number(compareLocalAsc(laterDate_, earlierDate_) === -sign));
		return result === 0 ? 0 : result;
	}
	function compareLocalAsc(laterDate, earlierDate) {
		const diff = laterDate.getFullYear() - earlierDate.getFullYear() || laterDate.getMonth() - earlierDate.getMonth() || laterDate.getDate() - earlierDate.getDate() || laterDate.getHours() - earlierDate.getHours() || laterDate.getMinutes() - earlierDate.getMinutes() || laterDate.getSeconds() - earlierDate.getSeconds() || laterDate.getMilliseconds() - earlierDate.getMilliseconds();
		if (diff < 0) return -1;
		if (diff > 0) return 1;
		return diff;
	}
	//#endregion
	//#region ../../node_modules/date-fns/differenceInMilliseconds.js
	/**
	* @name differenceInMilliseconds
	* @category Millisecond Helpers
	* @summary Get the number of milliseconds between the given dates.
	*
	* @description
	* Get the number of milliseconds between the given dates.
	*
	* @param laterDate - The later date
	* @param earlierDate - The earlier date
	*
	* @returns The number of milliseconds
	*
	* @example
	* // How many milliseconds are between
	* // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
	* const result = differenceInMilliseconds(
	*   new Date(2014, 6, 2, 12, 30, 21, 700),
	*   new Date(2014, 6, 2, 12, 30, 20, 600)
	* )
	* //=> 1100
	*/
	function differenceInMilliseconds(laterDate, earlierDate) {
		return +toDate(laterDate) - +toDate(earlierDate);
	}
	//#endregion
	//#region ../../node_modules/date-fns/endOfMonth.js
	/**
	* The {@link endOfMonth} function options.
	*/
	/**
	* @name endOfMonth
	* @category Month Helpers
	* @summary Return the end of a month for the given date.
	*
	* @description
	* Return the end of a month for the given date.
	* The result will be in the local timezone.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - An object with options
	*
	* @returns The end of a month
	*
	* @example
	* // The end of a month for 2 September 2014 11:55:00:
	* const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
	* //=> Tue Sep 30 2014 23:59:59.999
	*/
	function endOfMonth(date, options) {
		const _date = toDate(date, options?.in);
		const month = _date.getMonth();
		_date.setFullYear(_date.getFullYear(), month + 1, 0);
		_date.setHours(23, 59, 59, 999);
		return _date;
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfMonth.js
	/**
	* The {@link startOfMonth} function options.
	*/
	/**
	* @name startOfMonth
	* @category Month Helpers
	* @summary Return the start of a month for the given date.
	*
	* @description
	* Return the start of a month for the given date. The result will be in the local timezone.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
	* Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
	* or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - An object with options
	*
	* @returns The start of a month
	*
	* @example
	* // The start of a month for 2 September 2014 11:55:00:
	* const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
	* //=> Mon Sep 01 2014 00:00:00
	*/
	function startOfMonth(date, options) {
		const _date = toDate(date, options?.in);
		_date.setDate(1);
		_date.setHours(0, 0, 0, 0);
		return _date;
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfYear.js
	/**
	* The {@link startOfYear} function options.
	*/
	/**
	* @name startOfYear
	* @category Year Helpers
	* @summary Return the start of a year for the given date.
	*
	* @description
	* Return the start of a year for the given date.
	* The result will be in the local timezone.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The original date
	* @param options - The options
	*
	* @returns The start of a year
	*
	* @example
	* // The start of a year for 2 September 2014 11:55:00:
	* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
	* //=> Wed Jan 01 2014 00:00:00
	*/
	function startOfYear(date, options) {
		const date_ = toDate(date, options?.in);
		date_.setFullYear(date_.getFullYear(), 0, 1);
		date_.setHours(0, 0, 0, 0);
		return date_;
	}
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.js
	var formatDistanceLocale$83 = {
		lessThanXSeconds: {
			one: "less than a second",
			other: "less than {{count}} seconds"
		},
		xSeconds: {
			one: "1 second",
			other: "{{count}} seconds"
		},
		halfAMinute: "half a minute",
		lessThanXMinutes: {
			one: "less than a minute",
			other: "less than {{count}} minutes"
		},
		xMinutes: {
			one: "1 minute",
			other: "{{count}} minutes"
		},
		aboutXHours: {
			one: "about 1 hour",
			other: "about {{count}} hours"
		},
		xHours: {
			one: "1 hour",
			other: "{{count}} hours"
		},
		xDays: {
			one: "1 day",
			other: "{{count}} days"
		},
		aboutXWeeks: {
			one: "about 1 week",
			other: "about {{count}} weeks"
		},
		xWeeks: {
			one: "1 week",
			other: "{{count}} weeks"
		},
		aboutXMonths: {
			one: "about 1 month",
			other: "about {{count}} months"
		},
		xMonths: {
			one: "1 month",
			other: "{{count}} months"
		},
		aboutXYears: {
			one: "about 1 year",
			other: "about {{count}} years"
		},
		xYears: {
			one: "1 year",
			other: "{{count}} years"
		},
		overXYears: {
			one: "over 1 year",
			other: "over {{count}} years"
		},
		almostXYears: {
			one: "almost 1 year",
			other: "almost {{count}} years"
		}
	};
	var formatDistance$84 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$83[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
		else return result + " ago";
		return result;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
	function buildFormatLongFn(args) {
		return (options = {}) => {
			const width = options.width ? String(options.width) : args.defaultWidth;
			return args.formats[width] || args.formats[args.defaultWidth];
		};
	}
	var formatLong$92 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'at' {{time}}",
				long: "{{date}} 'at' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-US/_lib/formatRelative.js
	var formatRelativeLocale$84 = {
		lastWeek: "'last' eeee 'at' p",
		yesterday: "'yesterday at' p",
		today: "'today at' p",
		tomorrow: "'tomorrow at' p",
		nextWeek: "eeee 'at' p",
		other: "P"
	};
	var formatRelative$84 = (token, _date, _baseDate, _options) => formatRelativeLocale$84[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
	/**
	* The localize function argument callback which allows to convert raw value to
	* the actual type.
	*
	* @param value - The value to convert
	*
	* @returns The converted value
	*/
	/**
	* The map of localized values for each width.
	*/
	/**
	* The index type of the locale unit value. It types conversion of units of
	* values that don't start at 0 (i.e. quarters).
	*/
	/**
	* Converts the unit value to the tuple of values.
	*/
	/**
	* The tuple of localized era values. The first element represents BC,
	* the second element represents AD.
	*/
	/**
	* The tuple of localized quarter values. The first element represents Q1.
	*/
	/**
	* The tuple of localized day values. The first element represents Sunday.
	*/
	/**
	* The tuple of localized month values. The first element represents January.
	*/
	function buildLocalizeFn(args) {
		return (value, options) => {
			const context = options?.context ? String(options.context) : "standalone";
			let valuesArray;
			if (context === "formatting" && args.formattingValues) {
				const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
				const width = options?.width ? String(options.width) : defaultWidth;
				valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
			} else {
				const defaultWidth = args.defaultWidth;
				const width = options?.width ? String(options.width) : args.defaultWidth;
				valuesArray = args.values[width] || args.values[defaultWidth];
			}
			const index = args.argumentCallback ? args.argumentCallback(value) : value;
			return valuesArray[index];
		};
	}
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-US/_lib/localize.js
	var eraValues$84 = {
		narrow: ["B", "A"],
		abbreviated: ["BC", "AD"],
		wide: ["Before Christ", "Anno Domini"]
	};
	var quarterValues$84 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1st quarter",
			"2nd quarter",
			"3rd quarter",
			"4th quarter"
		]
	};
	var monthValues$84 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Feb",
			"Mar",
			"Apr",
			"May",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Oct",
			"Nov",
			"Dec"
		],
		wide: [
			"January",
			"February",
			"March",
			"April",
			"May",
			"June",
			"July",
			"August",
			"September",
			"October",
			"November",
			"December"
		]
	};
	var dayValues$84 = {
		narrow: [
			"S",
			"M",
			"T",
			"W",
			"T",
			"F",
			"S"
		],
		short: [
			"Su",
			"Mo",
			"Tu",
			"We",
			"Th",
			"Fr",
			"Sa"
		],
		abbreviated: [
			"Sun",
			"Mon",
			"Tue",
			"Wed",
			"Thu",
			"Fri",
			"Sat"
		],
		wide: [
			"Sunday",
			"Monday",
			"Tuesday",
			"Wednesday",
			"Thursday",
			"Friday",
			"Saturday"
		]
	};
	var dayPeriodValues$84 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mi",
			noon: "n",
			morning: "morning",
			afternoon: "afternoon",
			evening: "evening",
			night: "night"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "midnight",
			noon: "noon",
			morning: "morning",
			afternoon: "afternoon",
			evening: "evening",
			night: "night"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnight",
			noon: "noon",
			morning: "morning",
			afternoon: "afternoon",
			evening: "evening",
			night: "night"
		}
	};
	var formattingDayPeriodValues$68 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mi",
			noon: "n",
			morning: "in the morning",
			afternoon: "in the afternoon",
			evening: "in the evening",
			night: "at night"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "midnight",
			noon: "noon",
			morning: "in the morning",
			afternoon: "in the afternoon",
			evening: "in the evening",
			night: "at night"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnight",
			noon: "noon",
			morning: "in the morning",
			afternoon: "in the afternoon",
			evening: "in the evening",
			night: "at night"
		}
	};
	var ordinalNumber$84 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
			case 1: return number + "st";
			case 2: return number + "nd";
			case 3: return number + "rd";
		}
		return number + "th";
	};
	var localize$84 = {
		ordinalNumber: ordinalNumber$84,
		era: buildLocalizeFn({
			values: eraValues$84,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$84,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$84,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$84,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$84,
			defaultWidth: "wide",
			formattingValues: formattingDayPeriodValues$68,
			defaultFormattingWidth: "wide"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/_lib/buildMatchFn.js
	function buildMatchFn(args) {
		return (string, options = {}) => {
			const width = options.width;
			const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
			const matchResult = string.match(matchPattern);
			if (!matchResult) return null;
			const matchedString = matchResult[0];
			const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
			const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
			let value;
			value = args.valueCallback ? args.valueCallback(key) : key;
			value = options.valueCallback ? options.valueCallback(value) : value;
			const rest = string.slice(matchedString.length);
			return {
				value,
				rest
			};
		};
	}
	function findKey(object, predicate) {
		for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
	}
	function findIndex(array, predicate) {
		for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
	}
	//#endregion
	//#region ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
	function buildMatchPatternFn(args) {
		return (string, options = {}) => {
			const matchResult = string.match(args.matchPattern);
			if (!matchResult) return null;
			const matchedString = matchResult[0];
			const parseResult = string.match(args.parsePattern);
			if (!parseResult) return null;
			let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
			value = options.valueCallback ? options.valueCallback(value) : value;
			const rest = string.slice(matchedString.length);
			return {
				value,
				rest
			};
		};
	}
	var match$83 = {
		ordinalNumber: buildMatchPatternFn({
			matchPattern: /^(\d+)(th|st|nd|rd)?/i,
			parsePattern: /\d+/i,
			valueCallback: (value) => parseInt(value, 10)
		}),
		era: buildMatchFn({
			matchPatterns: {
				narrow: /^(b|a)/i,
				abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
				wide: /^(before christ|before common era|anno domini|common era)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [/^b/i, /^(a|c)/i] },
			defaultParseWidth: "any"
		}),
		quarter: buildMatchFn({
			matchPatterns: {
				narrow: /^[1234]/i,
				abbreviated: /^q[1234]/i,
				wide: /^[1234](th|st|nd|rd)? quarter/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [
				/1/i,
				/2/i,
				/3/i,
				/4/i
			] },
			defaultParseWidth: "any",
			valueCallback: (index) => index + 1
		}),
		month: buildMatchFn({
			matchPatterns: {
				narrow: /^[jfmasond]/i,
				abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
				wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^j/i,
					/^f/i,
					/^m/i,
					/^a/i,
					/^m/i,
					/^j/i,
					/^j/i,
					/^a/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				],
				any: [
					/^ja/i,
					/^f/i,
					/^mar/i,
					/^ap/i,
					/^may/i,
					/^jun/i,
					/^jul/i,
					/^au/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				]
			},
			defaultParseWidth: "any"
		}),
		day: buildMatchFn({
			matchPatterns: {
				narrow: /^[smtwf]/i,
				short: /^(su|mo|tu|we|th|fr|sa)/i,
				abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
				wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^s/i,
					/^m/i,
					/^t/i,
					/^w/i,
					/^t/i,
					/^f/i,
					/^s/i
				],
				any: [
					/^su/i,
					/^m/i,
					/^tu/i,
					/^w/i,
					/^th/i,
					/^f/i,
					/^sa/i
				]
			},
			defaultParseWidth: "any"
		}),
		dayPeriod: buildMatchFn({
			matchPatterns: {
				narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
				any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
			},
			defaultMatchWidth: "any",
			parsePatterns: { any: {
				am: /^a/i,
				pm: /^p/i,
				midnight: /^mi/i,
				noon: /^no/i,
				morning: /morning/i,
				afternoon: /afternoon/i,
				evening: /evening/i,
				night: /night/i
			} },
			defaultParseWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-US.js
	/**
	* @category Locales
	* @summary English locale (United States).
	* @language English
	* @iso-639-2 eng
	* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
	* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
	*/
	var enUS = {
		code: "en-US",
		formatDistance: formatDistance$84,
		formatLong: formatLong$92,
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/getDayOfYear.js
	/**
	* The {@link getDayOfYear} function options.
	*/
	/**
	* @name getDayOfYear
	* @category Day Helpers
	* @summary Get the day of the year of the given date.
	*
	* @description
	* Get the day of the year of the given date.
	*
	* @param date - The given date
	* @param options - The options
	*
	* @returns The day of year
	*
	* @example
	* // Which day of the year is 2 July 2014?
	* const result = getDayOfYear(new Date(2014, 6, 2))
	* //=> 183
	*/
	function getDayOfYear(date, options) {
		const _date = toDate(date, options?.in);
		return differenceInCalendarDays$1(_date, startOfYear(_date)) + 1;
	}
	//#endregion
	//#region ../../node_modules/date-fns/getISOWeek.js
	/**
	* The {@link getISOWeek} function options.
	*/
	/**
	* @name getISOWeek
	* @category ISO Week Helpers
	* @summary Get the ISO week of the given date.
	*
	* @description
	* Get the ISO week of the given date.
	*
	* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
	*
	* @param date - The given date
	* @param options - The options
	*
	* @returns The ISO week
	*
	* @example
	* // Which week of the ISO-week numbering year is 2 January 2005?
	* const result = getISOWeek(new Date(2005, 0, 2))
	* //=> 53
	*/
	function getISOWeek(date, options) {
		const _date = toDate(date, options?.in);
		const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
		return Math.round(diff / millisecondsInWeek) + 1;
	}
	//#endregion
	//#region ../../node_modules/date-fns/getWeekYear.js
	/**
	* The {@link getWeekYear} function options.
	*/
	/**
	* @name getWeekYear
	* @category Week-Numbering Year Helpers
	* @summary Get the local week-numbering year of the given date.
	*
	* @description
	* Get the local week-numbering year of the given date.
	* The exact calculation depends on the values of
	* `options.weekStartsOn` (which is the index of the first day of the week)
	* and `options.firstWeekContainsDate` (which is the day of January, which is always in
	* the first week of the week-numbering year)
	*
	* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
	*
	* @param date - The given date
	* @param options - An object with options.
	*
	* @returns The local week-numbering year
	*
	* @example
	* // Which week numbering year is 26 December 2004 with the default settings?
	* const result = getWeekYear(new Date(2004, 11, 26))
	* //=> 2005
	*
	* @example
	* // Which week numbering year is 26 December 2004 if week starts on Saturday?
	* const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
	* //=> 2004
	*
	* @example
	* // Which week numbering year is 26 December 2004 if the first week contains 4 January?
	* const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
	* //=> 2004
	*/
	function getWeekYear(date, options) {
		const _date = toDate(date, options?.in);
		const year = _date.getFullYear();
		const defaultOptions = getDefaultOptions$1();
		const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
		const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
		firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
		firstWeekOfNextYear.setHours(0, 0, 0, 0);
		const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
		const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
		firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
		firstWeekOfThisYear.setHours(0, 0, 0, 0);
		const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
		if (+_date >= +startOfNextYear) return year + 1;
		else if (+_date >= +startOfThisYear) return year;
		else return year - 1;
	}
	//#endregion
	//#region ../../node_modules/date-fns/startOfWeekYear.js
	/**
	* The {@link startOfWeekYear} function options.
	*/
	/**
	* @name startOfWeekYear
	* @category Week-Numbering Year Helpers
	* @summary Return the start of a local week-numbering year for the given date.
	*
	* @description
	* Return the start of a local week-numbering year.
	* The exact calculation depends on the values of
	* `options.weekStartsOn` (which is the index of the first day of the week)
	* and `options.firstWeekContainsDate` (which is the day of January, which is always in
	* the first week of the week-numbering year)
	*
	* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type.
	*
	* @param date - The original date
	* @param options - An object with options
	*
	* @returns The start of a week-numbering year
	*
	* @example
	* // The start of an a week-numbering year for 2 July 2005 with default settings:
	* const result = startOfWeekYear(new Date(2005, 6, 2))
	* //=> Sun Dec 26 2004 00:00:00
	*
	* @example
	* // The start of a week-numbering year for 2 July 2005
	* // if Monday is the first day of week
	* // and 4 January is always in the first week of the year:
	* const result = startOfWeekYear(new Date(2005, 6, 2), {
	*   weekStartsOn: 1,
	*   firstWeekContainsDate: 4
	* })
	* //=> Mon Jan 03 2005 00:00:00
	*/
	function startOfWeekYear(date, options) {
		const defaultOptions = getDefaultOptions$1();
		const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
		const year = getWeekYear(date, options);
		const firstWeek = constructFrom(options?.in || date, 0);
		firstWeek.setFullYear(year, 0, firstWeekContainsDate);
		firstWeek.setHours(0, 0, 0, 0);
		return startOfWeek(firstWeek, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/getWeek.js
	/**
	* The {@link getWeek} function options.
	*/
	/**
	* @name getWeek
	* @category Week Helpers
	* @summary Get the local week index of the given date.
	*
	* @description
	* Get the local week index of the given date.
	* The exact calculation depends on the values of
	* `options.weekStartsOn` (which is the index of the first day of the week)
	* and `options.firstWeekContainsDate` (which is the day of January, which is always in
	* the first week of the week-numbering year)
	*
	* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
	*
	* @param date - The given date
	* @param options - An object with options
	*
	* @returns The week
	*
	* @example
	* // Which week of the local week numbering year is 2 January 2005 with default options?
	* const result = getWeek(new Date(2005, 0, 2))
	* //=> 2
	*
	* @example
	* // Which week of the local week numbering year is 2 January 2005,
	* // if Monday is the first day of the week,
	* // and the first week of the year always contains 4 January?
	* const result = getWeek(new Date(2005, 0, 2), {
	*   weekStartsOn: 1,
	*   firstWeekContainsDate: 4
	* })
	* //=> 53
	*/
	function getWeek(date, options) {
		const _date = toDate(date, options?.in);
		const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
		return Math.round(diff / millisecondsInWeek) + 1;
	}
	//#endregion
	//#region ../../node_modules/date-fns/_lib/addLeadingZeros.js
	function addLeadingZeros(number, targetLength) {
		return (number < 0 ? "-" : "") + Math.abs(number).toString().padStart(targetLength, "0");
	}
	//#endregion
	//#region ../../node_modules/date-fns/_lib/format/lightFormatters.js
	var lightFormatters = {
		y(date, token) {
			const signedYear = date.getFullYear();
			const year = signedYear > 0 ? signedYear : 1 - signedYear;
			return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
		},
		M(date, token) {
			const month = date.getMonth();
			return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
		},
		d(date, token) {
			return addLeadingZeros(date.getDate(), token.length);
		},
		a(date, token) {
			const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
			switch (token) {
				case "a":
				case "aa": return dayPeriodEnumValue.toUpperCase();
				case "aaa": return dayPeriodEnumValue;
				case "aaaaa": return dayPeriodEnumValue[0];
				default: return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
			}
		},
		h(date, token) {
			return addLeadingZeros(date.getHours() % 12 || 12, token.length);
		},
		H(date, token) {
			return addLeadingZeros(date.getHours(), token.length);
		},
		m(date, token) {
			return addLeadingZeros(date.getMinutes(), token.length);
		},
		s(date, token) {
			return addLeadingZeros(date.getSeconds(), token.length);
		},
		S(date, token) {
			const numberOfDigits = token.length;
			const milliseconds = date.getMilliseconds();
			return addLeadingZeros(Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3)), token.length);
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/_lib/format/formatters.js
	var dayPeriodEnum = {
		am: "am",
		pm: "pm",
		midnight: "midnight",
		noon: "noon",
		morning: "morning",
		afternoon: "afternoon",
		evening: "evening",
		night: "night"
	};
	var formatters = {
		G: function(date, token, localize) {
			const era = date.getFullYear() > 0 ? 1 : 0;
			switch (token) {
				case "G":
				case "GG":
				case "GGG": return localize.era(era, { width: "abbreviated" });
				case "GGGGG": return localize.era(era, { width: "narrow" });
				default: return localize.era(era, { width: "wide" });
			}
		},
		y: function(date, token, localize) {
			if (token === "yo") {
				const signedYear = date.getFullYear();
				const year = signedYear > 0 ? signedYear : 1 - signedYear;
				return localize.ordinalNumber(year, { unit: "year" });
			}
			return lightFormatters.y(date, token);
		},
		Y: function(date, token, localize, options) {
			const signedWeekYear = getWeekYear(date, options);
			const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
			if (token === "YY") return addLeadingZeros(weekYear % 100, 2);
			if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
			return addLeadingZeros(weekYear, token.length);
		},
		R: function(date, token) {
			return addLeadingZeros(getISOWeekYear(date), token.length);
		},
		u: function(date, token) {
			return addLeadingZeros(date.getFullYear(), token.length);
		},
		Q: function(date, token, localize) {
			const quarter = Math.ceil((date.getMonth() + 1) / 3);
			switch (token) {
				case "Q": return String(quarter);
				case "QQ": return addLeadingZeros(quarter, 2);
				case "Qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
				case "QQQ": return localize.quarter(quarter, {
					width: "abbreviated",
					context: "formatting"
				});
				case "QQQQQ": return localize.quarter(quarter, {
					width: "narrow",
					context: "formatting"
				});
				default: return localize.quarter(quarter, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		q: function(date, token, localize) {
			const quarter = Math.ceil((date.getMonth() + 1) / 3);
			switch (token) {
				case "q": return String(quarter);
				case "qq": return addLeadingZeros(quarter, 2);
				case "qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
				case "qqq": return localize.quarter(quarter, {
					width: "abbreviated",
					context: "standalone"
				});
				case "qqqqq": return localize.quarter(quarter, {
					width: "narrow",
					context: "standalone"
				});
				default: return localize.quarter(quarter, {
					width: "wide",
					context: "standalone"
				});
			}
		},
		M: function(date, token, localize) {
			const month = date.getMonth();
			switch (token) {
				case "M":
				case "MM": return lightFormatters.M(date, token);
				case "Mo": return localize.ordinalNumber(month + 1, { unit: "month" });
				case "MMM": return localize.month(month, {
					width: "abbreviated",
					context: "formatting"
				});
				case "MMMMM": return localize.month(month, {
					width: "narrow",
					context: "formatting"
				});
				default: return localize.month(month, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		L: function(date, token, localize) {
			const month = date.getMonth();
			switch (token) {
				case "L": return String(month + 1);
				case "LL": return addLeadingZeros(month + 1, 2);
				case "Lo": return localize.ordinalNumber(month + 1, { unit: "month" });
				case "LLL": return localize.month(month, {
					width: "abbreviated",
					context: "standalone"
				});
				case "LLLLL": return localize.month(month, {
					width: "narrow",
					context: "standalone"
				});
				default: return localize.month(month, {
					width: "wide",
					context: "standalone"
				});
			}
		},
		w: function(date, token, localize, options) {
			const week = getWeek(date, options);
			if (token === "wo") return localize.ordinalNumber(week, { unit: "week" });
			return addLeadingZeros(week, token.length);
		},
		I: function(date, token, localize) {
			const isoWeek = getISOWeek(date);
			if (token === "Io") return localize.ordinalNumber(isoWeek, { unit: "week" });
			return addLeadingZeros(isoWeek, token.length);
		},
		d: function(date, token, localize) {
			if (token === "do") return localize.ordinalNumber(date.getDate(), { unit: "date" });
			return lightFormatters.d(date, token);
		},
		D: function(date, token, localize) {
			const dayOfYear = getDayOfYear(date);
			if (token === "Do") return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
			return addLeadingZeros(dayOfYear, token.length);
		},
		E: function(date, token, localize) {
			const dayOfWeek = date.getDay();
			switch (token) {
				case "E":
				case "EE":
				case "EEE": return localize.day(dayOfWeek, {
					width: "abbreviated",
					context: "formatting"
				});
				case "EEEEE": return localize.day(dayOfWeek, {
					width: "narrow",
					context: "formatting"
				});
				case "EEEEEE": return localize.day(dayOfWeek, {
					width: "short",
					context: "formatting"
				});
				default: return localize.day(dayOfWeek, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		e: function(date, token, localize, options) {
			const dayOfWeek = date.getDay();
			const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
			switch (token) {
				case "e": return String(localDayOfWeek);
				case "ee": return addLeadingZeros(localDayOfWeek, 2);
				case "eo": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
				case "eee": return localize.day(dayOfWeek, {
					width: "abbreviated",
					context: "formatting"
				});
				case "eeeee": return localize.day(dayOfWeek, {
					width: "narrow",
					context: "formatting"
				});
				case "eeeeee": return localize.day(dayOfWeek, {
					width: "short",
					context: "formatting"
				});
				default: return localize.day(dayOfWeek, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		c: function(date, token, localize, options) {
			const dayOfWeek = date.getDay();
			const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
			switch (token) {
				case "c": return String(localDayOfWeek);
				case "cc": return addLeadingZeros(localDayOfWeek, token.length);
				case "co": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
				case "ccc": return localize.day(dayOfWeek, {
					width: "abbreviated",
					context: "standalone"
				});
				case "ccccc": return localize.day(dayOfWeek, {
					width: "narrow",
					context: "standalone"
				});
				case "cccccc": return localize.day(dayOfWeek, {
					width: "short",
					context: "standalone"
				});
				default: return localize.day(dayOfWeek, {
					width: "wide",
					context: "standalone"
				});
			}
		},
		i: function(date, token, localize) {
			const dayOfWeek = date.getDay();
			const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
			switch (token) {
				case "i": return String(isoDayOfWeek);
				case "ii": return addLeadingZeros(isoDayOfWeek, token.length);
				case "io": return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
				case "iii": return localize.day(dayOfWeek, {
					width: "abbreviated",
					context: "formatting"
				});
				case "iiiii": return localize.day(dayOfWeek, {
					width: "narrow",
					context: "formatting"
				});
				case "iiiiii": return localize.day(dayOfWeek, {
					width: "short",
					context: "formatting"
				});
				default: return localize.day(dayOfWeek, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		a: function(date, token, localize) {
			const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
			switch (token) {
				case "a":
				case "aa": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "abbreviated",
					context: "formatting"
				});
				case "aaa": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "abbreviated",
					context: "formatting"
				}).toLowerCase();
				case "aaaaa": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "narrow",
					context: "formatting"
				});
				default: return localize.dayPeriod(dayPeriodEnumValue, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		b: function(date, token, localize) {
			const hours = date.getHours();
			let dayPeriodEnumValue;
			if (hours === 12) dayPeriodEnumValue = dayPeriodEnum.noon;
			else if (hours === 0) dayPeriodEnumValue = dayPeriodEnum.midnight;
			else dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
			switch (token) {
				case "b":
				case "bb": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "abbreviated",
					context: "formatting"
				});
				case "bbb": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "abbreviated",
					context: "formatting"
				}).toLowerCase();
				case "bbbbb": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "narrow",
					context: "formatting"
				});
				default: return localize.dayPeriod(dayPeriodEnumValue, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		B: function(date, token, localize) {
			const hours = date.getHours();
			let dayPeriodEnumValue;
			if (hours >= 17) dayPeriodEnumValue = dayPeriodEnum.evening;
			else if (hours >= 12) dayPeriodEnumValue = dayPeriodEnum.afternoon;
			else if (hours >= 4) dayPeriodEnumValue = dayPeriodEnum.morning;
			else dayPeriodEnumValue = dayPeriodEnum.night;
			switch (token) {
				case "B":
				case "BB":
				case "BBB": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "abbreviated",
					context: "formatting"
				});
				case "BBBBB": return localize.dayPeriod(dayPeriodEnumValue, {
					width: "narrow",
					context: "formatting"
				});
				default: return localize.dayPeriod(dayPeriodEnumValue, {
					width: "wide",
					context: "formatting"
				});
			}
		},
		h: function(date, token, localize) {
			if (token === "ho") {
				let hours = date.getHours() % 12;
				if (hours === 0) hours = 12;
				return localize.ordinalNumber(hours, { unit: "hour" });
			}
			return lightFormatters.h(date, token);
		},
		H: function(date, token, localize) {
			if (token === "Ho") return localize.ordinalNumber(date.getHours(), { unit: "hour" });
			return lightFormatters.H(date, token);
		},
		K: function(date, token, localize) {
			const hours = date.getHours() % 12;
			if (token === "Ko") return localize.ordinalNumber(hours, { unit: "hour" });
			return addLeadingZeros(hours, token.length);
		},
		k: function(date, token, localize) {
			let hours = date.getHours();
			if (hours === 0) hours = 24;
			if (token === "ko") return localize.ordinalNumber(hours, { unit: "hour" });
			return addLeadingZeros(hours, token.length);
		},
		m: function(date, token, localize) {
			if (token === "mo") return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
			return lightFormatters.m(date, token);
		},
		s: function(date, token, localize) {
			if (token === "so") return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
			return lightFormatters.s(date, token);
		},
		S: function(date, token) {
			return lightFormatters.S(date, token);
		},
		X: function(date, token, _localize) {
			const timezoneOffset = date.getTimezoneOffset();
			if (timezoneOffset === 0) return "Z";
			switch (token) {
				case "X": return formatTimezoneWithOptionalMinutes(timezoneOffset);
				case "XXXX":
				case "XX": return formatTimezone(timezoneOffset);
				default: return formatTimezone(timezoneOffset, ":");
			}
		},
		x: function(date, token, _localize) {
			const timezoneOffset = date.getTimezoneOffset();
			switch (token) {
				case "x": return formatTimezoneWithOptionalMinutes(timezoneOffset);
				case "xxxx":
				case "xx": return formatTimezone(timezoneOffset);
				default: return formatTimezone(timezoneOffset, ":");
			}
		},
		O: function(date, token, _localize) {
			const timezoneOffset = date.getTimezoneOffset();
			switch (token) {
				case "O":
				case "OO":
				case "OOO": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
				default: return "GMT" + formatTimezone(timezoneOffset, ":");
			}
		},
		z: function(date, token, _localize) {
			const timezoneOffset = date.getTimezoneOffset();
			switch (token) {
				case "z":
				case "zz":
				case "zzz": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
				default: return "GMT" + formatTimezone(timezoneOffset, ":");
			}
		},
		t: function(date, token, _localize) {
			return addLeadingZeros(Math.trunc(+date / 1e3), token.length);
		},
		T: function(date, token, _localize) {
			return addLeadingZeros(+date, token.length);
		}
	};
	function formatTimezoneShort(offset, delimiter = "") {
		const sign = offset > 0 ? "-" : "+";
		const absOffset = Math.abs(offset);
		const hours = Math.trunc(absOffset / 60);
		const minutes = absOffset % 60;
		if (minutes === 0) return sign + String(hours);
		return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
	}
	function formatTimezoneWithOptionalMinutes(offset, delimiter) {
		if (offset % 60 === 0) return (offset > 0 ? "-" : "+") + addLeadingZeros(Math.abs(offset) / 60, 2);
		return formatTimezone(offset, delimiter);
	}
	function formatTimezone(offset, delimiter = "") {
		const sign = offset > 0 ? "-" : "+";
		const absOffset = Math.abs(offset);
		const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
		const minutes = addLeadingZeros(absOffset % 60, 2);
		return sign + hours + delimiter + minutes;
	}
	//#endregion
	//#region ../../node_modules/date-fns/_lib/format/longFormatters.js
	var dateLongFormatter = (pattern, formatLong) => {
		switch (pattern) {
			case "P": return formatLong.date({ width: "short" });
			case "PP": return formatLong.date({ width: "medium" });
			case "PPP": return formatLong.date({ width: "long" });
			default: return formatLong.date({ width: "full" });
		}
	};
	var timeLongFormatter = (pattern, formatLong) => {
		switch (pattern) {
			case "p": return formatLong.time({ width: "short" });
			case "pp": return formatLong.time({ width: "medium" });
			case "ppp": return formatLong.time({ width: "long" });
			default: return formatLong.time({ width: "full" });
		}
	};
	var dateTimeLongFormatter = (pattern, formatLong) => {
		const matchResult = pattern.match(/(P+)(p+)?/) || [];
		const datePattern = matchResult[1];
		const timePattern = matchResult[2];
		if (!timePattern) return dateLongFormatter(pattern, formatLong);
		let dateTimeFormat;
		switch (datePattern) {
			case "P":
				dateTimeFormat = formatLong.dateTime({ width: "short" });
				break;
			case "PP":
				dateTimeFormat = formatLong.dateTime({ width: "medium" });
				break;
			case "PPP":
				dateTimeFormat = formatLong.dateTime({ width: "long" });
				break;
			default:
				dateTimeFormat = formatLong.dateTime({ width: "full" });
				break;
		}
		return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
	};
	var longFormatters = {
		p: timeLongFormatter,
		P: dateTimeLongFormatter
	};
	//#endregion
	//#region ../../node_modules/date-fns/_lib/protectedTokens.js
	var dayOfYearTokenRE = /^D+$/;
	var weekYearTokenRE = /^Y+$/;
	var throwTokens = [
		"D",
		"DD",
		"YY",
		"YYYY"
	];
	function isProtectedDayOfYearToken(token) {
		return dayOfYearTokenRE.test(token);
	}
	function isProtectedWeekYearToken(token) {
		return weekYearTokenRE.test(token);
	}
	function warnOrThrowProtectedError(token, format, input) {
		const _message = message(token, format, input);
		console.warn(_message);
		if (throwTokens.includes(token)) throw new RangeError(_message);
	}
	function message(token, format, input) {
		const subject = token[0] === "Y" ? "years" : "days of the month";
		return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
	}
	//#endregion
	//#region ../../node_modules/date-fns/format.js
	var formattingTokensRegExp$1 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
	var longFormattingTokensRegExp$1 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
	var escapedStringRegExp$1 = /^'([^]*?)'?$/;
	var doubleQuoteRegExp$1 = /''/g;
	var unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
	/**
	* The {@link format} function options.
	*/
	/**
	* @name format
	* @alias formatDate
	* @category Common Helpers
	* @summary Format the date.
	*
	* @description
	* Return the formatted date string in the given format. The result may vary by locale.
	*
	* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
	* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* The characters wrapped between two single quotes characters (') are escaped.
	* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
	* (see the last example)
	*
	* Format of the string is based on Unicode Technical Standard #35:
	* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
	* with a few additions (see note 7 below the table).
	*
	* Accepted patterns:
	* | Unit                            | Pattern | Result examples                   | Notes |
	* |---------------------------------|---------|-----------------------------------|-------|
	* | Era                             | G..GGG  | AD, BC                            |       |
	* |                                 | GGGG    | Anno Domini, Before Christ        | 2     |
	* |                                 | GGGGG   | A, B                              |       |
	* | Calendar year                   | y       | 44, 1, 1900, 2017                 | 5     |
	* |                                 | yo      | 44th, 1st, 0th, 17th              | 5,7   |
	* |                                 | yy      | 44, 01, 00, 17                    | 5     |
	* |                                 | yyy     | 044, 001, 1900, 2017              | 5     |
	* |                                 | yyyy    | 0044, 0001, 1900, 2017            | 5     |
	* |                                 | yyyyy   | ...                               | 3,5   |
	* | Local week-numbering year       | Y       | 44, 1, 1900, 2017                 | 5     |
	* |                                 | Yo      | 44th, 1st, 1900th, 2017th         | 5,7   |
	* |                                 | YY      | 44, 01, 00, 17                    | 5,8   |
	* |                                 | YYY     | 044, 001, 1900, 2017              | 5     |
	* |                                 | YYYY    | 0044, 0001, 1900, 2017            | 5,8   |
	* |                                 | YYYYY   | ...                               | 3,5   |
	* | ISO week-numbering year         | R       | -43, 0, 1, 1900, 2017             | 5,7   |
	* |                                 | RR      | -43, 00, 01, 1900, 2017           | 5,7   |
	* |                                 | RRR     | -043, 000, 001, 1900, 2017        | 5,7   |
	* |                                 | RRRR    | -0043, 0000, 0001, 1900, 2017     | 5,7   |
	* |                                 | RRRRR   | ...                               | 3,5,7 |
	* | Extended year                   | u       | -43, 0, 1, 1900, 2017             | 5     |
	* |                                 | uu      | -43, 01, 1900, 2017               | 5     |
	* |                                 | uuu     | -043, 001, 1900, 2017             | 5     |
	* |                                 | uuuu    | -0043, 0001, 1900, 2017           | 5     |
	* |                                 | uuuuu   | ...                               | 3,5   |
	* | Quarter (formatting)            | Q       | 1, 2, 3, 4                        |       |
	* |                                 | Qo      | 1st, 2nd, 3rd, 4th                | 7     |
	* |                                 | QQ      | 01, 02, 03, 04                    |       |
	* |                                 | QQQ     | Q1, Q2, Q3, Q4                    |       |
	* |                                 | QQQQ    | 1st quarter, 2nd quarter, ...     | 2     |
	* |                                 | QQQQQ   | 1, 2, 3, 4                        | 4     |
	* | Quarter (stand-alone)           | q       | 1, 2, 3, 4                        |       |
	* |                                 | qo      | 1st, 2nd, 3rd, 4th                | 7     |
	* |                                 | qq      | 01, 02, 03, 04                    |       |
	* |                                 | qqq     | Q1, Q2, Q3, Q4                    |       |
	* |                                 | qqqq    | 1st quarter, 2nd quarter, ...     | 2     |
	* |                                 | qqqqq   | 1, 2, 3, 4                        | 4     |
	* | Month (formatting)              | M       | 1, 2, ..., 12                     |       |
	* |                                 | Mo      | 1st, 2nd, ..., 12th               | 7     |
	* |                                 | MM      | 01, 02, ..., 12                   |       |
	* |                                 | MMM     | Jan, Feb, ..., Dec                |       |
	* |                                 | MMMM    | January, February, ..., December  | 2     |
	* |                                 | MMMMM   | J, F, ..., D                      |       |
	* | Month (stand-alone)             | L       | 1, 2, ..., 12                     |       |
	* |                                 | Lo      | 1st, 2nd, ..., 12th               | 7     |
	* |                                 | LL      | 01, 02, ..., 12                   |       |
	* |                                 | LLL     | Jan, Feb, ..., Dec                |       |
	* |                                 | LLLL    | January, February, ..., December  | 2     |
	* |                                 | LLLLL   | J, F, ..., D                      |       |
	* | Local week of year              | w       | 1, 2, ..., 53                     |       |
	* |                                 | wo      | 1st, 2nd, ..., 53th               | 7     |
	* |                                 | ww      | 01, 02, ..., 53                   |       |
	* | ISO week of year                | I       | 1, 2, ..., 53                     | 7     |
	* |                                 | Io      | 1st, 2nd, ..., 53th               | 7     |
	* |                                 | II      | 01, 02, ..., 53                   | 7     |
	* | Day of month                    | d       | 1, 2, ..., 31                     |       |
	* |                                 | do      | 1st, 2nd, ..., 31st               | 7     |
	* |                                 | dd      | 01, 02, ..., 31                   |       |
	* | Day of year                     | D       | 1, 2, ..., 365, 366               | 9     |
	* |                                 | Do      | 1st, 2nd, ..., 365th, 366th       | 7     |
	* |                                 | DD      | 01, 02, ..., 365, 366             | 9     |
	* |                                 | DDD     | 001, 002, ..., 365, 366           |       |
	* |                                 | DDDD    | ...                               | 3     |
	* | Day of week (formatting)        | E..EEE  | Mon, Tue, Wed, ..., Sun           |       |
	* |                                 | EEEE    | Monday, Tuesday, ..., Sunday      | 2     |
	* |                                 | EEEEE   | M, T, W, T, F, S, S               |       |
	* |                                 | EEEEEE  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
	* | ISO day of week (formatting)    | i       | 1, 2, 3, ..., 7                   | 7     |
	* |                                 | io      | 1st, 2nd, ..., 7th                | 7     |
	* |                                 | ii      | 01, 02, ..., 07                   | 7     |
	* |                                 | iii     | Mon, Tue, Wed, ..., Sun           | 7     |
	* |                                 | iiii    | Monday, Tuesday, ..., Sunday      | 2,7   |
	* |                                 | iiiii   | M, T, W, T, F, S, S               | 7     |
	* |                                 | iiiiii  | Mo, Tu, We, Th, Fr, Sa, Su        | 7     |
	* | Local day of week (formatting)  | e       | 2, 3, 4, ..., 1                   |       |
	* |                                 | eo      | 2nd, 3rd, ..., 1st                | 7     |
	* |                                 | ee      | 02, 03, ..., 01                   |       |
	* |                                 | eee     | Mon, Tue, Wed, ..., Sun           |       |
	* |                                 | eeee    | Monday, Tuesday, ..., Sunday      | 2     |
	* |                                 | eeeee   | M, T, W, T, F, S, S               |       |
	* |                                 | eeeeee  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
	* | Local day of week (stand-alone) | c       | 2, 3, 4, ..., 1                   |       |
	* |                                 | co      | 2nd, 3rd, ..., 1st                | 7     |
	* |                                 | cc      | 02, 03, ..., 01                   |       |
	* |                                 | ccc     | Mon, Tue, Wed, ..., Sun           |       |
	* |                                 | cccc    | Monday, Tuesday, ..., Sunday      | 2     |
	* |                                 | ccccc   | M, T, W, T, F, S, S               |       |
	* |                                 | cccccc  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
	* | AM, PM                          | a..aa   | AM, PM                            |       |
	* |                                 | aaa     | am, pm                            |       |
	* |                                 | aaaa    | a.m., p.m.                        | 2     |
	* |                                 | aaaaa   | a, p                              |       |
	* | AM, PM, noon, midnight          | b..bb   | AM, PM, noon, midnight            |       |
	* |                                 | bbb     | am, pm, noon, midnight            |       |
	* |                                 | bbbb    | a.m., p.m., noon, midnight        | 2     |
	* |                                 | bbbbb   | a, p, n, mi                       |       |
	* | Flexible day period             | B..BBB  | at night, in the morning, ...     |       |
	* |                                 | BBBB    | at night, in the morning, ...     | 2     |
	* |                                 | BBBBB   | at night, in the morning, ...     |       |
	* | Hour [1-12]                     | h       | 1, 2, ..., 11, 12                 |       |
	* |                                 | ho      | 1st, 2nd, ..., 11th, 12th         | 7     |
	* |                                 | hh      | 01, 02, ..., 11, 12               |       |
	* | Hour [0-23]                     | H       | 0, 1, 2, ..., 23                  |       |
	* |                                 | Ho      | 0th, 1st, 2nd, ..., 23rd          | 7     |
	* |                                 | HH      | 00, 01, 02, ..., 23               |       |
	* | Hour [0-11]                     | K       | 1, 2, ..., 11, 0                  |       |
	* |                                 | Ko      | 1st, 2nd, ..., 11th, 0th          | 7     |
	* |                                 | KK      | 01, 02, ..., 11, 00               |       |
	* | Hour [1-24]                     | k       | 24, 1, 2, ..., 23                 |       |
	* |                                 | ko      | 24th, 1st, 2nd, ..., 23rd         | 7     |
	* |                                 | kk      | 24, 01, 02, ..., 23               |       |
	* | Minute                          | m       | 0, 1, ..., 59                     |       |
	* |                                 | mo      | 0th, 1st, ..., 59th               | 7     |
	* |                                 | mm      | 00, 01, ..., 59                   |       |
	* | Second                          | s       | 0, 1, ..., 59                     |       |
	* |                                 | so      | 0th, 1st, ..., 59th               | 7     |
	* |                                 | ss      | 00, 01, ..., 59                   |       |
	* | Fraction of second              | S       | 0, 1, ..., 9                      |       |
	* |                                 | SS      | 00, 01, ..., 99                   |       |
	* |                                 | SSS     | 000, 001, ..., 999                |       |
	* |                                 | SSSS    | ...                               | 3     |
	* | Timezone (ISO-8601 w/ Z)        | X       | -08, +0530, Z                     |       |
	* |                                 | XX      | -0800, +0530, Z                   |       |
	* |                                 | XXX     | -08:00, +05:30, Z                 |       |
	* |                                 | XXXX    | -0800, +0530, Z, +123456          | 2     |
	* |                                 | XXXXX   | -08:00, +05:30, Z, +12:34:56      |       |
	* | Timezone (ISO-8601 w/o Z)       | x       | -08, +0530, +00                   |       |
	* |                                 | xx      | -0800, +0530, +0000               |       |
	* |                                 | xxx     | -08:00, +05:30, +00:00            | 2     |
	* |                                 | xxxx    | -0800, +0530, +0000, +123456      |       |
	* |                                 | xxxxx   | -08:00, +05:30, +00:00, +12:34:56 |       |
	* | Timezone (GMT)                  | O...OOO | GMT-8, GMT+5:30, GMT+0            |       |
	* |                                 | OOOO    | GMT-08:00, GMT+05:30, GMT+00:00   | 2     |
	* | Timezone (specific non-locat.)  | z...zzz | GMT-8, GMT+5:30, GMT+0            | 6     |
	* |                                 | zzzz    | GMT-08:00, GMT+05:30, GMT+00:00   | 2,6   |
	* | Seconds timestamp               | t       | 512969520                         | 7     |
	* |                                 | tt      | ...                               | 3,7   |
	* | Milliseconds timestamp          | T       | 512969520900                      | 7     |
	* |                                 | TT      | ...                               | 3,7   |
	* | Long localized date             | P       | 04/29/1453                        | 7     |
	* |                                 | PP      | Apr 29, 1453                      | 7     |
	* |                                 | PPP     | April 29th, 1453                  | 7     |
	* |                                 | PPPP    | Friday, April 29th, 1453          | 2,7   |
	* | Long localized time             | p       | 12:00 AM                          | 7     |
	* |                                 | pp      | 12:00:00 AM                       | 7     |
	* |                                 | ppp     | 12:00:00 AM GMT+2                 | 7     |
	* |                                 | pppp    | 12:00:00 AM GMT+02:00             | 2,7   |
	* | Combination of date and time    | Pp      | 04/29/1453, 12:00 AM              | 7     |
	* |                                 | PPpp    | Apr 29, 1453, 12:00:00 AM         | 7     |
	* |                                 | PPPppp  | April 29th, 1453 at ...           | 7     |
	* |                                 | PPPPpppp| Friday, April 29th, 1453 at ...   | 2,7   |
	* Notes:
	* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
	*    are the same as "stand-alone" units, but are different in some languages.
	*    "Formatting" units are declined according to the rules of the language
	*    in the context of a date. "Stand-alone" units are always nominative singular:
	*
	*    `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
	*
	*    `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
	*
	* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
	*    the single quote characters (see below).
	*    If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
	*    the output will be the same as default pattern for this unit, usually
	*    the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
	*    are marked with "2" in the last column of the table.
	*
	*    `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
	*
	*    `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
	*
	*    `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
	*
	*    `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
	*
	*    `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
	*
	* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
	*    The output will be padded with zeros to match the length of the pattern.
	*
	*    `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
	*
	* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
	*    These tokens represent the shortest form of the quarter.
	*
	* 5. The main difference between `y` and `u` patterns are B.C. years:
	*
	*    | Year | `y` | `u` |
	*    |------|-----|-----|
	*    | AC 1 |   1 |   1 |
	*    | BC 1 |   1 |   0 |
	*    | BC 2 |   2 |  -1 |
	*
	*    Also `yy` always returns the last two digits of a year,
	*    while `uu` pads single digit years to 2 characters and returns other years unchanged:
	*
	*    | Year | `yy` | `uu` |
	*    |------|------|------|
	*    | 1    |   01 |   01 |
	*    | 14   |   14 |   14 |
	*    | 376  |   76 |  376 |
	*    | 1453 |   53 | 1453 |
	*
	*    The same difference is true for local and ISO week-numbering years (`Y` and `R`),
	*    except local week-numbering years are dependent on `options.weekStartsOn`
	*    and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
	*    and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
	*
	* 6. Specific non-location timezones are currently unavailable in `date-fns`,
	*    so right now these tokens fall back to GMT timezones.
	*
	* 7. These patterns are not in the Unicode Technical Standard #35:
	*    - `i`: ISO day of week
	*    - `I`: ISO week of year
	*    - `R`: ISO week-numbering year
	*    - `t`: seconds timestamp
	*    - `T`: milliseconds timestamp
	*    - `o`: ordinal number modifier
	*    - `P`: long localized date
	*    - `p`: long localized time
	*
	* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
	*    You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
	*    You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* @param date - The original date
	* @param format - The string of tokens
	* @param options - An object with options
	*
	* @returns The formatted date string
	*
	* @throws `date` must not be Invalid Date
	* @throws `options.locale` must contain `localize` property
	* @throws `options.locale` must contain `formatLong` property
	* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws format string contains an unescaped latin alphabet character
	*
	* @example
	* // Represent 11 February 2014 in middle-endian format:
	* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
	* //=> '02/11/2014'
	*
	* @example
	* // Represent 2 July 2014 in Esperanto:
	* import { eoLocale } from 'date-fns/locale/eo'
	* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
	*   locale: eoLocale
	* })
	* //=> '2-a de julio 2014'
	*
	* @example
	* // Escape string by single quote characters:
	* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
	* //=> "3 o'clock"
	*/
	function format$2(date, formatStr, options) {
		const defaultOptions = getDefaultOptions$1();
		const locale = options?.locale ?? defaultOptions.locale ?? enUS;
		const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
		const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
		const originalDate = toDate(date, options?.in);
		if (!isValid(originalDate)) throw new RangeError("Invalid time value");
		let parts = formatStr.match(longFormattingTokensRegExp$1).map((substring) => {
			const firstCharacter = substring[0];
			if (firstCharacter === "p" || firstCharacter === "P") {
				const longFormatter = longFormatters[firstCharacter];
				return longFormatter(substring, locale.formatLong);
			}
			return substring;
		}).join("").match(formattingTokensRegExp$1).map((substring) => {
			if (substring === "''") return {
				isToken: false,
				value: "'"
			};
			const firstCharacter = substring[0];
			if (firstCharacter === "'") return {
				isToken: false,
				value: cleanEscapedString$1(substring)
			};
			if (formatters[firstCharacter]) return {
				isToken: true,
				value: substring
			};
			if (firstCharacter.match(unescapedLatinCharacterRegExp$1)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
			return {
				isToken: false,
				value: substring
			};
		});
		if (locale.localize.preprocessor) parts = locale.localize.preprocessor(originalDate, parts);
		const formatterOptions = {
			firstWeekContainsDate,
			weekStartsOn,
			locale
		};
		return parts.map((part) => {
			if (!part.isToken) return part.value;
			const token = part.value;
			if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) warnOrThrowProtectedError(token, formatStr, String(date));
			const formatter = formatters[token[0]];
			return formatter(originalDate, token, locale.localize, formatterOptions);
		}).join("");
	}
	function cleanEscapedString$1(input) {
		const matched = input.match(escapedStringRegExp$1);
		if (!matched) return input;
		return matched[1].replace(doubleQuoteRegExp$1, "'");
	}
	//#endregion
	//#region ../../node_modules/date-fns/getDate.js
	/**
	* The {@link getDate} function options.
	*/
	/**
	* @name getDate
	* @category Day Helpers
	* @summary Get the day of the month of the given date.
	*
	* @description
	* Get the day of the month of the given date.
	*
	* @param date - The given date
	* @param options - An object with options.
	*
	* @returns The day of month
	*
	* @example
	* // Which day of the month is 29 February 2012?
	* const result = getDate(new Date(2012, 1, 29))
	* //=> 29
	*/
	function getDate(date, options) {
		return toDate(date, options?.in).getDate();
	}
	//#endregion
	//#region ../../node_modules/date-fns/getDay.js
	/**
	* The {@link getDay} function options.
	*/
	/**
	* @name getDay
	* @category Weekday Helpers
	* @summary Get the day of the week of the given date.
	*
	* @description
	* Get the day of the week of the given date.
	*
	* @param date - The given date
	* @param options - The options
	*
	* @returns The day of week, 0 represents Sunday
	*
	* @example
	* // Which day of the week is 29 February 2012?
	* const result = getDay(new Date(2012, 1, 29))
	* //=> 3
	*/
	function getDay$1(date, options) {
		return toDate(date, options?.in).getDay();
	}
	//#endregion
	//#region ../../node_modules/date-fns/getDefaultOptions.js
	/**
	* @name getDefaultOptions
	* @category Common Helpers
	* @summary Get default options.
	* @pure false
	*
	* @description
	* Returns an object that contains defaults for
	* `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
	* arguments for all functions.
	*
	* You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
	*
	* @returns The default options
	*
	* @example
	* const result = getDefaultOptions()
	* //=> {}
	*
	* @example
	* setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
	* const result = getDefaultOptions()
	* //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
	*/
	function getDefaultOptions() {
		return Object.assign({}, getDefaultOptions$1());
	}
	//#endregion
	//#region ../../node_modules/date-fns/getISODay.js
	/**
	* The {@link getISODay} function options.
	*/
	/**
	* @name getISODay
	* @category Weekday Helpers
	* @summary Get the day of the ISO week of the given date.
	*
	* @description
	* Get the day of the ISO week of the given date,
	* which is 7 for Sunday, 1 for Monday etc.
	*
	* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
	*
	* @param date - The given date
	* @param options - An object with options
	*
	* @returns The day of ISO week
	*
	* @example
	* // Which day of the ISO week is 26 February 2012?
	* const result = getISODay(new Date(2012, 1, 26))
	* //=> 7
	*/
	function getISODay(date, options) {
		const day = toDate(date, options?.in).getDay();
		return day === 0 ? 7 : day;
	}
	//#endregion
	//#region ../../node_modules/date-fns/isAfter.js
	/**
	* @name isAfter
	* @category Common Helpers
	* @summary Is the first date after the second one?
	*
	* @description
	* Is the first date after the second one?
	*
	* @param date - The date that should be after the other one to return true
	* @param dateToCompare - The date to compare with
	*
	* @returns The first date is after the second date
	*
	* @example
	* // Is 10 July 1989 after 11 February 1987?
	* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
	* //=> true
	*/
	function isAfter$1(date, dateToCompare) {
		return +toDate(date) > +toDate(dateToCompare);
	}
	//#endregion
	//#region ../../node_modules/date-fns/isBefore.js
	/**
	* @name isBefore
	* @category Common Helpers
	* @summary Is the first date before the second one?
	*
	* @description
	* Is the first date before the second one?
	*
	* @param date - The date that should be before the other one to return true
	* @param dateToCompare - The date to compare with
	*
	* @returns The first date is before the second date
	*
	* @example
	* // Is 10 July 1989 before 11 February 1987?
	* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
	* //=> false
	*/
	function isBefore$1(date, dateToCompare) {
		return +toDate(date) < +toDate(dateToCompare);
	}
	//#endregion
	//#region ../../node_modules/date-fns/isFriday.js
	/**
	* The {@link isFriday} function options.
	*/
	/**
	* @name isFriday
	* @category Weekday Helpers
	* @summary Is the given date Friday?
	*
	* @description
	* Is the given date Friday?
	*
	* @param date - The date to check
	* @param options - An object with options
	*
	* @returns The date is Friday
	*
	* @example
	* // Is 26 September 2014 Friday?
	* const result = isFriday(new Date(2014, 8, 26))
	* //=> true
	*/
	function isFriday(date, options) {
		return toDate(date, options?.in).getDay() === 5;
	}
	//#endregion
	//#region ../../node_modules/date-fns/transpose.js
	/**
	* @name transpose
	* @category Generic Helpers
	* @summary Transpose the date to the given constructor.
	*
	* @description
	* The function transposes the date to the given constructor. It helps you
	* to transpose the date in the system time zone to say `UTCDate` or any other
	* date extension.
	*
	* @typeParam InputDate - The input `Date` type derived from the passed argument.
	* @typeParam ResultDate - The result `Date` type derived from the passed constructor.
	*
	* @param date - The date to use values from
	* @param constructor - The date constructor to use
	*
	* @returns Date transposed to the given constructor
	*
	* @example
	* // Create July 10, 2022 00:00 in locale time zone
	* const date = new Date(2022, 6, 10)
	* //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'
	*
	* @example
	* // Transpose the date to July 10, 2022 00:00 in UTC
	* transpose(date, UTCDate)
	* //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'
	*/
	function transpose(date, constructor) {
		const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0);
		date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
		date_.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
		return date_;
	}
	function isConstructor(constructor) {
		return typeof constructor === "function" && constructor.prototype?.constructor === constructor;
	}
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/Setter.js
	var TIMEZONE_UNIT_PRIORITY = 10;
	var Setter = class {
		constructor() {
			_defineProperty(this, "subPriority", 0);
		}
		validate(_utcDate, _options) {
			return true;
		}
	};
	var ValueSetter = class extends Setter {
		constructor(value, validateValue, setValue, priority, subPriority) {
			super();
			this.value = value;
			this.validateValue = validateValue;
			this.setValue = setValue;
			this.priority = priority;
			if (subPriority) this.subPriority = subPriority;
		}
		validate(date, options) {
			return this.validateValue(date, this.value, options);
		}
		set(date, flags, options) {
			return this.setValue(date, flags, this.value, options);
		}
	};
	var DateTimezoneSetter = class extends Setter {
		constructor(context, reference) {
			super();
			_defineProperty(this, "priority", TIMEZONE_UNIT_PRIORITY);
			_defineProperty(this, "subPriority", -1);
			this.context = context || ((date) => constructFrom(reference, date));
		}
		set(date, flags) {
			if (flags.timestampIsSet) return date;
			return constructFrom(date, transpose(date, this.context));
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/Parser.js
	var Parser$1 = class {
		run(dateString, token, match, options) {
			const result = this.parse(dateString, token, match, options);
			if (!result) return null;
			return {
				setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
				rest: result.rest
			};
		}
		validate(_utcDate, _value, _options) {
			return true;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/EraParser.js
	var EraParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 140);
			_defineProperty(this, "incompatibleTokens", [
				"R",
				"u",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "G":
				case "GG":
				case "GGG": return match.era(dateString, { width: "abbreviated" }) || match.era(dateString, { width: "narrow" });
				case "GGGGG": return match.era(dateString, { width: "narrow" });
				default: return match.era(dateString, { width: "wide" }) || match.era(dateString, { width: "abbreviated" }) || match.era(dateString, { width: "narrow" });
			}
		}
		set(date, flags, value) {
			flags.era = value;
			date.setFullYear(value, 0, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/constants.js
	var numericPatterns = {
		month: /^(1[0-2]|0?\d)/,
		date: /^(3[0-1]|[0-2]?\d)/,
		dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
		week: /^(5[0-3]|[0-4]?\d)/,
		hour23h: /^(2[0-3]|[0-1]?\d)/,
		hour24h: /^(2[0-4]|[0-1]?\d)/,
		hour11h: /^(1[0-1]|0?\d)/,
		hour12h: /^(1[0-2]|0?\d)/,
		minute: /^[0-5]?\d/,
		second: /^[0-5]?\d/,
		singleDigit: /^\d/,
		twoDigits: /^\d{1,2}/,
		threeDigits: /^\d{1,3}/,
		fourDigits: /^\d{1,4}/,
		anyDigitsSigned: /^-?\d+/,
		singleDigitSigned: /^-?\d/,
		twoDigitsSigned: /^-?\d{1,2}/,
		threeDigitsSigned: /^-?\d{1,3}/,
		fourDigitsSigned: /^-?\d{1,4}/
	};
	var timezonePatterns = {
		basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
		basic: /^([+-])(\d{2})(\d{2})|Z/,
		basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
		extended: /^([+-])(\d{2}):(\d{2})|Z/,
		extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/utils.js
	function mapValue(parseFnResult, mapFn) {
		if (!parseFnResult) return parseFnResult;
		return {
			value: mapFn(parseFnResult.value),
			rest: parseFnResult.rest
		};
	}
	function parseNumericPattern(pattern, dateString) {
		const matchResult = dateString.match(pattern);
		if (!matchResult) return null;
		return {
			value: parseInt(matchResult[0], 10),
			rest: dateString.slice(matchResult[0].length)
		};
	}
	function parseTimezonePattern(pattern, dateString) {
		const matchResult = dateString.match(pattern);
		if (!matchResult) return null;
		if (matchResult[0] === "Z") return {
			value: 0,
			rest: dateString.slice(1)
		};
		const sign = matchResult[1] === "+" ? 1 : -1;
		const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
		const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
		const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
		return {
			value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
			rest: dateString.slice(matchResult[0].length)
		};
	}
	function parseAnyDigitsSigned(dateString) {
		return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
	}
	function parseNDigits(n, dateString) {
		switch (n) {
			case 1: return parseNumericPattern(numericPatterns.singleDigit, dateString);
			case 2: return parseNumericPattern(numericPatterns.twoDigits, dateString);
			case 3: return parseNumericPattern(numericPatterns.threeDigits, dateString);
			case 4: return parseNumericPattern(numericPatterns.fourDigits, dateString);
			default: return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
		}
	}
	function parseNDigitsSigned(n, dateString) {
		switch (n) {
			case 1: return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
			case 2: return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
			case 3: return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
			case 4: return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
			default: return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
		}
	}
	function dayPeriodEnumToHours(dayPeriod) {
		switch (dayPeriod) {
			case "morning": return 4;
			case "evening": return 17;
			case "pm":
			case "noon":
			case "afternoon": return 12;
			default: return 0;
		}
	}
	function normalizeTwoDigitYear(twoDigitYear, currentYear) {
		const isCommonEra = currentYear > 0;
		const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
		let result;
		if (absCurrentYear <= 50) result = twoDigitYear || 100;
		else {
			const rangeEnd = absCurrentYear + 50;
			const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
			const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
			result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
		}
		return isCommonEra ? result : 1 - result;
	}
	function isLeapYearIndex$1(year) {
		return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
	}
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/YearParser.js
	var YearParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 130);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"u",
				"w",
				"I",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			const valueCallback = (year) => ({
				year,
				isTwoDigitYear: token === "yy"
			});
			switch (token) {
				case "y": return mapValue(parseNDigits(4, dateString), valueCallback);
				case "yo": return mapValue(match.ordinalNumber(dateString, { unit: "year" }), valueCallback);
				default: return mapValue(parseNDigits(token.length, dateString), valueCallback);
			}
		}
		validate(_date, value) {
			return value.isTwoDigitYear || value.year > 0;
		}
		set(date, flags, value) {
			const currentYear = date.getFullYear();
			if (value.isTwoDigitYear) {
				const normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
				date.setFullYear(normalizedTwoDigitYear, 0, 1);
				date.setHours(0, 0, 0, 0);
				return date;
			}
			const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
			date.setFullYear(year, 0, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js
	var LocalWeekYearParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 130);
			_defineProperty(this, "incompatibleTokens", [
				"y",
				"R",
				"u",
				"Q",
				"q",
				"M",
				"L",
				"I",
				"d",
				"D",
				"i",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			const valueCallback = (year) => ({
				year,
				isTwoDigitYear: token === "YY"
			});
			switch (token) {
				case "Y": return mapValue(parseNDigits(4, dateString), valueCallback);
				case "Yo": return mapValue(match.ordinalNumber(dateString, { unit: "year" }), valueCallback);
				default: return mapValue(parseNDigits(token.length, dateString), valueCallback);
			}
		}
		validate(_date, value) {
			return value.isTwoDigitYear || value.year > 0;
		}
		set(date, flags, value, options) {
			const currentYear = getWeekYear(date, options);
			if (value.isTwoDigitYear) {
				const normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
				date.setFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
				date.setHours(0, 0, 0, 0);
				return startOfWeek(date, options);
			}
			const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
			date.setFullYear(year, 0, options.firstWeekContainsDate);
			date.setHours(0, 0, 0, 0);
			return startOfWeek(date, options);
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js
	var ISOWeekYearParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 130);
			_defineProperty(this, "incompatibleTokens", [
				"G",
				"y",
				"Y",
				"u",
				"Q",
				"q",
				"M",
				"L",
				"w",
				"d",
				"D",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token) {
			if (token === "R") return parseNDigitsSigned(4, dateString);
			return parseNDigitsSigned(token.length, dateString);
		}
		set(date, _flags, value) {
			const firstWeekOfYear = constructFrom(date, 0);
			firstWeekOfYear.setFullYear(value, 0, 4);
			firstWeekOfYear.setHours(0, 0, 0, 0);
			return startOfISOWeek(firstWeekOfYear);
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js
	var ExtendedYearParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 130);
			_defineProperty(this, "incompatibleTokens", [
				"G",
				"y",
				"Y",
				"R",
				"w",
				"I",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token) {
			if (token === "u") return parseNDigitsSigned(4, dateString);
			return parseNDigitsSigned(token.length, dateString);
		}
		set(date, _flags, value) {
			date.setFullYear(value, 0, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/QuarterParser.js
	var QuarterParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 120);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"q",
				"M",
				"L",
				"w",
				"I",
				"d",
				"D",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "Q":
				case "QQ": return parseNDigits(token.length, dateString);
				case "Qo": return match.ordinalNumber(dateString, { unit: "quarter" });
				case "QQQ": return match.quarter(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.quarter(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "QQQQQ": return match.quarter(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.quarter(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.quarter(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.quarter(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 4;
		}
		set(date, _flags, value) {
			date.setMonth((value - 1) * 3, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js
	var StandAloneQuarterParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 120);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"Q",
				"M",
				"L",
				"w",
				"I",
				"d",
				"D",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "q":
				case "qq": return parseNDigits(token.length, dateString);
				case "qo": return match.ordinalNumber(dateString, { unit: "quarter" });
				case "qqq": return match.quarter(dateString, {
					width: "abbreviated",
					context: "standalone"
				}) || match.quarter(dateString, {
					width: "narrow",
					context: "standalone"
				});
				case "qqqqq": return match.quarter(dateString, {
					width: "narrow",
					context: "standalone"
				});
				default: return match.quarter(dateString, {
					width: "wide",
					context: "standalone"
				}) || match.quarter(dateString, {
					width: "abbreviated",
					context: "standalone"
				}) || match.quarter(dateString, {
					width: "narrow",
					context: "standalone"
				});
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 4;
		}
		set(date, _flags, value) {
			date.setMonth((value - 1) * 3, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/MonthParser.js
	var MonthParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"q",
				"Q",
				"L",
				"w",
				"I",
				"D",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
			_defineProperty(this, "priority", 110);
		}
		parse(dateString, token, match) {
			const valueCallback = (value) => value - 1;
			switch (token) {
				case "M": return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
				case "MM": return mapValue(parseNDigits(2, dateString), valueCallback);
				case "Mo": return mapValue(match.ordinalNumber(dateString, { unit: "month" }), valueCallback);
				case "MMM": return match.month(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.month(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "MMMMM": return match.month(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.month(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.month(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.month(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 11;
		}
		set(date, _flags, value) {
			date.setMonth(value, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js
	var StandAloneMonthParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 110);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"q",
				"Q",
				"M",
				"w",
				"I",
				"D",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			const valueCallback = (value) => value - 1;
			switch (token) {
				case "L": return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
				case "LL": return mapValue(parseNDigits(2, dateString), valueCallback);
				case "Lo": return mapValue(match.ordinalNumber(dateString, { unit: "month" }), valueCallback);
				case "LLL": return match.month(dateString, {
					width: "abbreviated",
					context: "standalone"
				}) || match.month(dateString, {
					width: "narrow",
					context: "standalone"
				});
				case "LLLLL": return match.month(dateString, {
					width: "narrow",
					context: "standalone"
				});
				default: return match.month(dateString, {
					width: "wide",
					context: "standalone"
				}) || match.month(dateString, {
					width: "abbreviated",
					context: "standalone"
				}) || match.month(dateString, {
					width: "narrow",
					context: "standalone"
				});
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 11;
		}
		set(date, _flags, value) {
			date.setMonth(value, 1);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/setWeek.js
	/**
	* The {@link setWeek} function options.
	*/
	/**
	* @name setWeek
	* @category Week Helpers
	* @summary Set the local week to the given date.
	*
	* @description
	* Set the local week to the given date, saving the weekday number.
	* The exact calculation depends on the values of
	* `options.weekStartsOn` (which is the index of the first day of the week)
	* and `options.firstWeekContainsDate` (which is the day of January, which is always in
	* the first week of the week-numbering year)
	*
	* Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param week - The week of the new date
	* @param options - An object with options
	*
	* @returns The new date with the local week set
	*
	* @example
	* // Set the 1st week to 2 January 2005 with default options:
	* const result = setWeek(new Date(2005, 0, 2), 1)
	* //=> Sun Dec 26 2004 00:00:00
	*
	* @example
	* // Set the 1st week to 2 January 2005,
	* // if Monday is the first day of the week,
	* // and the first week of the year always contains 4 January:
	* const result = setWeek(new Date(2005, 0, 2), 1, {
	*   weekStartsOn: 1,
	*   firstWeekContainsDate: 4
	* })
	* //=> Sun Jan 4 2004 00:00:00
	*/
	function setWeek(date, week, options) {
		const date_ = toDate(date, options?.in);
		const diff = getWeek(date_, options) - week;
		date_.setDate(date_.getDate() - diff * 7);
		return toDate(date_, options?.in);
	}
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js
	var LocalWeekParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 100);
			_defineProperty(this, "incompatibleTokens", [
				"y",
				"R",
				"u",
				"q",
				"Q",
				"M",
				"L",
				"I",
				"d",
				"D",
				"i",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "w": return parseNumericPattern(numericPatterns.week, dateString);
				case "wo": return match.ordinalNumber(dateString, { unit: "week" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 53;
		}
		set(date, _flags, value, options) {
			return startOfWeek(setWeek(date, value, options), options);
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/setISOWeek.js
	/**
	* The {@link setISOWeek} function options.
	*/
	/**
	* @name setISOWeek
	* @category ISO Week Helpers
	* @summary Set the ISO week to the given date.
	*
	* @description
	* Set the ISO week to the given date, saving the weekday number.
	*
	* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The `Date` type of the context function.
	*
	* @param date - The date to be changed
	* @param week - The ISO week of the new date
	* @param options - An object with options
	*
	* @returns The new date with the ISO week set
	*
	* @example
	* // Set the 53rd ISO week to 7 August 2004:
	* const result = setISOWeek(new Date(2004, 7, 7), 53)
	* //=> Sat Jan 01 2005 00:00:00
	*/
	function setISOWeek(date, week, options) {
		const _date = toDate(date, options?.in);
		const diff = getISOWeek(_date, options) - week;
		_date.setDate(_date.getDate() - diff * 7);
		return _date;
	}
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js
	var ISOWeekParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 100);
			_defineProperty(this, "incompatibleTokens", [
				"y",
				"Y",
				"u",
				"q",
				"Q",
				"M",
				"L",
				"w",
				"d",
				"D",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "I": return parseNumericPattern(numericPatterns.week, dateString);
				case "Io": return match.ordinalNumber(dateString, { unit: "week" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 53;
		}
		set(date, _flags, value) {
			return startOfISOWeek(setISOWeek(date, value));
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/DateParser.js
	var DAYS_IN_MONTH = [
		31,
		28,
		31,
		30,
		31,
		30,
		31,
		31,
		30,
		31,
		30,
		31
	];
	var DAYS_IN_MONTH_LEAP_YEAR = [
		31,
		29,
		31,
		30,
		31,
		30,
		31,
		31,
		30,
		31,
		30,
		31
	];
	var DateParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 90);
			_defineProperty(this, "subPriority", 1);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"q",
				"Q",
				"w",
				"I",
				"D",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "d": return parseNumericPattern(numericPatterns.date, dateString);
				case "do": return match.ordinalNumber(dateString, { unit: "date" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(date, value) {
			const isLeapYear = isLeapYearIndex$1(date.getFullYear());
			const month = date.getMonth();
			if (isLeapYear) return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
			else return value >= 1 && value <= DAYS_IN_MONTH[month];
		}
		set(date, _flags, value) {
			date.setDate(value);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js
	var DayOfYearParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 90);
			_defineProperty(this, "subpriority", 1);
			_defineProperty(this, "incompatibleTokens", [
				"Y",
				"R",
				"q",
				"Q",
				"M",
				"L",
				"w",
				"I",
				"d",
				"E",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "D":
				case "DD": return parseNumericPattern(numericPatterns.dayOfYear, dateString);
				case "Do": return match.ordinalNumber(dateString, { unit: "date" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(date, value) {
			if (isLeapYearIndex$1(date.getFullYear())) return value >= 1 && value <= 366;
			else return value >= 1 && value <= 365;
		}
		set(date, _flags, value) {
			date.setMonth(0, value);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/setDay.js
	/**
	* The {@link setDay} function options.
	*/
	/**
	* @name setDay
	* @category Weekday Helpers
	* @summary Set the day of the week to the given date.
	*
	* @description
	* Set the day of the week to the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param day - The day of the week of the new date
	* @param options - An object with options.
	*
	* @returns The new date with the day of the week set
	*
	* @example
	* // Set week day to Sunday, with the default weekStartsOn of Sunday:
	* const result = setDay(new Date(2014, 8, 1), 0)
	* //=> Sun Aug 31 2014 00:00:00
	*
	* @example
	* // Set week day to Sunday, with a weekStartsOn of Monday:
	* const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
	* //=> Sun Sep 07 2014 00:00:00
	*/
	function setDay(date, day, options) {
		const defaultOptions = getDefaultOptions$1();
		const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
		const date_ = toDate(date, options?.in);
		const currentDay = date_.getDay();
		const dayIndex = (day % 7 + 7) % 7;
		const delta = 7 - weekStartsOn;
		return addDays$1(date_, day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/DayParser.js
	var DayParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 90);
			_defineProperty(this, "incompatibleTokens", [
				"D",
				"i",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "E":
				case "EE":
				case "EEE": return match.day(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "EEEEE": return match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "EEEEEE": return match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.day(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.day(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 6;
		}
		set(date, _flags, value, options) {
			date = setDay(date, value, options);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js
	var LocalDayParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 90);
			_defineProperty(this, "incompatibleTokens", [
				"y",
				"R",
				"u",
				"q",
				"Q",
				"M",
				"L",
				"I",
				"d",
				"D",
				"E",
				"i",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match, options) {
			const valueCallback = (value) => {
				const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
				return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
			};
			switch (token) {
				case "e":
				case "ee": return mapValue(parseNDigits(token.length, dateString), valueCallback);
				case "eo": return mapValue(match.ordinalNumber(dateString, { unit: "day" }), valueCallback);
				case "eee": return match.day(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "eeeee": return match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "eeeeee": return match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.day(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.day(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 6;
		}
		set(date, _flags, value, options) {
			date = setDay(date, value, options);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js
	var StandAloneLocalDayParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 90);
			_defineProperty(this, "incompatibleTokens", [
				"y",
				"R",
				"u",
				"q",
				"Q",
				"M",
				"L",
				"I",
				"d",
				"D",
				"E",
				"i",
				"e",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match, options) {
			const valueCallback = (value) => {
				const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
				return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
			};
			switch (token) {
				case "c":
				case "cc": return mapValue(parseNDigits(token.length, dateString), valueCallback);
				case "co": return mapValue(match.ordinalNumber(dateString, { unit: "day" }), valueCallback);
				case "ccc": return match.day(dateString, {
					width: "abbreviated",
					context: "standalone"
				}) || match.day(dateString, {
					width: "short",
					context: "standalone"
				}) || match.day(dateString, {
					width: "narrow",
					context: "standalone"
				});
				case "ccccc": return match.day(dateString, {
					width: "narrow",
					context: "standalone"
				});
				case "cccccc": return match.day(dateString, {
					width: "short",
					context: "standalone"
				}) || match.day(dateString, {
					width: "narrow",
					context: "standalone"
				});
				default: return match.day(dateString, {
					width: "wide",
					context: "standalone"
				}) || match.day(dateString, {
					width: "abbreviated",
					context: "standalone"
				}) || match.day(dateString, {
					width: "short",
					context: "standalone"
				}) || match.day(dateString, {
					width: "narrow",
					context: "standalone"
				});
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 6;
		}
		set(date, _flags, value, options) {
			date = setDay(date, value, options);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/setISODay.js
	/**
	* The {@link setISODay} function options.
	*/
	/**
	* @name setISODay
	* @category Weekday Helpers
	* @summary Set the day of the ISO week to the given date.
	*
	* @description
	* Set the day of the ISO week to the given date.
	* ISO week starts with Monday.
	* 7 is the index of Sunday, 1 is the index of Monday, etc.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param day - The day of the ISO week of the new date
	* @param options - An object with options
	*
	* @returns The new date with the day of the ISO week set
	*
	* @example
	* // Set Sunday to 1 September 2014:
	* const result = setISODay(new Date(2014, 8, 1), 7)
	* //=> Sun Sep 07 2014 00:00:00
	*/
	function setISODay(date, day, options) {
		const date_ = toDate(date, options?.in);
		return addDays$1(date_, day - getISODay(date_, options), options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/ISODayParser.js
	var ISODayParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 90);
			_defineProperty(this, "incompatibleTokens", [
				"y",
				"Y",
				"u",
				"q",
				"Q",
				"M",
				"L",
				"w",
				"d",
				"D",
				"E",
				"e",
				"c",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			const valueCallback = (value) => {
				if (value === 0) return 7;
				return value;
			};
			switch (token) {
				case "i":
				case "ii": return parseNDigits(token.length, dateString);
				case "io": return match.ordinalNumber(dateString, { unit: "day" });
				case "iii": return mapValue(match.day(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				}), valueCallback);
				case "iiiii": return mapValue(match.day(dateString, {
					width: "narrow",
					context: "formatting"
				}), valueCallback);
				case "iiiiii": return mapValue(match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				}), valueCallback);
				default: return mapValue(match.day(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.day(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.day(dateString, {
					width: "short",
					context: "formatting"
				}) || match.day(dateString, {
					width: "narrow",
					context: "formatting"
				}), valueCallback);
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 7;
		}
		set(date, _flags, value) {
			date = setISODay(date, value);
			date.setHours(0, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/AMPMParser.js
	var AMPMParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 80);
			_defineProperty(this, "incompatibleTokens", [
				"b",
				"B",
				"H",
				"k",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "a":
				case "aa":
				case "aaa": return match.dayPeriod(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "aaaaa": return match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.dayPeriod(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		set(date, _flags, value) {
			date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js
	var AMPMMidnightParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 80);
			_defineProperty(this, "incompatibleTokens", [
				"a",
				"B",
				"H",
				"k",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "b":
				case "bb":
				case "bbb": return match.dayPeriod(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "bbbbb": return match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.dayPeriod(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		set(date, _flags, value) {
			date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js
	var DayPeriodParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 80);
			_defineProperty(this, "incompatibleTokens", [
				"a",
				"b",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "B":
				case "BB":
				case "BBB": return match.dayPeriod(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
				case "BBBBB": return match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
				default: return match.dayPeriod(dateString, {
					width: "wide",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "abbreviated",
					context: "formatting"
				}) || match.dayPeriod(dateString, {
					width: "narrow",
					context: "formatting"
				});
			}
		}
		set(date, _flags, value) {
			date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js
	var Hour1to12Parser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 70);
			_defineProperty(this, "incompatibleTokens", [
				"H",
				"K",
				"k",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "h": return parseNumericPattern(numericPatterns.hour12h, dateString);
				case "ho": return match.ordinalNumber(dateString, { unit: "hour" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 12;
		}
		set(date, _flags, value) {
			const isPM = date.getHours() >= 12;
			if (isPM && value < 12) date.setHours(value + 12, 0, 0, 0);
			else if (!isPM && value === 12) date.setHours(0, 0, 0, 0);
			else date.setHours(value, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js
	var Hour0to23Parser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 70);
			_defineProperty(this, "incompatibleTokens", [
				"a",
				"b",
				"h",
				"K",
				"k",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "H": return parseNumericPattern(numericPatterns.hour23h, dateString);
				case "Ho": return match.ordinalNumber(dateString, { unit: "hour" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 23;
		}
		set(date, _flags, value) {
			date.setHours(value, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js
	var Hour0To11Parser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 70);
			_defineProperty(this, "incompatibleTokens", [
				"h",
				"H",
				"k",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "K": return parseNumericPattern(numericPatterns.hour11h, dateString);
				case "Ko": return match.ordinalNumber(dateString, { unit: "hour" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 11;
		}
		set(date, _flags, value) {
			if (date.getHours() >= 12 && value < 12) date.setHours(value + 12, 0, 0, 0);
			else date.setHours(value, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js
	var Hour1To24Parser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 70);
			_defineProperty(this, "incompatibleTokens", [
				"a",
				"b",
				"h",
				"H",
				"K",
				"t",
				"T"
			]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "k": return parseNumericPattern(numericPatterns.hour24h, dateString);
				case "ko": return match.ordinalNumber(dateString, { unit: "hour" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 1 && value <= 24;
		}
		set(date, _flags, value) {
			const hours = value <= 24 ? value % 24 : value;
			date.setHours(hours, 0, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/MinuteParser.js
	var MinuteParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 60);
			_defineProperty(this, "incompatibleTokens", ["t", "T"]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "m": return parseNumericPattern(numericPatterns.minute, dateString);
				case "mo": return match.ordinalNumber(dateString, { unit: "minute" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 59;
		}
		set(date, _flags, value) {
			date.setMinutes(value, 0, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/SecondParser.js
	var SecondParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 50);
			_defineProperty(this, "incompatibleTokens", ["t", "T"]);
		}
		parse(dateString, token, match) {
			switch (token) {
				case "s": return parseNumericPattern(numericPatterns.second, dateString);
				case "so": return match.ordinalNumber(dateString, { unit: "second" });
				default: return parseNDigits(token.length, dateString);
			}
		}
		validate(_date, value) {
			return value >= 0 && value <= 59;
		}
		set(date, _flags, value) {
			date.setSeconds(value, 0);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js
	var FractionOfSecondParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 30);
			_defineProperty(this, "incompatibleTokens", ["t", "T"]);
		}
		parse(dateString, token) {
			const valueCallback = (value) => Math.trunc(value * Math.pow(10, -token.length + 3));
			return mapValue(parseNDigits(token.length, dateString), valueCallback);
		}
		set(date, _flags, value) {
			date.setMilliseconds(value);
			return date;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js
	var ISOTimezoneWithZParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 10);
			_defineProperty(this, "incompatibleTokens", [
				"t",
				"T",
				"x"
			]);
		}
		parse(dateString, token) {
			switch (token) {
				case "X": return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
				case "XX": return parseTimezonePattern(timezonePatterns.basic, dateString);
				case "XXXX": return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
				case "XXXXX": return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
				default: return parseTimezonePattern(timezonePatterns.extended, dateString);
			}
		}
		set(date, flags, value) {
			if (flags.timestampIsSet) return date;
			return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js
	var ISOTimezoneParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 10);
			_defineProperty(this, "incompatibleTokens", [
				"t",
				"T",
				"X"
			]);
		}
		parse(dateString, token) {
			switch (token) {
				case "x": return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
				case "xx": return parseTimezonePattern(timezonePatterns.basic, dateString);
				case "xxxx": return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
				case "xxxxx": return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
				default: return parseTimezonePattern(timezonePatterns.extended, dateString);
			}
		}
		set(date, flags, value) {
			if (flags.timestampIsSet) return date;
			return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js
	var TimestampSecondsParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 40);
			_defineProperty(this, "incompatibleTokens", "*");
		}
		parse(dateString) {
			return parseAnyDigitsSigned(dateString);
		}
		set(date, _flags, value) {
			return [constructFrom(date, value * 1e3), { timestampIsSet: true }];
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js
	var TimestampMillisecondsParser = class extends Parser$1 {
		constructor(..._args) {
			super(..._args);
			_defineProperty(this, "priority", 20);
			_defineProperty(this, "incompatibleTokens", "*");
		}
		parse(dateString) {
			return parseAnyDigitsSigned(dateString);
		}
		set(date, _flags, value) {
			return [constructFrom(date, value), { timestampIsSet: true }];
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse/_lib/parsers.js
	var parsers = {
		G: new EraParser(),
		y: new YearParser(),
		Y: new LocalWeekYearParser(),
		R: new ISOWeekYearParser(),
		u: new ExtendedYearParser(),
		Q: new QuarterParser(),
		q: new StandAloneQuarterParser(),
		M: new MonthParser(),
		L: new StandAloneMonthParser(),
		w: new LocalWeekParser(),
		I: new ISOWeekParser(),
		d: new DateParser(),
		D: new DayOfYearParser(),
		E: new DayParser(),
		e: new LocalDayParser(),
		c: new StandAloneLocalDayParser(),
		i: new ISODayParser(),
		a: new AMPMParser(),
		b: new AMPMMidnightParser(),
		B: new DayPeriodParser(),
		h: new Hour1to12Parser(),
		H: new Hour0to23Parser(),
		K: new Hour0To11Parser(),
		k: new Hour1To24Parser(),
		m: new MinuteParser(),
		s: new SecondParser(),
		S: new FractionOfSecondParser(),
		X: new ISOTimezoneWithZParser(),
		x: new ISOTimezoneParser(),
		t: new TimestampSecondsParser(),
		T: new TimestampMillisecondsParser()
	};
	//#endregion
	//#region ../../node_modules/date-fns/parse.js
	/**
	* The {@link parse} function options.
	*/
	var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
	var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
	var escapedStringRegExp = /^'([^]*?)'?$/;
	var doubleQuoteRegExp = /''/g;
	var notWhitespaceRegExp = /\S/;
	var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
	/**
	* @name parse
	* @category Common Helpers
	* @summary Parse the date.
	*
	* @description
	* Return the date parsed from string using the given format string.
	*
	* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
	* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* The characters in the format string wrapped between two single quotes characters (') are escaped.
	* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
	*
	* Format of the format string is based on Unicode Technical Standard #35:
	* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
	* with a few additions (see note 5 below the table).
	*
	* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
	* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
	*
	* ```javascript
	* parse('23 AM', 'HH a', new Date())
	* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
	* ```
	*
	* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
	*
	* Accepted format string patterns:
	* | Unit                            |Prior| Pattern | Result examples                   | Notes |
	* |---------------------------------|-----|---------|-----------------------------------|-------|
	* | Era                             | 140 | G..GGG  | AD, BC                            |       |
	* |                                 |     | GGGG    | Anno Domini, Before Christ        | 2     |
	* |                                 |     | GGGGG   | A, B                              |       |
	* | Calendar year                   | 130 | y       | 44, 1, 1900, 2017, 9999           | 4     |
	* |                                 |     | yo      | 44th, 1st, 1900th, 9999999th      | 4,5   |
	* |                                 |     | yy      | 44, 01, 00, 17                    | 4     |
	* |                                 |     | yyy     | 044, 001, 123, 999                | 4     |
	* |                                 |     | yyyy    | 0044, 0001, 1900, 2017            | 4     |
	* |                                 |     | yyyyy   | ...                               | 2,4   |
	* | Local week-numbering year       | 130 | Y       | 44, 1, 1900, 2017, 9000           | 4     |
	* |                                 |     | Yo      | 44th, 1st, 1900th, 9999999th      | 4,5   |
	* |                                 |     | YY      | 44, 01, 00, 17                    | 4,6   |
	* |                                 |     | YYY     | 044, 001, 123, 999                | 4     |
	* |                                 |     | YYYY    | 0044, 0001, 1900, 2017            | 4,6   |
	* |                                 |     | YYYYY   | ...                               | 2,4   |
	* | ISO week-numbering year         | 130 | R       | -43, 1, 1900, 2017, 9999, -9999   | 4,5   |
	* |                                 |     | RR      | -43, 01, 00, 17                   | 4,5   |
	* |                                 |     | RRR     | -043, 001, 123, 999, -999         | 4,5   |
	* |                                 |     | RRRR    | -0043, 0001, 2017, 9999, -9999    | 4,5   |
	* |                                 |     | RRRRR   | ...                               | 2,4,5 |
	* | Extended year                   | 130 | u       | -43, 1, 1900, 2017, 9999, -999    | 4     |
	* |                                 |     | uu      | -43, 01, 99, -99                  | 4     |
	* |                                 |     | uuu     | -043, 001, 123, 999, -999         | 4     |
	* |                                 |     | uuuu    | -0043, 0001, 2017, 9999, -9999    | 4     |
	* |                                 |     | uuuuu   | ...                               | 2,4   |
	* | Quarter (formatting)            | 120 | Q       | 1, 2, 3, 4                        |       |
	* |                                 |     | Qo      | 1st, 2nd, 3rd, 4th                | 5     |
	* |                                 |     | QQ      | 01, 02, 03, 04                    |       |
	* |                                 |     | QQQ     | Q1, Q2, Q3, Q4                    |       |
	* |                                 |     | QQQQ    | 1st quarter, 2nd quarter, ...     | 2     |
	* |                                 |     | QQQQQ   | 1, 2, 3, 4                        | 4     |
	* | Quarter (stand-alone)           | 120 | q       | 1, 2, 3, 4                        |       |
	* |                                 |     | qo      | 1st, 2nd, 3rd, 4th                | 5     |
	* |                                 |     | qq      | 01, 02, 03, 04                    |       |
	* |                                 |     | qqq     | Q1, Q2, Q3, Q4                    |       |
	* |                                 |     | qqqq    | 1st quarter, 2nd quarter, ...     | 2     |
	* |                                 |     | qqqqq   | 1, 2, 3, 4                        | 3     |
	* | Month (formatting)              | 110 | M       | 1, 2, ..., 12                     |       |
	* |                                 |     | Mo      | 1st, 2nd, ..., 12th               | 5     |
	* |                                 |     | MM      | 01, 02, ..., 12                   |       |
	* |                                 |     | MMM     | Jan, Feb, ..., Dec                |       |
	* |                                 |     | MMMM    | January, February, ..., December  | 2     |
	* |                                 |     | MMMMM   | J, F, ..., D                      |       |
	* | Month (stand-alone)             | 110 | L       | 1, 2, ..., 12                     |       |
	* |                                 |     | Lo      | 1st, 2nd, ..., 12th               | 5     |
	* |                                 |     | LL      | 01, 02, ..., 12                   |       |
	* |                                 |     | LLL     | Jan, Feb, ..., Dec                |       |
	* |                                 |     | LLLL    | January, February, ..., December  | 2     |
	* |                                 |     | LLLLL   | J, F, ..., D                      |       |
	* | Local week of year              | 100 | w       | 1, 2, ..., 53                     |       |
	* |                                 |     | wo      | 1st, 2nd, ..., 53th               | 5     |
	* |                                 |     | ww      | 01, 02, ..., 53                   |       |
	* | ISO week of year                | 100 | I       | 1, 2, ..., 53                     | 5     |
	* |                                 |     | Io      | 1st, 2nd, ..., 53th               | 5     |
	* |                                 |     | II      | 01, 02, ..., 53                   | 5     |
	* | Day of month                    |  90 | d       | 1, 2, ..., 31                     |       |
	* |                                 |     | do      | 1st, 2nd, ..., 31st               | 5     |
	* |                                 |     | dd      | 01, 02, ..., 31                   |       |
	* | Day of year                     |  90 | D       | 1, 2, ..., 365, 366               | 7     |
	* |                                 |     | Do      | 1st, 2nd, ..., 365th, 366th       | 5     |
	* |                                 |     | DD      | 01, 02, ..., 365, 366             | 7     |
	* |                                 |     | DDD     | 001, 002, ..., 365, 366           |       |
	* |                                 |     | DDDD    | ...                               | 2     |
	* | Day of week (formatting)        |  90 | E..EEE  | Mon, Tue, Wed, ..., Sun           |       |
	* |                                 |     | EEEE    | Monday, Tuesday, ..., Sunday      | 2     |
	* |                                 |     | EEEEE   | M, T, W, T, F, S, S               |       |
	* |                                 |     | EEEEEE  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
	* | ISO day of week (formatting)    |  90 | i       | 1, 2, 3, ..., 7                   | 5     |
	* |                                 |     | io      | 1st, 2nd, ..., 7th                | 5     |
	* |                                 |     | ii      | 01, 02, ..., 07                   | 5     |
	* |                                 |     | iii     | Mon, Tue, Wed, ..., Sun           | 5     |
	* |                                 |     | iiii    | Monday, Tuesday, ..., Sunday      | 2,5   |
	* |                                 |     | iiiii   | M, T, W, T, F, S, S               | 5     |
	* |                                 |     | iiiiii  | Mo, Tu, We, Th, Fr, Sa, Su        | 5     |
	* | Local day of week (formatting)  |  90 | e       | 2, 3, 4, ..., 1                   |       |
	* |                                 |     | eo      | 2nd, 3rd, ..., 1st                | 5     |
	* |                                 |     | ee      | 02, 03, ..., 01                   |       |
	* |                                 |     | eee     | Mon, Tue, Wed, ..., Sun           |       |
	* |                                 |     | eeee    | Monday, Tuesday, ..., Sunday      | 2     |
	* |                                 |     | eeeee   | M, T, W, T, F, S, S               |       |
	* |                                 |     | eeeeee  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
	* | Local day of week (stand-alone) |  90 | c       | 2, 3, 4, ..., 1                   |       |
	* |                                 |     | co      | 2nd, 3rd, ..., 1st                | 5     |
	* |                                 |     | cc      | 02, 03, ..., 01                   |       |
	* |                                 |     | ccc     | Mon, Tue, Wed, ..., Sun           |       |
	* |                                 |     | cccc    | Monday, Tuesday, ..., Sunday      | 2     |
	* |                                 |     | ccccc   | M, T, W, T, F, S, S               |       |
	* |                                 |     | cccccc  | Mo, Tu, We, Th, Fr, Sa, Su        |       |
	* | AM, PM                          |  80 | a..aaa  | AM, PM                            |       |
	* |                                 |     | aaaa    | a.m., p.m.                        | 2     |
	* |                                 |     | aaaaa   | a, p                              |       |
	* | AM, PM, noon, midnight          |  80 | b..bbb  | AM, PM, noon, midnight            |       |
	* |                                 |     | bbbb    | a.m., p.m., noon, midnight        | 2     |
	* |                                 |     | bbbbb   | a, p, n, mi                       |       |
	* | Flexible day period             |  80 | B..BBB  | at night, in the morning, ...     |       |
	* |                                 |     | BBBB    | at night, in the morning, ...     | 2     |
	* |                                 |     | BBBBB   | at night, in the morning, ...     |       |
	* | Hour [1-12]                     |  70 | h       | 1, 2, ..., 11, 12                 |       |
	* |                                 |     | ho      | 1st, 2nd, ..., 11th, 12th         | 5     |
	* |                                 |     | hh      | 01, 02, ..., 11, 12               |       |
	* | Hour [0-23]                     |  70 | H       | 0, 1, 2, ..., 23                  |       |
	* |                                 |     | Ho      | 0th, 1st, 2nd, ..., 23rd          | 5     |
	* |                                 |     | HH      | 00, 01, 02, ..., 23               |       |
	* | Hour [0-11]                     |  70 | K       | 1, 2, ..., 11, 0                  |       |
	* |                                 |     | Ko      | 1st, 2nd, ..., 11th, 0th          | 5     |
	* |                                 |     | KK      | 01, 02, ..., 11, 00               |       |
	* | Hour [1-24]                     |  70 | k       | 24, 1, 2, ..., 23                 |       |
	* |                                 |     | ko      | 24th, 1st, 2nd, ..., 23rd         | 5     |
	* |                                 |     | kk      | 24, 01, 02, ..., 23               |       |
	* | Minute                          |  60 | m       | 0, 1, ..., 59                     |       |
	* |                                 |     | mo      | 0th, 1st, ..., 59th               | 5     |
	* |                                 |     | mm      | 00, 01, ..., 59                   |       |
	* | Second                          |  50 | s       | 0, 1, ..., 59                     |       |
	* |                                 |     | so      | 0th, 1st, ..., 59th               | 5     |
	* |                                 |     | ss      | 00, 01, ..., 59                   |       |
	* | Seconds timestamp               |  40 | t       | 512969520                         |       |
	* |                                 |     | tt      | ...                               | 2     |
	* | Fraction of second              |  30 | S       | 0, 1, ..., 9                      |       |
	* |                                 |     | SS      | 00, 01, ..., 99                   |       |
	* |                                 |     | SSS     | 000, 001, ..., 999                |       |
	* |                                 |     | SSSS    | ...                               | 2     |
	* | Milliseconds timestamp          |  20 | T       | 512969520900                      |       |
	* |                                 |     | TT      | ...                               | 2     |
	* | Timezone (ISO-8601 w/ Z)        |  10 | X       | -08, +0530, Z                     |       |
	* |                                 |     | XX      | -0800, +0530, Z                   |       |
	* |                                 |     | XXX     | -08:00, +05:30, Z                 |       |
	* |                                 |     | XXXX    | -0800, +0530, Z, +123456          | 2     |
	* |                                 |     | XXXXX   | -08:00, +05:30, Z, +12:34:56      |       |
	* | Timezone (ISO-8601 w/o Z)       |  10 | x       | -08, +0530, +00                   |       |
	* |                                 |     | xx      | -0800, +0530, +0000               |       |
	* |                                 |     | xxx     | -08:00, +05:30, +00:00            | 2     |
	* |                                 |     | xxxx    | -0800, +0530, +0000, +123456      |       |
	* |                                 |     | xxxxx   | -08:00, +05:30, +00:00, +12:34:56 |       |
	* | Long localized date             |  NA | P       | 05/29/1453                        | 5,8   |
	* |                                 |     | PP      | May 29, 1453                      |       |
	* |                                 |     | PPP     | May 29th, 1453                    |       |
	* |                                 |     | PPPP    | Sunday, May 29th, 1453            | 2,5,8 |
	* | Long localized time             |  NA | p       | 12:00 AM                          | 5,8   |
	* |                                 |     | pp      | 12:00:00 AM                       |       |
	* | Combination of date and time    |  NA | Pp      | 05/29/1453, 12:00 AM              |       |
	* |                                 |     | PPpp    | May 29, 1453, 12:00:00 AM         |       |
	* |                                 |     | PPPpp   | May 29th, 1453 at ...             |       |
	* |                                 |     | PPPPpp  | Sunday, May 29th, 1453 at ...     | 2,5,8 |
	* Notes:
	* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
	*    are the same as "stand-alone" units, but are different in some languages.
	*    "Formatting" units are declined according to the rules of the language
	*    in the context of a date. "Stand-alone" units are always nominative singular.
	*    In `format` function, they will produce different result:
	*
	*    `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
	*
	*    `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
	*
	*    `parse` will try to match both formatting and stand-alone units interchangeably.
	*
	* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
	*    the single quote characters (see below).
	*    If the sequence is longer than listed in table:
	*    - for numerical units (`yyyyyyyy`) `parse` will try to match a number
	*      as wide as the sequence
	*    - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
	*      These variations are marked with "2" in the last column of the table.
	*
	* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
	*    These tokens represent the shortest form of the quarter.
	*
	* 4. The main difference between `y` and `u` patterns are B.C. years:
	*
	*    | Year | `y` | `u` |
	*    |------|-----|-----|
	*    | AC 1 |   1 |   1 |
	*    | BC 1 |   1 |   0 |
	*    | BC 2 |   2 |  -1 |
	*
	*    Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
	*
	*    `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
	*
	*    `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
	*
	*    while `uu` will just assign the year as is:
	*
	*    `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
	*
	*    `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
	*
	*    The same difference is true for local and ISO week-numbering years (`Y` and `R`),
	*    except local week-numbering years are dependent on `options.weekStartsOn`
	*    and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
	*    and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
	*
	* 5. These patterns are not in the Unicode Technical Standard #35:
	*    - `i`: ISO day of week
	*    - `I`: ISO week of year
	*    - `R`: ISO week-numbering year
	*    - `o`: ordinal number modifier
	*    - `P`: long localized date
	*    - `p`: long localized time
	*
	* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
	*    You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
	*    You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
	*    on the given locale.
	*
	*    using `en-US` locale: `P` => `MM/dd/yyyy`
	*    using `en-US` locale: `p` => `hh:mm a`
	*    using `pt-BR` locale: `P` => `dd/MM/yyyy`
	*    using `pt-BR` locale: `p` => `HH:mm`
	*
	* Values will be assigned to the date in the descending order of its unit's priority.
	* Units of an equal priority overwrite each other in the order of appearance.
	*
	* If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
	* the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
	*
	* `referenceDate` must be passed for correct work of the function.
	* If you're not sure which `referenceDate` to supply, create a new instance of Date:
	* `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
	* In this case parsing will be done in the context of the current date.
	* If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
	* then `Invalid Date` will be returned.
	*
	* The result may vary by locale.
	*
	* If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
	*
	* If parsing failed, `Invalid Date` will be returned.
	* Invalid Date is a Date, whose time value is NaN.
	* Time value of Date: http://es5.github.io/#x15.9.1.1
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param dateStr - The string to parse
	* @param formatStr - The string of tokens
	* @param referenceDate - defines values missing from the parsed dateString
	* @param options - An object with options.
	*   see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*   see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	*
	* @returns The parsed date
	*
	* @throws `options.locale` must contain `match` property
	* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
	* @throws format string contains an unescaped latin alphabet character
	*
	* @example
	* // Parse 11 February 2014 from middle-endian format:
	* var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
	* //=> Tue Feb 11 2014 00:00:00
	*
	* @example
	* // Parse 28th of February in Esperanto locale in the context of 2010 year:
	* import eo from 'date-fns/locale/eo'
	* var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
	*   locale: eo
	* })
	* //=> Sun Feb 28 2010 00:00:00
	*/
	function parse$1(dateStr, formatStr, referenceDate, options) {
		const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
		const defaultOptions = getDefaultOptions();
		const locale = options?.locale ?? defaultOptions.locale ?? enUS;
		const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
		const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
		if (!formatStr) return dateStr ? invalidDate() : toDate(referenceDate, options?.in);
		const subFnOptions = {
			firstWeekContainsDate,
			weekStartsOn,
			locale
		};
		const setters = [new DateTimezoneSetter(options?.in, referenceDate)];
		const tokens = formatStr.match(longFormattingTokensRegExp).map((substring) => {
			const firstCharacter = substring[0];
			if (firstCharacter in longFormatters) {
				const longFormatter = longFormatters[firstCharacter];
				return longFormatter(substring, locale.formatLong);
			}
			return substring;
		}).join("").match(formattingTokensRegExp);
		const usedTokens = [];
		for (let token of tokens) {
			if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) warnOrThrowProtectedError(token, formatStr, dateStr);
			if (!options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) warnOrThrowProtectedError(token, formatStr, dateStr);
			const firstCharacter = token[0];
			const parser = parsers[firstCharacter];
			if (parser) {
				const { incompatibleTokens } = parser;
				if (Array.isArray(incompatibleTokens)) {
					const incompatibleToken = usedTokens.find((usedToken) => incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter);
					if (incompatibleToken) throw new RangeError(`The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`);
				} else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) throw new RangeError(`The format string mustn't contain \`${token}\` and any other token at the same time`);
				usedTokens.push({
					token: firstCharacter,
					fullToken: token
				});
				const parseResult = parser.run(dateStr, token, locale.match, subFnOptions);
				if (!parseResult) return invalidDate();
				setters.push(parseResult.setter);
				dateStr = parseResult.rest;
			} else {
				if (firstCharacter.match(unescapedLatinCharacterRegExp)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
				if (token === "''") token = "'";
				else if (firstCharacter === "'") token = cleanEscapedString(token);
				if (dateStr.indexOf(token) === 0) dateStr = dateStr.slice(token.length);
				else return invalidDate();
			}
		}
		if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) return invalidDate();
		const uniquePrioritySetters = setters.map((setter) => setter.priority).sort((a, b) => b - a).filter((priority, index, array) => array.indexOf(priority) === index).map((priority) => setters.filter((setter) => setter.priority === priority).sort((a, b) => b.subPriority - a.subPriority)).map((setterArray) => setterArray[0]);
		let date = toDate(referenceDate, options?.in);
		if (isNaN(+date)) return invalidDate();
		const flags = {};
		for (const setter of uniquePrioritySetters) {
			if (!setter.validate(date, subFnOptions)) return invalidDate();
			const result = setter.set(date, flags, subFnOptions);
			if (Array.isArray(result)) {
				date = result[0];
				Object.assign(flags, result[1]);
			} else date = result;
		}
		return date;
	}
	function cleanEscapedString(input) {
		return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
	}
	//#endregion
	//#region ../../node_modules/date-fns/isSameWeek.js
	/**
	* The {@link isSameWeek} function options.
	*/
	/**
	* @name isSameWeek
	* @category Week Helpers
	* @summary Are the given dates in the same week (and month and year)?
	*
	* @description
	* Are the given dates in the same week (and month and year)?
	*
	* @param laterDate - The first date to check
	* @param earlierDate - The second date to check
	* @param options - An object with options
	*
	* @returns The dates are in the same week (and month and year)
	*
	* @example
	* // Are 31 August 2014 and 4 September 2014 in the same week?
	* const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))
	* //=> true
	*
	* @example
	* // If week starts with Monday,
	* // are 31 August 2014 and 4 September 2014 in the same week?
	* const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {
	*   weekStartsOn: 1
	* })
	* //=> false
	*
	* @example
	* // Are 1 January 2014 and 1 January 2015 in the same week?
	* const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))
	* //=> false
	*/
	function isSameWeek(laterDate, earlierDate, options) {
		const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
		return +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/subDays.js
	/**
	* The {@link subDays} function options.
	*/
	/**
	* @name subDays
	* @category Day Helpers
	* @summary Subtract the specified number of days from the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of days to be subtracted.
	* @param options - An object with options
	*
	* @returns The new date with the days subtracted
	*
	* @example
	* // Subtract 10 days from 1 September 2014:
	* const result = subDays(new Date(2014, 8, 1), 10)
	* //=> Fri Aug 22 2014 00:00:00
	*/
	function subDays$1(date, amount, options) {
		return addDays$1(date, -amount, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/nextDay.js
	/**
	* The {@link nextDay} function options.
	*/
	/**
	* @name nextDay
	* @category Weekday Helpers
	* @summary When is the next day of the week? 0-6 the day of the week, 0 represents Sunday.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to check
	* @param day - Day of the week
	* @param options - An object with options
	*
	* @returns The date is the next day of the week
	*
	* @example
	* // When is the next Monday after Mar, 20, 2020?
	* const result = nextDay(new Date(2020, 2, 20), 1)
	* //=> Mon Mar 23 2020 00:00:00
	*
	* @example
	* // When is the next Tuesday after Mar, 21, 2020?
	* const result = nextDay(new Date(2020, 2, 21), 2)
	* //=> Tue Mar 24 2020 00:00:00
	*/
	function nextDay(date, day, options) {
		let delta = day - getDay$1(date, options);
		if (delta <= 0) delta += 7;
		return addDays$1(date, delta, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/nextMonday.js
	/**
	* The {@link nextMonday} function options.
	*/
	/**
	* @name nextMonday
	* @category Weekday Helpers
	* @summary When is the next Monday?
	*
	* @description
	* When is the next Monday?
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, returned from the context function if passed, or inferred from the arguments.
	*
	* @param date - The date to start counting from
	* @param options - An object with options
	*
	* @returns The next Monday
	*
	* @example
	* // When is the next Monday after Mar, 22, 2020?
	* const result = nextMonday(new Date(2020, 2, 22))
	* //=> Mon Mar 23 2020 00:00:00
	*/
	function nextMonday(date, options) {
		return nextDay(date, 1, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/parseISO.js
	/**
	* The {@link parseISO} function options.
	*/
	/**
	* @name parseISO
	* @category Common Helpers
	* @summary Parse ISO string
	*
	* @description
	* Parse the given string in ISO 8601 format and return an instance of Date.
	*
	* Function accepts complete ISO 8601 formats as well as partial implementations.
	* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
	*
	* If the argument isn't a string, the function cannot parse the string or
	* the values are invalid, it returns Invalid Date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param argument - The value to convert
	* @param options - An object with options
	*
	* @returns The parsed date in the local time zone
	*
	* @example
	* // Convert string '2014-02-11T11:30:30' to date:
	* const result = parseISO('2014-02-11T11:30:30')
	* //=> Tue Feb 11 2014 11:30:30
	*
	* @example
	* // Convert string '+02014101' to date,
	* // if the additional number of digits in the extended year format is 1:
	* const result = parseISO('+02014101', { additionalDigits: 1 })
	* //=> Fri Apr 11 2014 00:00:00
	*/
	function parseISO(argument, options) {
		const invalidDate = () => constructFrom(options?.in, NaN);
		const additionalDigits = options?.additionalDigits ?? 2;
		const dateStrings = splitDateString(argument);
		let date;
		if (dateStrings.date) {
			const parseYearResult = parseYear$1(dateStrings.date, additionalDigits);
			date = parseDate$2(parseYearResult.restDateString, parseYearResult.year);
		}
		if (!date || isNaN(+date)) return invalidDate();
		const timestamp = +date;
		let time = 0;
		let offset;
		if (dateStrings.time) {
			time = parseTime(dateStrings.time);
			if (isNaN(time)) return invalidDate();
		}
		if (dateStrings.timezone) {
			offset = parseTimezone(dateStrings.timezone);
			if (isNaN(offset)) return invalidDate();
		} else {
			const tmpDate = new Date(timestamp + time);
			const result = toDate(0, options?.in);
			result.setFullYear(tmpDate.getUTCFullYear(), tmpDate.getUTCMonth(), tmpDate.getUTCDate());
			result.setHours(tmpDate.getUTCHours(), tmpDate.getUTCMinutes(), tmpDate.getUTCSeconds(), tmpDate.getUTCMilliseconds());
			return result;
		}
		return toDate(timestamp + time + offset, options?.in);
	}
	var patterns = {
		dateTimeDelimiter: /[T ]/,
		timeZoneDelimiter: /[Z ]/i,
		timezone: /([Z+-].*)$/
	};
	var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
	var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
	var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
	function splitDateString(dateString) {
		const dateStrings = {};
		const array = dateString.split(patterns.dateTimeDelimiter);
		let timeString;
		if (array.length > 2) return dateStrings;
		if (/:/.test(array[0])) timeString = array[0];
		else {
			dateStrings.date = array[0];
			timeString = array[1];
			if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
				dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
				timeString = dateString.substr(dateStrings.date.length, dateString.length);
			}
		}
		if (timeString) {
			const token = patterns.timezone.exec(timeString);
			if (token) {
				dateStrings.time = timeString.replace(token[1], "");
				dateStrings.timezone = token[1];
			} else dateStrings.time = timeString;
		}
		return dateStrings;
	}
	function parseYear$1(dateString, additionalDigits) {
		const regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
		const captures = dateString.match(regex);
		if (!captures) return {
			year: NaN,
			restDateString: ""
		};
		const year = captures[1] ? parseInt(captures[1]) : null;
		const century = captures[2] ? parseInt(captures[2]) : null;
		return {
			year: century === null ? year : century * 100,
			restDateString: dateString.slice((captures[1] || captures[2]).length)
		};
	}
	function parseDate$2(dateString, year) {
		if (year === null) return /* @__PURE__ */ new Date(NaN);
		const captures = dateString.match(dateRegex);
		if (!captures) return /* @__PURE__ */ new Date(NaN);
		const isWeekDate = !!captures[4];
		const dayOfYear = parseDateUnit(captures[1]);
		const month = parseDateUnit(captures[2]) - 1;
		const day = parseDateUnit(captures[3]);
		const week = parseDateUnit(captures[4]);
		const dayOfWeek = parseDateUnit(captures[5]) - 1;
		if (isWeekDate) {
			if (!validateWeekDate(year, week, dayOfWeek)) return /* @__PURE__ */ new Date(NaN);
			return dayOfISOWeekYear(year, week, dayOfWeek);
		} else {
			const date = /* @__PURE__ */ new Date(0);
			if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) return /* @__PURE__ */ new Date(NaN);
			date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
			return date;
		}
	}
	function parseDateUnit(value) {
		return value ? parseInt(value) : 1;
	}
	function parseTime(timeString) {
		const captures = timeString.match(timeRegex);
		if (!captures) return NaN;
		const hours = parseTimeUnit(captures[1]);
		const minutes = parseTimeUnit(captures[2]);
		const seconds = parseTimeUnit(captures[3]);
		if (!validateTime(hours, minutes, seconds)) return NaN;
		return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
	}
	function parseTimeUnit(value) {
		return value && parseFloat(value.replace(",", ".")) || 0;
	}
	function parseTimezone(timezoneString) {
		if (timezoneString === "Z") return 0;
		const captures = timezoneString.match(timezoneRegex);
		if (!captures) return 0;
		const sign = captures[1] === "+" ? -1 : 1;
		const hours = parseInt(captures[2]);
		const minutes = captures[3] && parseInt(captures[3]) || 0;
		if (!validateTimezone(hours, minutes)) return NaN;
		return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
	}
	function dayOfISOWeekYear(isoWeekYear, week, day) {
		const date = /* @__PURE__ */ new Date(0);
		date.setUTCFullYear(isoWeekYear, 0, 4);
		const fourthOfJanuaryDay = date.getUTCDay() || 7;
		const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
		date.setUTCDate(date.getUTCDate() + diff);
		return date;
	}
	var daysInMonths = [
		31,
		null,
		31,
		30,
		31,
		30,
		31,
		31,
		30,
		31,
		30,
		31
	];
	function isLeapYearIndex(year) {
		return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
	}
	function validateDate(year, month, date) {
		return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));
	}
	function validateDayOfYearDate(year, dayOfYear) {
		return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
	}
	function validateWeekDate(_year, week, day) {
		return week >= 1 && week <= 53 && day >= 0 && day <= 6;
	}
	function validateTime(hours, minutes, seconds) {
		if (hours === 24) return minutes === 0 && seconds === 0;
		return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
	}
	function validateTimezone(_hours, minutes) {
		return minutes >= 0 && minutes <= 59;
	}
	//#endregion
	//#region ../../node_modules/date-fns/previousDay.js
	/**
	* The {@link previousDay} function options.
	*/
	/**
	* @name previousDay
	* @category Weekday Helpers
	* @summary When is the previous day of the week?
	*
	* @description
	* When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to check
	* @param day - The day of the week
	* @param options - An object with options
	*
	* @returns The date is the previous day of week
	*
	* @example
	* // When is the previous Monday before Mar, 20, 2020?
	* const result = previousDay(new Date(2020, 2, 20), 1)
	* //=> Mon Mar 16 2020 00:00:00
	*
	* @example
	* // When is the previous Tuesday before Mar, 21, 2020?
	* const result = previousDay(new Date(2020, 2, 21), 2)
	* //=> Tue Mar 17 2020 00:00:00
	*/
	function previousDay(date, day, options) {
		let delta = getDay$1(date, options) - day;
		if (delta <= 0) delta += 7;
		return subDays$1(date, delta, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/previousFriday.js
	/**
	* The {@link previousFriday} function options.
	*/
	/**
	* @name previousFriday
	* @category Weekday Helpers
	* @summary When is the previous Friday?
	*
	* @description
	* When is the previous Friday?
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [UTCDate](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to start counting from
	* @param options - The options
	*
	* @returns The previous Friday
	*
	* @example
	* // When is the previous Friday before Jun, 19, 2021?
	* const result = previousFriday(new Date(2021, 5, 19))
	* //=> Fri June 18 2021 00:00:00
	*/
	function previousFriday(date, options) {
		return previousDay(date, 5, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/subMonths.js
	/**
	* The subMonths function options.
	*/
	/**
	* @name subMonths
	* @category Month Helpers
	* @summary Subtract the specified number of months from the given date.
	*
	* @description
	* Subtract the specified number of months from the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of months to be subtracted.
	* @param options - An object with options
	*
	* @returns The new date with the months subtracted
	*
	* @example
	* // Subtract 5 months from 1 February 2015:
	* const result = subMonths(new Date(2015, 1, 1), 5)
	* //=> Mon Sep 01 2014 00:00:00
	*/
	function subMonths$1(date, amount, options) {
		return addMonths$1(date, -amount, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/subWeeks.js
	/**
	* The {@link subWeeks} function options.
	*/
	/**
	* @name subWeeks
	* @category Week Helpers
	* @summary Subtract the specified number of weeks from the given date.
	*
	* @description
	* Subtract the specified number of weeks from the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of weeks to be subtracted.
	* @param options - An object with options
	*
	* @returns The new date with the weeks subtracted
	*
	* @example
	* // Subtract 4 weeks from 1 September 2014:
	* const result = subWeeks(new Date(2014, 8, 1), 4)
	* //=> Mon Aug 04 2014 00:00:00
	*/
	function subWeeks$1(date, amount, options) {
		return addWeeks$1(date, -amount, options);
	}
	//#endregion
	//#region ../../node_modules/date-fns/subYears.js
	/**
	* The {@link subYears} function options.
	*/
	/**
	* @name subYears
	* @category Year Helpers
	* @summary Subtract the specified number of years from the given date.
	*
	* @description
	* Subtract the specified number of years from the given date.
	*
	* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
	* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
	*
	* @param date - The date to be changed
	* @param amount - The amount of years to be subtracted.
	* @param options - An object with options
	*
	* @returns The new date with the years subtracted
	*
	* @example
	* // Subtract 5 years from 1 September 2014:
	* const result = subYears(new Date(2014, 8, 1), 5)
	* //=> Tue Sep 01 2009 00:00:00
	*/
	function subYears(date, amount, options) {
		return addYears(date, -amount, options);
	}
	//#endregion
	//#region ../loot-core/src/shared/util.ts
	function last$1(arr) {
		return arr[arr.length - 1];
	}
	function getChangedValues(obj1, obj2) {
		const diff = {};
		const keys = Object.keys(obj2);
		let hasChanged = false;
		if (obj1.id) diff.id = obj1.id;
		for (let i = 0; i < keys.length; i++) {
			const key = keys[i];
			if (obj1[key] !== obj2[key]) {
				diff[key] = obj2[key];
				hasChanged = true;
			}
		}
		return hasChanged ? diff : null;
	}
	function hasFieldsChanged(obj1, obj2, fields) {
		let changed = false;
		for (let i = 0; i < fields.length; i++) {
			const field = fields[i];
			if (obj1[field] !== obj2[field]) {
				changed = true;
				break;
			}
		}
		return changed;
	}
	function partitionByField(data, field) {
		const res = /* @__PURE__ */ new Map();
		for (let i = 0; i < data.length; i++) {
			const item = data[i];
			const key = item[field];
			const items = res.get(key) || [];
			items.push(item);
			res.set(key, items);
		}
		return res;
	}
	function groupBy$1(data, field) {
		const res = /* @__PURE__ */ new Map();
		for (let i = 0; i < data.length; i++) {
			const item = data[i];
			const key = item[field];
			const existing = res.get(key) || [];
			res.set(key, existing.concat([item]));
		}
		return res;
	}
	function _groupById(data) {
		const res = /* @__PURE__ */ new Map();
		for (let i = 0; i < data.length; i++) {
			const item = data[i];
			res.set(item.id, item);
		}
		return res;
	}
	function diffItems(items, newItems) {
		const grouped = _groupById(items);
		const newGrouped = _groupById(newItems);
		const added = [];
		const updated = [];
		const deleted = items.filter((item) => !newGrouped.has(item.id)).map((item) => ({ id: item.id }));
		newItems.forEach((newItem) => {
			const item = grouped.get(newItem.id);
			if (!item) added.push(newItem);
			else {
				const changes = getChangedValues(item, newItem);
				if (changes) updated.push(changes);
			}
		});
		return {
			added,
			updated,
			deleted
		};
	}
	function groupById(data) {
		if (!data) return {};
		const res = {};
		for (let i = 0; i < data.length; i++) {
			const item = data[i];
			res[item.id] = item;
		}
		return res;
	}
	function setIn(map, keys, item) {
		for (let i = 0; i < keys.length; i++) {
			const key = keys[i];
			if (i === keys.length - 1) map.set(key, item);
			else {
				if (!map.has(key)) map.set(key, /* @__PURE__ */ new Map());
				map = map.get(key);
			}
		}
	}
	function getIn(map, keys) {
		let item = map;
		for (let i = 0; i < keys.length; i++) {
			item = item.get(keys[i]);
			if (item == null) return item;
		}
		return item;
	}
	function fastSetMerge(set1, set2) {
		const finalSet = new Set(set1);
		const iter = set2.values();
		let value = iter.next();
		while (!value.done) {
			finalSet.add(value.value);
			value = iter.next();
		}
		return finalSet;
	}
	var numberFormatConfig = {
		format: "comma-dot",
		hideFraction: false
	};
	function getNumberFormat({ format = numberFormatConfig.format, hideFraction = numberFormatConfig.hideFraction, decimalPlaces } = numberFormatConfig) {
		let locale, thousandsSeparator, decimalSeparator;
		const currentFormat = format || numberFormatConfig.format;
		const currentHideFraction = typeof hideFraction === "boolean" ? hideFraction : numberFormatConfig.hideFraction;
		switch (format) {
			case "space-comma":
				locale = "fr-FR";
				thousandsSeparator = " ";
				decimalSeparator = ",";
				break;
			case "dot-comma":
				locale = "de-DE";
				thousandsSeparator = ".";
				decimalSeparator = ",";
				break;
			case "apostrophe-dot":
				locale = "de-CH";
				thousandsSeparator = "’";
				decimalSeparator = ".";
				break;
			case "comma-dot-in":
				locale = "en-IN";
				thousandsSeparator = ",";
				decimalSeparator = ".";
				break;
			default:
				locale = "en-US";
				thousandsSeparator = ",";
				decimalSeparator = ".";
		}
		const fractionDigitsOptions = typeof decimalPlaces === "number" ? {
			minimumFractionDigits: decimalPlaces,
			maximumFractionDigits: decimalPlaces
		} : {
			minimumFractionDigits: currentHideFraction ? 0 : 2,
			maximumFractionDigits: currentHideFraction ? 0 : 2
		};
		const intlFormatter = new Intl.NumberFormat(locale, fractionDigitsOptions);
		return {
			value: currentFormat,
			thousandsSeparator,
			decimalSeparator,
			formatter: { format: (value) => {
				let formatted = intlFormatter.format(value);
				if (currentFormat === "apostrophe-dot") formatted = formatted.replace(/'/g, "’");
				return formatted === "-0" ? "0" : formatted;
			} }
		};
	}
	var MAX_SAFE_NUMBER = 2 ** 51 - 1;
	var MIN_SAFE_NUMBER = -MAX_SAFE_NUMBER;
	function safeNumber(value) {
		if (!Number.isInteger(value)) throw new Error("safeNumber: number is not an integer: " + JSON.stringify(value));
		if (value > MAX_SAFE_NUMBER || value < MIN_SAFE_NUMBER) throw new Error("safeNumber: can't safely perform arithmetic with number: " + value);
		return value;
	}
	function integerToCurrency(integerAmount, formatter = getNumberFormat().formatter, decimalPlaces = 2) {
		const divisor = Math.pow(10, decimalPlaces);
		const amount = safeNumber(integerAmount) / divisor;
		return formatter.format(amount);
	}
	function stringToInteger(str) {
		const amount = parseInt(str.replace(/\u2212/g, "-").replace(/[^-0-9.,]/g, ""));
		if (!isNaN(amount)) return amount;
		return null;
	}
	function amountToInteger(amount, decimalPlaces = 2) {
		return Math.round(amount * Math.pow(10, decimalPlaces));
	}
	function integerToAmount(integerAmount, decimalPlaces = 2) {
		return integerAmount / Math.pow(10, decimalPlaces);
	}
	function looselyParseAmount(amount) {
		function safeNumber(v) {
			if (isNaN(v)) return null;
			const value = v * 100;
			if (value > MAX_SAFE_NUMBER || value < MIN_SAFE_NUMBER) return null;
			return v;
		}
		function extractNumbers(v) {
			return v.replace(/[^0-9-]/g, "");
		}
		amount = amount.trim();
		if (amount.startsWith("(") && amount.endsWith(")")) {
			amount = amount.replace(/\u2212/g, "");
			amount = amount.replace("(", "-").replace(")", "");
		} else amount = amount.replace(/\u2212/g, "-");
		const m = amount.match(/[.,]([^.,]{4,9}|[^.,]{1,2})$/);
		if (!m || m.index === void 0) return safeNumber(parseFloat(extractNumbers(amount)));
		const left = extractNumbers(amount.slice(0, m.index));
		const right = extractNumbers(amount.slice(m.index + 1));
		return safeNumber(parseFloat(left + "." + right));
	}
	function sortByKey(arr, key) {
		return [...arr].sort((item1, item2) => {
			if (item1[key] < item2[key]) return -1;
			else if (item1[key] > item2[key]) return 1;
			return 0;
		});
	}
	//#endregion
	//#region ../../node_modules/i18next/dist/esm/i18next.js
	init_dist$1();
	var isString$2 = (obj) => typeof obj === "string";
	var defer = () => {
		let res;
		let rej;
		const promise = new Promise((resolve, reject) => {
			res = resolve;
			rej = reject;
		});
		promise.resolve = res;
		promise.reject = rej;
		return promise;
	};
	var makeString = (object) => {
		if (object == null) return "";
		return "" + object;
	};
	var copy = (a, s, t) => {
		a.forEach((m) => {
			if (s[m]) t[m] = s[m];
		});
	};
	var lastOfPathSeparatorRegExp = /###/g;
	var cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
	var canNotTraverseDeeper = (object) => !object || isString$2(object);
	var getLastOfPath = (object, path, Empty) => {
		const stack = !isString$2(path) ? path : path.split(".");
		let stackIndex = 0;
		while (stackIndex < stack.length - 1) {
			if (canNotTraverseDeeper(object)) return {};
			const key = cleanKey(stack[stackIndex]);
			if (!object[key] && Empty) object[key] = new Empty();
			if (Object.prototype.hasOwnProperty.call(object, key)) object = object[key];
			else object = {};
			++stackIndex;
		}
		if (canNotTraverseDeeper(object)) return {};
		return {
			obj: object,
			k: cleanKey(stack[stackIndex])
		};
	};
	var setPath = (object, path, newValue) => {
		const { obj, k } = getLastOfPath(object, path, Object);
		if (obj !== void 0 || path.length === 1) {
			obj[k] = newValue;
			return;
		}
		let e = path[path.length - 1];
		let p = path.slice(0, path.length - 1);
		let last = getLastOfPath(object, p, Object);
		while (last.obj === void 0 && p.length) {
			e = `${p[p.length - 1]}.${e}`;
			p = p.slice(0, p.length - 1);
			last = getLastOfPath(object, p, Object);
			if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== "undefined") last.obj = void 0;
		}
		last.obj[`${last.k}.${e}`] = newValue;
	};
	var pushPath = (object, path, newValue, concat) => {
		const { obj, k } = getLastOfPath(object, path, Object);
		obj[k] = obj[k] || [];
		obj[k].push(newValue);
	};
	var getPath = (object, path) => {
		const { obj, k } = getLastOfPath(object, path);
		if (!obj) return void 0;
		if (!Object.prototype.hasOwnProperty.call(obj, k)) return void 0;
		return obj[k];
	};
	var getPathWithDefaults = (data, defaultData, key) => {
		const value = getPath(data, key);
		if (value !== void 0) return value;
		return getPath(defaultData, key);
	};
	var deepExtend = (target, source, overwrite) => {
		for (const prop in source) if (prop !== "__proto__" && prop !== "constructor") if (prop in target) if (isString$2(target[prop]) || target[prop] instanceof String || isString$2(source[prop]) || source[prop] instanceof String) {
			if (overwrite) target[prop] = source[prop];
		} else deepExtend(target[prop], source[prop], overwrite);
		else target[prop] = source[prop];
		return target;
	};
	var regexEscape = (str) => str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
	var _entityMap = {
		"&": "&amp;",
		"<": "&lt;",
		">": "&gt;",
		"\"": "&quot;",
		"'": "&#39;",
		"/": "&#x2F;"
	};
	var escape = (data) => {
		if (isString$2(data)) return data.replace(/[&<>"'\/]/g, (s) => _entityMap[s]);
		return data;
	};
	var RegExpCache = class {
		constructor(capacity) {
			this.capacity = capacity;
			this.regExpMap = /* @__PURE__ */ new Map();
			this.regExpQueue = [];
		}
		getRegExp(pattern) {
			const regExpFromCache = this.regExpMap.get(pattern);
			if (regExpFromCache !== void 0) return regExpFromCache;
			const regExpNew = new RegExp(pattern);
			if (this.regExpQueue.length === this.capacity) this.regExpMap.delete(this.regExpQueue.shift());
			this.regExpMap.set(pattern, regExpNew);
			this.regExpQueue.push(pattern);
			return regExpNew;
		}
	};
	var chars = [
		" ",
		",",
		"?",
		"!",
		";"
	];
	var looksLikeObjectPathRegExpCache = new RegExpCache(20);
	var looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
		nsSeparator = nsSeparator || "";
		keySeparator = keySeparator || "";
		const possibleChars = chars.filter((c) => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);
		if (possibleChars.length === 0) return true;
		const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map((c) => c === "?" ? "\\?" : c).join("|")})`);
		let matched = !r.test(key);
		if (!matched) {
			const ki = key.indexOf(keySeparator);
			if (ki > 0 && !r.test(key.substring(0, ki))) matched = true;
		}
		return matched;
	};
	var deepFind = (obj, path, keySeparator = ".") => {
		if (!obj) return void 0;
		if (obj[path]) {
			if (!Object.prototype.hasOwnProperty.call(obj, path)) return void 0;
			return obj[path];
		}
		const tokens = path.split(keySeparator);
		let current = obj;
		for (let i = 0; i < tokens.length;) {
			if (!current || typeof current !== "object") return;
			let next;
			let nextPath = "";
			for (let j = i; j < tokens.length; ++j) {
				if (j !== i) nextPath += keySeparator;
				nextPath += tokens[j];
				next = current[nextPath];
				if (next !== void 0) {
					if ([
						"string",
						"number",
						"boolean"
					].indexOf(typeof next) > -1 && j < tokens.length - 1) continue;
					i += j - i + 1;
					break;
				}
			}
			current = next;
		}
		return current;
	};
	var getCleanedCode = (code) => code?.replace(/_/g, "-");
	var consoleLogger = {
		type: "logger",
		log(args) {
			this.output("log", args);
		},
		warn(args) {
			this.output("warn", args);
		},
		error(args) {
			this.output("error", args);
		},
		output(type, args) {
			console?.[type]?.apply?.(console, args);
		}
	};
	var baseLogger = new class Logger {
		constructor(concreteLogger, options = {}) {
			this.init(concreteLogger, options);
		}
		init(concreteLogger, options = {}) {
			this.prefix = options.prefix || "i18next:";
			this.logger = concreteLogger || consoleLogger;
			this.options = options;
			this.debug = options.debug;
		}
		log(...args) {
			return this.forward(args, "log", "", true);
		}
		warn(...args) {
			return this.forward(args, "warn", "", true);
		}
		error(...args) {
			return this.forward(args, "error", "");
		}
		deprecate(...args) {
			return this.forward(args, "warn", "WARNING DEPRECATED: ", true);
		}
		forward(args, lvl, prefix, debugOnly) {
			if (debugOnly && !this.debug) return null;
			if (isString$2(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;
			return this.logger[lvl](args);
		}
		create(moduleName) {
			return new Logger(this.logger, {
				prefix: `${this.prefix}:${moduleName}:`,
				...this.options
			});
		}
		clone(options) {
			options = options || this.options;
			options.prefix = options.prefix || this.prefix;
			return new Logger(this.logger, options);
		}
	}();
	var EventEmitter = class {
		constructor() {
			this.observers = {};
		}
		on(events, listener) {
			events.split(" ").forEach((event) => {
				if (!this.observers[event]) this.observers[event] = /* @__PURE__ */ new Map();
				const numListeners = this.observers[event].get(listener) || 0;
				this.observers[event].set(listener, numListeners + 1);
			});
			return this;
		}
		off(event, listener) {
			if (!this.observers[event]) return;
			if (!listener) {
				delete this.observers[event];
				return;
			}
			this.observers[event].delete(listener);
		}
		emit(event, ...args) {
			if (this.observers[event]) Array.from(this.observers[event].entries()).forEach(([observer, numTimesAdded]) => {
				for (let i = 0; i < numTimesAdded; i++) observer(...args);
			});
			if (this.observers["*"]) Array.from(this.observers["*"].entries()).forEach(([observer, numTimesAdded]) => {
				for (let i = 0; i < numTimesAdded; i++) observer.apply(observer, [event, ...args]);
			});
		}
	};
	var ResourceStore = class extends EventEmitter {
		constructor(data, options = {
			ns: ["translation"],
			defaultNS: "translation"
		}) {
			super();
			this.data = data || {};
			this.options = options;
			if (this.options.keySeparator === void 0) this.options.keySeparator = ".";
			if (this.options.ignoreJSONStructure === void 0) this.options.ignoreJSONStructure = true;
		}
		addNamespaces(ns) {
			if (this.options.ns.indexOf(ns) < 0) this.options.ns.push(ns);
		}
		removeNamespaces(ns) {
			const index = this.options.ns.indexOf(ns);
			if (index > -1) this.options.ns.splice(index, 1);
		}
		getResource(lng, ns, key, options = {}) {
			const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
			const ignoreJSONStructure = options.ignoreJSONStructure !== void 0 ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
			let path;
			if (lng.indexOf(".") > -1) path = lng.split(".");
			else {
				path = [lng, ns];
				if (key) if (Array.isArray(key)) path.push(...key);
				else if (isString$2(key) && keySeparator) path.push(...key.split(keySeparator));
				else path.push(key);
			}
			const result = getPath(this.data, path);
			if (!result && !ns && !key && lng.indexOf(".") > -1) {
				lng = path[0];
				ns = path[1];
				key = path.slice(2).join(".");
			}
			if (result || !ignoreJSONStructure || !isString$2(key)) return result;
			return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
		}
		addResource(lng, ns, key, value, options = { silent: false }) {
			const keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator;
			let path = [lng, ns];
			if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
			if (lng.indexOf(".") > -1) {
				path = lng.split(".");
				value = ns;
				ns = path[1];
			}
			this.addNamespaces(ns);
			setPath(this.data, path, value);
			if (!options.silent) this.emit("added", lng, ns, key, value);
		}
		addResources(lng, ns, resources, options = { silent: false }) {
			for (const m in resources) if (isString$2(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], { silent: true });
			if (!options.silent) this.emit("added", lng, ns, resources);
		}
		addResourceBundle(lng, ns, resources, deep, overwrite, options = {
			silent: false,
			skipCopy: false
		}) {
			let path = [lng, ns];
			if (lng.indexOf(".") > -1) {
				path = lng.split(".");
				deep = resources;
				resources = ns;
				ns = path[1];
			}
			this.addNamespaces(ns);
			let pack = getPath(this.data, path) || {};
			if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));
			if (deep) deepExtend(pack, resources, overwrite);
			else pack = {
				...pack,
				...resources
			};
			setPath(this.data, path, pack);
			if (!options.silent) this.emit("added", lng, ns, resources);
		}
		removeResourceBundle(lng, ns) {
			if (this.hasResourceBundle(lng, ns)) delete this.data[lng][ns];
			this.removeNamespaces(ns);
			this.emit("removed", lng, ns);
		}
		hasResourceBundle(lng, ns) {
			return this.getResource(lng, ns) !== void 0;
		}
		getResourceBundle(lng, ns) {
			if (!ns) ns = this.options.defaultNS;
			return this.getResource(lng, ns);
		}
		getDataByLanguage(lng) {
			return this.data[lng];
		}
		hasLanguageSomeTranslations(lng) {
			const data = this.getDataByLanguage(lng);
			return !!(data && Object.keys(data) || []).find((v) => data[v] && Object.keys(data[v]).length > 0);
		}
		toJSON() {
			return this.data;
		}
	};
	var postProcessor = {
		processors: {},
		addPostProcessor(module) {
			this.processors[module.name] = module;
		},
		handle(processors, value, key, options, translator) {
			processors.forEach((processor) => {
				value = this.processors[processor]?.process(value, key, options, translator) ?? value;
			});
			return value;
		}
	};
	var PATH_KEY = Symbol("i18next/PATH_KEY");
	function createProxy() {
		const state = [];
		const handler = Object.create(null);
		let proxy;
		handler.get = (target, key) => {
			proxy?.revoke?.();
			if (key === PATH_KEY) return state;
			state.push(key);
			proxy = Proxy.revocable(target, handler);
			return proxy.proxy;
		};
		return Proxy.revocable(Object.create(null), handler).proxy;
	}
	function keysFromSelector(selector, opts) {
		const { [PATH_KEY]: path } = selector(createProxy());
		const keySeparator = opts?.keySeparator ?? ".";
		const nsSeparator = opts?.nsSeparator ?? ":";
		if (path.length > 1 && nsSeparator) {
			const ns = opts?.ns;
			const nsArray = Array.isArray(ns) ? ns : null;
			if (nsArray && nsArray.length > 1 && nsArray.slice(1).includes(path[0])) return `${path[0]}${nsSeparator}${path.slice(1).join(keySeparator)}`;
		}
		return path.join(keySeparator);
	}
	var checkedLoadedFor = {};
	var shouldHandleAsObject = (res) => !isString$2(res) && typeof res !== "boolean" && typeof res !== "number";
	var Translator = class Translator extends EventEmitter {
		constructor(services, options = {}) {
			super();
			copy([
				"resourceStore",
				"languageUtils",
				"pluralResolver",
				"interpolator",
				"backendConnector",
				"i18nFormat",
				"utils"
			], services, this);
			this.options = options;
			if (this.options.keySeparator === void 0) this.options.keySeparator = ".";
			this.logger = baseLogger.create("translator");
		}
		changeLanguage(lng) {
			if (lng) this.language = lng;
		}
		exists(key, o = { interpolation: {} }) {
			const opt = { ...o };
			if (key == null) return false;
			const resolved = this.resolve(key, opt);
			if (resolved?.res === void 0) return false;
			const isObject = shouldHandleAsObject(resolved.res);
			if (opt.returnObjects === false && isObject) return false;
			return true;
		}
		extractFromKey(key, opt) {
			let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator;
			if (nsSeparator === void 0) nsSeparator = ":";
			const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator;
			let namespaces = opt.ns || this.options.defaultNS || [];
			const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
			const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !opt.keySeparator && !this.options.userDefinedNsSeparator && !opt.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
			if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
				const m = key.match(this.interpolator.nestingRegexp);
				if (m && m.length > 0) return {
					key,
					namespaces: isString$2(namespaces) ? [namespaces] : namespaces
				};
				const parts = key.split(nsSeparator);
				if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
				key = parts.join(keySeparator);
			}
			return {
				key,
				namespaces: isString$2(namespaces) ? [namespaces] : namespaces
			};
		}
		translate(keys, o, lastKey) {
			let opt = typeof o === "object" ? { ...o } : o;
			if (typeof opt !== "object" && this.options.overloadTranslationOptionHandler) opt = this.options.overloadTranslationOptionHandler(arguments);
			if (typeof opt === "object") opt = { ...opt };
			if (!opt) opt = {};
			if (keys == null) return "";
			if (typeof keys === "function") keys = keysFromSelector(keys, {
				...this.options,
				...opt
			});
			if (!Array.isArray(keys)) keys = [String(keys)];
			keys = keys.map((k) => typeof k === "function" ? keysFromSelector(k, {
				...this.options,
				...opt
			}) : String(k));
			const returnDetails = opt.returnDetails !== void 0 ? opt.returnDetails : this.options.returnDetails;
			const keySeparator = opt.keySeparator !== void 0 ? opt.keySeparator : this.options.keySeparator;
			const { key, namespaces } = this.extractFromKey(keys[keys.length - 1], opt);
			const namespace = namespaces[namespaces.length - 1];
			let nsSeparator = opt.nsSeparator !== void 0 ? opt.nsSeparator : this.options.nsSeparator;
			if (nsSeparator === void 0) nsSeparator = ":";
			const lng = opt.lng || this.language;
			const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
			if (lng?.toLowerCase() === "cimode") {
				if (appendNamespaceToCIMode) {
					if (returnDetails) return {
						res: `${namespace}${nsSeparator}${key}`,
						usedKey: key,
						exactUsedKey: key,
						usedLng: lng,
						usedNS: namespace,
						usedParams: this.getUsedParamsDetails(opt)
					};
					return `${namespace}${nsSeparator}${key}`;
				}
				if (returnDetails) return {
					res: key,
					usedKey: key,
					exactUsedKey: key,
					usedLng: lng,
					usedNS: namespace,
					usedParams: this.getUsedParamsDetails(opt)
				};
				return key;
			}
			const resolved = this.resolve(keys, opt);
			let res = resolved?.res;
			const resUsedKey = resolved?.usedKey || key;
			const resExactUsedKey = resolved?.exactUsedKey || key;
			const noObject = [
				"[object Number]",
				"[object Function]",
				"[object RegExp]"
			];
			const joinArrays = opt.joinArrays !== void 0 ? opt.joinArrays : this.options.joinArrays;
			const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
			const needsPluralHandling = opt.count !== void 0 && !isString$2(opt.count);
			const hasDefaultValue = Translator.hasDefaultValue(opt);
			const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, opt) : "";
			const defaultValueSuffixOrdinalFallback = opt.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, opt.count, { ordinal: false }) : "";
			const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
			const defaultValue = needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] || opt[`defaultValue${defaultValueSuffix}`] || opt[`defaultValue${defaultValueSuffixOrdinalFallback}`] || opt.defaultValue;
			let resForObjHndl = res;
			if (handleAsObjectInI18nFormat && !res && hasDefaultValue) resForObjHndl = defaultValue;
			const handleAsObject = shouldHandleAsObject(resForObjHndl);
			const resType = Object.prototype.toString.apply(resForObjHndl);
			if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString$2(joinArrays) && Array.isArray(resForObjHndl))) {
				if (!opt.returnObjects && !this.options.returnObjects) {
					if (!this.options.returnedObjectHandler) this.logger.warn("accessing an object - but returnObjects options is not enabled!");
					const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, resForObjHndl, {
						...opt,
						ns: namespaces
					}) : `key '${key} (${this.language})' returned an object instead of string.`;
					if (returnDetails) {
						resolved.res = r;
						resolved.usedParams = this.getUsedParamsDetails(opt);
						return resolved;
					}
					return r;
				}
				if (keySeparator) {
					const resTypeIsArray = Array.isArray(resForObjHndl);
					const copy = resTypeIsArray ? [] : {};
					const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
					for (const m in resForObjHndl) if (Object.prototype.hasOwnProperty.call(resForObjHndl, m)) {
						const deepKey = `${newKeyToUse}${keySeparator}${m}`;
						if (hasDefaultValue && !res) copy[m] = this.translate(deepKey, {
							...opt,
							defaultValue: shouldHandleAsObject(defaultValue) ? defaultValue[m] : void 0,
							joinArrays: false,
							ns: namespaces
						});
						else copy[m] = this.translate(deepKey, {
							...opt,
							joinArrays: false,
							ns: namespaces
						});
						if (copy[m] === deepKey) copy[m] = resForObjHndl[m];
					}
					res = copy;
				}
			} else if (handleAsObjectInI18nFormat && isString$2(joinArrays) && Array.isArray(res)) {
				res = res.join(joinArrays);
				if (res) res = this.extendTranslation(res, keys, opt, lastKey);
			} else {
				let usedDefault = false;
				let usedKey = false;
				if (!this.isValidLookup(res) && hasDefaultValue) {
					usedDefault = true;
					res = defaultValue;
				}
				if (!this.isValidLookup(res)) {
					usedKey = true;
					res = key;
				}
				const resForMissing = (opt.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && usedKey ? void 0 : res;
				const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
				if (usedKey || usedDefault || updateMissing) {
					this.logger.log(updateMissing ? "updateKey" : "missingKey", lng, namespace, key, updateMissing ? defaultValue : res);
					if (keySeparator) {
						const fk = this.resolve(key, {
							...opt,
							keySeparator: false
						});
						if (fk && fk.res) this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
					}
					let lngs = [];
					const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, opt.lng || this.language);
					if (this.options.saveMissingTo === "fallback" && fallbackLngs && fallbackLngs[0]) for (let i = 0; i < fallbackLngs.length; i++) lngs.push(fallbackLngs[i]);
					else if (this.options.saveMissingTo === "all") lngs = this.languageUtils.toResolveHierarchy(opt.lng || this.language);
					else lngs.push(opt.lng || this.language);
					const send = (l, k, specificDefaultValue) => {
						const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
						if (this.options.missingKeyHandler) this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, opt);
						else if (this.backendConnector?.saveMissing) this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, opt);
						this.emit("missingKey", l, namespace, k, res);
					};
					if (this.options.saveMissing) if (this.options.saveMissingPlurals && needsPluralHandling) lngs.forEach((language) => {
						const suffixes = this.pluralResolver.getSuffixes(language, opt);
						if (needsZeroSuffixLookup && opt[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) suffixes.push(`${this.options.pluralSeparator}zero`);
						suffixes.forEach((suffix) => {
							send([language], key + suffix, opt[`defaultValue${suffix}`] || defaultValue);
						});
					});
					else send(lngs, key, defaultValue);
				}
				res = this.extendTranslation(res, keys, opt, resolved, lastKey);
				if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}${nsSeparator}${key}`;
				if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : void 0, opt);
			}
			if (returnDetails) {
				resolved.res = res;
				resolved.usedParams = this.getUsedParamsDetails(opt);
				return resolved;
			}
			return res;
		}
		extendTranslation(res, key, opt, resolved, lastKey) {
			if (this.i18nFormat?.parse) res = this.i18nFormat.parse(res, {
				...this.options.interpolation.defaultVariables,
				...opt
			}, opt.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, { resolved });
			else if (!opt.skipInterpolation) {
				if (opt.interpolation) this.interpolator.init({
					...opt,
					interpolation: {
						...this.options.interpolation,
						...opt.interpolation
					}
				});
				const skipOnVariables = isString$2(res) && (opt?.interpolation?.skipOnVariables !== void 0 ? opt.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
				let nestBef;
				if (skipOnVariables) {
					const nb = res.match(this.interpolator.nestingRegexp);
					nestBef = nb && nb.length;
				}
				let data = opt.replace && !isString$2(opt.replace) ? opt.replace : opt;
				if (this.options.interpolation.defaultVariables) data = {
					...this.options.interpolation.defaultVariables,
					...data
				};
				res = this.interpolator.interpolate(res, data, opt.lng || this.language || resolved.usedLng, opt);
				if (skipOnVariables) {
					const na = res.match(this.interpolator.nestingRegexp);
					const nestAft = na && na.length;
					if (nestBef < nestAft) opt.nest = false;
				}
				if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
				if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {
					if (lastKey?.[0] === args[0] && !opt.context) {
						this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
						return null;
					}
					return this.translate(...args, key);
				}, opt);
				if (opt.interpolation) this.interpolator.reset();
			}
			const postProcess = opt.postProcess || this.options.postProcess;
			const postProcessorNames = isString$2(postProcess) ? [postProcess] : postProcess;
			if (res != null && postProcessorNames?.length && opt.applyPostProcessor !== false) res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
				i18nResolved: {
					...resolved,
					usedParams: this.getUsedParamsDetails(opt)
				},
				...opt
			} : opt, this);
			return res;
		}
		resolve(keys, opt = {}) {
			let found;
			let usedKey;
			let exactUsedKey;
			let usedLng;
			let usedNS;
			if (isString$2(keys)) keys = [keys];
			if (Array.isArray(keys)) keys = keys.map((k) => typeof k === "function" ? keysFromSelector(k, {
				...this.options,
				...opt
			}) : k);
			keys.forEach((k) => {
				if (this.isValidLookup(found)) return;
				const extracted = this.extractFromKey(k, opt);
				const key = extracted.key;
				usedKey = key;
				let namespaces = extracted.namespaces;
				if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
				const needsPluralHandling = opt.count !== void 0 && !isString$2(opt.count);
				const needsZeroSuffixLookup = needsPluralHandling && !opt.ordinal && opt.count === 0;
				const needsContextHandling = opt.context !== void 0 && (isString$2(opt.context) || typeof opt.context === "number") && opt.context !== "";
				const codes = opt.lngs ? opt.lngs : this.languageUtils.toResolveHierarchy(opt.lng || this.language, opt.fallbackLng);
				namespaces.forEach((ns) => {
					if (this.isValidLookup(found)) return;
					usedNS = ns;
					if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
						checkedLoadedFor[`${codes[0]}-${ns}`] = true;
						this.logger.warn(`key "${usedKey}" for languages "${codes.join(", ")}" won't get resolved as namespace "${usedNS}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
					}
					codes.forEach((code) => {
						if (this.isValidLookup(found)) return;
						usedLng = code;
						const finalKeys = [key];
						if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, opt);
						else {
							let pluralSuffix;
							if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, opt.count, opt);
							const zeroSuffix = `${this.options.pluralSeparator}zero`;
							const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
							if (needsPluralHandling) {
								if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
								finalKeys.push(key + pluralSuffix);
								if (needsZeroSuffixLookup) finalKeys.push(key + zeroSuffix);
							}
							if (needsContextHandling) {
								const contextKey = `${key}${this.options.contextSeparator || "_"}${opt.context}`;
								finalKeys.push(contextKey);
								if (needsPluralHandling) {
									if (opt.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));
									finalKeys.push(contextKey + pluralSuffix);
									if (needsZeroSuffixLookup) finalKeys.push(contextKey + zeroSuffix);
								}
							}
						}
						let possibleKey;
						while (possibleKey = finalKeys.pop()) if (!this.isValidLookup(found)) {
							exactUsedKey = possibleKey;
							found = this.getResource(code, ns, possibleKey, opt);
						}
					});
				});
			});
			return {
				res: found,
				usedKey,
				exactUsedKey,
				usedLng,
				usedNS
			};
		}
		isValidLookup(res) {
			return res !== void 0 && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === "");
		}
		getResource(code, ns, key, options = {}) {
			if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
			return this.resourceStore.getResource(code, ns, key, options);
		}
		getUsedParamsDetails(options = {}) {
			const optionsKeys = [
				"defaultValue",
				"ordinal",
				"context",
				"replace",
				"lng",
				"lngs",
				"fallbackLng",
				"ns",
				"keySeparator",
				"nsSeparator",
				"returnObjects",
				"returnDetails",
				"joinArrays",
				"postProcess",
				"interpolation"
			];
			const useOptionsReplaceForData = options.replace && !isString$2(options.replace);
			let data = useOptionsReplaceForData ? options.replace : options;
			if (useOptionsReplaceForData && typeof options.count !== "undefined") data.count = options.count;
			if (this.options.interpolation.defaultVariables) data = {
				...this.options.interpolation.defaultVariables,
				...data
			};
			if (!useOptionsReplaceForData) {
				data = { ...data };
				for (const key of optionsKeys) delete data[key];
			}
			return data;
		}
		static hasDefaultValue(options) {
			const prefix = "defaultValue";
			for (const option in options) if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, 12) && void 0 !== options[option]) return true;
			return false;
		}
	};
	var LanguageUtil = class {
		constructor(options) {
			this.options = options;
			this.supportedLngs = this.options.supportedLngs || false;
			this.logger = baseLogger.create("languageUtils");
		}
		getScriptPartFromCode(code) {
			code = getCleanedCode(code);
			if (!code || code.indexOf("-") < 0) return null;
			const p = code.split("-");
			if (p.length === 2) return null;
			p.pop();
			if (p[p.length - 1].toLowerCase() === "x") return null;
			return this.formatLanguageCode(p.join("-"));
		}
		getLanguagePartFromCode(code) {
			code = getCleanedCode(code);
			if (!code || code.indexOf("-") < 0) return code;
			const p = code.split("-");
			return this.formatLanguageCode(p[0]);
		}
		formatLanguageCode(code) {
			if (isString$2(code) && code.indexOf("-") > -1) {
				let formattedCode;
				try {
					formattedCode = Intl.getCanonicalLocales(code)[0];
				} catch (e) {}
				if (formattedCode && this.options.lowerCaseLng) formattedCode = formattedCode.toLowerCase();
				if (formattedCode) return formattedCode;
				if (this.options.lowerCaseLng) return code.toLowerCase();
				return code;
			}
			return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
		}
		isSupportedCode(code) {
			if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) code = this.getLanguagePartFromCode(code);
			return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
		}
		getBestMatchFromCodes(codes) {
			if (!codes) return null;
			let found;
			codes.forEach((code) => {
				if (found) return;
				const cleanedLng = this.formatLanguageCode(code);
				if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;
			});
			if (!found && this.options.supportedLngs) codes.forEach((code) => {
				if (found) return;
				const lngScOnly = this.getScriptPartFromCode(code);
				if (this.isSupportedCode(lngScOnly)) return found = lngScOnly;
				const lngOnly = this.getLanguagePartFromCode(code);
				if (this.isSupportedCode(lngOnly)) return found = lngOnly;
				found = this.options.supportedLngs.find((supportedLng) => {
					if (supportedLng === lngOnly) return supportedLng;
					if (supportedLng.indexOf("-") < 0 && lngOnly.indexOf("-") < 0) return;
					if (supportedLng.indexOf("-") > 0 && lngOnly.indexOf("-") < 0 && supportedLng.substring(0, supportedLng.indexOf("-")) === lngOnly) return supportedLng;
					if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;
				});
			});
			if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
			return found;
		}
		getFallbackCodes(fallbacks, code) {
			if (!fallbacks) return [];
			if (typeof fallbacks === "function") fallbacks = fallbacks(code);
			if (isString$2(fallbacks)) fallbacks = [fallbacks];
			if (Array.isArray(fallbacks)) return fallbacks;
			if (!code) return fallbacks.default || [];
			let found = fallbacks[code];
			if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
			if (!found) found = fallbacks[this.formatLanguageCode(code)];
			if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
			if (!found) found = fallbacks.default;
			return found || [];
		}
		toResolveHierarchy(code, fallbackCode) {
			const fallbackCodes = this.getFallbackCodes((fallbackCode === false ? [] : fallbackCode) || this.options.fallbackLng || [], code);
			const codes = [];
			const addCode = (c) => {
				if (!c) return;
				if (this.isSupportedCode(c)) codes.push(c);
				else this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);
			};
			if (isString$2(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) {
				if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code));
				if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code));
				if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code));
			} else if (isString$2(code)) addCode(this.formatLanguageCode(code));
			fallbackCodes.forEach((fc) => {
				if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));
			});
			return codes;
		}
	};
	var suffixesOrder = {
		zero: 0,
		one: 1,
		two: 2,
		few: 3,
		many: 4,
		other: 5
	};
	var dummyRule = {
		select: (count) => count === 1 ? "one" : "other",
		resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
	};
	var PluralResolver = class {
		constructor(languageUtils, options = {}) {
			this.languageUtils = languageUtils;
			this.options = options;
			this.logger = baseLogger.create("pluralResolver");
			this.pluralRulesCache = {};
		}
		clearCache() {
			this.pluralRulesCache = {};
		}
		getRule(code, options = {}) {
			const cleanedCode = getCleanedCode(code === "dev" ? "en" : code);
			const type = options.ordinal ? "ordinal" : "cardinal";
			const cacheKey = JSON.stringify({
				cleanedCode,
				type
			});
			if (cacheKey in this.pluralRulesCache) return this.pluralRulesCache[cacheKey];
			let rule;
			try {
				rule = new Intl.PluralRules(cleanedCode, { type });
			} catch (err) {
				if (typeof Intl === "undefined") {
					this.logger.error("No Intl support, please use an Intl polyfill!");
					return dummyRule;
				}
				if (!code.match(/-|_/)) return dummyRule;
				const lngPart = this.languageUtils.getLanguagePartFromCode(code);
				rule = this.getRule(lngPart, options);
			}
			this.pluralRulesCache[cacheKey] = rule;
			return rule;
		}
		needsPlural(code, options = {}) {
			let rule = this.getRule(code, options);
			if (!rule) rule = this.getRule("dev", options);
			return rule?.resolvedOptions().pluralCategories.length > 1;
		}
		getPluralFormsOfKey(code, key, options = {}) {
			return this.getSuffixes(code, options).map((suffix) => `${key}${suffix}`);
		}
		getSuffixes(code, options = {}) {
			let rule = this.getRule(code, options);
			if (!rule) rule = this.getRule("dev", options);
			if (!rule) return [];
			return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map((pluralCategory) => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${pluralCategory}`);
		}
		getSuffix(code, count, options = {}) {
			const rule = this.getRule(code, options);
			if (rule) return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ""}${rule.select(count)}`;
			this.logger.warn(`no plural rule found for: ${code}`);
			return this.getSuffix("dev", count, options);
		}
	};
	var deepFindWithDefaults = (data, defaultData, key, keySeparator = ".", ignoreJSONStructure = true) => {
		let path = getPathWithDefaults(data, defaultData, key);
		if (!path && ignoreJSONStructure && isString$2(key)) {
			path = deepFind(data, key, keySeparator);
			if (path === void 0) path = deepFind(defaultData, key, keySeparator);
		}
		return path;
	};
	var regexSafe = (val) => val.replace(/\$/g, "$$$$");
	var Interpolator = class {
		constructor(options = {}) {
			this.logger = baseLogger.create("interpolator");
			this.options = options;
			this.format = options?.interpolation?.format || ((value) => value);
			this.init(options);
		}
		init(options = {}) {
			if (!options.interpolation) options.interpolation = { escapeValue: true };
			const { escape: escape$1, escapeValue, useRawValueToEscape, prefix, prefixEscaped, suffix, suffixEscaped, formatSeparator, unescapeSuffix, unescapePrefix, nestingPrefix, nestingPrefixEscaped, nestingSuffix, nestingSuffixEscaped, nestingOptionsSeparator, maxReplaces, alwaysFormat } = options.interpolation;
			this.escape = escape$1 !== void 0 ? escape$1 : escape;
			this.escapeValue = escapeValue !== void 0 ? escapeValue : true;
			this.useRawValueToEscape = useRawValueToEscape !== void 0 ? useRawValueToEscape : false;
			this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || "{{";
			this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || "}}";
			this.formatSeparator = formatSeparator || ",";
			this.unescapePrefix = unescapeSuffix ? "" : unescapePrefix || "-";
			this.unescapeSuffix = this.unescapePrefix ? "" : unescapeSuffix || "";
			this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape("$t(");
			this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(")");
			this.nestingOptionsSeparator = nestingOptionsSeparator || ",";
			this.maxReplaces = maxReplaces || 1e3;
			this.alwaysFormat = alwaysFormat !== void 0 ? alwaysFormat : false;
			this.resetRegExp();
		}
		reset() {
			if (this.options) this.init(this.options);
		}
		resetRegExp() {
			const getOrResetRegExp = (existingRegExp, pattern) => {
				if (existingRegExp?.source === pattern) {
					existingRegExp.lastIndex = 0;
					return existingRegExp;
				}
				return new RegExp(pattern, "g");
			};
			this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);
			this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);
			this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
		}
		interpolate(str, data, lng, options) {
			let match;
			let value;
			let replaces;
			const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
			const handleFormat = (key) => {
				if (key.indexOf(this.formatSeparator) < 0) {
					const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);
					return this.alwaysFormat ? this.format(path, void 0, lng, {
						...options,
						...data,
						interpolationkey: key
					}) : path;
				}
				const p = key.split(this.formatSeparator);
				const k = p.shift().trim();
				const f = p.join(this.formatSeparator).trim();
				return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {
					...options,
					...data,
					interpolationkey: k
				});
			};
			this.resetRegExp();
			const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
			const skipOnVariables = options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
			[{
				regex: this.regexpUnescape,
				safeValue: (val) => regexSafe(val)
			}, {
				regex: this.regexp,
				safeValue: (val) => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)
			}].forEach((todo) => {
				replaces = 0;
				while (match = todo.regex.exec(str)) {
					const matchedVar = match[1].trim();
					value = handleFormat(matchedVar);
					if (value === void 0) if (typeof missingInterpolationHandler === "function") {
						const temp = missingInterpolationHandler(str, match, options);
						value = isString$2(temp) ? temp : "";
					} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) value = "";
					else if (skipOnVariables) {
						value = match[0];
						continue;
					} else {
						this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
						value = "";
					}
					else if (!isString$2(value) && !this.useRawValueToEscape) value = makeString(value);
					const safeValue = todo.safeValue(value);
					str = str.replace(match[0], safeValue);
					if (skipOnVariables) {
						todo.regex.lastIndex += value.length;
						todo.regex.lastIndex -= match[0].length;
					} else todo.regex.lastIndex = 0;
					replaces++;
					if (replaces >= this.maxReplaces) break;
				}
			});
			return str;
		}
		nest(str, fc, options = {}) {
			let match;
			let value;
			let clonedOptions;
			const handleHasOptions = (key, inheritedOptions) => {
				const sep = this.nestingOptionsSeparator;
				if (key.indexOf(sep) < 0) return key;
				const c = key.split(new RegExp(`${regexEscape(sep)}[ ]*{`));
				let optionsString = `{${c[1]}`;
				key = c[0];
				optionsString = this.interpolate(optionsString, clonedOptions);
				const matchedSingleQuotes = optionsString.match(/'/g);
				const matchedDoubleQuotes = optionsString.match(/"/g);
				if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || (matchedDoubleQuotes?.length ?? 0) % 2 !== 0) optionsString = optionsString.replace(/'/g, "\"");
				try {
					clonedOptions = JSON.parse(optionsString);
					if (inheritedOptions) clonedOptions = {
						...inheritedOptions,
						...clonedOptions
					};
				} catch (e) {
					this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);
					return `${key}${sep}${optionsString}`;
				}
				if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;
				return key;
			};
			while (match = this.nestingRegexp.exec(str)) {
				let formatters = [];
				clonedOptions = { ...options };
				clonedOptions = clonedOptions.replace && !isString$2(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
				clonedOptions.applyPostProcessor = false;
				delete clonedOptions.defaultValue;
				const keyEndIndex = /{.*}/.test(match[1]) ? match[1].lastIndexOf("}") + 1 : match[1].indexOf(this.formatSeparator);
				if (keyEndIndex !== -1) {
					formatters = match[1].slice(keyEndIndex).split(this.formatSeparator).map((elem) => elem.trim()).filter(Boolean);
					match[1] = match[1].slice(0, keyEndIndex);
				}
				value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
				if (value && match[0] === str && !isString$2(value)) return value;
				if (!isString$2(value)) value = makeString(value);
				if (!value) {
					this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);
					value = "";
				}
				if (formatters.length) value = formatters.reduce((v, f) => this.format(v, f, options.lng, {
					...options,
					interpolationkey: match[1].trim()
				}), value.trim());
				str = str.replace(match[0], value);
				this.regexp.lastIndex = 0;
			}
			return str;
		}
	};
	var parseFormatStr = (formatStr) => {
		let formatName = formatStr.toLowerCase().trim();
		const formatOptions = {};
		if (formatStr.indexOf("(") > -1) {
			const p = formatStr.split("(");
			formatName = p[0].toLowerCase().trim();
			const optStr = p[1].substring(0, p[1].length - 1);
			if (formatName === "currency" && optStr.indexOf(":") < 0) {
				if (!formatOptions.currency) formatOptions.currency = optStr.trim();
			} else if (formatName === "relativetime" && optStr.indexOf(":") < 0) {
				if (!formatOptions.range) formatOptions.range = optStr.trim();
			} else optStr.split(";").forEach((opt) => {
				if (opt) {
					const [key, ...rest] = opt.split(":");
					const val = rest.join(":").trim().replace(/^'+|'+$/g, "");
					const trimmedKey = key.trim();
					if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;
					if (val === "false") formatOptions[trimmedKey] = false;
					if (val === "true") formatOptions[trimmedKey] = true;
					if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);
				}
			});
		}
		return {
			formatName,
			formatOptions
		};
	};
	var createCachedFormatter = (fn) => {
		const cache = {};
		return (v, l, o) => {
			let optForCache = o;
			if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) optForCache = {
				...optForCache,
				[o.interpolationkey]: void 0
			};
			const key = l + JSON.stringify(optForCache);
			let frm = cache[key];
			if (!frm) {
				frm = fn(getCleanedCode(l), o);
				cache[key] = frm;
			}
			return frm(v);
		};
	};
	var createNonCachedFormatter = (fn) => (v, l, o) => fn(getCleanedCode(l), o)(v);
	var Formatter = class {
		constructor(options = {}) {
			this.logger = baseLogger.create("formatter");
			this.options = options;
			this.init(options);
		}
		init(services, options = { interpolation: {} }) {
			this.formatSeparator = options.interpolation.formatSeparator || ",";
			const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;
			this.formats = {
				number: cf((lng, opt) => {
					const formatter = new Intl.NumberFormat(lng, { ...opt });
					return (val) => formatter.format(val);
				}),
				currency: cf((lng, opt) => {
					const formatter = new Intl.NumberFormat(lng, {
						...opt,
						style: "currency"
					});
					return (val) => formatter.format(val);
				}),
				datetime: cf((lng, opt) => {
					const formatter = new Intl.DateTimeFormat(lng, { ...opt });
					return (val) => formatter.format(val);
				}),
				relativetime: cf((lng, opt) => {
					const formatter = new Intl.RelativeTimeFormat(lng, { ...opt });
					return (val) => formatter.format(val, opt.range || "day");
				}),
				list: cf((lng, opt) => {
					const formatter = new Intl.ListFormat(lng, { ...opt });
					return (val) => formatter.format(val);
				})
			};
		}
		add(name, fc) {
			this.formats[name.toLowerCase().trim()] = fc;
		}
		addCached(name, fc) {
			this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
		}
		format(value, format, lng, options = {}) {
			const formats = format.split(this.formatSeparator);
			if (formats.length > 1 && formats[0].indexOf("(") > 1 && formats[0].indexOf(")") < 0 && formats.find((f) => f.indexOf(")") > -1)) {
				const lastIndex = formats.findIndex((f) => f.indexOf(")") > -1);
				formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);
			}
			return formats.reduce((mem, f) => {
				const { formatName, formatOptions } = parseFormatStr(f);
				if (this.formats[formatName]) {
					let formatted = mem;
					try {
						const valOptions = options?.formatParams?.[options.interpolationkey] || {};
						const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
						formatted = this.formats[formatName](mem, l, {
							...formatOptions,
							...options,
							...valOptions
						});
					} catch (error) {
						this.logger.warn(error);
					}
					return formatted;
				} else this.logger.warn(`there was no format function for ${formatName}`);
				return mem;
			}, value);
		}
	};
	var removePending = (q, name) => {
		if (q.pending[name] !== void 0) {
			delete q.pending[name];
			q.pendingCount--;
		}
	};
	var Connector = class extends EventEmitter {
		constructor(backend, store, services, options = {}) {
			super();
			this.backend = backend;
			this.store = store;
			this.services = services;
			this.languageUtils = services.languageUtils;
			this.options = options;
			this.logger = baseLogger.create("backendConnector");
			this.waitingReads = [];
			this.maxParallelReads = options.maxParallelReads || 10;
			this.readingCalls = 0;
			this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;
			this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
			this.state = {};
			this.queue = [];
			this.backend?.init?.(services, options.backend, options);
		}
		queueLoad(languages, namespaces, options, callback) {
			const toLoad = {};
			const pending = {};
			const toLoadLanguages = {};
			const toLoadNamespaces = {};
			languages.forEach((lng) => {
				let hasAllNamespaces = true;
				namespaces.forEach((ns) => {
					const name = `${lng}|${ns}`;
					if (!options.reload && this.store.hasResourceBundle(lng, ns)) this.state[name] = 2;
					else if (this.state[name] < 0);
					else if (this.state[name] === 1) {
						if (pending[name] === void 0) pending[name] = true;
					} else {
						this.state[name] = 1;
						hasAllNamespaces = false;
						if (pending[name] === void 0) pending[name] = true;
						if (toLoad[name] === void 0) toLoad[name] = true;
						if (toLoadNamespaces[ns] === void 0) toLoadNamespaces[ns] = true;
					}
				});
				if (!hasAllNamespaces) toLoadLanguages[lng] = true;
			});
			if (Object.keys(toLoad).length || Object.keys(pending).length) this.queue.push({
				pending,
				pendingCount: Object.keys(pending).length,
				loaded: {},
				errors: [],
				callback
			});
			return {
				toLoad: Object.keys(toLoad),
				pending: Object.keys(pending),
				toLoadLanguages: Object.keys(toLoadLanguages),
				toLoadNamespaces: Object.keys(toLoadNamespaces)
			};
		}
		loaded(name, err, data) {
			const s = name.split("|");
			const lng = s[0];
			const ns = s[1];
			if (err) this.emit("failedLoading", lng, ns, err);
			if (!err && data) this.store.addResourceBundle(lng, ns, data, void 0, void 0, { skipCopy: true });
			this.state[name] = err ? -1 : 2;
			if (err && data) this.state[name] = 0;
			const loaded = {};
			this.queue.forEach((q) => {
				pushPath(q.loaded, [lng], ns);
				removePending(q, name);
				if (err) q.errors.push(err);
				if (q.pendingCount === 0 && !q.done) {
					Object.keys(q.loaded).forEach((l) => {
						if (!loaded[l]) loaded[l] = {};
						const loadedKeys = q.loaded[l];
						if (loadedKeys.length) loadedKeys.forEach((n) => {
							if (loaded[l][n] === void 0) loaded[l][n] = true;
						});
					});
					q.done = true;
					if (q.errors.length) q.callback(q.errors);
					else q.callback();
				}
			});
			this.emit("loaded", loaded);
			this.queue = this.queue.filter((q) => !q.done);
		}
		read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {
			if (!lng.length) return callback(null, {});
			if (this.readingCalls >= this.maxParallelReads) {
				this.waitingReads.push({
					lng,
					ns,
					fcName,
					tried,
					wait,
					callback
				});
				return;
			}
			this.readingCalls++;
			const resolver = (err, data) => {
				this.readingCalls--;
				if (this.waitingReads.length > 0) {
					const next = this.waitingReads.shift();
					this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);
				}
				if (err && data && tried < this.maxRetries) {
					setTimeout(() => {
						this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);
					}, wait);
					return;
				}
				callback(err, data);
			};
			const fc = this.backend[fcName].bind(this.backend);
			if (fc.length === 2) {
				try {
					const r = fc(lng, ns);
					if (r && typeof r.then === "function") r.then((data) => resolver(null, data)).catch(resolver);
					else resolver(null, r);
				} catch (err) {
					resolver(err);
				}
				return;
			}
			return fc(lng, ns, resolver);
		}
		prepareLoading(languages, namespaces, options = {}, callback) {
			if (!this.backend) {
				this.logger.warn("No backend was added via i18next.use. Will not load resources.");
				return callback && callback();
			}
			if (isString$2(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
			if (isString$2(namespaces)) namespaces = [namespaces];
			const toLoad = this.queueLoad(languages, namespaces, options, callback);
			if (!toLoad.toLoad.length) {
				if (!toLoad.pending.length) callback();
				return null;
			}
			toLoad.toLoad.forEach((name) => {
				this.loadOne(name);
			});
		}
		load(languages, namespaces, callback) {
			this.prepareLoading(languages, namespaces, {}, callback);
		}
		reload(languages, namespaces, callback) {
			this.prepareLoading(languages, namespaces, { reload: true }, callback);
		}
		loadOne(name, prefix = "") {
			const s = name.split("|");
			const lng = s[0];
			const ns = s[1];
			this.read(lng, ns, "read", void 0, void 0, (err, data) => {
				if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);
				if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);
				this.loaded(name, err, data);
			});
		}
		saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {}) {
			if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
				this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
				return;
			}
			if (key === void 0 || key === null || key === "") return;
			if (this.backend?.create) {
				const opts = {
					...options,
					isUpdate
				};
				const fc = this.backend.create.bind(this.backend);
				if (fc.length < 6) try {
					let r;
					if (fc.length === 5) r = fc(languages, namespace, key, fallbackValue, opts);
					else r = fc(languages, namespace, key, fallbackValue);
					if (r && typeof r.then === "function") r.then((data) => clb(null, data)).catch(clb);
					else clb(null, r);
				} catch (err) {
					clb(err);
				}
				else fc(languages, namespace, key, fallbackValue, clb, opts);
			}
			if (!languages || !languages[0]) return;
			this.store.addResource(languages[0], namespace, key, fallbackValue);
		}
	};
	var get$3 = () => ({
		debug: false,
		initAsync: true,
		ns: ["translation"],
		defaultNS: ["translation"],
		fallbackLng: ["dev"],
		fallbackNS: false,
		supportedLngs: false,
		nonExplicitSupportedLngs: false,
		load: "all",
		preload: false,
		simplifyPluralSuffix: true,
		keySeparator: ".",
		nsSeparator: ":",
		pluralSeparator: "_",
		contextSeparator: "_",
		partialBundledLanguages: false,
		saveMissing: false,
		updateMissing: false,
		saveMissingTo: "fallback",
		saveMissingPlurals: true,
		missingKeyHandler: false,
		missingInterpolationHandler: false,
		postProcess: false,
		postProcessPassResolved: false,
		returnNull: false,
		returnEmptyString: true,
		returnObjects: false,
		joinArrays: false,
		returnedObjectHandler: false,
		parseMissingKeyHandler: false,
		appendNamespaceToMissingKey: false,
		appendNamespaceToCIMode: false,
		overloadTranslationOptionHandler: (args) => {
			let ret = {};
			if (typeof args[1] === "object") ret = args[1];
			if (isString$2(args[1])) ret.defaultValue = args[1];
			if (isString$2(args[2])) ret.tDescription = args[2];
			if (typeof args[2] === "object" || typeof args[3] === "object") {
				const options = args[3] || args[2];
				Object.keys(options).forEach((key) => {
					ret[key] = options[key];
				});
			}
			return ret;
		},
		interpolation: {
			escapeValue: true,
			format: (value) => value,
			prefix: "{{",
			suffix: "}}",
			formatSeparator: ",",
			unescapePrefix: "-",
			nestingPrefix: "$t(",
			nestingSuffix: ")",
			nestingOptionsSeparator: ",",
			maxReplaces: 1e3,
			skipOnVariables: true
		},
		cacheInBuiltFormats: true
	});
	var transformOptions = (options) => {
		if (isString$2(options.ns)) options.ns = [options.ns];
		if (isString$2(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
		if (isString$2(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
		if (options.supportedLngs?.indexOf?.("cimode") < 0) options.supportedLngs = options.supportedLngs.concat(["cimode"]);
		if (typeof options.initImmediate === "boolean") options.initAsync = options.initImmediate;
		return options;
	};
	var noop = () => {};
	var bindMemberFunctions = (inst) => {
		Object.getOwnPropertyNames(Object.getPrototypeOf(inst)).forEach((mem) => {
			if (typeof inst[mem] === "function") inst[mem] = inst[mem].bind(inst);
		});
	};
	var SUPPORT_NOTICE_KEY = "__i18next_supportNoticeShown";
	var getSupportNoticeShown = () => {
		if (typeof globalThis !== "undefined" && !!globalThis[SUPPORT_NOTICE_KEY]) return true;
		if (typeof process$1 !== "undefined" && {}.I18NEXT_NO_SUPPORT_NOTICE) return true;
		if (typeof process$1 !== "undefined" && process$1.env.NODE_ENV === "production") return true;
		return false;
	};
	var setSupportNoticeShown = () => {
		if (typeof globalThis !== "undefined") globalThis[SUPPORT_NOTICE_KEY] = true;
	};
	var usesLocize = (inst) => {
		if (inst?.modules?.backend?.name?.indexOf("Locize") > 0) return true;
		if (inst?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0) return true;
		if (inst?.options?.backend?.backends) {
			if (inst.options.backend.backends.some((b) => b?.name?.indexOf("Locize") > 0 || b?.constructor?.name?.indexOf("Locize") > 0)) return true;
		}
		if (inst?.options?.backend?.projectId) return true;
		if (inst?.options?.backend?.backendOptions) {
			if (inst.options.backend.backendOptions.some((b) => b?.projectId)) return true;
		}
		return false;
	};
	var instance = class I18n extends EventEmitter {
		constructor(options = {}, callback) {
			super();
			this.options = transformOptions(options);
			this.services = {};
			this.logger = baseLogger;
			this.modules = { external: [] };
			bindMemberFunctions(this);
			if (callback && !this.isInitialized && !options.isClone) {
				if (!this.options.initAsync) {
					this.init(options, callback);
					return this;
				}
				setTimeout(() => {
					this.init(options, callback);
				}, 0);
			}
		}
		init(options = {}, callback) {
			this.isInitializing = true;
			if (typeof options === "function") {
				callback = options;
				options = {};
			}
			if (options.defaultNS == null && options.ns) {
				if (isString$2(options.ns)) options.defaultNS = options.ns;
				else if (options.ns.indexOf("translation") < 0) options.defaultNS = options.ns[0];
			}
			const defOpts = get$3();
			this.options = {
				...defOpts,
				...this.options,
				...transformOptions(options)
			};
			this.options.interpolation = {
				...defOpts.interpolation,
				...this.options.interpolation
			};
			if (options.keySeparator !== void 0) this.options.userDefinedKeySeparator = options.keySeparator;
			if (options.nsSeparator !== void 0) this.options.userDefinedNsSeparator = options.nsSeparator;
			if (typeof this.options.overloadTranslationOptionHandler !== "function") this.options.overloadTranslationOptionHandler = defOpts.overloadTranslationOptionHandler;
			if (this.options.showSupportNotice !== false && !usesLocize(this) && !getSupportNoticeShown()) {
				if (typeof console !== "undefined" && typeof console.info !== "undefined") console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");
				setSupportNoticeShown();
			}
			const createClassOnDemand = (ClassOrObject) => {
				if (!ClassOrObject) return null;
				if (typeof ClassOrObject === "function") return new ClassOrObject();
				return ClassOrObject;
			};
			if (!this.options.isClone) {
				if (this.modules.logger) baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
				else baseLogger.init(null, this.options);
				let formatter;
				if (this.modules.formatter) formatter = this.modules.formatter;
				else formatter = Formatter;
				const lu = new LanguageUtil(this.options);
				this.store = new ResourceStore(this.options.resources, this.options);
				const s = this.services;
				s.logger = baseLogger;
				s.resourceStore = this.store;
				s.languageUtils = lu;
				s.pluralResolver = new PluralResolver(lu, {
					prepend: this.options.pluralSeparator,
					simplifyPluralSuffix: this.options.simplifyPluralSuffix
				});
				if (this.options.interpolation.format && this.options.interpolation.format !== defOpts.interpolation.format) this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`);
				if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
					s.formatter = createClassOnDemand(formatter);
					if (s.formatter.init) s.formatter.init(s, this.options);
					this.options.interpolation.format = s.formatter.format.bind(s.formatter);
				}
				s.interpolator = new Interpolator(this.options);
				s.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) };
				s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
				s.backendConnector.on("*", (event, ...args) => {
					this.emit(event, ...args);
				});
				if (this.modules.languageDetector) {
					s.languageDetector = createClassOnDemand(this.modules.languageDetector);
					if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);
				}
				if (this.modules.i18nFormat) {
					s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
					if (s.i18nFormat.init) s.i18nFormat.init(this);
				}
				this.translator = new Translator(this.services, this.options);
				this.translator.on("*", (event, ...args) => {
					this.emit(event, ...args);
				});
				this.modules.external.forEach((m) => {
					if (m.init) m.init(this);
				});
			}
			this.format = this.options.interpolation.format;
			if (!callback) callback = noop;
			if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
				const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
				if (codes.length > 0 && codes[0] !== "dev") this.options.lng = codes[0];
			}
			if (!this.services.languageDetector && !this.options.lng) this.logger.warn("init: no languageDetector is used and no lng is defined");
			[
				"getResource",
				"hasResourceBundle",
				"getResourceBundle",
				"getDataByLanguage"
			].forEach((fcName) => {
				this[fcName] = (...args) => this.store[fcName](...args);
			});
			[
				"addResource",
				"addResources",
				"addResourceBundle",
				"removeResourceBundle"
			].forEach((fcName) => {
				this[fcName] = (...args) => {
					this.store[fcName](...args);
					return this;
				};
			});
			const deferred = defer();
			const load = () => {
				const finish = (err, t) => {
					this.isInitializing = false;
					if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn("init: i18next is already initialized. You should call init just once!");
					this.isInitialized = true;
					if (!this.options.isClone) this.logger.log("initialized", this.options);
					this.emit("initialized", this.options);
					deferred.resolve(t);
					callback(err, t);
				};
				if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
				this.changeLanguage(this.options.lng, finish);
			};
			if (this.options.resources || !this.options.initAsync) load();
			else setTimeout(load, 0);
			return deferred;
		}
		loadResources(language, callback = noop) {
			let usedCallback = callback;
			const usedLng = isString$2(language) ? language : this.language;
			if (typeof language === "function") usedCallback = language;
			if (!this.options.resources || this.options.partialBundledLanguages) {
				if (usedLng?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
				const toLoad = [];
				const append = (lng) => {
					if (!lng) return;
					if (lng === "cimode") return;
					this.services.languageUtils.toResolveHierarchy(lng).forEach((l) => {
						if (l === "cimode") return;
						if (toLoad.indexOf(l) < 0) toLoad.push(l);
					});
				};
				if (!usedLng) this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l) => append(l));
				else append(usedLng);
				this.options.preload?.forEach?.((l) => append(l));
				this.services.backendConnector.load(toLoad, this.options.ns, (e) => {
					if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
					usedCallback(e);
				});
			} else usedCallback(null);
		}
		reloadResources(lngs, ns, callback) {
			const deferred = defer();
			if (typeof lngs === "function") {
				callback = lngs;
				lngs = void 0;
			}
			if (typeof ns === "function") {
				callback = ns;
				ns = void 0;
			}
			if (!lngs) lngs = this.languages;
			if (!ns) ns = this.options.ns;
			if (!callback) callback = noop;
			this.services.backendConnector.reload(lngs, ns, (err) => {
				deferred.resolve();
				callback(err);
			});
			return deferred;
		}
		use(module) {
			if (!module) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
			if (!module.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
			if (module.type === "backend") this.modules.backend = module;
			if (module.type === "logger" || module.log && module.warn && module.error) this.modules.logger = module;
			if (module.type === "languageDetector") this.modules.languageDetector = module;
			if (module.type === "i18nFormat") this.modules.i18nFormat = module;
			if (module.type === "postProcessor") postProcessor.addPostProcessor(module);
			if (module.type === "formatter") this.modules.formatter = module;
			if (module.type === "3rdParty") this.modules.external.push(module);
			return this;
		}
		setResolvedLanguage(l) {
			if (!l || !this.languages) return;
			if (["cimode", "dev"].indexOf(l) > -1) return;
			for (let li = 0; li < this.languages.length; li++) {
				const lngInLngs = this.languages[li];
				if (["cimode", "dev"].indexOf(lngInLngs) > -1) continue;
				if (this.store.hasLanguageSomeTranslations(lngInLngs)) {
					this.resolvedLanguage = lngInLngs;
					break;
				}
			}
			if (!this.resolvedLanguage && this.languages.indexOf(l) < 0 && this.store.hasLanguageSomeTranslations(l)) {
				this.resolvedLanguage = l;
				this.languages.unshift(l);
			}
		}
		changeLanguage(lng, callback) {
			this.isLanguageChangingTo = lng;
			const deferred = defer();
			this.emit("languageChanging", lng);
			const setLngProps = (l) => {
				this.language = l;
				this.languages = this.services.languageUtils.toResolveHierarchy(l);
				this.resolvedLanguage = void 0;
				this.setResolvedLanguage(l);
			};
			const done = (err, l) => {
				if (l) {
					if (this.isLanguageChangingTo === lng) {
						setLngProps(l);
						this.translator.changeLanguage(l);
						this.isLanguageChangingTo = void 0;
						this.emit("languageChanged", l);
						this.logger.log("languageChanged", l);
					}
				} else this.isLanguageChangingTo = void 0;
				deferred.resolve((...args) => this.t(...args));
				if (callback) callback(err, (...args) => this.t(...args));
			};
			const setLng = (lngs) => {
				if (!lng && !lngs && this.services.languageDetector) lngs = [];
				const fl = isString$2(lngs) ? lngs : lngs && lngs[0];
				const l = this.store.hasLanguageSomeTranslations(fl) ? fl : this.services.languageUtils.getBestMatchFromCodes(isString$2(lngs) ? [lngs] : lngs);
				if (l) {
					if (!this.language) setLngProps(l);
					if (!this.translator.language) this.translator.changeLanguage(l);
					this.services.languageDetector?.cacheUserLanguage?.(l);
				}
				this.loadResources(l, (err) => {
					done(err, l);
				});
			};
			if (!lng && this.services.languageDetector && !this.services.languageDetector.async) setLng(this.services.languageDetector.detect());
			else if (!lng && this.services.languageDetector && this.services.languageDetector.async) if (this.services.languageDetector.detect.length === 0) this.services.languageDetector.detect().then(setLng);
			else this.services.languageDetector.detect(setLng);
			else setLng(lng);
			return deferred;
		}
		getFixedT(lng, ns, keyPrefix) {
			const fixedT = (key, opts, ...rest) => {
				let o;
				if (typeof opts !== "object") o = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));
				else o = { ...opts };
				o.lng = o.lng || fixedT.lng;
				o.lngs = o.lngs || fixedT.lngs;
				o.ns = o.ns || fixedT.ns;
				if (o.keyPrefix !== "") o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
				const selectorOpts = {
					...this.options,
					...o
				};
				if (typeof o.keyPrefix === "function") o.keyPrefix = keysFromSelector(o.keyPrefix, selectorOpts);
				const keySeparator = this.options.keySeparator || ".";
				let resultKey;
				if (o.keyPrefix && Array.isArray(key)) resultKey = key.map((k) => {
					if (typeof k === "function") k = keysFromSelector(k, selectorOpts);
					return `${o.keyPrefix}${keySeparator}${k}`;
				});
				else {
					if (typeof key === "function") key = keysFromSelector(key, selectorOpts);
					resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
				}
				return this.t(resultKey, o);
			};
			if (isString$2(lng)) fixedT.lng = lng;
			else fixedT.lngs = lng;
			fixedT.ns = ns;
			fixedT.keyPrefix = keyPrefix;
			return fixedT;
		}
		t(...args) {
			return this.translator?.translate(...args);
		}
		exists(...args) {
			return this.translator?.exists(...args);
		}
		setDefaultNamespace(ns) {
			this.options.defaultNS = ns;
		}
		hasLoadedNamespace(ns, options = {}) {
			if (!this.isInitialized) {
				this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages);
				return false;
			}
			if (!this.languages || !this.languages.length) {
				this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages);
				return false;
			}
			const lng = options.lng || this.resolvedLanguage || this.languages[0];
			const fallbackLng = this.options ? this.options.fallbackLng : false;
			const lastLng = this.languages[this.languages.length - 1];
			if (lng.toLowerCase() === "cimode") return true;
			const loadNotPending = (l, n) => {
				const loadState = this.services.backendConnector.state[`${l}|${n}`];
				return loadState === -1 || loadState === 0 || loadState === 2;
			};
			if (options.precheck) {
				const preResult = options.precheck(this, loadNotPending);
				if (preResult !== void 0) return preResult;
			}
			if (this.hasResourceBundle(lng, ns)) return true;
			if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;
			if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
			return false;
		}
		loadNamespaces(ns, callback) {
			const deferred = defer();
			if (!this.options.ns) {
				if (callback) callback();
				return Promise.resolve();
			}
			if (isString$2(ns)) ns = [ns];
			ns.forEach((n) => {
				if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
			});
			this.loadResources((err) => {
				deferred.resolve();
				if (callback) callback(err);
			});
			return deferred;
		}
		loadLanguages(lngs, callback) {
			const deferred = defer();
			if (isString$2(lngs)) lngs = [lngs];
			const preloaded = this.options.preload || [];
			const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
			if (!newLngs.length) {
				if (callback) callback();
				return Promise.resolve();
			}
			this.options.preload = preloaded.concat(newLngs);
			this.loadResources((err) => {
				deferred.resolve();
				if (callback) callback(err);
			});
			return deferred;
		}
		dir(lng) {
			if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
			if (!lng) return "rtl";
			try {
				const l = new Intl.Locale(lng);
				if (l && l.getTextInfo) {
					const ti = l.getTextInfo();
					if (ti && ti.direction) return ti.direction;
				}
			} catch (e) {}
			const rtlLngs = [
				"ar",
				"shu",
				"sqr",
				"ssh",
				"xaa",
				"yhd",
				"yud",
				"aao",
				"abh",
				"abv",
				"acm",
				"acq",
				"acw",
				"acx",
				"acy",
				"adf",
				"ads",
				"aeb",
				"aec",
				"afb",
				"ajp",
				"apc",
				"apd",
				"arb",
				"arq",
				"ars",
				"ary",
				"arz",
				"auz",
				"avl",
				"ayh",
				"ayl",
				"ayn",
				"ayp",
				"bbz",
				"pga",
				"he",
				"iw",
				"ps",
				"pbt",
				"pbu",
				"pst",
				"prp",
				"prd",
				"ug",
				"ur",
				"ydd",
				"yds",
				"yih",
				"ji",
				"yi",
				"hbo",
				"men",
				"xmn",
				"fa",
				"jpr",
				"peo",
				"pes",
				"prs",
				"dv",
				"sam",
				"ckb"
			];
			const languageUtils = this.services?.languageUtils || new LanguageUtil(get$3());
			if (lng.toLowerCase().indexOf("-latn") > 1) return "ltr";
			return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
		}
		static createInstance(options = {}, callback) {
			const instance = new I18n(options, callback);
			instance.createInstance = I18n.createInstance;
			return instance;
		}
		cloneInstance(options = {}, callback = noop) {
			const forkResourceStore = options.forkResourceStore;
			if (forkResourceStore) delete options.forkResourceStore;
			const mergedOptions = {
				...this.options,
				...options,
				isClone: true
			};
			const clone = new I18n(mergedOptions);
			if (options.debug !== void 0 || options.prefix !== void 0) clone.logger = clone.logger.clone(options);
			[
				"store",
				"services",
				"language"
			].forEach((m) => {
				clone[m] = this[m];
			});
			clone.services = { ...this.services };
			clone.services.utils = { hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone) };
			if (forkResourceStore) {
				clone.store = new ResourceStore(Object.keys(this.store.data).reduce((prev, l) => {
					prev[l] = { ...this.store.data[l] };
					prev[l] = Object.keys(prev[l]).reduce((acc, n) => {
						acc[n] = { ...prev[l][n] };
						return acc;
					}, prev[l]);
					return prev;
				}, {}), mergedOptions);
				clone.services.resourceStore = clone.store;
			}
			if (options.interpolation) {
				const mergedInterpolation = {
					...get$3().interpolation,
					...this.options.interpolation,
					...options.interpolation
				};
				const mergedForInterpolator = {
					...mergedOptions,
					interpolation: mergedInterpolation
				};
				clone.services.interpolator = new Interpolator(mergedForInterpolator);
			}
			clone.translator = new Translator(clone.services, mergedOptions);
			clone.translator.on("*", (event, ...args) => {
				clone.emit(event, ...args);
			});
			clone.init(mergedOptions, callback);
			clone.translator.options = mergedOptions;
			clone.translator.backendConnector.services.utils = { hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone) };
			return clone;
		}
		toJSON() {
			return {
				options: this.options,
				store: this.store,
				language: this.language,
				languages: this.languages,
				resolvedLanguage: this.resolvedLanguage
			};
		}
	}.createInstance();
	instance.createInstance;
	instance.dir;
	instance.init;
	instance.loadResources;
	instance.reloadResources;
	instance.use;
	instance.changeLanguage;
	instance.getFixedT;
	var t = instance.t;
	instance.exists;
	instance.setDefaultNamespace;
	instance.hasLoadedNamespace;
	instance.loadNamespaces;
	instance.loadLanguages;
	//#endregion
	//#region ../../node_modules/uuid/dist/stringify.js
	var byteToHex = [];
	for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
	function unsafeStringify(arr, offset = 0) {
		return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
	}
	//#endregion
	//#region ../../node_modules/uuid/dist/rng.js
	var rnds8 = new Uint8Array(16);
	function rng() {
		return crypto.getRandomValues(rnds8);
	}
	//#endregion
	//#region ../../node_modules/uuid/dist/v4.js
	function v4(options, buf, offset) {
		if (!buf && !options && crypto.randomUUID) return crypto.randomUUID();
		return _v4(options, buf, offset);
	}
	function _v4(options, buf, offset) {
		options = options || {};
		const rnds = options.random ?? options.rng?.() ?? rng();
		if (rnds.length < 16) throw new Error("Random bytes length must be >= 16");
		rnds[6] = rnds[6] & 15 | 64;
		rnds[8] = rnds[8] & 63 | 128;
		if (buf) {
			offset = offset || 0;
			if (offset < 0 || offset + 16 > buf.length) throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
			for (let i = 0; i < 16; ++i) buf[offset + i] = rnds[i];
			return buf;
		}
		return unsafeStringify(rnds);
	}
	//#endregion
	//#region ../../node_modules/mitt/dist/mitt.mjs
	function mitt_default(n) {
		return {
			all: n = n || /* @__PURE__ */ new Map(),
			on: function(t, e) {
				var i = n.get(t);
				i ? i.push(e) : n.set(t, [e]);
			},
			off: function(t, e) {
				var i = n.get(t);
				i && (e ? i.splice(i.indexOf(e) >>> 0, 1) : n.set(t, []));
			},
			emit: function(t, e) {
				var i = n.get(t);
				i && i.slice().map(function(n) {
					n(e);
				}), (i = n.get("*")) && i.slice().map(function(n) {
					n(t, e);
				});
			}
		};
	}
	//#endregion
	//#region ../loot-core/src/server/app.ts
	var App = class {
		constructor() {
			_defineProperty(this, "events", void 0);
			_defineProperty(this, "handlers", void 0);
			_defineProperty(this, "services", void 0);
			_defineProperty(this, "unlistenServices", void 0);
			this.handlers = {};
			this.services = [];
			this.events = mitt_default();
			this.unlistenServices = [];
		}
		method(name, func) {
			if (this.handlers[name] != null) throw new Error("Conflicting method name, names must be globally unique: " + name);
			this.handlers[name] = func;
		}
		service(func) {
			this.services.push(func);
		}
		combine(...apps) {
			for (const app of apps) {
				Object.keys(app.handlers).forEach((name) => {
					this.method(name, app.handlers[name]);
				});
				app.services.forEach((service) => {
					this.service(service);
				});
				for (const [name, listeners] of app.events.all.entries()) for (const listener of listeners) this.events.on(name, listener);
			}
		}
		startServices() {
			if (this.unlistenServices.length > 0) captureException(/* @__PURE__ */ new Error("App: startServices called while services are already running"));
			this.unlistenServices = this.services.map((service) => service());
		}
		async stopServices() {
			this.unlistenServices.forEach((unlisten) => {
				if (unlisten) unlisten();
			});
			this.unlistenServices = [];
		}
	};
	function createApp() {
		return new App();
	}
	//#endregion
	//#region ../crdt/src/crdt/merkle.ts
	function emptyTrie() {
		return { hash: 0 };
	}
	function isNumberTrieNodeKey(input) {
		return [
			"0",
			"1",
			"2"
		].includes(input);
	}
	function getKeys(trie) {
		return Object.keys(trie).filter(isNumberTrieNodeKey);
	}
	function keyToTimestamp(key) {
		const fullkey = key + "0".repeat(16 - key.length);
		return parseInt(fullkey, 3) * 1e3 * 60;
	}
	/**
	* Mutates `trie` to insert a node at `timestamp`
	*/
	function insert$1(trie, timestamp) {
		const hash = timestamp.hash();
		const key = Number(Math.floor(timestamp.millis() / 1e3 / 60)).toString(3);
		trie = Object.assign({}, trie, { hash: (trie.hash || 0) ^ hash });
		return insertKey(trie, key, hash);
	}
	function insertKey(trie, key, hash) {
		if (key.length === 0) return trie;
		const c = key[0];
		const n = (isNumberTrieNodeKey(c) ? trie[c] : void 0) || {};
		return Object.assign({}, trie, { [c]: Object.assign({}, n, insertKey(n, key.slice(1), hash), { hash: (n.hash || 0) ^ hash }) });
	}
	function diff(trie1, trie2) {
		if (trie1.hash === trie2.hash) return null;
		let node1 = trie1;
		let node2 = trie2;
		let k = "";
		while (true) {
			const keys = [...new Set([...getKeys(node1), ...getKeys(node2)]).values()];
			keys.sort((a, b) => a.localeCompare(b));
			let diffkey = null;
			for (let i = 0; i < keys.length; i++) {
				const key = keys[i];
				const next1 = node1[key];
				const next2 = node2[key];
				if (!next1 || !next2) break;
				if (next1.hash !== next2.hash) {
					diffkey = key;
					break;
				}
			}
			if (!diffkey) return keyToTimestamp(k);
			k += diffkey;
			node1 = node1[diffkey] || emptyTrie();
			node2 = node2[diffkey] || emptyTrie();
		}
		return null;
	}
	function prune(trie, n = 2) {
		if (!trie.hash) return trie;
		const keys = getKeys(trie);
		keys.sort((a, b) => a.localeCompare(b));
		const next = { hash: trie.hash };
		for (const k of keys.slice(-n)) {
			const node = trie[k];
			if (!node) throw new Error(`TrieNode for key ${k} could not be found`);
			next[k] = prune(node, n);
		}
		return next;
	}
	//#endregion
	//#region ../crdt/src/crdt/timestamp.ts
	var import_murmurhash = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			const _global = this;
			const createBuffer = (val) => new TextEncoder().encode(val);
			/**
			* JS Implementation of MurmurHash2
			*
			* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
			* @see http://github.com/garycourt/murmurhash-js
			* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
			* @see http://sites.google.com/site/murmurhash/
			*
			* @param {Uint8Array | string} str ASCII only
			* @param {number} seed Positive integer only
			* @return {number} 32-bit positive integer hash
			*/
			function MurmurHashV2(str, seed) {
				if (typeof str === "string") str = createBuffer(str);
				let l = str.length, h = seed ^ l, i = 0, k;
				while (l >= 4) {
					k = str[i] & 255 | (str[++i] & 255) << 8 | (str[++i] & 255) << 16 | (str[++i] & 255) << 24;
					k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
					k ^= k >>> 24;
					k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
					h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16) ^ k;
					l -= 4;
					++i;
				}
				switch (l) {
					case 3: h ^= (str[i + 2] & 255) << 16;
					case 2: h ^= (str[i + 1] & 255) << 8;
					case 1:
						h ^= str[i] & 255;
						h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
				}
				h ^= h >>> 13;
				h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
				h ^= h >>> 15;
				return h >>> 0;
			}
			function MurmurHashV3(key, seed) {
				if (typeof key === "string") key = createBuffer(key);
				let remainder, bytes, h1, h1b, c1, c2, k1, i;
				remainder = key.length & 3;
				bytes = key.length - remainder;
				h1 = seed;
				c1 = 3432918353;
				c2 = 461845907;
				i = 0;
				while (i < bytes) {
					k1 = key[i] & 255 | (key[++i] & 255) << 8 | (key[++i] & 255) << 16 | (key[++i] & 255) << 24;
					++i;
					k1 = (k1 & 65535) * c1 + (((k1 >>> 16) * c1 & 65535) << 16) & 4294967295;
					k1 = k1 << 15 | k1 >>> 17;
					k1 = (k1 & 65535) * c2 + (((k1 >>> 16) * c2 & 65535) << 16) & 4294967295;
					h1 ^= k1;
					h1 = h1 << 13 | h1 >>> 19;
					h1b = (h1 & 65535) * 5 + (((h1 >>> 16) * 5 & 65535) << 16) & 4294967295;
					h1 = (h1b & 65535) + 27492 + (((h1b >>> 16) + 58964 & 65535) << 16);
				}
				k1 = 0;
				switch (remainder) {
					case 3: k1 ^= (key[i + 2] & 255) << 16;
					case 2: k1 ^= (key[i + 1] & 255) << 8;
					case 1:
						k1 ^= key[i] & 255;
						k1 = (k1 & 65535) * c1 + (((k1 >>> 16) * c1 & 65535) << 16) & 4294967295;
						k1 = k1 << 15 | k1 >>> 17;
						k1 = (k1 & 65535) * c2 + (((k1 >>> 16) * c2 & 65535) << 16) & 4294967295;
						h1 ^= k1;
				}
				h1 ^= key.length;
				h1 ^= h1 >>> 16;
				h1 = (h1 & 65535) * 2246822507 + (((h1 >>> 16) * 2246822507 & 65535) << 16) & 4294967295;
				h1 ^= h1 >>> 13;
				h1 = (h1 & 65535) * 3266489909 + (((h1 >>> 16) * 3266489909 & 65535) << 16) & 4294967295;
				h1 ^= h1 >>> 16;
				return h1 >>> 0;
			}
			const murmur = MurmurHashV3;
			murmur.v2 = MurmurHashV2;
			murmur.v3 = MurmurHashV3;
			if (typeof module != "undefined") module.exports = murmur;
			else {
				const _previousRoot = _global.murmur;
				murmur.noConflict = function() {
					_global.murmur = _previousRoot;
					return murmur;
				};
				_global.murmur = murmur;
			}
		})();
	})))(), 1);
	var _Timestamp;
	var clock;
	function setClock(clock_) {
		clock = clock_;
	}
	function getClock() {
		return clock;
	}
	function makeClock(timestamp, merkle = {}) {
		return {
			timestamp: MutableTimestamp.from(timestamp),
			merkle
		};
	}
	function serializeClock(clock) {
		return JSON.stringify({
			timestamp: clock.timestamp.toString(),
			merkle: clock.merkle
		});
	}
	function deserializeClock(clock) {
		let data;
		try {
			data = JSON.parse(clock);
		} catch {
			data = {
				timestamp: "1970-01-01T00:00:00.000Z-0000-" + makeClientId(),
				merkle: {}
			};
		}
		const ts = Timestamp.parse(data.timestamp);
		if (!ts) throw new Timestamp.InvalidError(data.timestamp);
		return {
			timestamp: MutableTimestamp.from(ts),
			merkle: data.merkle
		};
	}
	function makeClientId() {
		return v4().replace(/-/g, "").slice(-16);
	}
	var config$1 = { maxDrift: 300 * 1e3 };
	var MAX_COUNTER = parseInt("0xFFFF");
	var MAX_NODE_LENGTH = 16;
	/**
	* timestamp instance class
	*/
	var Timestamp = class Timestamp {
		constructor(millis, counter, node) {
			this._state = {
				millis,
				counter,
				node
			};
		}
		valueOf() {
			return this.toString();
		}
		toString() {
			return [
				new Date(this.millis()).toISOString(),
				("0000" + this.counter().toString(16).toUpperCase()).slice(-4),
				("0000000000000000" + this.node()).slice(-16)
			].join("-");
		}
		millis() {
			return this._state.millis;
		}
		counter() {
			return this._state.counter;
		}
		node() {
			return this._state.node;
		}
		hash() {
			return import_murmurhash.default.v3(this.toString());
		}
		static init(options = {}) {
			if (options.maxDrift) config$1.maxDrift = options.maxDrift;
			setClock(makeClock(new Timestamp(0, 0, options.node ? ("0000000000000000" + options.node).toString().slice(-16) : "")));
		}
		/**
		* timestamp parsing
		* converts a fixed-length string timestamp to the structured value
		*/
		static parse(timestamp) {
			if (timestamp instanceof Timestamp) return timestamp;
			if (typeof timestamp === "string") {
				const parts = timestamp.split("-");
				if (parts && parts.length === 5) {
					const millis = Date.parse(parts.slice(0, 3).join("-")).valueOf();
					const counter = parseInt(parts[3], 16);
					const node = parts[4];
					if (!isNaN(millis) && millis >= 0 && !isNaN(counter) && counter <= MAX_COUNTER && typeof node === "string" && node.length <= MAX_NODE_LENGTH) return new Timestamp(millis, counter, node);
				}
			}
			return null;
		}
		/**
		* Timestamp send. Generates a unique, monotonic timestamp suitable
		* for transmission to another system in string format
		*/
		static send() {
			if (!clock) return null;
			const phys = Date.now();
			const lOld = clock.timestamp.millis();
			const cOld = clock.timestamp.counter();
			const lNew = Math.max(lOld, phys);
			const cNew = lOld === lNew ? cOld + 1 : 0;
			if (lNew - phys > config$1.maxDrift) throw new Timestamp.ClockDriftError(lNew, phys, config$1.maxDrift);
			if (cNew > MAX_COUNTER) throw new Timestamp.OverflowError();
			clock.timestamp.setMillis(lNew);
			clock.timestamp.setCounter(cNew);
			return new Timestamp(clock.timestamp.millis(), clock.timestamp.counter(), clock.timestamp.node());
		}
		static recv(msg) {
			if (!clock) return null;
			const phys = Date.now();
			const lMsg = msg.millis();
			const cMsg = msg.counter();
			if (lMsg - phys > config$1.maxDrift) throw new Timestamp.ClockDriftError();
			const lOld = clock.timestamp.millis();
			const cOld = clock.timestamp.counter();
			const lNew = Math.max(Math.max(lOld, phys), lMsg);
			const cNew = lNew === lOld && lNew === lMsg ? Math.max(cOld, cMsg) + 1 : lNew === lOld ? cOld + 1 : lNew === lMsg ? cMsg + 1 : 0;
			if (lNew - phys > config$1.maxDrift) throw new Timestamp.ClockDriftError();
			if (cNew > MAX_COUNTER) throw new Timestamp.OverflowError();
			clock.timestamp.setMillis(lNew);
			clock.timestamp.setCounter(cNew);
			return new Timestamp(clock.timestamp.millis(), clock.timestamp.counter(), clock.timestamp.node());
		}
	};
	_Timestamp = Timestamp;
	_Timestamp.max = _Timestamp.parse("9999-12-31T23:59:59.999Z-FFFF-FFFFFFFFFFFFFFFF");
	_Timestamp.zero = _Timestamp.parse("1970-01-01T00:00:00.000Z-0000-0000000000000000");
	_Timestamp.since = (isoString) => isoString + "-0000-0000000000000000";
	_Timestamp.DuplicateNodeError = class DuplicateNodeError extends Error {
		constructor(node) {
			super("duplicate node identifier " + node);
			this.name = "DuplicateNodeError";
		}
	};
	_Timestamp.ClockDriftError = class ClockDriftError extends Error {
		constructor(...args) {
			super(["maximum clock drift exceeded", ...args.map(String)].join(" "));
			this.name = "ClockDriftError";
		}
	};
	_Timestamp.OverflowError = class OverflowError extends Error {
		constructor() {
			super("timestamp counter overflow");
			this.name = "OverflowError";
		}
	};
	_Timestamp.InvalidError = class InvalidError extends Error {
		constructor(...args) {
			super(["timestamp is not valid"].concat(args.map(String)).join(" "));
			this.name = "InvalidError";
		}
	};
	var MutableTimestamp = class MutableTimestamp extends Timestamp {
		static from(timestamp) {
			return new MutableTimestamp(timestamp.millis(), timestamp.counter(), timestamp.node());
		}
		setMillis(n) {
			this._state.millis = n;
		}
		setCounter(n) {
			this._state.counter = n;
		}
		setNode(n) {
			this._state.node = n;
		}
	};
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js
	/**
	* Converts snake_case to protoCamelCase according to the convention
	* used by protoc to convert a field name to a JSON name.
	*
	* See https://protobuf.com/docs/language-spec#default-json-names
	*
	* The function protoSnakeCase provides the reverse.
	*/
	function protoCamelCase(snakeCase) {
		let capNext = false;
		const b = [];
		for (let i = 0; i < snakeCase.length; i++) {
			let c = snakeCase.charAt(i);
			switch (c) {
				case "_":
					capNext = true;
					break;
				case "0":
				case "1":
				case "2":
				case "3":
				case "4":
				case "5":
				case "6":
				case "7":
				case "8":
				case "9":
					b.push(c);
					capNext = false;
					break;
				default:
					if (capNext) {
						capNext = false;
						c = c.toUpperCase();
					}
					b.push(c);
					break;
			}
		}
		return b.join("");
	}
	/**
	* Names that cannot be used for object properties because they are reserved
	* by built-in JavaScript properties.
	*/
	var reservedObjectProperties = new Set([
		"constructor",
		"toString",
		"toJSON",
		"valueOf"
	]);
	/**
	* Escapes names that are reserved for ECMAScript built-in object properties.
	*
	* Also see safeIdentifier() from @bufbuild/protoplugin.
	*/
	function safeObjectProperty(name) {
		return reservedObjectProperties.has(name) ? name + "$" : name;
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js
	/**
	* Read a 64 bit varint as two JS numbers.
	*
	* Returns tuple:
	* [0]: low bits
	* [1]: high bits
	*
	* Copyright 2008 Google Inc.  All rights reserved.
	*
	* See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L175
	*/
	function varint64read() {
		let lowBits = 0;
		let highBits = 0;
		for (let shift = 0; shift < 28; shift += 7) {
			let b = this.buf[this.pos++];
			lowBits |= (b & 127) << shift;
			if ((b & 128) == 0) {
				this.assertBounds();
				return [lowBits, highBits];
			}
		}
		let middleByte = this.buf[this.pos++];
		lowBits |= (middleByte & 15) << 28;
		highBits = (middleByte & 112) >> 4;
		if ((middleByte & 128) == 0) {
			this.assertBounds();
			return [lowBits, highBits];
		}
		for (let shift = 3; shift <= 31; shift += 7) {
			let b = this.buf[this.pos++];
			highBits |= (b & 127) << shift;
			if ((b & 128) == 0) {
				this.assertBounds();
				return [lowBits, highBits];
			}
		}
		throw new Error("invalid varint");
	}
	/**
	* Write a 64 bit varint, given as two JS numbers, to the given bytes array.
	*
	* Copyright 2008 Google Inc.  All rights reserved.
	*
	* See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/writer.js#L344
	*/
	function varint64write(lo, hi, bytes) {
		for (let i = 0; i < 28; i = i + 7) {
			const shift = lo >>> i;
			const hasNext = !(shift >>> 7 == 0 && hi == 0);
			const byte = (hasNext ? shift | 128 : shift) & 255;
			bytes.push(byte);
			if (!hasNext) return;
		}
		const splitBits = lo >>> 28 & 15 | (hi & 7) << 4;
		const hasMoreBits = !(hi >> 3 == 0);
		bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255);
		if (!hasMoreBits) return;
		for (let i = 3; i < 31; i = i + 7) {
			const shift = hi >>> i;
			const hasNext = !(shift >>> 7 == 0);
			const byte = (hasNext ? shift | 128 : shift) & 255;
			bytes.push(byte);
			if (!hasNext) return;
		}
		bytes.push(hi >>> 31 & 1);
	}
	var TWO_PWR_32_DBL = 4294967296;
	/**
	* Parse decimal string of 64 bit integer value as two JS numbers.
	*
	* Copyright 2008 Google Inc.  All rights reserved.
	*
	* See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
	*/
	function int64FromString(dec) {
		const minus = dec[0] === "-";
		if (minus) dec = dec.slice(1);
		const base = 1e6;
		let lowBits = 0;
		let highBits = 0;
		function add1e6digit(begin, end) {
			const digit1e6 = Number(dec.slice(begin, end));
			highBits *= base;
			lowBits = lowBits * base + digit1e6;
			if (lowBits >= TWO_PWR_32_DBL) {
				highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0);
				lowBits = lowBits % TWO_PWR_32_DBL;
			}
		}
		add1e6digit(-24, -18);
		add1e6digit(-18, -12);
		add1e6digit(-12, -6);
		add1e6digit(-6);
		return minus ? negate(lowBits, highBits) : newBits(lowBits, highBits);
	}
	/**
	* Losslessly converts a 64-bit signed integer in 32:32 split representation
	* into a decimal string.
	*
	* Copyright 2008 Google Inc.  All rights reserved.
	*
	* See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
	*/
	function int64ToString(lo, hi) {
		let bits = newBits(lo, hi);
		const negative = bits.hi & 2147483648;
		if (negative) bits = negate(bits.lo, bits.hi);
		const result = uInt64ToString(bits.lo, bits.hi);
		return negative ? "-" + result : result;
	}
	/**
	* Losslessly converts a 64-bit unsigned integer in 32:32 split representation
	* into a decimal string.
	*
	* Copyright 2008 Google Inc.  All rights reserved.
	*
	* See https://github.com/protocolbuffers/protobuf-javascript/blob/a428c58273abad07c66071d9753bc4d1289de426/experimental/runtime/int64.js#L10
	*/
	function uInt64ToString(lo, hi) {
		({lo, hi} = toUnsigned(lo, hi));
		if (hi <= 2097151) return String(TWO_PWR_32_DBL * hi + lo);
		const low = lo & 16777215;
		const mid = (lo >>> 24 | hi << 8) & 16777215;
		const high = hi >> 16 & 65535;
		let digitA = low + mid * 6777216 + high * 6710656;
		let digitB = mid + high * 8147497;
		let digitC = high * 2;
		const base = 1e7;
		if (digitA >= base) {
			digitB += Math.floor(digitA / base);
			digitA %= base;
		}
		if (digitB >= base) {
			digitC += Math.floor(digitB / base);
			digitB %= base;
		}
		return digitC.toString() + decimalFrom1e7WithLeadingZeros(digitB) + decimalFrom1e7WithLeadingZeros(digitA);
	}
	function toUnsigned(lo, hi) {
		return {
			lo: lo >>> 0,
			hi: hi >>> 0
		};
	}
	function newBits(lo, hi) {
		return {
			lo: lo | 0,
			hi: hi | 0
		};
	}
	/**
	* Returns two's compliment negation of input.
	* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators#Signed_32-bit_integers
	*/
	function negate(lowBits, highBits) {
		highBits = ~highBits;
		if (lowBits) lowBits = ~lowBits + 1;
		else highBits += 1;
		return newBits(lowBits, highBits);
	}
	/**
	* Returns decimal representation of digit1e7 with leading zeros.
	*/
	var decimalFrom1e7WithLeadingZeros = (digit1e7) => {
		const partial = String(digit1e7);
		return "0000000".slice(partial.length) + partial;
	};
	/**
	* Write a 32 bit varint, signed or unsigned. Same as `varint64write(0, value, bytes)`
	*
	* Copyright 2008 Google Inc.  All rights reserved.
	*
	* See https://github.com/protocolbuffers/protobuf/blob/1b18833f4f2a2f681f4e4a25cdf3b0a43115ec26/js/binary/encoder.js#L144
	*/
	function varint32write(value, bytes) {
		if (value >= 0) {
			while (value > 127) {
				bytes.push(value & 127 | 128);
				value = value >>> 7;
			}
			bytes.push(value);
		} else {
			for (let i = 0; i < 9; i++) {
				bytes.push(value & 127 | 128);
				value = value >> 7;
			}
			bytes.push(1);
		}
	}
	/**
	* Read an unsigned 32 bit varint.
	*
	* See https://github.com/protocolbuffers/protobuf/blob/8a71927d74a4ce34efe2d8769fda198f52d20d12/js/experimental/runtime/kernel/buffer_decoder.js#L220
	*/
	function varint32read() {
		let b = this.buf[this.pos++];
		let result = b & 127;
		if ((b & 128) == 0) {
			this.assertBounds();
			return result;
		}
		b = this.buf[this.pos++];
		result |= (b & 127) << 7;
		if ((b & 128) == 0) {
			this.assertBounds();
			return result;
		}
		b = this.buf[this.pos++];
		result |= (b & 127) << 14;
		if ((b & 128) == 0) {
			this.assertBounds();
			return result;
		}
		b = this.buf[this.pos++];
		result |= (b & 127) << 21;
		if ((b & 128) == 0) {
			this.assertBounds();
			return result;
		}
		b = this.buf[this.pos++];
		result |= (b & 15) << 28;
		for (let readBytes = 5; (b & 128) !== 0 && readBytes < 10; readBytes++) b = this.buf[this.pos++];
		if ((b & 128) != 0) throw new Error("invalid varint");
		this.assertBounds();
		return result >>> 0;
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js
	init_dist$1();
	/**
	* Int64Support for the current environment.
	*/
	var protoInt64 = /* @__PURE__ */ makeInt64Support();
	function makeInt64Support() {
		const dv = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
		if (typeof BigInt === "function" && typeof dv.getBigInt64 === "function" && typeof dv.getBigUint64 === "function" && typeof dv.setBigInt64 === "function" && typeof dv.setBigUint64 === "function" && (!!globalThis.Deno || typeof process$1 != "object" || {}.BUF_BIGINT_DISABLE !== "1")) {
			const MIN = BigInt("-9223372036854775808");
			const MAX = BigInt("9223372036854775807");
			const UMIN = BigInt("0");
			const UMAX = BigInt("18446744073709551615");
			return {
				zero: BigInt(0),
				supported: true,
				parse(value) {
					const bi = typeof value == "bigint" ? value : BigInt(value);
					if (bi > MAX || bi < MIN) throw new Error(`invalid int64: ${value}`);
					return bi;
				},
				uParse(value) {
					const bi = typeof value == "bigint" ? value : BigInt(value);
					if (bi > UMAX || bi < UMIN) throw new Error(`invalid uint64: ${value}`);
					return bi;
				},
				enc(value) {
					dv.setBigInt64(0, this.parse(value), true);
					return {
						lo: dv.getInt32(0, true),
						hi: dv.getInt32(4, true)
					};
				},
				uEnc(value) {
					dv.setBigInt64(0, this.uParse(value), true);
					return {
						lo: dv.getInt32(0, true),
						hi: dv.getInt32(4, true)
					};
				},
				dec(lo, hi) {
					dv.setInt32(0, lo, true);
					dv.setInt32(4, hi, true);
					return dv.getBigInt64(0, true);
				},
				uDec(lo, hi) {
					dv.setInt32(0, lo, true);
					dv.setInt32(4, hi, true);
					return dv.getBigUint64(0, true);
				}
			};
		}
		return {
			zero: "0",
			supported: false,
			parse(value) {
				if (typeof value != "string") value = value.toString();
				assertInt64String(value);
				return value;
			},
			uParse(value) {
				if (typeof value != "string") value = value.toString();
				assertUInt64String(value);
				return value;
			},
			enc(value) {
				if (typeof value != "string") value = value.toString();
				assertInt64String(value);
				return int64FromString(value);
			},
			uEnc(value) {
				if (typeof value != "string") value = value.toString();
				assertUInt64String(value);
				return int64FromString(value);
			},
			dec(lo, hi) {
				return int64ToString(lo, hi);
			},
			uDec(lo, hi) {
				return uInt64ToString(lo, hi);
			}
		};
	}
	function assertInt64String(value) {
		if (!/^-?[0-9]+$/.test(value)) throw new Error("invalid int64: " + value);
	}
	function assertUInt64String(value) {
		if (!/^[0-9]+$/.test(value)) throw new Error("invalid uint64: " + value);
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/descriptors.js
	/**
	* Scalar value types. This is a subset of field types declared by protobuf
	* enum google.protobuf.FieldDescriptorProto.Type The types GROUP and MESSAGE
	* are omitted, but the numerical values are identical.
	*/
	var ScalarType;
	(function(ScalarType) {
		ScalarType[ScalarType["DOUBLE"] = 1] = "DOUBLE";
		ScalarType[ScalarType["FLOAT"] = 2] = "FLOAT";
		ScalarType[ScalarType["INT64"] = 3] = "INT64";
		ScalarType[ScalarType["UINT64"] = 4] = "UINT64";
		ScalarType[ScalarType["INT32"] = 5] = "INT32";
		ScalarType[ScalarType["FIXED64"] = 6] = "FIXED64";
		ScalarType[ScalarType["FIXED32"] = 7] = "FIXED32";
		ScalarType[ScalarType["BOOL"] = 8] = "BOOL";
		ScalarType[ScalarType["STRING"] = 9] = "STRING";
		ScalarType[ScalarType["BYTES"] = 12] = "BYTES";
		ScalarType[ScalarType["UINT32"] = 13] = "UINT32";
		ScalarType[ScalarType["SFIXED32"] = 15] = "SFIXED32";
		ScalarType[ScalarType["SFIXED64"] = 16] = "SFIXED64";
		ScalarType[ScalarType["SINT32"] = 17] = "SINT32";
		ScalarType[ScalarType["SINT64"] = 18] = "SINT64";
	})(ScalarType || (ScalarType = {}));
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js
	/**
	* Returns the zero value for the given scalar type.
	*/
	function scalarZeroValue(type, longAsString) {
		switch (type) {
			case ScalarType.STRING: return "";
			case ScalarType.BOOL: return false;
			case ScalarType.DOUBLE:
			case ScalarType.FLOAT: return 0;
			case ScalarType.INT64:
			case ScalarType.UINT64:
			case ScalarType.SFIXED64:
			case ScalarType.FIXED64:
			case ScalarType.SINT64: return longAsString ? "0" : protoInt64.zero;
			case ScalarType.BYTES: return new Uint8Array(0);
			default: return 0;
		}
	}
	/**
	* Returns true for a zero-value. For example, an integer has the zero-value `0`,
	* a boolean is `false`, a string is `""`, and bytes is an empty Uint8Array.
	*
	* In proto3, zero-values are not written to the wire, unless the field is
	* optional or repeated.
	*/
	function isScalarZeroValue(type, value) {
		switch (type) {
			case ScalarType.BOOL: return value === false;
			case ScalarType.STRING: return value === "";
			case ScalarType.BYTES: return value instanceof Uint8Array && !value.byteLength;
			default: return value == 0;
		}
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js
	var IMPLICIT$2 = 2;
	var unsafeLocal = Symbol.for("reflect unsafe local");
	/**
	* Return the selected field of a oneof group.
	*
	* @private
	*/
	function unsafeOneofCase(target, oneof) {
		const c = target[oneof.localName].case;
		if (c === void 0) return c;
		return oneof.fields.find((f) => f.localName === c);
	}
	/**
	* Returns true if the field is set.
	*
	* @private
	*/
	function unsafeIsSet(target, field) {
		const name = field.localName;
		if (field.oneof) return target[field.oneof.localName].case === name;
		if (field.presence != IMPLICIT$2) return target[name] !== void 0 && Object.prototype.hasOwnProperty.call(target, name);
		switch (field.fieldKind) {
			case "list": return target[name].length > 0;
			case "map": return Object.keys(target[name]).length > 0;
			case "scalar": return !isScalarZeroValue(field.scalar, target[name]);
			case "enum": return target[name] !== field.enum.values[0].number;
		}
		throw new Error("message field with implicit presence");
	}
	/**
	* Returns true if the field is set, but only for singular fields with explicit
	* presence (proto2).
	*
	* @private
	*/
	function unsafeIsSetExplicit(target, localName) {
		return Object.prototype.hasOwnProperty.call(target, localName) && target[localName] !== void 0;
	}
	/**
	* Return a field value, respecting oneof groups.
	*
	* @private
	*/
	function unsafeGet(target, field) {
		if (field.oneof) {
			const oneof = target[field.oneof.localName];
			if (oneof.case === field.localName) return oneof.value;
			return;
		}
		return target[field.localName];
	}
	/**
	* Set a field value, respecting oneof groups.
	*
	* @private
	*/
	function unsafeSet(target, field, value) {
		if (field.oneof) target[field.oneof.localName] = {
			case: field.localName,
			value
		};
		else target[field.localName] = value;
	}
	/**
	* Resets the field, so that unsafeIsSet() will return false.
	*
	* @private
	*/
	function unsafeClear(target, field) {
		const name = field.localName;
		if (field.oneof) {
			const oneofLocalName = field.oneof.localName;
			if (target[oneofLocalName].case === name) target[oneofLocalName] = { case: void 0 };
		} else if (field.presence != IMPLICIT$2) delete target[name];
		else switch (field.fieldKind) {
			case "map":
				target[name] = {};
				break;
			case "list":
				target[name] = [];
				break;
			case "enum":
				target[name] = field.enum.values[0].number;
				break;
			case "scalar":
				target[name] = scalarZeroValue(field.scalar, field.longAsString);
				break;
		}
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js
	/**
	* @private
	*/
	function restoreJsonNames(message) {
		for (const f of message.field) if (!unsafeIsSetExplicit(f, "jsonName")) f.jsonName = protoCamelCase(f.name);
		message.nestedType.forEach(restoreJsonNames);
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js
	/**
	* Parse an enum value from the Protobuf text format.
	*
	* @private
	*/
	function parseTextFormatEnumValue(descEnum, value) {
		const enumValue = descEnum.values.find((v) => v.name === value);
		if (!enumValue) throw new Error(`cannot parse ${descEnum} default value: ${value}`);
		return enumValue.number;
	}
	/**
	* Parse a scalar value from the Protobuf text format.
	*
	* @private
	*/
	function parseTextFormatScalarValue(type, value) {
		switch (type) {
			case ScalarType.STRING: return value;
			case ScalarType.BYTES: {
				const u = unescapeBytesDefaultValue(value);
				if (u === false) throw new Error(`cannot parse ${ScalarType[type]} default value: ${value}`);
				return u;
			}
			case ScalarType.INT64:
			case ScalarType.SFIXED64:
			case ScalarType.SINT64: return protoInt64.parse(value);
			case ScalarType.UINT64:
			case ScalarType.FIXED64: return protoInt64.uParse(value);
			case ScalarType.DOUBLE:
			case ScalarType.FLOAT: switch (value) {
				case "inf": return Number.POSITIVE_INFINITY;
				case "-inf": return Number.NEGATIVE_INFINITY;
				case "nan": return NaN;
				default: return parseFloat(value);
			}
			case ScalarType.BOOL: return value === "true";
			case ScalarType.INT32:
			case ScalarType.UINT32:
			case ScalarType.SINT32:
			case ScalarType.FIXED32:
			case ScalarType.SFIXED32: return parseInt(value, 10);
		}
	}
	/**
	* Parses a text-encoded default value (proto2) of a BYTES field.
	*/
	function unescapeBytesDefaultValue(str) {
		const b = [];
		const input = {
			tail: str,
			c: "",
			next() {
				if (this.tail.length == 0) return false;
				this.c = this.tail[0];
				this.tail = this.tail.substring(1);
				return true;
			},
			take(n) {
				if (this.tail.length >= n) {
					const r = this.tail.substring(0, n);
					this.tail = this.tail.substring(n);
					return r;
				}
				return false;
			}
		};
		while (input.next()) switch (input.c) {
			case "\\":
				if (input.next()) switch (input.c) {
					case "\\":
						b.push(input.c.charCodeAt(0));
						break;
					case "b":
						b.push(8);
						break;
					case "f":
						b.push(12);
						break;
					case "n":
						b.push(10);
						break;
					case "r":
						b.push(13);
						break;
					case "t":
						b.push(9);
						break;
					case "v":
						b.push(11);
						break;
					case "0":
					case "1":
					case "2":
					case "3":
					case "4":
					case "5":
					case "6":
					case "7": {
						const s = input.c;
						const t = input.take(2);
						if (t === false) return false;
						const n = parseInt(s + t, 8);
						if (Number.isNaN(n)) return false;
						b.push(n);
						break;
					}
					case "x": {
						const s = input.c;
						const t = input.take(2);
						if (t === false) return false;
						const n = parseInt(s + t, 16);
						if (Number.isNaN(n)) return false;
						b.push(n);
						break;
					}
					case "u": {
						const s = input.c;
						const t = input.take(4);
						if (t === false) return false;
						const n = parseInt(s + t, 16);
						if (Number.isNaN(n)) return false;
						const chunk = new Uint8Array(4);
						new DataView(chunk.buffer).setInt32(0, n, true);
						b.push(chunk[0], chunk[1], chunk[2], chunk[3]);
						break;
					}
					case "U": {
						const s = input.c;
						const t = input.take(8);
						if (t === false) return false;
						const tc = protoInt64.uEnc(s + t);
						const chunk = new Uint8Array(8);
						const view = new DataView(chunk.buffer);
						view.setInt32(0, tc.lo, true);
						view.setInt32(4, tc.hi, true);
						b.push(chunk[0], chunk[1], chunk[2], chunk[3], chunk[4], chunk[5], chunk[6], chunk[7]);
						break;
					}
				}
				break;
			default: b.push(input.c.charCodeAt(0));
		}
		return new Uint8Array(b);
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js
	/**
	* Iterate over all types - enumerations, extensions, services, messages -
	* and enumerations, extensions and messages nested in messages.
	*/
	function* nestedTypes(desc) {
		switch (desc.kind) {
			case "file":
				for (const message of desc.messages) {
					yield message;
					yield* nestedTypes(message);
				}
				yield* desc.enums;
				yield* desc.services;
				yield* desc.extensions;
				break;
			case "message":
				for (const message of desc.nestedMessages) {
					yield message;
					yield* nestedTypes(message);
				}
				yield* desc.nestedEnums;
				yield* desc.nestedExtensions;
				break;
		}
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/registry.js
	function createFileRegistry(...args) {
		const registry = createBaseRegistry();
		if (!args.length) return registry;
		if ("$typeName" in args[0] && args[0].$typeName == "google.protobuf.FileDescriptorSet") {
			for (const file of args[0].file) addFile(file, registry);
			return registry;
		}
		if ("$typeName" in args[0]) {
			const input = args[0];
			const resolve = args[1];
			const seen = /* @__PURE__ */ new Set();
			function recurseDeps(file) {
				const deps = [];
				for (const protoFileName of file.dependency) {
					if (registry.getFile(protoFileName) != void 0) continue;
					if (seen.has(protoFileName)) continue;
					const dep = resolve(protoFileName);
					if (!dep) throw new Error(`Unable to resolve ${protoFileName}, imported by ${file.name}`);
					if ("kind" in dep) registry.addFile(dep, false, true);
					else {
						seen.add(dep.name);
						deps.push(dep);
					}
				}
				return deps.concat(...deps.map(recurseDeps));
			}
			for (const file of [input, ...recurseDeps(input)].reverse()) addFile(file, registry);
		} else for (const fileReg of args) for (const file of fileReg.files) registry.addFile(file);
		return registry;
	}
	/**
	* @private
	*/
	function createBaseRegistry() {
		const types = /* @__PURE__ */ new Map();
		const extendees = /* @__PURE__ */ new Map();
		const files = /* @__PURE__ */ new Map();
		return {
			kind: "registry",
			types,
			extendees,
			[Symbol.iterator]() {
				return types.values();
			},
			get files() {
				return files.values();
			},
			addFile(file, skipTypes, withDeps) {
				files.set(file.proto.name, file);
				if (!skipTypes) for (const type of nestedTypes(file)) this.add(type);
				if (withDeps) for (const f of file.dependencies) this.addFile(f, skipTypes, withDeps);
			},
			add(desc) {
				if (desc.kind == "extension") {
					let numberToExt = extendees.get(desc.extendee.typeName);
					if (!numberToExt) extendees.set(desc.extendee.typeName, numberToExt = /* @__PURE__ */ new Map());
					numberToExt.set(desc.number, desc);
				}
				types.set(desc.typeName, desc);
			},
			get(typeName) {
				return types.get(typeName);
			},
			getFile(fileName) {
				return files.get(fileName);
			},
			getMessage(typeName) {
				const t = types.get(typeName);
				return (t === null || t === void 0 ? void 0 : t.kind) == "message" ? t : void 0;
			},
			getEnum(typeName) {
				const t = types.get(typeName);
				return (t === null || t === void 0 ? void 0 : t.kind) == "enum" ? t : void 0;
			},
			getExtension(typeName) {
				const t = types.get(typeName);
				return (t === null || t === void 0 ? void 0 : t.kind) == "extension" ? t : void 0;
			},
			getExtensionFor(extendee, no) {
				var _a;
				return (_a = extendees.get(extendee.typeName)) === null || _a === void 0 ? void 0 : _a.get(no);
			},
			getService(typeName) {
				const t = types.get(typeName);
				return (t === null || t === void 0 ? void 0 : t.kind) == "service" ? t : void 0;
			}
		};
	}
	var EDITION_PROTO2$1 = 998;
	var EDITION_PROTO3$1 = 999;
	var EDITION_UNSTABLE = 9999;
	var TYPE_STRING = 9;
	var TYPE_GROUP = 10;
	var TYPE_MESSAGE = 11;
	var TYPE_BYTES = 12;
	var TYPE_ENUM = 14;
	var LABEL_REPEATED = 3;
	var LABEL_REQUIRED = 2;
	var JS_STRING = 1;
	var IDEMPOTENCY_UNKNOWN = 0;
	var EXPLICIT = 1;
	var IMPLICIT$1 = 2;
	var LEGACY_REQUIRED$1 = 3;
	var PACKED = 1;
	var DELIMITED = 2;
	var OPEN = 1;
	var VERIFY = 2;
	var maximumEdition = 1001;
	var featureDefaults = {
		998: {
			fieldPresence: 1,
			enumType: 2,
			repeatedFieldEncoding: 2,
			utf8Validation: 3,
			messageEncoding: 1,
			jsonFormat: 2,
			enforceNamingStyle: 2,
			defaultSymbolVisibility: 1
		},
		999: {
			fieldPresence: 2,
			enumType: 1,
			repeatedFieldEncoding: 1,
			utf8Validation: 2,
			messageEncoding: 1,
			jsonFormat: 1,
			enforceNamingStyle: 2,
			defaultSymbolVisibility: 1
		},
		1e3: {
			fieldPresence: 1,
			enumType: 1,
			repeatedFieldEncoding: 1,
			utf8Validation: 2,
			messageEncoding: 1,
			jsonFormat: 1,
			enforceNamingStyle: 2,
			defaultSymbolVisibility: 1
		},
		1001: {
			fieldPresence: 1,
			enumType: 1,
			repeatedFieldEncoding: 1,
			utf8Validation: 2,
			messageEncoding: 1,
			jsonFormat: 1,
			enforceNamingStyle: 1,
			defaultSymbolVisibility: 2
		}
	};
	/**
	* Create a descriptor for a file, add it to the registry.
	*/
	function addFile(proto, reg) {
		var _a, _b;
		const file = {
			kind: "file",
			proto,
			deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
			edition: getFileEdition(proto),
			name: proto.name.replace(/\.proto$/, ""),
			dependencies: findFileDependencies(proto, reg),
			enums: [],
			messages: [],
			extensions: [],
			services: [],
			toString() {
				return `file ${proto.name}`;
			}
		};
		const mapEntriesStore = /* @__PURE__ */ new Map();
		const mapEntries = {
			get(typeName) {
				return mapEntriesStore.get(typeName);
			},
			add(desc) {
				var _a;
				assert$1(((_a = desc.proto.options) === null || _a === void 0 ? void 0 : _a.mapEntry) === true);
				mapEntriesStore.set(desc.typeName, desc);
			}
		};
		for (const enumProto of proto.enumType) addEnum(enumProto, file, void 0, reg);
		for (const messageProto of proto.messageType) addMessage(messageProto, file, void 0, reg, mapEntries);
		for (const serviceProto of proto.service) addService(serviceProto, file, reg);
		addExtensions(file, reg);
		for (const mapEntry of mapEntriesStore.values()) addFields(mapEntry, reg, mapEntries);
		for (const message of file.messages) {
			addFields(message, reg, mapEntries);
			addExtensions(message, reg);
		}
		reg.addFile(file, true);
	}
	/**
	* Create descriptors for extensions, and add them to the message / file,
	* and to our cart.
	* Recurses into nested types.
	*/
	function addExtensions(desc, reg) {
		switch (desc.kind) {
			case "file":
				for (const proto of desc.proto.extension) {
					const ext = newField(proto, desc, reg);
					desc.extensions.push(ext);
					reg.add(ext);
				}
				break;
			case "message":
				for (const proto of desc.proto.extension) {
					const ext = newField(proto, desc, reg);
					desc.nestedExtensions.push(ext);
					reg.add(ext);
				}
				for (const message of desc.nestedMessages) addExtensions(message, reg);
				break;
		}
	}
	/**
	* Create descriptors for fields and oneof groups, and add them to the message.
	* Recurses into nested types.
	*/
	function addFields(message, reg, mapEntries) {
		const allOneofs = message.proto.oneofDecl.map((proto) => newOneof(proto, message));
		const oneofsSeen = /* @__PURE__ */ new Set();
		for (const proto of message.proto.field) {
			const oneof = findOneof(proto, allOneofs);
			const field = newField(proto, message, reg, oneof, mapEntries);
			message.fields.push(field);
			message.field[field.localName] = field;
			if (oneof === void 0) message.members.push(field);
			else {
				oneof.fields.push(field);
				if (!oneofsSeen.has(oneof)) {
					oneofsSeen.add(oneof);
					message.members.push(oneof);
				}
			}
		}
		for (const oneof of allOneofs.filter((o) => oneofsSeen.has(o))) message.oneofs.push(oneof);
		for (const child of message.nestedMessages) addFields(child, reg, mapEntries);
	}
	/**
	* Create a descriptor for an enumeration, and add it our cart and to the
	* parent type, if any.
	*/
	function addEnum(proto, file, parent, reg) {
		var _a, _b, _c, _d, _e;
		const sharedPrefix = findEnumSharedPrefix(proto.name, proto.value);
		const desc = {
			kind: "enum",
			proto,
			deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
			file,
			parent,
			open: true,
			name: proto.name,
			typeName: makeTypeName(proto, parent, file),
			value: {},
			values: [],
			sharedPrefix,
			toString() {
				return `enum ${this.typeName}`;
			}
		};
		desc.open = isEnumOpen(desc);
		reg.add(desc);
		for (const p of proto.value) {
			const name = p.name;
			desc.values.push(desc.value[p.number] = {
				kind: "enum_value",
				proto: p,
				deprecated: (_d = (_c = p.options) === null || _c === void 0 ? void 0 : _c.deprecated) !== null && _d !== void 0 ? _d : false,
				parent: desc,
				name,
				localName: safeObjectProperty(sharedPrefix == void 0 ? name : name.substring(sharedPrefix.length)),
				number: p.number,
				toString() {
					return `enum value ${desc.typeName}.${name}`;
				}
			});
		}
		((_e = parent === null || parent === void 0 ? void 0 : parent.nestedEnums) !== null && _e !== void 0 ? _e : file.enums).push(desc);
	}
	/**
	* Create a descriptor for a message, including nested types, and add it to our
	* cart. Note that this does not create descriptors fields.
	*/
	function addMessage(proto, file, parent, reg, mapEntries) {
		var _a, _b, _c, _d;
		const desc = {
			kind: "message",
			proto,
			deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
			file,
			parent,
			name: proto.name,
			typeName: makeTypeName(proto, parent, file),
			fields: [],
			field: {},
			oneofs: [],
			members: [],
			nestedEnums: [],
			nestedMessages: [],
			nestedExtensions: [],
			toString() {
				return `message ${this.typeName}`;
			}
		};
		if (((_c = proto.options) === null || _c === void 0 ? void 0 : _c.mapEntry) === true) mapEntries.add(desc);
		else {
			((_d = parent === null || parent === void 0 ? void 0 : parent.nestedMessages) !== null && _d !== void 0 ? _d : file.messages).push(desc);
			reg.add(desc);
		}
		for (const enumProto of proto.enumType) addEnum(enumProto, file, desc, reg);
		for (const messageProto of proto.nestedType) addMessage(messageProto, file, desc, reg, mapEntries);
	}
	/**
	* Create a descriptor for a service, including methods, and add it to our
	* cart.
	*/
	function addService(proto, file, reg) {
		var _a, _b;
		const desc = {
			kind: "service",
			proto,
			deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
			file,
			name: proto.name,
			typeName: makeTypeName(proto, void 0, file),
			methods: [],
			method: {},
			toString() {
				return `service ${this.typeName}`;
			}
		};
		file.services.push(desc);
		reg.add(desc);
		for (const methodProto of proto.method) {
			const method = newMethod(methodProto, desc, reg);
			desc.methods.push(method);
			desc.method[method.localName] = method;
		}
	}
	/**
	* Create a descriptor for a method.
	*/
	function newMethod(proto, parent, reg) {
		var _a, _b, _c, _d;
		let methodKind;
		if (proto.clientStreaming && proto.serverStreaming) methodKind = "bidi_streaming";
		else if (proto.clientStreaming) methodKind = "client_streaming";
		else if (proto.serverStreaming) methodKind = "server_streaming";
		else methodKind = "unary";
		const input = reg.getMessage(trimLeadingDot(proto.inputType));
		const output = reg.getMessage(trimLeadingDot(proto.outputType));
		assert$1(input, `invalid MethodDescriptorProto: input_type ${proto.inputType} not found`);
		assert$1(output, `invalid MethodDescriptorProto: output_type ${proto.inputType} not found`);
		const name = proto.name;
		return {
			kind: "rpc",
			proto,
			deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
			parent,
			name,
			localName: safeObjectProperty(name.length ? safeObjectProperty(name[0].toLowerCase() + name.substring(1)) : name),
			methodKind,
			input,
			output,
			idempotency: (_d = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.idempotencyLevel) !== null && _d !== void 0 ? _d : IDEMPOTENCY_UNKNOWN,
			toString() {
				return `rpc ${parent.typeName}.${name}`;
			}
		};
	}
	/**
	* Create a descriptor for a oneof group.
	*/
	function newOneof(proto, parent) {
		return {
			kind: "oneof",
			proto,
			deprecated: false,
			parent,
			fields: [],
			name: proto.name,
			localName: safeObjectProperty(protoCamelCase(proto.name)),
			toString() {
				return `oneof ${parent.typeName}.${this.name}`;
			}
		};
	}
	function newField(proto, parentOrFile, reg, oneof, mapEntries) {
		var _a, _b, _c;
		const isExtension = mapEntries === void 0;
		const field = {
			kind: "field",
			proto,
			deprecated: (_b = (_a = proto.options) === null || _a === void 0 ? void 0 : _a.deprecated) !== null && _b !== void 0 ? _b : false,
			name: proto.name,
			number: proto.number,
			scalar: void 0,
			message: void 0,
			enum: void 0,
			presence: getFieldPresence(proto, oneof, isExtension, parentOrFile),
			utf8Validation: isUtf8Validated(proto, parentOrFile),
			listKind: void 0,
			mapKind: void 0,
			mapKey: void 0,
			delimitedEncoding: void 0,
			packed: void 0,
			longAsString: false,
			getDefaultValue: void 0
		};
		if (isExtension) {
			const file = parentOrFile.kind == "file" ? parentOrFile : parentOrFile.file;
			const parent = parentOrFile.kind == "file" ? void 0 : parentOrFile;
			const typeName = makeTypeName(proto, parent, file);
			field.kind = "extension";
			field.file = file;
			field.parent = parent;
			field.oneof = void 0;
			field.typeName = typeName;
			field.jsonName = `[${typeName}]`;
			field.toString = () => `extension ${typeName}`;
			const extendee = reg.getMessage(trimLeadingDot(proto.extendee));
			assert$1(extendee, `invalid FieldDescriptorProto: extendee ${proto.extendee} not found`);
			field.extendee = extendee;
		} else {
			const parent = parentOrFile;
			assert$1(parent.kind == "message");
			field.parent = parent;
			field.oneof = oneof;
			field.localName = oneof ? protoCamelCase(proto.name) : safeObjectProperty(protoCamelCase(proto.name));
			field.jsonName = proto.jsonName;
			field.toString = () => `field ${parent.typeName}.${proto.name}`;
		}
		const label = proto.label;
		const type = proto.type;
		const jstype = (_c = proto.options) === null || _c === void 0 ? void 0 : _c.jstype;
		if (label === LABEL_REPEATED) {
			const mapEntry = type == TYPE_MESSAGE ? mapEntries === null || mapEntries === void 0 ? void 0 : mapEntries.get(trimLeadingDot(proto.typeName)) : void 0;
			if (mapEntry) {
				field.fieldKind = "map";
				const { key, value } = findMapEntryFields(mapEntry);
				field.mapKey = key.scalar;
				field.mapKind = value.fieldKind;
				field.message = value.message;
				field.delimitedEncoding = false;
				field.enum = value.enum;
				field.scalar = value.scalar;
				return field;
			}
			field.fieldKind = "list";
			switch (type) {
				case TYPE_MESSAGE:
				case TYPE_GROUP:
					field.listKind = "message";
					field.message = reg.getMessage(trimLeadingDot(proto.typeName));
					assert$1(field.message);
					field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
					break;
				case TYPE_ENUM:
					field.listKind = "enum";
					field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
					assert$1(field.enum);
					break;
				default:
					field.listKind = "scalar";
					field.scalar = type;
					field.longAsString = jstype == JS_STRING;
					break;
			}
			field.packed = isPackedField(proto, parentOrFile);
			return field;
		}
		switch (type) {
			case TYPE_MESSAGE:
			case TYPE_GROUP:
				field.fieldKind = "message";
				field.message = reg.getMessage(trimLeadingDot(proto.typeName));
				assert$1(field.message, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
				field.delimitedEncoding = isDelimitedEncoding(proto, parentOrFile);
				field.getDefaultValue = () => void 0;
				break;
			case TYPE_ENUM: {
				const enumeration = reg.getEnum(trimLeadingDot(proto.typeName));
				assert$1(enumeration !== void 0, `invalid FieldDescriptorProto: type_name ${proto.typeName} not found`);
				field.fieldKind = "enum";
				field.enum = reg.getEnum(trimLeadingDot(proto.typeName));
				field.getDefaultValue = () => {
					return unsafeIsSetExplicit(proto, "defaultValue") ? parseTextFormatEnumValue(enumeration, proto.defaultValue) : void 0;
				};
				break;
			}
			default:
				field.fieldKind = "scalar";
				field.scalar = type;
				field.longAsString = jstype == JS_STRING;
				field.getDefaultValue = () => {
					return unsafeIsSetExplicit(proto, "defaultValue") ? parseTextFormatScalarValue(type, proto.defaultValue) : void 0;
				};
				break;
		}
		return field;
	}
	/**
	* Parse the "syntax" and "edition" fields, returning one of the supported
	* editions.
	*/
	function getFileEdition(proto) {
		switch (proto.syntax) {
			case "":
			case "proto2": return EDITION_PROTO2$1;
			case "proto3": return EDITION_PROTO3$1;
			case "editions":
				if (proto.edition === EDITION_UNSTABLE) return maximumEdition;
				if (proto.edition in featureDefaults) return proto.edition;
				throw new Error(`${proto.name}: unsupported edition`);
			default: throw new Error(`${proto.name}: unsupported syntax "${proto.syntax}"`);
		}
	}
	/**
	* Resolve dependencies of FileDescriptorProto to DescFile.
	*/
	function findFileDependencies(proto, reg) {
		return proto.dependency.map((wantName) => {
			const dep = reg.getFile(wantName);
			if (!dep) throw new Error(`Cannot find ${wantName}, imported by ${proto.name}`);
			return dep;
		});
	}
	/**
	* Finds a prefix shared by enum values, for example `my_enum_` for
	* `enum MyEnum {MY_ENUM_A=0; MY_ENUM_B=1;}`.
	*/
	function findEnumSharedPrefix(enumName, values) {
		const prefix = camelToSnakeCase(enumName) + "_";
		for (const value of values) {
			if (!value.name.toLowerCase().startsWith(prefix)) return;
			const shortName = value.name.substring(prefix.length);
			if (shortName.length == 0) return;
			if (/^\d/.test(shortName)) return;
		}
		return prefix;
	}
	/**
	* Converts lowerCamelCase or UpperCamelCase into lower_snake_case.
	* This is used to find shared prefixes in an enum.
	*/
	function camelToSnakeCase(camel) {
		return (camel.substring(0, 1) + camel.substring(1).replace(/[A-Z]/g, (c) => "_" + c)).toLowerCase();
	}
	/**
	* Create a fully qualified name for a protobuf type or extension field.
	*
	* The fully qualified name for messages, enumerations, and services is
	* constructed by concatenating the package name (if present), parent
	* message names (for nested types), and the type name. We omit the leading
	* dot added by protobuf compilers. Examples:
	* - mypackage.MyMessage
	* - mypackage.MyMessage.NestedMessage
	*
	* The fully qualified name for extension fields is constructed by
	* concatenating the package name (if present), parent message names (for
	* extensions declared within a message), and the field name. Examples:
	* - mypackage.extfield
	* - mypackage.MyMessage.extfield
	*/
	function makeTypeName(proto, parent, file) {
		let typeName;
		if (parent) typeName = `${parent.typeName}.${proto.name}`;
		else if (file.proto.package.length > 0) typeName = `${file.proto.package}.${proto.name}`;
		else typeName = `${proto.name}`;
		return typeName;
	}
	/**
	* Remove the leading dot from a fully qualified type name.
	*/
	function trimLeadingDot(typeName) {
		return typeName.startsWith(".") ? typeName.substring(1) : typeName;
	}
	/**
	* Did the user put the field in a oneof group?
	* Synthetic oneofs for proto3 optionals are ignored.
	*/
	function findOneof(proto, allOneofs) {
		if (!unsafeIsSetExplicit(proto, "oneofIndex")) return;
		if (proto.proto3Optional) return;
		const oneof = allOneofs[proto.oneofIndex];
		assert$1(oneof, `invalid FieldDescriptorProto: oneof #${proto.oneofIndex} for field #${proto.number} not found`);
		return oneof;
	}
	/**
	* Presence of the field.
	* See https://protobuf.dev/programming-guides/field_presence/
	*/
	function getFieldPresence(proto, oneof, isExtension, parent) {
		if (proto.label == LABEL_REQUIRED) return LEGACY_REQUIRED$1;
		if (proto.label == LABEL_REPEATED) return IMPLICIT$1;
		if (!!oneof || proto.proto3Optional) return EXPLICIT;
		if (isExtension) return EXPLICIT;
		const resolved = resolveFeature("fieldPresence", {
			proto,
			parent
		});
		if (resolved == IMPLICIT$1 && (proto.type == TYPE_MESSAGE || proto.type == TYPE_GROUP)) return EXPLICIT;
		return resolved;
	}
	/**
	* Pack this repeated field?
	*/
	function isPackedField(proto, parent) {
		if (proto.label != LABEL_REPEATED) return false;
		switch (proto.type) {
			case TYPE_STRING:
			case TYPE_BYTES:
			case TYPE_GROUP:
			case TYPE_MESSAGE: return false;
		}
		const o = proto.options;
		if (o && unsafeIsSetExplicit(o, "packed")) return o.packed;
		return PACKED == resolveFeature("repeatedFieldEncoding", {
			proto,
			parent
		});
	}
	/**
	* Find the key and value fields of a synthetic map entry message.
	*/
	function findMapEntryFields(mapEntry) {
		const key = mapEntry.fields.find((f) => f.number === 1);
		const value = mapEntry.fields.find((f) => f.number === 2);
		assert$1(key && key.fieldKind == "scalar" && key.scalar != ScalarType.BYTES && key.scalar != ScalarType.FLOAT && key.scalar != ScalarType.DOUBLE && value && value.fieldKind != "list" && value.fieldKind != "map");
		return {
			key,
			value
		};
	}
	/**
	* Enumerations can be open or closed.
	* See https://protobuf.dev/programming-guides/enum/
	*/
	function isEnumOpen(desc) {
		var _a;
		return OPEN == resolveFeature("enumType", {
			proto: desc.proto,
			parent: (_a = desc.parent) !== null && _a !== void 0 ? _a : desc.file
		});
	}
	/**
	* Encode the message delimited (a.k.a. proto2 group encoding), or
	* length-prefixed?
	*/
	function isDelimitedEncoding(proto, parent) {
		if (proto.type == TYPE_GROUP) return true;
		return DELIMITED == resolveFeature("messageEncoding", {
			proto,
			parent
		});
	}
	/**
	* Reject invalid UTF-8 when reading string fields from the binary wire format?
	* Driven by the resolved `utf8_validation` feature: VERIFY (proto3 / editions
	* 2023+ default) enforces; NONE (proto2 default) does not.
	*/
	function isUtf8Validated(proto, parent) {
		return VERIFY == resolveFeature("utf8Validation", {
			proto,
			parent
		});
	}
	function resolveFeature(name, ref) {
		var _a, _b;
		const featureSet = (_a = ref.proto.options) === null || _a === void 0 ? void 0 : _a.features;
		if (featureSet) {
			const val = featureSet[name];
			if (val != 0) return val;
		}
		if ("kind" in ref) {
			if (ref.kind == "message") return resolveFeature(name, (_b = ref.parent) !== null && _b !== void 0 ? _b : ref.file);
			const editionDefaults = featureDefaults[ref.edition];
			if (!editionDefaults) throw new Error(`feature default for edition ${ref.edition} not found`);
			return editionDefaults[name];
		}
		return resolveFeature(name, ref.parent);
	}
	/**
	* Assert that condition is truthy or throw error (with message)
	*/
	function assert$1(condition, msg) {
		if (!condition) throw new Error(msg);
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js
	/**
	* Hydrate a file descriptor for google/protobuf/descriptor.proto from a plain
	* object.
	*
	* See createFileDescriptorProtoBoot() for details.
	*
	* @private
	*/
	function boot(boot) {
		const root = bootFileDescriptorProto(boot);
		root.messageType.forEach(restoreJsonNames);
		return createFileRegistry(root, () => void 0).getFile(root.name);
	}
	/**
	* Creates the message google.protobuf.FileDescriptorProto from an object literal.
	*
	* See createFileDescriptorProtoBoot() for details.
	*
	* @private
	*/
	function bootFileDescriptorProto(init) {
		return Object.assign(Object.create({
			syntax: "",
			edition: 0
		}), Object.assign(Object.assign({
			$typeName: "google.protobuf.FileDescriptorProto",
			dependency: [],
			publicDependency: [],
			weakDependency: [],
			optionDependency: [],
			service: [],
			extension: []
		}, init), {
			messageType: init.messageType.map(bootDescriptorProto),
			enumType: init.enumType.map(bootEnumDescriptorProto)
		}));
	}
	function bootDescriptorProto(init) {
		var _a, _b, _c, _d, _e, _f, _g, _h;
		return Object.assign(Object.create({ visibility: 0 }), {
			$typeName: "google.protobuf.DescriptorProto",
			name: init.name,
			field: (_b = (_a = init.field) === null || _a === void 0 ? void 0 : _a.map(bootFieldDescriptorProto)) !== null && _b !== void 0 ? _b : [],
			extension: [],
			nestedType: (_d = (_c = init.nestedType) === null || _c === void 0 ? void 0 : _c.map(bootDescriptorProto)) !== null && _d !== void 0 ? _d : [],
			enumType: (_f = (_e = init.enumType) === null || _e === void 0 ? void 0 : _e.map(bootEnumDescriptorProto)) !== null && _f !== void 0 ? _f : [],
			extensionRange: (_h = (_g = init.extensionRange) === null || _g === void 0 ? void 0 : _g.map((e) => Object.assign({ $typeName: "google.protobuf.DescriptorProto.ExtensionRange" }, e))) !== null && _h !== void 0 ? _h : [],
			oneofDecl: [],
			reservedRange: [],
			reservedName: []
		});
	}
	function bootFieldDescriptorProto(init) {
		return Object.assign(Object.create({
			label: 1,
			typeName: "",
			extendee: "",
			defaultValue: "",
			oneofIndex: 0,
			jsonName: "",
			proto3Optional: false
		}), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldDescriptorProto" }, init), { options: init.options ? bootFieldOptions(init.options) : void 0 }));
	}
	function bootFieldOptions(init) {
		var _a, _b, _c;
		return Object.assign(Object.create({
			ctype: 0,
			packed: false,
			jstype: 0,
			lazy: false,
			unverifiedLazy: false,
			deprecated: false,
			weak: false,
			debugRedact: false,
			retention: 0
		}), Object.assign(Object.assign({ $typeName: "google.protobuf.FieldOptions" }, init), {
			targets: (_a = init.targets) !== null && _a !== void 0 ? _a : [],
			editionDefaults: (_c = (_b = init.editionDefaults) === null || _b === void 0 ? void 0 : _b.map((e) => Object.assign({ $typeName: "google.protobuf.FieldOptions.EditionDefault" }, e))) !== null && _c !== void 0 ? _c : [],
			uninterpretedOption: []
		}));
	}
	function bootEnumDescriptorProto(init) {
		return Object.assign(Object.create({ visibility: 0 }), {
			$typeName: "google.protobuf.EnumDescriptorProto",
			name: init.name,
			reservedName: [],
			reservedRange: [],
			value: init.value.map((e) => Object.assign({ $typeName: "google.protobuf.EnumValueDescriptorProto" }, e))
		});
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js
	/**
	* Decodes a base64 string to a byte array.
	*
	* - ignores white-space, including line breaks and tabs
	* - allows inner padding (can decode concatenated base64 strings)
	* - does not require padding
	* - understands base64url encoding:
	*   "-" instead of "+",
	*   "_" instead of "/",
	*   no padding
	*/
	function base64Decode(base64Str) {
		const table = getDecodeTable();
		let es = base64Str.length * 3 / 4;
		if (base64Str[base64Str.length - 2] == "=") es -= 2;
		else if (base64Str[base64Str.length - 1] == "=") es -= 1;
		let bytes = new Uint8Array(es), bytePos = 0, groupPos = 0, b, p = 0;
		for (let i = 0; i < base64Str.length; i++) {
			b = table[base64Str.charCodeAt(i)];
			if (b === void 0) switch (base64Str[i]) {
				case "=": groupPos = 0;
				case "\n":
				case "\r":
				case "	":
				case " ": continue;
				default: throw Error("invalid base64 string");
			}
			switch (groupPos) {
				case 0:
					p = b;
					groupPos = 1;
					break;
				case 1:
					bytes[bytePos++] = p << 2 | (b & 48) >> 4;
					p = b;
					groupPos = 2;
					break;
				case 2:
					bytes[bytePos++] = (p & 15) << 4 | (b & 60) >> 2;
					p = b;
					groupPos = 3;
					break;
				case 3:
					bytes[bytePos++] = (p & 3) << 6 | b;
					groupPos = 0;
					break;
			}
		}
		if (groupPos == 1) throw Error("invalid base64 string");
		return bytes.subarray(0, bytePos);
	}
	var encodeTableStd;
	var encodeTableUrl;
	var decodeTable;
	function getEncodeTable(encoding) {
		if (!encodeTableStd) {
			encodeTableStd = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
			encodeTableUrl = encodeTableStd.slice(0, -2).concat("-", "_");
		}
		return encoding == "url" ? encodeTableUrl : encodeTableStd;
	}
	function getDecodeTable() {
		if (!decodeTable) {
			decodeTable = [];
			const encodeTable = getEncodeTable("std");
			for (let i = 0; i < encodeTable.length; i++) decodeTable[encodeTable[i].charCodeAt(0)] = i;
			decodeTable["-".charCodeAt(0)] = encodeTable.indexOf("+");
			decodeTable["_".charCodeAt(0)] = encodeTable.indexOf("/");
		}
		return decodeTable;
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/is-message.js
	/**
	* Determine whether the given `arg` is a message.
	* If `desc` is set, determine whether `arg` is this specific message.
	*/
	function isMessage(arg, schema) {
		if (!(arg !== null && typeof arg == "object" && "$typeName" in arg && typeof arg.$typeName == "string")) return false;
		if (schema === void 0) return true;
		return schema.typeName === arg.$typeName;
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js
	var FieldError = class extends Error {
		constructor(fieldOrOneof, message, name = "FieldValueInvalidError") {
			super(message);
			this.name = name;
			this.field = () => fieldOrOneof;
		}
	};
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js
	function isObject$1(arg) {
		return arg !== null && typeof arg == "object" && !Array.isArray(arg);
	}
	function isReflectList(arg, field) {
		var _a, _b, _c, _d;
		if (isObject$1(arg) && unsafeLocal in arg && "add" in arg && "field" in arg && typeof arg.field == "function") {
			if (field !== void 0) {
				const a = field;
				const b = arg.field();
				return a.listKind == b.listKind && a.scalar === b.scalar && ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName);
			}
			return true;
		}
		return false;
	}
	function isReflectMap(arg, field) {
		var _a, _b, _c, _d;
		if (isObject$1(arg) && unsafeLocal in arg && "has" in arg && "field" in arg && typeof arg.field == "function") {
			if (field !== void 0) {
				const a = field, b = arg.field();
				return a.mapKey === b.mapKey && a.mapKind == b.mapKind && a.scalar === b.scalar && ((_a = a.message) === null || _a === void 0 ? void 0 : _a.typeName) === ((_b = b.message) === null || _b === void 0 ? void 0 : _b.typeName) && ((_c = a.enum) === null || _c === void 0 ? void 0 : _c.typeName) === ((_d = b.enum) === null || _d === void 0 ? void 0 : _d.typeName);
			}
			return true;
		}
		return false;
	}
	function isReflectMessage(arg, messageDesc) {
		return isObject$1(arg) && unsafeLocal in arg && "desc" in arg && isObject$1(arg.desc) && arg.desc.kind === "message" && (messageDesc === void 0 || arg.desc.typeName == messageDesc.typeName);
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js
	var symbol = Symbol.for("@bufbuild/protobuf/text-encoding");
	function getTextEncoding() {
		if (globalThis[symbol] == void 0) {
			const te = new globalThis.TextEncoder();
			const td = new globalThis.TextDecoder();
			let tdStrict;
			globalThis[symbol] = {
				encodeUtf8(text) {
					return te.encode(text);
				},
				decodeUtf8(bytes, strict) {
					if (strict) {
						if (tdStrict === void 0) tdStrict = new globalThis.TextDecoder("utf-8", { fatal: true });
						return tdStrict.decode(bytes);
					}
					return td.decode(bytes);
				},
				checkUtf8(text) {
					try {
						return true;
					} catch (_) {
						return false;
					}
				}
			};
		}
		return globalThis[symbol];
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js
	/**
	* Protobuf binary format wire types.
	*
	* A wire type provides just enough information to find the length of the
	* following value.
	*
	* See https://developers.google.com/protocol-buffers/docs/encoding#structure
	*/
	var WireType;
	(function(WireType) {
		/**
		* Used for int32, int64, uint32, uint64, sint32, sint64, bool, enum
		*/
		WireType[WireType["Varint"] = 0] = "Varint";
		/**
		* Used for fixed64, sfixed64, double.
		* Always 8 bytes with little-endian byte order.
		*/
		WireType[WireType["Bit64"] = 1] = "Bit64";
		/**
		* Used for string, bytes, embedded messages, packed repeated fields
		*
		* Only repeated numeric types (types which use the varint, 32-bit,
		* or 64-bit wire types) can be packed. In proto3, such fields are
		* packed by default.
		*/
		WireType[WireType["LengthDelimited"] = 2] = "LengthDelimited";
		/**
		* Start of a tag-delimited aggregate, such as a proto2 group, or a message
		* in editions with message_encoding = DELIMITED.
		*/
		WireType[WireType["StartGroup"] = 3] = "StartGroup";
		/**
		* End of a tag-delimited aggregate.
		*/
		WireType[WireType["EndGroup"] = 4] = "EndGroup";
		/**
		* Used for fixed32, sfixed32, float.
		* Always 4 bytes with little-endian byte order.
		*/
		WireType[WireType["Bit32"] = 5] = "Bit32";
	})(WireType || (WireType = {}));
	var BinaryWriter = class {
		constructor(encodeUtf8 = getTextEncoding().encodeUtf8) {
			this.encodeUtf8 = encodeUtf8;
			/**
			* Previous fork states.
			*/
			this.stack = [];
			this.chunks = [];
			this.buf = [];
		}
		/**
		* Return all bytes written and reset this writer.
		*/
		finish() {
			if (this.buf.length) {
				this.chunks.push(new Uint8Array(this.buf));
				this.buf = [];
			}
			let len = 0;
			for (let i = 0; i < this.chunks.length; i++) len += this.chunks[i].length;
			let bytes = new Uint8Array(len);
			let offset = 0;
			for (let i = 0; i < this.chunks.length; i++) {
				bytes.set(this.chunks[i], offset);
				offset += this.chunks[i].length;
			}
			this.chunks = [];
			return bytes;
		}
		/**
		* Start a new fork for length-delimited data like a message
		* or a packed repeated field.
		*
		* Must be joined later with `join()`.
		*/
		fork() {
			this.stack.push({
				chunks: this.chunks,
				buf: this.buf
			});
			this.chunks = [];
			this.buf = [];
			return this;
		}
		/**
		* Join the last fork. Write its length and bytes, then
		* return to the previous state.
		*/
		join() {
			let chunk = this.finish();
			let prev = this.stack.pop();
			if (!prev) throw new Error("invalid state, fork stack empty");
			this.chunks = prev.chunks;
			this.buf = prev.buf;
			this.uint32(chunk.byteLength);
			return this.raw(chunk);
		}
		/**
		* Writes a tag (field number and wire type).
		*
		* Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`.
		*
		* Generated code should compute the tag ahead of time and call `uint32()`.
		*/
		tag(fieldNo, type) {
			return this.uint32((fieldNo << 3 | type) >>> 0);
		}
		/**
		* Write a chunk of raw bytes.
		*/
		raw(chunk) {
			if (this.buf.length) {
				this.chunks.push(new Uint8Array(this.buf));
				this.buf = [];
			}
			this.chunks.push(chunk);
			return this;
		}
		/**
		* Write a `uint32` value, an unsigned 32 bit varint.
		*/
		uint32(value) {
			assertUInt32(value);
			while (value > 127) {
				this.buf.push(value & 127 | 128);
				value = value >>> 7;
			}
			this.buf.push(value);
			return this;
		}
		/**
		* Write a `int32` value, a signed 32 bit varint.
		*/
		int32(value) {
			assertInt32(value);
			varint32write(value, this.buf);
			return this;
		}
		/**
		* Write a `bool` value, a varint.
		*/
		bool(value) {
			this.buf.push(value ? 1 : 0);
			return this;
		}
		/**
		* Write a `bytes` value, length-delimited arbitrary data.
		*/
		bytes(value) {
			this.uint32(value.byteLength);
			return this.raw(value);
		}
		/**
		* Write a `string` value, length-delimited data converted to UTF-8 text.
		*/
		string(value) {
			let chunk = this.encodeUtf8(value);
			this.uint32(chunk.byteLength);
			return this.raw(chunk);
		}
		/**
		* Write a `float` value, 32-bit floating point number.
		*/
		float(value) {
			assertFloat32(value);
			let chunk = new Uint8Array(4);
			new DataView(chunk.buffer).setFloat32(0, value, true);
			return this.raw(chunk);
		}
		/**
		* Write a `double` value, a 64-bit floating point number.
		*/
		double(value) {
			let chunk = new Uint8Array(8);
			new DataView(chunk.buffer).setFloat64(0, value, true);
			return this.raw(chunk);
		}
		/**
		* Write a `fixed32` value, an unsigned, fixed-length 32-bit integer.
		*/
		fixed32(value) {
			assertUInt32(value);
			let chunk = new Uint8Array(4);
			new DataView(chunk.buffer).setUint32(0, value, true);
			return this.raw(chunk);
		}
		/**
		* Write a `sfixed32` value, a signed, fixed-length 32-bit integer.
		*/
		sfixed32(value) {
			assertInt32(value);
			let chunk = new Uint8Array(4);
			new DataView(chunk.buffer).setInt32(0, value, true);
			return this.raw(chunk);
		}
		/**
		* Write a `sint32` value, a signed, zigzag-encoded 32-bit varint.
		*/
		sint32(value) {
			assertInt32(value);
			value = (value << 1 ^ value >> 31) >>> 0;
			varint32write(value, this.buf);
			return this;
		}
		/**
		* Write a `sfixed64` value, a signed, fixed-length 64-bit integer.
		*/
		sfixed64(value) {
			let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.enc(value);
			view.setInt32(0, tc.lo, true);
			view.setInt32(4, tc.hi, true);
			return this.raw(chunk);
		}
		/**
		* Write a `fixed64` value, an unsigned, fixed-length 64 bit integer.
		*/
		fixed64(value) {
			let chunk = new Uint8Array(8), view = new DataView(chunk.buffer), tc = protoInt64.uEnc(value);
			view.setInt32(0, tc.lo, true);
			view.setInt32(4, tc.hi, true);
			return this.raw(chunk);
		}
		/**
		* Write a `int64` value, a signed 64-bit varint.
		*/
		int64(value) {
			let tc = protoInt64.enc(value);
			varint64write(tc.lo, tc.hi, this.buf);
			return this;
		}
		/**
		* Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint.
		*/
		sint64(value) {
			const tc = protoInt64.enc(value), sign = tc.hi >> 31;
			varint64write(tc.lo << 1 ^ sign, (tc.hi << 1 | tc.lo >>> 31) ^ sign, this.buf);
			return this;
		}
		/**
		* Write a `uint64` value, an unsigned 64-bit varint.
		*/
		uint64(value) {
			const tc = protoInt64.uEnc(value);
			varint64write(tc.lo, tc.hi, this.buf);
			return this;
		}
	};
	var BinaryReader = class {
		constructor(buf, decodeUtf8 = getTextEncoding().decodeUtf8) {
			this.decodeUtf8 = decodeUtf8;
			this.varint64 = varint64read;
			/**
			* Read a `uint32` field, an unsigned 32 bit varint.
			*/
			this.uint32 = varint32read;
			this.buf = buf;
			this.len = buf.length;
			this.pos = 0;
			this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
		}
		/**
		* Reads a tag - field number and wire type. Tags are uint32 varints; values
		* that do not fit in uint32 are rejected.
		*/
		tag() {
			const start = this.pos;
			const tag = this.uint32();
			const bytesRead = this.pos - start;
			if (bytesRead > 5 || bytesRead == 5 && this.buf[this.pos - 1] > 15) throw new Error("illegal tag: varint overflows uint32");
			const fieldNo = tag >>> 3;
			const wireType = tag & 7;
			if (fieldNo <= 0 || wireType > 5) throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType);
			return [fieldNo, wireType];
		}
		/**
		* Skip one element and return the skipped data.
		*
		* When skipping StartGroup, provide the tags field number to check for
		* matching field number in the EndGroup tag.
		*/
		skip(wireType, fieldNo) {
			let start = this.pos;
			switch (wireType) {
				case WireType.Varint:
					while (this.buf[this.pos++] & 128);
					break;
				case WireType.Bit64: this.pos += 4;
				case WireType.Bit32:
					this.pos += 4;
					break;
				case WireType.LengthDelimited:
					let len = this.uint32();
					this.pos += len;
					break;
				case WireType.StartGroup:
					for (;;) {
						const [fn, wt] = this.tag();
						if (wt === WireType.EndGroup) {
							if (fieldNo !== void 0 && fn !== fieldNo) throw new Error("invalid end group tag");
							break;
						}
						this.skip(wt, fn);
					}
					break;
				default: throw new Error("cant skip wire type " + wireType);
			}
			this.assertBounds();
			return this.buf.subarray(start, this.pos);
		}
		/**
		* Throws error if position in byte array is out of range.
		*/
		assertBounds() {
			if (this.pos > this.len) throw new RangeError("premature EOF");
		}
		/**
		* Read a `int32` field, a signed 32 bit varint.
		*/
		int32() {
			return this.uint32() | 0;
		}
		/**
		* Read a `sint32` field, a signed, zigzag-encoded 32-bit varint.
		*/
		sint32() {
			let zze = this.uint32();
			return zze >>> 1 ^ -(zze & 1);
		}
		/**
		* Read a `int64` field, a signed 64-bit varint.
		*/
		int64() {
			return protoInt64.dec(...this.varint64());
		}
		/**
		* Read a `uint64` field, an unsigned 64-bit varint.
		*/
		uint64() {
			return protoInt64.uDec(...this.varint64());
		}
		/**
		* Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint.
		*/
		sint64() {
			let [lo, hi] = this.varint64();
			let s = -(lo & 1);
			lo = (lo >>> 1 | (hi & 1) << 31) ^ s;
			hi = hi >>> 1 ^ s;
			return protoInt64.dec(lo, hi);
		}
		/**
		* Read a `bool` field, a variant.
		*/
		bool() {
			let [lo, hi] = this.varint64();
			return lo !== 0 || hi !== 0;
		}
		/**
		* Read a `fixed32` field, an unsigned, fixed-length 32-bit integer.
		*/
		fixed32() {
			return this.view.getUint32((this.pos += 4) - 4, true);
		}
		/**
		* Read a `sfixed32` field, a signed, fixed-length 32-bit integer.
		*/
		sfixed32() {
			return this.view.getInt32((this.pos += 4) - 4, true);
		}
		/**
		* Read a `fixed64` field, an unsigned, fixed-length 64 bit integer.
		*/
		fixed64() {
			return protoInt64.uDec(this.sfixed32(), this.sfixed32());
		}
		/**
		* Read a `fixed64` field, a signed, fixed-length 64-bit integer.
		*/
		sfixed64() {
			return protoInt64.dec(this.sfixed32(), this.sfixed32());
		}
		/**
		* Read a `float` field, 32-bit floating point number.
		*/
		float() {
			return this.view.getFloat32((this.pos += 4) - 4, true);
		}
		/**
		* Read a `double` field, a 64-bit floating point number.
		*/
		double() {
			return this.view.getFloat64((this.pos += 8) - 8, true);
		}
		/**
		* Read a `bytes` field, length-delimited arbitrary data.
		*/
		bytes() {
			let len = this.uint32(), start = this.pos;
			this.pos += len;
			this.assertBounds();
			return this.buf.subarray(start, start + len);
		}
		/**
		* Read a `string` field, length-delimited data converted to UTF-8 text. If
		* `strict` is true, throw on invalid UTF-8 instead of substituting U+FFFD.
		*/
		string(strict) {
			return this.decodeUtf8(this.bytes(), strict);
		}
	};
	/**
	* Assert a valid signed protobuf 32-bit integer as a number or string.
	*/
	function assertInt32(arg) {
		if (typeof arg == "string") arg = Number(arg);
		else if (typeof arg != "number") throw new Error("invalid int32: " + typeof arg);
		if (!Number.isInteger(arg) || arg > 2147483647 || arg < -2147483648) throw new Error("invalid int32: " + arg);
	}
	/**
	* Assert a valid unsigned protobuf 32-bit integer as a number or string.
	*/
	function assertUInt32(arg) {
		if (typeof arg == "string") arg = Number(arg);
		else if (typeof arg != "number") throw new Error("invalid uint32: " + typeof arg);
		if (!Number.isInteger(arg) || arg > 4294967295 || arg < 0) throw new Error("invalid uint32: " + arg);
	}
	/**
	* Assert a valid protobuf float value as a number or string.
	*/
	function assertFloat32(arg) {
		if (typeof arg == "string") {
			const o = arg;
			arg = Number(arg);
			if (Number.isNaN(arg) && o !== "NaN") throw new Error("invalid float32: " + o);
		} else if (typeof arg != "number") throw new Error("invalid float32: " + typeof arg);
		if (Number.isFinite(arg) && (arg > 34028234663852886e22 || arg < -34028234663852886e22)) throw new Error("invalid float32: " + arg);
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js
	/**
	* Check whether the given field value is valid for the reflect API.
	*/
	function checkField(field, value) {
		const check = field.fieldKind == "list" ? isReflectList(value, field) : field.fieldKind == "map" ? isReflectMap(value, field) : checkSingular(field, value);
		if (check === true) return;
		let reason;
		switch (field.fieldKind) {
			case "list":
				reason = `expected ${formatReflectList(field)}, got ${formatVal(value)}`;
				break;
			case "map":
				reason = `expected ${formatReflectMap(field)}, got ${formatVal(value)}`;
				break;
			default: reason = reasonSingular(field, value, check);
		}
		return new FieldError(field, reason);
	}
	/**
	* Check whether the given list item is valid for the reflect API.
	*/
	function checkListItem(field, index, value) {
		const check = checkSingular(field, value);
		if (check !== true) return new FieldError(field, `list item #${index + 1}: ${reasonSingular(field, value, check)}`);
	}
	/**
	* Check whether the given map key and value are valid for the reflect API.
	*/
	function checkMapEntry(field, key, value) {
		const checkKey = checkScalarValue(key, field.mapKey);
		if (checkKey !== true) return new FieldError(field, `invalid map key: ${reasonSingular({ scalar: field.mapKey }, key, checkKey)}`);
		const checkVal = checkSingular(field, value);
		if (checkVal !== true) return new FieldError(field, `map entry ${formatVal(key)}: ${reasonSingular(field, value, checkVal)}`);
	}
	function checkSingular(field, value) {
		if (field.scalar !== void 0) return checkScalarValue(value, field.scalar);
		if (field.enum !== void 0) {
			if (field.enum.open) return Number.isInteger(value);
			return field.enum.values.some((v) => v.number === value);
		}
		return isReflectMessage(value, field.message);
	}
	function checkScalarValue(value, scalar) {
		switch (scalar) {
			case ScalarType.DOUBLE: return typeof value == "number";
			case ScalarType.FLOAT:
				if (typeof value != "number") return false;
				if (Number.isNaN(value) || !Number.isFinite(value)) return true;
				if (value > 34028234663852886e22 || value < -34028234663852886e22) return `${value.toFixed()} out of range`;
				return true;
			case ScalarType.INT32:
			case ScalarType.SFIXED32:
			case ScalarType.SINT32:
				if (typeof value !== "number" || !Number.isInteger(value)) return false;
				if (value > 2147483647 || value < -2147483648) return `${value.toFixed()} out of range`;
				return true;
			case ScalarType.FIXED32:
			case ScalarType.UINT32:
				if (typeof value !== "number" || !Number.isInteger(value)) return false;
				if (value > 4294967295 || value < 0) return `${value.toFixed()} out of range`;
				return true;
			case ScalarType.BOOL: return typeof value == "boolean";
			case ScalarType.STRING:
				if (typeof value != "string") return false;
				return getTextEncoding().checkUtf8(value) || "invalid UTF8";
			case ScalarType.BYTES: return value instanceof Uint8Array;
			case ScalarType.INT64:
			case ScalarType.SFIXED64:
			case ScalarType.SINT64:
				if (typeof value == "bigint" || typeof value == "number" || typeof value == "string" && value.length > 0) try {
					protoInt64.parse(value);
					return true;
				} catch (_) {
					return `${value} out of range`;
				}
				return false;
			case ScalarType.FIXED64:
			case ScalarType.UINT64:
				if (typeof value == "bigint" || typeof value == "number" || typeof value == "string" && value.length > 0) try {
					protoInt64.uParse(value);
					return true;
				} catch (_) {
					return `${value} out of range`;
				}
				return false;
		}
	}
	function reasonSingular(field, val, details) {
		details = typeof details == "string" ? `: ${details}` : `, got ${formatVal(val)}`;
		if (field.scalar !== void 0) return `expected ${scalarTypeDescription(field.scalar)}` + details;
		if (field.enum !== void 0) return `expected ${field.enum.toString()}` + details;
		return `expected ${formatReflectMessage(field.message)}` + details;
	}
	function formatVal(val) {
		switch (typeof val) {
			case "object":
				if (val === null) return "null";
				if (val instanceof Uint8Array) return `Uint8Array(${val.length})`;
				if (Array.isArray(val)) return `Array(${val.length})`;
				if (isReflectList(val)) return formatReflectList(val.field());
				if (isReflectMap(val)) return formatReflectMap(val.field());
				if (isReflectMessage(val)) return formatReflectMessage(val.desc);
				if (isMessage(val)) return `message ${val.$typeName}`;
				return "object";
			case "string": return val.length > 30 ? "string" : `"${val.split("\"").join("\\\"")}"`;
			case "boolean": return String(val);
			case "number": return String(val);
			case "bigint": return String(val) + "n";
			default: return typeof val;
		}
	}
	function formatReflectMessage(desc) {
		return `ReflectMessage (${desc.typeName})`;
	}
	function formatReflectList(field) {
		switch (field.listKind) {
			case "message": return `ReflectList (${field.message.toString()})`;
			case "enum": return `ReflectList (${field.enum.toString()})`;
			case "scalar": return `ReflectList (${ScalarType[field.scalar]})`;
		}
	}
	function formatReflectMap(field) {
		switch (field.mapKind) {
			case "message": return `ReflectMap (${ScalarType[field.mapKey]}, ${field.message.toString()})`;
			case "enum": return `ReflectMap (${ScalarType[field.mapKey]}, ${field.enum.toString()})`;
			case "scalar": return `ReflectMap (${ScalarType[field.mapKey]}, ${ScalarType[field.scalar]})`;
		}
	}
	function scalarTypeDescription(scalar) {
		switch (scalar) {
			case ScalarType.STRING: return "string";
			case ScalarType.BOOL: return "boolean";
			case ScalarType.INT64:
			case ScalarType.SINT64:
			case ScalarType.SFIXED64: return "bigint (int64)";
			case ScalarType.UINT64:
			case ScalarType.FIXED64: return "bigint (uint64)";
			case ScalarType.BYTES: return "Uint8Array";
			case ScalarType.DOUBLE: return "number (float64)";
			case ScalarType.FLOAT: return "number (float32)";
			case ScalarType.FIXED32:
			case ScalarType.UINT32: return "number (uint32)";
			case ScalarType.INT32:
			case ScalarType.SFIXED32:
			case ScalarType.SINT32: return "number (int32)";
		}
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js
	function isWrapper(arg) {
		return isWrapperTypeName(arg.$typeName);
	}
	function isWrapperDesc(messageDesc) {
		const f = messageDesc.fields[0];
		return isWrapperTypeName(messageDesc.typeName) && f !== void 0 && f.fieldKind == "scalar" && f.name == "value" && f.number == 1;
	}
	function isWrapperTypeName(name) {
		return name.startsWith("google.protobuf.") && [
			"DoubleValue",
			"FloatValue",
			"Int64Value",
			"UInt64Value",
			"Int32Value",
			"UInt32Value",
			"BoolValue",
			"StringValue",
			"BytesValue"
		].includes(name.substring(16));
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/create.js
	var EDITION_PROTO3 = 999;
	var EDITION_PROTO2 = 998;
	var IMPLICIT = 2;
	/**
	* Create a new message instance.
	*
	* The second argument is an optional initializer object, where all fields are
	* optional.
	*/
	function create(schema, init) {
		if (isMessage(init, schema)) return init;
		const message = createZeroMessage(schema);
		if (init !== void 0) initMessage(schema, message, init);
		return message;
	}
	/**
	* Sets field values from a MessageInitShape on a zero message.
	*/
	function initMessage(messageDesc, message, init) {
		for (const member of messageDesc.members) {
			let value = init[member.localName];
			if (value == null) continue;
			let field;
			if (member.kind == "oneof") {
				const oneofField = unsafeOneofCase(init, member);
				if (!oneofField) continue;
				field = oneofField;
				value = unsafeGet(init, oneofField);
			} else field = member;
			switch (field.fieldKind) {
				case "message":
					value = toMessage(field, value);
					break;
				case "scalar":
					value = initScalar(field, value);
					break;
				case "list":
					value = initList(field, value);
					break;
				case "map":
					value = initMap(field, value);
					break;
			}
			unsafeSet(message, field, value);
		}
		return message;
	}
	function initScalar(field, value) {
		if (field.scalar == ScalarType.BYTES) return toU8Arr(value);
		return value;
	}
	function initMap(field, value) {
		if (isObject$1(value)) {
			if (field.scalar == ScalarType.BYTES) return convertObjectValues(value, toU8Arr);
			if (field.mapKind == "message") return convertObjectValues(value, (val) => toMessage(field, val));
		}
		return value;
	}
	function initList(field, value) {
		if (Array.isArray(value)) {
			if (field.scalar == ScalarType.BYTES) return value.map(toU8Arr);
			if (field.listKind == "message") return value.map((item) => toMessage(field, item));
		}
		return value;
	}
	function toMessage(field, value) {
		if (field.fieldKind == "message" && !field.oneof && isWrapperDesc(field.message)) return initScalar(field.message.fields[0], value);
		if (isObject$1(value)) {
			if (field.message.typeName == "google.protobuf.Struct" && field.parent.typeName !== "google.protobuf.Value") return value;
			if (!isMessage(value, field.message)) return create(field.message, value);
		}
		return value;
	}
	function toU8Arr(value) {
		return Array.isArray(value) ? new Uint8Array(value) : value;
	}
	function convertObjectValues(obj, fn) {
		const ret = {};
		for (const entry of Object.entries(obj)) ret[entry[0]] = fn(entry[1]);
		return ret;
	}
	var tokenZeroMessageField = Symbol();
	var messagePrototypes = /* @__PURE__ */ new WeakMap();
	/**
	* Create a zero message.
	*/
	function createZeroMessage(desc) {
		let msg;
		if (!needsPrototypeChain(desc)) {
			msg = { $typeName: desc.typeName };
			for (const member of desc.members) if (member.kind == "oneof" || member.presence == IMPLICIT) msg[member.localName] = createZeroField(member);
		} else {
			const cached = messagePrototypes.get(desc);
			let prototype;
			let members;
			if (cached) ({prototype, members} = cached);
			else {
				prototype = {};
				members = /* @__PURE__ */ new Set();
				for (const member of desc.members) {
					if (member.kind == "oneof") continue;
					if (member.fieldKind != "scalar" && member.fieldKind != "enum") continue;
					if (member.presence == IMPLICIT) continue;
					members.add(member);
					prototype[member.localName] = createZeroField(member);
				}
				messagePrototypes.set(desc, {
					prototype,
					members
				});
			}
			msg = Object.create(prototype);
			msg.$typeName = desc.typeName;
			for (const member of desc.members) {
				if (members.has(member)) continue;
				if (member.kind == "field") {
					if (member.fieldKind == "message") continue;
					if (member.fieldKind == "scalar" || member.fieldKind == "enum") {
						if (member.presence != IMPLICIT) continue;
					}
				}
				msg[member.localName] = createZeroField(member);
			}
		}
		return msg;
	}
	/**
	* Do we need the prototype chain to track field presence?
	*/
	function needsPrototypeChain(desc) {
		switch (desc.file.edition) {
			case EDITION_PROTO3: return false;
			case EDITION_PROTO2: return true;
			default: return desc.fields.some((f) => f.presence != IMPLICIT && f.fieldKind != "message" && !f.oneof);
		}
	}
	/**
	* Returns a zero value for oneof groups, and for every field kind except
	* messages. Scalar and enum fields can have default values.
	*/
	function createZeroField(field) {
		if (field.kind == "oneof") return { case: void 0 };
		if (field.fieldKind == "list") return [];
		if (field.fieldKind == "map") return {};
		if (field.fieldKind == "message") return tokenZeroMessageField;
		const defaultValue = field.getDefaultValue();
		if (defaultValue !== void 0) return field.fieldKind == "scalar" && field.longAsString ? defaultValue.toString() : defaultValue;
		return field.fieldKind == "scalar" ? scalarZeroValue(field.scalar, field.longAsString) : field.enum.values[0].number;
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js
	/**
	* Create a ReflectMessage.
	*/
	function reflect(messageDesc, message, check = true) {
		return new ReflectMessageImpl(messageDesc, message, check);
	}
	var messageSortedFields = /* @__PURE__ */ new WeakMap();
	var ReflectMessageImpl = class {
		get sortedFields() {
			const cached = messageSortedFields.get(this.desc);
			if (cached) return cached;
			const sortedFields = this.desc.fields.concat().sort((a, b) => a.number - b.number);
			messageSortedFields.set(this.desc, sortedFields);
			return sortedFields;
		}
		constructor(messageDesc, message, check = true) {
			this.lists = /* @__PURE__ */ new Map();
			this.maps = /* @__PURE__ */ new Map();
			this.check = check;
			this.desc = messageDesc;
			this.message = this[unsafeLocal] = message !== null && message !== void 0 ? message : create(messageDesc);
			this.fields = messageDesc.fields;
			this.oneofs = messageDesc.oneofs;
			this.members = messageDesc.members;
		}
		findNumber(number) {
			if (!this._fieldsByNumber) this._fieldsByNumber = new Map(this.desc.fields.map((f) => [f.number, f]));
			return this._fieldsByNumber.get(number);
		}
		oneofCase(oneof) {
			assertOwn(this.message, oneof);
			return unsafeOneofCase(this.message, oneof);
		}
		isSet(field) {
			assertOwn(this.message, field);
			return unsafeIsSet(this.message, field);
		}
		clear(field) {
			assertOwn(this.message, field);
			unsafeClear(this.message, field);
		}
		get(field) {
			assertOwn(this.message, field);
			const value = unsafeGet(this.message, field);
			switch (field.fieldKind) {
				case "list":
					let list = this.lists.get(field);
					if (!list || list[unsafeLocal] !== value) this.lists.set(field, list = new ReflectListImpl(field, value, this.check));
					return list;
				case "map":
					let map = this.maps.get(field);
					if (!map || map[unsafeLocal] !== value) this.maps.set(field, map = new ReflectMapImpl(field, value, this.check));
					return map;
				case "message": return messageToReflect(field, value, this.check);
				case "scalar": return value === void 0 ? scalarZeroValue(field.scalar, false) : longToReflect(field, value);
				case "enum": return value !== null && value !== void 0 ? value : field.enum.values[0].number;
			}
		}
		set(field, value) {
			assertOwn(this.message, field);
			if (this.check) {
				const err = checkField(field, value);
				if (err) throw err;
			}
			let local;
			if (field.fieldKind == "message") local = messageToLocal(field, value);
			else if (isReflectMap(value) || isReflectList(value)) local = value[unsafeLocal];
			else local = longToLocal(field, value);
			unsafeSet(this.message, field, local);
		}
		getUnknown() {
			return this.message.$unknown;
		}
		setUnknown(value) {
			this.message.$unknown = value;
		}
	};
	function assertOwn(owner, member) {
		if (member.parent.typeName !== owner.$typeName) throw new FieldError(member, `cannot use ${member.toString()} with message ${owner.$typeName}`, "ForeignFieldError");
	}
	var ReflectListImpl = class {
		field() {
			return this._field;
		}
		get size() {
			return this._arr.length;
		}
		constructor(field, unsafeInput, check) {
			this._field = field;
			this._arr = this[unsafeLocal] = unsafeInput;
			this.check = check;
		}
		get(index) {
			const item = this._arr[index];
			return item === void 0 ? void 0 : listItemToReflect(this._field, item, this.check);
		}
		set(index, item) {
			if (index < 0 || index >= this._arr.length) throw new FieldError(this._field, `list item #${index + 1}: out of range`);
			if (this.check) {
				const err = checkListItem(this._field, index, item);
				if (err) throw err;
			}
			this._arr[index] = listItemToLocal(this._field, item);
		}
		add(item) {
			if (this.check) {
				const err = checkListItem(this._field, this._arr.length, item);
				if (err) throw err;
			}
			this._arr.push(listItemToLocal(this._field, item));
		}
		clear() {
			this._arr.splice(0, this._arr.length);
		}
		[Symbol.iterator]() {
			return this.values();
		}
		keys() {
			return this._arr.keys();
		}
		*values() {
			for (const item of this._arr) yield listItemToReflect(this._field, item, this.check);
		}
		*entries() {
			for (let i = 0; i < this._arr.length; i++) yield [i, listItemToReflect(this._field, this._arr[i], this.check)];
		}
	};
	var ReflectMapImpl = class {
		constructor(field, unsafeInput, check = true) {
			this.obj = this[unsafeLocal] = unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : {};
			this.check = check;
			this._field = field;
		}
		field() {
			return this._field;
		}
		set(key, value) {
			if (this.check) {
				const err = checkMapEntry(this._field, key, value);
				if (err) throw err;
			}
			this.obj[mapKeyToLocal(key)] = mapValueToLocal(this._field, value);
			return this;
		}
		delete(key) {
			const k = mapKeyToLocal(key);
			const has = Object.prototype.hasOwnProperty.call(this.obj, k);
			if (has) delete this.obj[k];
			return has;
		}
		clear() {
			for (const key of Object.keys(this.obj)) delete this.obj[key];
		}
		get(key) {
			let val = this.obj[mapKeyToLocal(key)];
			if (val !== void 0) val = mapValueToReflect(this._field, val, this.check);
			return val;
		}
		has(key) {
			return Object.prototype.hasOwnProperty.call(this.obj, mapKeyToLocal(key));
		}
		*keys() {
			for (const objKey of Object.keys(this.obj)) yield mapKeyToReflect(objKey, this._field.mapKey);
		}
		*entries() {
			for (const objEntry of Object.entries(this.obj)) yield [mapKeyToReflect(objEntry[0], this._field.mapKey), mapValueToReflect(this._field, objEntry[1], this.check)];
		}
		[Symbol.iterator]() {
			return this.entries();
		}
		get size() {
			return Object.keys(this.obj).length;
		}
		*values() {
			for (const val of Object.values(this.obj)) yield mapValueToReflect(this._field, val, this.check);
		}
		forEach(callbackfn, thisArg) {
			for (const mapEntry of this.entries()) callbackfn.call(thisArg, mapEntry[1], mapEntry[0], this);
		}
	};
	function messageToLocal(field, value) {
		if (!isReflectMessage(value)) return value;
		if (isWrapper(value.message) && !field.oneof && field.fieldKind == "message") return value.message.value;
		if (value.desc.typeName == "google.protobuf.Struct" && field.parent.typeName != "google.protobuf.Value") return wktStructToLocal(value.message);
		return value.message;
	}
	function messageToReflect(field, value, check) {
		if (value !== void 0) {
			if (isWrapperDesc(field.message) && !field.oneof && field.fieldKind == "message") value = {
				$typeName: field.message.typeName,
				value: longToReflect(field.message.fields[0], value)
			};
			else if (field.message.typeName == "google.protobuf.Struct" && field.parent.typeName != "google.protobuf.Value" && isObject$1(value)) value = wktStructToReflect(value);
		}
		return new ReflectMessageImpl(field.message, value, check);
	}
	function listItemToLocal(field, value) {
		if (field.listKind == "message") return messageToLocal(field, value);
		return longToLocal(field, value);
	}
	function listItemToReflect(field, value, check) {
		if (field.listKind == "message") return messageToReflect(field, value, check);
		return longToReflect(field, value);
	}
	function mapValueToLocal(field, value) {
		if (field.mapKind == "message") return messageToLocal(field, value);
		return longToLocal(field, value);
	}
	function mapValueToReflect(field, value, check) {
		if (field.mapKind == "message") return messageToReflect(field, value, check);
		return value;
	}
	function mapKeyToLocal(key) {
		return typeof key == "string" || typeof key == "number" ? key : String(key);
	}
	/**
	* Converts a map key (any scalar value except float, double, or bytes) from its
	* representation in a message (string or number, the only possible object key
	* types) to the closest possible type in ECMAScript.
	*/
	function mapKeyToReflect(key, type) {
		switch (type) {
			case ScalarType.STRING: return key;
			case ScalarType.INT32:
			case ScalarType.FIXED32:
			case ScalarType.UINT32:
			case ScalarType.SFIXED32:
			case ScalarType.SINT32: {
				const n = Number.parseInt(key);
				if (Number.isFinite(n)) return n;
				break;
			}
			case ScalarType.BOOL:
				switch (key) {
					case "true": return true;
					case "false": return false;
				}
				break;
			case ScalarType.UINT64:
			case ScalarType.FIXED64:
				try {
					return protoInt64.uParse(key);
				} catch (_a) {}
				break;
			default:
				try {
					return protoInt64.parse(key);
				} catch (_b) {}
				break;
		}
		return key;
	}
	function longToReflect(field, value) {
		switch (field.scalar) {
			case ScalarType.INT64:
			case ScalarType.SFIXED64:
			case ScalarType.SINT64:
				if ("longAsString" in field && field.longAsString && typeof value == "string") value = protoInt64.parse(value);
				break;
			case ScalarType.FIXED64:
			case ScalarType.UINT64:
				if ("longAsString" in field && field.longAsString && typeof value == "string") value = protoInt64.uParse(value);
				break;
		}
		return value;
	}
	function longToLocal(field, value) {
		switch (field.scalar) {
			case ScalarType.INT64:
			case ScalarType.SFIXED64:
			case ScalarType.SINT64:
				if ("longAsString" in field && field.longAsString) value = String(value);
				else if (typeof value == "string" || typeof value == "number") value = protoInt64.parse(value);
				break;
			case ScalarType.FIXED64:
			case ScalarType.UINT64:
				if ("longAsString" in field && field.longAsString) value = String(value);
				else if (typeof value == "string" || typeof value == "number") value = protoInt64.uParse(value);
				break;
		}
		return value;
	}
	function wktStructToReflect(json) {
		const struct = {
			$typeName: "google.protobuf.Struct",
			fields: {}
		};
		if (isObject$1(json)) for (const [k, v] of Object.entries(json)) struct.fields[k] = wktValueToReflect(v);
		return struct;
	}
	function wktStructToLocal(val) {
		const json = {};
		for (const [k, v] of Object.entries(val.fields)) json[k] = wktValueToLocal(v);
		return json;
	}
	function wktValueToLocal(val) {
		switch (val.kind.case) {
			case "structValue": return wktStructToLocal(val.kind.value);
			case "listValue": return val.kind.value.values.map(wktValueToLocal);
			case "nullValue":
			case void 0: return null;
			default: return val.kind.value;
		}
	}
	function wktValueToReflect(json) {
		const value = {
			$typeName: "google.protobuf.Value",
			kind: { case: void 0 }
		};
		switch (typeof json) {
			case "number":
				value.kind = {
					case: "numberValue",
					value: json
				};
				break;
			case "string":
				value.kind = {
					case: "stringValue",
					value: json
				};
				break;
			case "boolean":
				value.kind = {
					case: "boolValue",
					value: json
				};
				break;
			case "object":
				if (json === null) value.kind = {
					case: "nullValue",
					value: 0
				};
				else if (Array.isArray(json)) {
					const listValue = {
						$typeName: "google.protobuf.ListValue",
						values: []
					};
					if (Array.isArray(json)) for (const e of json) listValue.values.push(wktValueToReflect(e));
					value.kind = {
						case: "listValue",
						value: listValue
					};
				} else value.kind = {
					case: "structValue",
					value: wktStructToReflect(json)
				};
				break;
		}
		return value;
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/to-binary.js
	var LEGACY_REQUIRED = 3;
	var writeDefaults = { writeUnknownFields: true };
	function makeWriteOptions(options) {
		return options ? Object.assign(Object.assign({}, writeDefaults), options) : writeDefaults;
	}
	function toBinary(schema, message, options) {
		return writeFields(new BinaryWriter(), makeWriteOptions(options), reflect(schema, message)).finish();
	}
	function writeFields(writer, opts, msg) {
		var _a;
		for (const f of msg.sortedFields) {
			if (!msg.isSet(f)) {
				if (f.presence == LEGACY_REQUIRED) throw new Error(`cannot encode ${f} to binary: required field not set`);
				continue;
			}
			writeField(writer, opts, msg, f);
		}
		if (opts.writeUnknownFields) for (const { no, wireType, data } of (_a = msg.getUnknown()) !== null && _a !== void 0 ? _a : []) writer.tag(no, wireType).raw(data);
		return writer;
	}
	/**
	* @private
	*/
	function writeField(writer, opts, msg, field) {
		var _a;
		switch (field.fieldKind) {
			case "scalar":
			case "enum":
				writeScalar(writer, msg.desc.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32, field.number, msg.get(field));
				break;
			case "list":
				writeListField(writer, opts, field, msg.get(field));
				break;
			case "message":
				writeMessageField(writer, opts, field, msg.get(field));
				break;
			case "map":
				for (const [key, val] of msg.get(field)) writeMapEntry(writer, opts, field, key, val);
				break;
		}
	}
	function writeScalar(writer, msgName, fieldName, scalarType, fieldNo, value) {
		writeScalarValue(writer.tag(fieldNo, writeTypeOfScalar(scalarType)), msgName, fieldName, scalarType, value);
	}
	function writeMessageField(writer, opts, field, message) {
		if (field.delimitedEncoding) writeFields(writer.tag(field.number, WireType.StartGroup), opts, message).tag(field.number, WireType.EndGroup);
		else writeFields(writer.tag(field.number, WireType.LengthDelimited).fork(), opts, message).join();
	}
	function writeListField(writer, opts, field, list) {
		var _a;
		if (field.listKind == "message") {
			for (const item of list) writeMessageField(writer, opts, field, item);
			return;
		}
		const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32;
		if (field.packed) {
			if (!list.size) return;
			writer.tag(field.number, WireType.LengthDelimited).fork();
			for (const item of list) writeScalarValue(writer, field.parent.typeName, field.name, scalarType, item);
			writer.join();
			return;
		}
		for (const item of list) writeScalar(writer, field.parent.typeName, field.name, scalarType, field.number, item);
	}
	function writeMapEntry(writer, opts, field, key, value) {
		var _a;
		writer.tag(field.number, WireType.LengthDelimited).fork();
		writeScalar(writer, field.parent.typeName, field.name, field.mapKey, 1, key);
		switch (field.mapKind) {
			case "scalar":
			case "enum":
				writeScalar(writer, field.parent.typeName, field.name, (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32, 2, value);
				break;
			case "message":
				writeFields(writer.tag(2, WireType.LengthDelimited).fork(), opts, value).join();
				break;
		}
		writer.join();
	}
	function writeScalarValue(writer, msgName, fieldName, type, value) {
		try {
			switch (type) {
				case ScalarType.STRING:
					writer.string(value);
					break;
				case ScalarType.BOOL:
					writer.bool(value);
					break;
				case ScalarType.DOUBLE:
					writer.double(value);
					break;
				case ScalarType.FLOAT:
					writer.float(value);
					break;
				case ScalarType.INT32:
					writer.int32(value);
					break;
				case ScalarType.INT64:
					writer.int64(value);
					break;
				case ScalarType.UINT64:
					writer.uint64(value);
					break;
				case ScalarType.FIXED64:
					writer.fixed64(value);
					break;
				case ScalarType.BYTES:
					writer.bytes(value);
					break;
				case ScalarType.FIXED32:
					writer.fixed32(value);
					break;
				case ScalarType.SFIXED32:
					writer.sfixed32(value);
					break;
				case ScalarType.SFIXED64:
					writer.sfixed64(value);
					break;
				case ScalarType.SINT64:
					writer.sint64(value);
					break;
				case ScalarType.UINT32:
					writer.uint32(value);
					break;
				case ScalarType.SINT32:
					writer.sint32(value);
					break;
			}
		} catch (e) {
			if (e instanceof Error) throw new Error(`cannot encode field ${msgName}.${fieldName} to binary: ${e.message}`);
			throw e;
		}
	}
	function writeTypeOfScalar(type) {
		switch (type) {
			case ScalarType.BYTES:
			case ScalarType.STRING: return WireType.LengthDelimited;
			case ScalarType.DOUBLE:
			case ScalarType.FIXED64:
			case ScalarType.SFIXED64: return WireType.Bit64;
			case ScalarType.FIXED32:
			case ScalarType.SFIXED32:
			case ScalarType.FLOAT: return WireType.Bit32;
			default: return WireType.Varint;
		}
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js
	/**
	* Hydrate a message descriptor.
	*
	* @private
	*/
	function messageDesc(file, path, ...paths) {
		return paths.reduce((acc, cur) => acc.nestedMessages[cur], file.messages[path]);
	}
	/**
	* Describes the message google.protobuf.FileDescriptorProto.
	* Use `create(FileDescriptorProtoSchema)` to create a new message.
	*/
	var FileDescriptorProtoSchema = /* @__PURE__ */ messageDesc(/* @__PURE__ */ boot({
		"name": "google/protobuf/descriptor.proto",
		"package": "google.protobuf",
		"messageType": [
			{
				"name": "FileDescriptorSet",
				"field": [{
					"name": "file",
					"number": 1,
					"type": 11,
					"label": 3,
					"typeName": ".google.protobuf.FileDescriptorProto"
				}],
				"extensionRange": [{
					"start": 536e6,
					"end": 536000001
				}]
			},
			{
				"name": "FileDescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "package",
						"number": 2,
						"type": 9,
						"label": 1
					},
					{
						"name": "dependency",
						"number": 3,
						"type": 9,
						"label": 3
					},
					{
						"name": "public_dependency",
						"number": 10,
						"type": 5,
						"label": 3
					},
					{
						"name": "weak_dependency",
						"number": 11,
						"type": 5,
						"label": 3
					},
					{
						"name": "option_dependency",
						"number": 15,
						"type": 9,
						"label": 3
					},
					{
						"name": "message_type",
						"number": 4,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.DescriptorProto"
					},
					{
						"name": "enum_type",
						"number": 5,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.EnumDescriptorProto"
					},
					{
						"name": "service",
						"number": 6,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.ServiceDescriptorProto"
					},
					{
						"name": "extension",
						"number": 7,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.FieldDescriptorProto"
					},
					{
						"name": "options",
						"number": 8,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FileOptions"
					},
					{
						"name": "source_code_info",
						"number": 9,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.SourceCodeInfo"
					},
					{
						"name": "syntax",
						"number": 12,
						"type": 9,
						"label": 1
					},
					{
						"name": "edition",
						"number": 14,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.Edition"
					}
				]
			},
			{
				"name": "DescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "field",
						"number": 2,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.FieldDescriptorProto"
					},
					{
						"name": "extension",
						"number": 6,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.FieldDescriptorProto"
					},
					{
						"name": "nested_type",
						"number": 3,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.DescriptorProto"
					},
					{
						"name": "enum_type",
						"number": 4,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.EnumDescriptorProto"
					},
					{
						"name": "extension_range",
						"number": 5,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.DescriptorProto.ExtensionRange"
					},
					{
						"name": "oneof_decl",
						"number": 8,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.OneofDescriptorProto"
					},
					{
						"name": "options",
						"number": 7,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.MessageOptions"
					},
					{
						"name": "reserved_range",
						"number": 9,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.DescriptorProto.ReservedRange"
					},
					{
						"name": "reserved_name",
						"number": 10,
						"type": 9,
						"label": 3
					},
					{
						"name": "visibility",
						"number": 11,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.SymbolVisibility"
					}
				],
				"nestedType": [{
					"name": "ExtensionRange",
					"field": [
						{
							"name": "start",
							"number": 1,
							"type": 5,
							"label": 1
						},
						{
							"name": "end",
							"number": 2,
							"type": 5,
							"label": 1
						},
						{
							"name": "options",
							"number": 3,
							"type": 11,
							"label": 1,
							"typeName": ".google.protobuf.ExtensionRangeOptions"
						}
					]
				}, {
					"name": "ReservedRange",
					"field": [{
						"name": "start",
						"number": 1,
						"type": 5,
						"label": 1
					}, {
						"name": "end",
						"number": 2,
						"type": 5,
						"label": 1
					}]
				}]
			},
			{
				"name": "ExtensionRangeOptions",
				"field": [
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					},
					{
						"name": "declaration",
						"number": 2,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.ExtensionRangeOptions.Declaration",
						"options": { "retention": 2 }
					},
					{
						"name": "features",
						"number": 50,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "verification",
						"number": 3,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.ExtensionRangeOptions.VerificationState",
						"defaultValue": "UNVERIFIED",
						"options": { "retention": 2 }
					}
				],
				"nestedType": [{
					"name": "Declaration",
					"field": [
						{
							"name": "number",
							"number": 1,
							"type": 5,
							"label": 1
						},
						{
							"name": "full_name",
							"number": 2,
							"type": 9,
							"label": 1
						},
						{
							"name": "type",
							"number": 3,
							"type": 9,
							"label": 1
						},
						{
							"name": "reserved",
							"number": 5,
							"type": 8,
							"label": 1
						},
						{
							"name": "repeated",
							"number": 6,
							"type": 8,
							"label": 1
						}
					]
				}],
				"enumType": [{
					"name": "VerificationState",
					"value": [{
						"name": "DECLARATION",
						"number": 0
					}, {
						"name": "UNVERIFIED",
						"number": 1
					}]
				}],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "FieldDescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "number",
						"number": 3,
						"type": 5,
						"label": 1
					},
					{
						"name": "label",
						"number": 4,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FieldDescriptorProto.Label"
					},
					{
						"name": "type",
						"number": 5,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FieldDescriptorProto.Type"
					},
					{
						"name": "type_name",
						"number": 6,
						"type": 9,
						"label": 1
					},
					{
						"name": "extendee",
						"number": 2,
						"type": 9,
						"label": 1
					},
					{
						"name": "default_value",
						"number": 7,
						"type": 9,
						"label": 1
					},
					{
						"name": "oneof_index",
						"number": 9,
						"type": 5,
						"label": 1
					},
					{
						"name": "json_name",
						"number": 10,
						"type": 9,
						"label": 1
					},
					{
						"name": "options",
						"number": 8,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FieldOptions"
					},
					{
						"name": "proto3_optional",
						"number": 17,
						"type": 8,
						"label": 1
					}
				],
				"enumType": [{
					"name": "Type",
					"value": [
						{
							"name": "TYPE_DOUBLE",
							"number": 1
						},
						{
							"name": "TYPE_FLOAT",
							"number": 2
						},
						{
							"name": "TYPE_INT64",
							"number": 3
						},
						{
							"name": "TYPE_UINT64",
							"number": 4
						},
						{
							"name": "TYPE_INT32",
							"number": 5
						},
						{
							"name": "TYPE_FIXED64",
							"number": 6
						},
						{
							"name": "TYPE_FIXED32",
							"number": 7
						},
						{
							"name": "TYPE_BOOL",
							"number": 8
						},
						{
							"name": "TYPE_STRING",
							"number": 9
						},
						{
							"name": "TYPE_GROUP",
							"number": 10
						},
						{
							"name": "TYPE_MESSAGE",
							"number": 11
						},
						{
							"name": "TYPE_BYTES",
							"number": 12
						},
						{
							"name": "TYPE_UINT32",
							"number": 13
						},
						{
							"name": "TYPE_ENUM",
							"number": 14
						},
						{
							"name": "TYPE_SFIXED32",
							"number": 15
						},
						{
							"name": "TYPE_SFIXED64",
							"number": 16
						},
						{
							"name": "TYPE_SINT32",
							"number": 17
						},
						{
							"name": "TYPE_SINT64",
							"number": 18
						}
					]
				}, {
					"name": "Label",
					"value": [
						{
							"name": "LABEL_OPTIONAL",
							"number": 1
						},
						{
							"name": "LABEL_REPEATED",
							"number": 3
						},
						{
							"name": "LABEL_REQUIRED",
							"number": 2
						}
					]
				}]
			},
			{
				"name": "OneofDescriptorProto",
				"field": [{
					"name": "name",
					"number": 1,
					"type": 9,
					"label": 1
				}, {
					"name": "options",
					"number": 2,
					"type": 11,
					"label": 1,
					"typeName": ".google.protobuf.OneofOptions"
				}]
			},
			{
				"name": "EnumDescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "value",
						"number": 2,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.EnumValueDescriptorProto"
					},
					{
						"name": "options",
						"number": 3,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.EnumOptions"
					},
					{
						"name": "reserved_range",
						"number": 4,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.EnumDescriptorProto.EnumReservedRange"
					},
					{
						"name": "reserved_name",
						"number": 5,
						"type": 9,
						"label": 3
					},
					{
						"name": "visibility",
						"number": 6,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.SymbolVisibility"
					}
				],
				"nestedType": [{
					"name": "EnumReservedRange",
					"field": [{
						"name": "start",
						"number": 1,
						"type": 5,
						"label": 1
					}, {
						"name": "end",
						"number": 2,
						"type": 5,
						"label": 1
					}]
				}]
			},
			{
				"name": "EnumValueDescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "number",
						"number": 2,
						"type": 5,
						"label": 1
					},
					{
						"name": "options",
						"number": 3,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.EnumValueOptions"
					}
				]
			},
			{
				"name": "ServiceDescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "method",
						"number": 2,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.MethodDescriptorProto"
					},
					{
						"name": "options",
						"number": 3,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.ServiceOptions"
					}
				]
			},
			{
				"name": "MethodDescriptorProto",
				"field": [
					{
						"name": "name",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "input_type",
						"number": 2,
						"type": 9,
						"label": 1
					},
					{
						"name": "output_type",
						"number": 3,
						"type": 9,
						"label": 1
					},
					{
						"name": "options",
						"number": 4,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.MethodOptions"
					},
					{
						"name": "client_streaming",
						"number": 5,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "server_streaming",
						"number": 6,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					}
				]
			},
			{
				"name": "FileOptions",
				"field": [
					{
						"name": "java_package",
						"number": 1,
						"type": 9,
						"label": 1
					},
					{
						"name": "java_outer_classname",
						"number": 8,
						"type": 9,
						"label": 1
					},
					{
						"name": "java_multiple_files",
						"number": 10,
						"type": 8,
						"label": 1,
						"defaultValue": "false",
						"options": {}
					},
					{
						"name": "java_generate_equals_and_hash",
						"number": 20,
						"type": 8,
						"label": 1,
						"options": { "deprecated": true }
					},
					{
						"name": "java_string_check_utf8",
						"number": 27,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "optimize_for",
						"number": 9,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FileOptions.OptimizeMode",
						"defaultValue": "SPEED"
					},
					{
						"name": "go_package",
						"number": 11,
						"type": 9,
						"label": 1
					},
					{
						"name": "cc_generic_services",
						"number": 16,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "java_generic_services",
						"number": 17,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "py_generic_services",
						"number": 18,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "deprecated",
						"number": 23,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "cc_enable_arenas",
						"number": 31,
						"type": 8,
						"label": 1,
						"defaultValue": "true"
					},
					{
						"name": "objc_class_prefix",
						"number": 36,
						"type": 9,
						"label": 1
					},
					{
						"name": "csharp_namespace",
						"number": 37,
						"type": 9,
						"label": 1
					},
					{
						"name": "swift_prefix",
						"number": 39,
						"type": 9,
						"label": 1
					},
					{
						"name": "php_class_prefix",
						"number": 40,
						"type": 9,
						"label": 1
					},
					{
						"name": "php_namespace",
						"number": 41,
						"type": 9,
						"label": 1
					},
					{
						"name": "php_metadata_namespace",
						"number": 44,
						"type": 9,
						"label": 1
					},
					{
						"name": "ruby_package",
						"number": 45,
						"type": 9,
						"label": 1
					},
					{
						"name": "features",
						"number": 50,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"enumType": [{
					"name": "OptimizeMode",
					"value": [
						{
							"name": "SPEED",
							"number": 1
						},
						{
							"name": "CODE_SIZE",
							"number": 2
						},
						{
							"name": "LITE_RUNTIME",
							"number": 3
						}
					]
				}],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "MessageOptions",
				"field": [
					{
						"name": "message_set_wire_format",
						"number": 1,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "no_standard_descriptor_accessor",
						"number": 2,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "deprecated",
						"number": 3,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "map_entry",
						"number": 7,
						"type": 8,
						"label": 1
					},
					{
						"name": "deprecated_legacy_json_field_conflicts",
						"number": 11,
						"type": 8,
						"label": 1,
						"options": { "deprecated": true }
					},
					{
						"name": "features",
						"number": 12,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "FieldOptions",
				"field": [
					{
						"name": "ctype",
						"number": 1,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FieldOptions.CType",
						"defaultValue": "STRING"
					},
					{
						"name": "packed",
						"number": 2,
						"type": 8,
						"label": 1
					},
					{
						"name": "jstype",
						"number": 6,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FieldOptions.JSType",
						"defaultValue": "JS_NORMAL"
					},
					{
						"name": "lazy",
						"number": 5,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "unverified_lazy",
						"number": 15,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "deprecated",
						"number": 3,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "weak",
						"number": 10,
						"type": 8,
						"label": 1,
						"defaultValue": "false",
						"options": { "deprecated": true }
					},
					{
						"name": "debug_redact",
						"number": 16,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "retention",
						"number": 17,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FieldOptions.OptionRetention"
					},
					{
						"name": "targets",
						"number": 19,
						"type": 14,
						"label": 3,
						"typeName": ".google.protobuf.FieldOptions.OptionTargetType"
					},
					{
						"name": "edition_defaults",
						"number": 20,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.FieldOptions.EditionDefault"
					},
					{
						"name": "features",
						"number": 21,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "feature_support",
						"number": 22,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FieldOptions.FeatureSupport"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"nestedType": [{
					"name": "EditionDefault",
					"field": [{
						"name": "edition",
						"number": 3,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.Edition"
					}, {
						"name": "value",
						"number": 2,
						"type": 9,
						"label": 1
					}]
				}, {
					"name": "FeatureSupport",
					"field": [
						{
							"name": "edition_introduced",
							"number": 1,
							"type": 14,
							"label": 1,
							"typeName": ".google.protobuf.Edition"
						},
						{
							"name": "edition_deprecated",
							"number": 2,
							"type": 14,
							"label": 1,
							"typeName": ".google.protobuf.Edition"
						},
						{
							"name": "deprecation_warning",
							"number": 3,
							"type": 9,
							"label": 1
						},
						{
							"name": "edition_removed",
							"number": 4,
							"type": 14,
							"label": 1,
							"typeName": ".google.protobuf.Edition"
						},
						{
							"name": "removal_error",
							"number": 5,
							"type": 9,
							"label": 1
						}
					]
				}],
				"enumType": [
					{
						"name": "CType",
						"value": [
							{
								"name": "STRING",
								"number": 0
							},
							{
								"name": "CORD",
								"number": 1
							},
							{
								"name": "STRING_PIECE",
								"number": 2
							}
						]
					},
					{
						"name": "JSType",
						"value": [
							{
								"name": "JS_NORMAL",
								"number": 0
							},
							{
								"name": "JS_STRING",
								"number": 1
							},
							{
								"name": "JS_NUMBER",
								"number": 2
							}
						]
					},
					{
						"name": "OptionRetention",
						"value": [
							{
								"name": "RETENTION_UNKNOWN",
								"number": 0
							},
							{
								"name": "RETENTION_RUNTIME",
								"number": 1
							},
							{
								"name": "RETENTION_SOURCE",
								"number": 2
							}
						]
					},
					{
						"name": "OptionTargetType",
						"value": [
							{
								"name": "TARGET_TYPE_UNKNOWN",
								"number": 0
							},
							{
								"name": "TARGET_TYPE_FILE",
								"number": 1
							},
							{
								"name": "TARGET_TYPE_EXTENSION_RANGE",
								"number": 2
							},
							{
								"name": "TARGET_TYPE_MESSAGE",
								"number": 3
							},
							{
								"name": "TARGET_TYPE_FIELD",
								"number": 4
							},
							{
								"name": "TARGET_TYPE_ONEOF",
								"number": 5
							},
							{
								"name": "TARGET_TYPE_ENUM",
								"number": 6
							},
							{
								"name": "TARGET_TYPE_ENUM_ENTRY",
								"number": 7
							},
							{
								"name": "TARGET_TYPE_SERVICE",
								"number": 8
							},
							{
								"name": "TARGET_TYPE_METHOD",
								"number": 9
							}
						]
					}
				],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "OneofOptions",
				"field": [{
					"name": "features",
					"number": 1,
					"type": 11,
					"label": 1,
					"typeName": ".google.protobuf.FeatureSet"
				}, {
					"name": "uninterpreted_option",
					"number": 999,
					"type": 11,
					"label": 3,
					"typeName": ".google.protobuf.UninterpretedOption"
				}],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "EnumOptions",
				"field": [
					{
						"name": "allow_alias",
						"number": 2,
						"type": 8,
						"label": 1
					},
					{
						"name": "deprecated",
						"number": 3,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "deprecated_legacy_json_field_conflicts",
						"number": 6,
						"type": 8,
						"label": 1,
						"options": { "deprecated": true }
					},
					{
						"name": "features",
						"number": 7,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "EnumValueOptions",
				"field": [
					{
						"name": "deprecated",
						"number": 1,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "features",
						"number": 2,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "debug_redact",
						"number": 3,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "feature_support",
						"number": 4,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FieldOptions.FeatureSupport"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "ServiceOptions",
				"field": [
					{
						"name": "features",
						"number": 34,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "deprecated",
						"number": 33,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "MethodOptions",
				"field": [
					{
						"name": "deprecated",
						"number": 33,
						"type": 8,
						"label": 1,
						"defaultValue": "false"
					},
					{
						"name": "idempotency_level",
						"number": 34,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.MethodOptions.IdempotencyLevel",
						"defaultValue": "IDEMPOTENCY_UNKNOWN"
					},
					{
						"name": "features",
						"number": 35,
						"type": 11,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet"
					},
					{
						"name": "uninterpreted_option",
						"number": 999,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption"
					}
				],
				"enumType": [{
					"name": "IdempotencyLevel",
					"value": [
						{
							"name": "IDEMPOTENCY_UNKNOWN",
							"number": 0
						},
						{
							"name": "NO_SIDE_EFFECTS",
							"number": 1
						},
						{
							"name": "IDEMPOTENT",
							"number": 2
						}
					]
				}],
				"extensionRange": [{
					"start": 1e3,
					"end": 536870912
				}]
			},
			{
				"name": "UninterpretedOption",
				"field": [
					{
						"name": "name",
						"number": 2,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.UninterpretedOption.NamePart"
					},
					{
						"name": "identifier_value",
						"number": 3,
						"type": 9,
						"label": 1
					},
					{
						"name": "positive_int_value",
						"number": 4,
						"type": 4,
						"label": 1
					},
					{
						"name": "negative_int_value",
						"number": 5,
						"type": 3,
						"label": 1
					},
					{
						"name": "double_value",
						"number": 6,
						"type": 1,
						"label": 1
					},
					{
						"name": "string_value",
						"number": 7,
						"type": 12,
						"label": 1
					},
					{
						"name": "aggregate_value",
						"number": 8,
						"type": 9,
						"label": 1
					}
				],
				"nestedType": [{
					"name": "NamePart",
					"field": [{
						"name": "name_part",
						"number": 1,
						"type": 9,
						"label": 2
					}, {
						"name": "is_extension",
						"number": 2,
						"type": 8,
						"label": 2
					}]
				}]
			},
			{
				"name": "FeatureSet",
				"field": [
					{
						"name": "field_presence",
						"number": 1,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.FieldPresence",
						"options": {
							"retention": 1,
							"targets": [4, 1],
							"editionDefaults": [
								{
									"value": "EXPLICIT",
									"edition": 900
								},
								{
									"value": "IMPLICIT",
									"edition": 999
								},
								{
									"value": "EXPLICIT",
									"edition": 1e3
								}
							]
						}
					},
					{
						"name": "enum_type",
						"number": 2,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.EnumType",
						"options": {
							"retention": 1,
							"targets": [6, 1],
							"editionDefaults": [{
								"value": "CLOSED",
								"edition": 900
							}, {
								"value": "OPEN",
								"edition": 999
							}]
						}
					},
					{
						"name": "repeated_field_encoding",
						"number": 3,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.RepeatedFieldEncoding",
						"options": {
							"retention": 1,
							"targets": [4, 1],
							"editionDefaults": [{
								"value": "EXPANDED",
								"edition": 900
							}, {
								"value": "PACKED",
								"edition": 999
							}]
						}
					},
					{
						"name": "utf8_validation",
						"number": 4,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.Utf8Validation",
						"options": {
							"retention": 1,
							"targets": [4, 1],
							"editionDefaults": [{
								"value": "NONE",
								"edition": 900
							}, {
								"value": "VERIFY",
								"edition": 999
							}]
						}
					},
					{
						"name": "message_encoding",
						"number": 5,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.MessageEncoding",
						"options": {
							"retention": 1,
							"targets": [4, 1],
							"editionDefaults": [{
								"value": "LENGTH_PREFIXED",
								"edition": 900
							}]
						}
					},
					{
						"name": "json_format",
						"number": 6,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.JsonFormat",
						"options": {
							"retention": 1,
							"targets": [
								3,
								6,
								1
							],
							"editionDefaults": [{
								"value": "LEGACY_BEST_EFFORT",
								"edition": 900
							}, {
								"value": "ALLOW",
								"edition": 999
							}]
						}
					},
					{
						"name": "enforce_naming_style",
						"number": 7,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.EnforceNamingStyle",
						"options": {
							"retention": 2,
							"targets": [
								1,
								2,
								3,
								4,
								5,
								6,
								7,
								8,
								9
							],
							"editionDefaults": [{
								"value": "STYLE_LEGACY",
								"edition": 900
							}, {
								"value": "STYLE2024",
								"edition": 1001
							}]
						}
					},
					{
						"name": "default_symbol_visibility",
						"number": 8,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",
						"options": {
							"retention": 2,
							"targets": [1],
							"editionDefaults": [{
								"value": "EXPORT_ALL",
								"edition": 900
							}, {
								"value": "EXPORT_TOP_LEVEL",
								"edition": 1001
							}]
						}
					}
				],
				"nestedType": [{
					"name": "VisibilityFeature",
					"enumType": [{
						"name": "DefaultSymbolVisibility",
						"value": [
							{
								"name": "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",
								"number": 0
							},
							{
								"name": "EXPORT_ALL",
								"number": 1
							},
							{
								"name": "EXPORT_TOP_LEVEL",
								"number": 2
							},
							{
								"name": "LOCAL_ALL",
								"number": 3
							},
							{
								"name": "STRICT",
								"number": 4
							}
						]
					}]
				}],
				"enumType": [
					{
						"name": "FieldPresence",
						"value": [
							{
								"name": "FIELD_PRESENCE_UNKNOWN",
								"number": 0
							},
							{
								"name": "EXPLICIT",
								"number": 1
							},
							{
								"name": "IMPLICIT",
								"number": 2
							},
							{
								"name": "LEGACY_REQUIRED",
								"number": 3
							}
						]
					},
					{
						"name": "EnumType",
						"value": [
							{
								"name": "ENUM_TYPE_UNKNOWN",
								"number": 0
							},
							{
								"name": "OPEN",
								"number": 1
							},
							{
								"name": "CLOSED",
								"number": 2
							}
						]
					},
					{
						"name": "RepeatedFieldEncoding",
						"value": [
							{
								"name": "REPEATED_FIELD_ENCODING_UNKNOWN",
								"number": 0
							},
							{
								"name": "PACKED",
								"number": 1
							},
							{
								"name": "EXPANDED",
								"number": 2
							}
						]
					},
					{
						"name": "Utf8Validation",
						"value": [
							{
								"name": "UTF8_VALIDATION_UNKNOWN",
								"number": 0
							},
							{
								"name": "VERIFY",
								"number": 2
							},
							{
								"name": "NONE",
								"number": 3
							}
						]
					},
					{
						"name": "MessageEncoding",
						"value": [
							{
								"name": "MESSAGE_ENCODING_UNKNOWN",
								"number": 0
							},
							{
								"name": "LENGTH_PREFIXED",
								"number": 1
							},
							{
								"name": "DELIMITED",
								"number": 2
							}
						]
					},
					{
						"name": "JsonFormat",
						"value": [
							{
								"name": "JSON_FORMAT_UNKNOWN",
								"number": 0
							},
							{
								"name": "ALLOW",
								"number": 1
							},
							{
								"name": "LEGACY_BEST_EFFORT",
								"number": 2
							}
						]
					},
					{
						"name": "EnforceNamingStyle",
						"value": [
							{
								"name": "ENFORCE_NAMING_STYLE_UNKNOWN",
								"number": 0
							},
							{
								"name": "STYLE2024",
								"number": 1
							},
							{
								"name": "STYLE_LEGACY",
								"number": 2
							}
						]
					}
				],
				"extensionRange": [
					{
						"start": 1e3,
						"end": 9995
					},
					{
						"start": 9995,
						"end": 1e4
					},
					{
						"start": 1e4,
						"end": 10001
					}
				]
			},
			{
				"name": "FeatureSetDefaults",
				"field": [
					{
						"name": "defaults",
						"number": 1,
						"type": 11,
						"label": 3,
						"typeName": ".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"
					},
					{
						"name": "minimum_edition",
						"number": 4,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.Edition"
					},
					{
						"name": "maximum_edition",
						"number": 5,
						"type": 14,
						"label": 1,
						"typeName": ".google.protobuf.Edition"
					}
				],
				"nestedType": [{
					"name": "FeatureSetEditionDefault",
					"field": [
						{
							"name": "edition",
							"number": 3,
							"type": 14,
							"label": 1,
							"typeName": ".google.protobuf.Edition"
						},
						{
							"name": "overridable_features",
							"number": 4,
							"type": 11,
							"label": 1,
							"typeName": ".google.protobuf.FeatureSet"
						},
						{
							"name": "fixed_features",
							"number": 5,
							"type": 11,
							"label": 1,
							"typeName": ".google.protobuf.FeatureSet"
						}
					]
				}]
			},
			{
				"name": "SourceCodeInfo",
				"field": [{
					"name": "location",
					"number": 1,
					"type": 11,
					"label": 3,
					"typeName": ".google.protobuf.SourceCodeInfo.Location"
				}],
				"nestedType": [{
					"name": "Location",
					"field": [
						{
							"name": "path",
							"number": 1,
							"type": 5,
							"label": 3,
							"options": { "packed": true }
						},
						{
							"name": "span",
							"number": 2,
							"type": 5,
							"label": 3,
							"options": { "packed": true }
						},
						{
							"name": "leading_comments",
							"number": 3,
							"type": 9,
							"label": 1
						},
						{
							"name": "trailing_comments",
							"number": 4,
							"type": 9,
							"label": 1
						},
						{
							"name": "leading_detached_comments",
							"number": 6,
							"type": 9,
							"label": 3
						}
					]
				}],
				"extensionRange": [{
					"start": 536e6,
					"end": 536000001
				}]
			},
			{
				"name": "GeneratedCodeInfo",
				"field": [{
					"name": "annotation",
					"number": 1,
					"type": 11,
					"label": 3,
					"typeName": ".google.protobuf.GeneratedCodeInfo.Annotation"
				}],
				"nestedType": [{
					"name": "Annotation",
					"field": [
						{
							"name": "path",
							"number": 1,
							"type": 5,
							"label": 3,
							"options": { "packed": true }
						},
						{
							"name": "source_file",
							"number": 2,
							"type": 9,
							"label": 1
						},
						{
							"name": "begin",
							"number": 3,
							"type": 5,
							"label": 1
						},
						{
							"name": "end",
							"number": 4,
							"type": 5,
							"label": 1
						},
						{
							"name": "semantic",
							"number": 5,
							"type": 14,
							"label": 1,
							"typeName": ".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"
						}
					],
					"enumType": [{
						"name": "Semantic",
						"value": [
							{
								"name": "NONE",
								"number": 0
							},
							{
								"name": "SET",
								"number": 1
							},
							{
								"name": "ALIAS",
								"number": 2
							}
						]
					}]
				}]
			}
		],
		"enumType": [{
			"name": "Edition",
			"value": [
				{
					"name": "EDITION_UNKNOWN",
					"number": 0
				},
				{
					"name": "EDITION_LEGACY",
					"number": 900
				},
				{
					"name": "EDITION_PROTO2",
					"number": 998
				},
				{
					"name": "EDITION_PROTO3",
					"number": 999
				},
				{
					"name": "EDITION_2023",
					"number": 1e3
				},
				{
					"name": "EDITION_2024",
					"number": 1001
				},
				{
					"name": "EDITION_UNSTABLE",
					"number": 9999
				},
				{
					"name": "EDITION_1_TEST_ONLY",
					"number": 1
				},
				{
					"name": "EDITION_2_TEST_ONLY",
					"number": 2
				},
				{
					"name": "EDITION_99997_TEST_ONLY",
					"number": 99997
				},
				{
					"name": "EDITION_99998_TEST_ONLY",
					"number": 99998
				},
				{
					"name": "EDITION_99999_TEST_ONLY",
					"number": 99999
				},
				{
					"name": "EDITION_MAX",
					"number": 2147483647
				}
			]
		}, {
			"name": "SymbolVisibility",
			"value": [
				{
					"name": "VISIBILITY_UNSET",
					"number": 0
				},
				{
					"name": "VISIBILITY_LOCAL",
					"number": 1
				},
				{
					"name": "VISIBILITY_EXPORT",
					"number": 2
				}
			]
		}]
	}), 1);
	/**
	* The verification state of the extension range.
	*
	* @generated from enum google.protobuf.ExtensionRangeOptions.VerificationState
	*/
	var ExtensionRangeOptions_VerificationState;
	(function(ExtensionRangeOptions_VerificationState) {
		/**
		* All the extensions of the range must be declared.
		*
		* @generated from enum value: DECLARATION = 0;
		*/
		ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["DECLARATION"] = 0] = "DECLARATION";
		/**
		* @generated from enum value: UNVERIFIED = 1;
		*/
		ExtensionRangeOptions_VerificationState[ExtensionRangeOptions_VerificationState["UNVERIFIED"] = 1] = "UNVERIFIED";
	})(ExtensionRangeOptions_VerificationState || (ExtensionRangeOptions_VerificationState = {}));
	/**
	* @generated from enum google.protobuf.FieldDescriptorProto.Type
	*/
	var FieldDescriptorProto_Type;
	(function(FieldDescriptorProto_Type) {
		/**
		* 0 is reserved for errors.
		* Order is weird for historical reasons.
		*
		* @generated from enum value: TYPE_DOUBLE = 1;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["DOUBLE"] = 1] = "DOUBLE";
		/**
		* @generated from enum value: TYPE_FLOAT = 2;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["FLOAT"] = 2] = "FLOAT";
		/**
		* Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if
		* negative values are likely.
		*
		* @generated from enum value: TYPE_INT64 = 3;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT64"] = 3] = "INT64";
		/**
		* @generated from enum value: TYPE_UINT64 = 4;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT64"] = 4] = "UINT64";
		/**
		* Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if
		* negative values are likely.
		*
		* @generated from enum value: TYPE_INT32 = 5;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["INT32"] = 5] = "INT32";
		/**
		* @generated from enum value: TYPE_FIXED64 = 6;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED64"] = 6] = "FIXED64";
		/**
		* @generated from enum value: TYPE_FIXED32 = 7;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["FIXED32"] = 7] = "FIXED32";
		/**
		* @generated from enum value: TYPE_BOOL = 8;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["BOOL"] = 8] = "BOOL";
		/**
		* @generated from enum value: TYPE_STRING = 9;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["STRING"] = 9] = "STRING";
		/**
		* Tag-delimited aggregate.
		* Group type is deprecated and not supported after google.protobuf. However, Proto3
		* implementations should still be able to parse the group wire format and
		* treat group fields as unknown fields.  In Editions, the group wire format
		* can be enabled via the `message_encoding` feature.
		*
		* @generated from enum value: TYPE_GROUP = 10;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["GROUP"] = 10] = "GROUP";
		/**
		* Length-delimited aggregate.
		*
		* @generated from enum value: TYPE_MESSAGE = 11;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["MESSAGE"] = 11] = "MESSAGE";
		/**
		* New in version 2.
		*
		* @generated from enum value: TYPE_BYTES = 12;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["BYTES"] = 12] = "BYTES";
		/**
		* @generated from enum value: TYPE_UINT32 = 13;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["UINT32"] = 13] = "UINT32";
		/**
		* @generated from enum value: TYPE_ENUM = 14;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["ENUM"] = 14] = "ENUM";
		/**
		* @generated from enum value: TYPE_SFIXED32 = 15;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED32"] = 15] = "SFIXED32";
		/**
		* @generated from enum value: TYPE_SFIXED64 = 16;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["SFIXED64"] = 16] = "SFIXED64";
		/**
		* Uses ZigZag encoding.
		*
		* @generated from enum value: TYPE_SINT32 = 17;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT32"] = 17] = "SINT32";
		/**
		* Uses ZigZag encoding.
		*
		* @generated from enum value: TYPE_SINT64 = 18;
		*/
		FieldDescriptorProto_Type[FieldDescriptorProto_Type["SINT64"] = 18] = "SINT64";
	})(FieldDescriptorProto_Type || (FieldDescriptorProto_Type = {}));
	/**
	* @generated from enum google.protobuf.FieldDescriptorProto.Label
	*/
	var FieldDescriptorProto_Label;
	(function(FieldDescriptorProto_Label) {
		/**
		* 0 is reserved for errors
		*
		* @generated from enum value: LABEL_OPTIONAL = 1;
		*/
		FieldDescriptorProto_Label[FieldDescriptorProto_Label["OPTIONAL"] = 1] = "OPTIONAL";
		/**
		* @generated from enum value: LABEL_REPEATED = 3;
		*/
		FieldDescriptorProto_Label[FieldDescriptorProto_Label["REPEATED"] = 3] = "REPEATED";
		/**
		* The required label is only allowed in google.protobuf.  In proto3 and Editions
		* it's explicitly prohibited.  In Editions, the `field_presence` feature
		* can be used to get this behavior.
		*
		* @generated from enum value: LABEL_REQUIRED = 2;
		*/
		FieldDescriptorProto_Label[FieldDescriptorProto_Label["REQUIRED"] = 2] = "REQUIRED";
	})(FieldDescriptorProto_Label || (FieldDescriptorProto_Label = {}));
	/**
	* Generated classes can be optimized for speed or code size.
	*
	* @generated from enum google.protobuf.FileOptions.OptimizeMode
	*/
	var FileOptions_OptimizeMode;
	(function(FileOptions_OptimizeMode) {
		/**
		* Generate complete code for parsing, serialization,
		*
		* @generated from enum value: SPEED = 1;
		*/
		FileOptions_OptimizeMode[FileOptions_OptimizeMode["SPEED"] = 1] = "SPEED";
		/**
		* etc.
		*
		* Use ReflectionOps to implement these methods.
		*
		* @generated from enum value: CODE_SIZE = 2;
		*/
		FileOptions_OptimizeMode[FileOptions_OptimizeMode["CODE_SIZE"] = 2] = "CODE_SIZE";
		/**
		* Generate code using MessageLite and the lite runtime.
		*
		* @generated from enum value: LITE_RUNTIME = 3;
		*/
		FileOptions_OptimizeMode[FileOptions_OptimizeMode["LITE_RUNTIME"] = 3] = "LITE_RUNTIME";
	})(FileOptions_OptimizeMode || (FileOptions_OptimizeMode = {}));
	/**
	* @generated from enum google.protobuf.FieldOptions.CType
	*/
	var FieldOptions_CType;
	(function(FieldOptions_CType) {
		/**
		* Default mode.
		*
		* @generated from enum value: STRING = 0;
		*/
		FieldOptions_CType[FieldOptions_CType["STRING"] = 0] = "STRING";
		/**
		* The option [ctype=CORD] may be applied to a non-repeated field of type
		* "bytes". It indicates that in C++, the data should be stored in a Cord
		* instead of a string.  For very large strings, this may reduce memory
		* fragmentation. It may also allow better performance when parsing from a
		* Cord, or when parsing with aliasing enabled, as the parsed Cord may then
		* alias the original buffer.
		*
		* @generated from enum value: CORD = 1;
		*/
		FieldOptions_CType[FieldOptions_CType["CORD"] = 1] = "CORD";
		/**
		* @generated from enum value: STRING_PIECE = 2;
		*/
		FieldOptions_CType[FieldOptions_CType["STRING_PIECE"] = 2] = "STRING_PIECE";
	})(FieldOptions_CType || (FieldOptions_CType = {}));
	/**
	* @generated from enum google.protobuf.FieldOptions.JSType
	*/
	var FieldOptions_JSType;
	(function(FieldOptions_JSType) {
		/**
		* Use the default type.
		*
		* @generated from enum value: JS_NORMAL = 0;
		*/
		FieldOptions_JSType[FieldOptions_JSType["JS_NORMAL"] = 0] = "JS_NORMAL";
		/**
		* Use JavaScript strings.
		*
		* @generated from enum value: JS_STRING = 1;
		*/
		FieldOptions_JSType[FieldOptions_JSType["JS_STRING"] = 1] = "JS_STRING";
		/**
		* Use JavaScript numbers.
		*
		* @generated from enum value: JS_NUMBER = 2;
		*/
		FieldOptions_JSType[FieldOptions_JSType["JS_NUMBER"] = 2] = "JS_NUMBER";
	})(FieldOptions_JSType || (FieldOptions_JSType = {}));
	/**
	* If set to RETENTION_SOURCE, the option will be omitted from the binary.
	*
	* @generated from enum google.protobuf.FieldOptions.OptionRetention
	*/
	var FieldOptions_OptionRetention;
	(function(FieldOptions_OptionRetention) {
		/**
		* @generated from enum value: RETENTION_UNKNOWN = 0;
		*/
		FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_UNKNOWN"] = 0] = "RETENTION_UNKNOWN";
		/**
		* @generated from enum value: RETENTION_RUNTIME = 1;
		*/
		FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_RUNTIME"] = 1] = "RETENTION_RUNTIME";
		/**
		* @generated from enum value: RETENTION_SOURCE = 2;
		*/
		FieldOptions_OptionRetention[FieldOptions_OptionRetention["RETENTION_SOURCE"] = 2] = "RETENTION_SOURCE";
	})(FieldOptions_OptionRetention || (FieldOptions_OptionRetention = {}));
	/**
	* This indicates the types of entities that the field may apply to when used
	* as an option. If it is unset, then the field may be freely used as an
	* option on any kind of entity.
	*
	* @generated from enum google.protobuf.FieldOptions.OptionTargetType
	*/
	var FieldOptions_OptionTargetType;
	(function(FieldOptions_OptionTargetType) {
		/**
		* @generated from enum value: TARGET_TYPE_UNKNOWN = 0;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_UNKNOWN"] = 0] = "TARGET_TYPE_UNKNOWN";
		/**
		* @generated from enum value: TARGET_TYPE_FILE = 1;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FILE"] = 1] = "TARGET_TYPE_FILE";
		/**
		* @generated from enum value: TARGET_TYPE_EXTENSION_RANGE = 2;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_EXTENSION_RANGE"] = 2] = "TARGET_TYPE_EXTENSION_RANGE";
		/**
		* @generated from enum value: TARGET_TYPE_MESSAGE = 3;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_MESSAGE"] = 3] = "TARGET_TYPE_MESSAGE";
		/**
		* @generated from enum value: TARGET_TYPE_FIELD = 4;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_FIELD"] = 4] = "TARGET_TYPE_FIELD";
		/**
		* @generated from enum value: TARGET_TYPE_ONEOF = 5;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ONEOF"] = 5] = "TARGET_TYPE_ONEOF";
		/**
		* @generated from enum value: TARGET_TYPE_ENUM = 6;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM"] = 6] = "TARGET_TYPE_ENUM";
		/**
		* @generated from enum value: TARGET_TYPE_ENUM_ENTRY = 7;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_ENUM_ENTRY"] = 7] = "TARGET_TYPE_ENUM_ENTRY";
		/**
		* @generated from enum value: TARGET_TYPE_SERVICE = 8;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_SERVICE"] = 8] = "TARGET_TYPE_SERVICE";
		/**
		* @generated from enum value: TARGET_TYPE_METHOD = 9;
		*/
		FieldOptions_OptionTargetType[FieldOptions_OptionTargetType["TARGET_TYPE_METHOD"] = 9] = "TARGET_TYPE_METHOD";
	})(FieldOptions_OptionTargetType || (FieldOptions_OptionTargetType = {}));
	/**
	* Is this method side-effect-free (or safe in HTTP parlance), or idempotent,
	* or neither? HTTP based RPC implementation may choose GET verb for safe
	* methods, and PUT verb for idempotent methods instead of the default POST.
	*
	* @generated from enum google.protobuf.MethodOptions.IdempotencyLevel
	*/
	var MethodOptions_IdempotencyLevel;
	(function(MethodOptions_IdempotencyLevel) {
		/**
		* @generated from enum value: IDEMPOTENCY_UNKNOWN = 0;
		*/
		MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENCY_UNKNOWN"] = 0] = "IDEMPOTENCY_UNKNOWN";
		/**
		* implies idempotent
		*
		* @generated from enum value: NO_SIDE_EFFECTS = 1;
		*/
		MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["NO_SIDE_EFFECTS"] = 1] = "NO_SIDE_EFFECTS";
		/**
		* idempotent, but may have side effects
		*
		* @generated from enum value: IDEMPOTENT = 2;
		*/
		MethodOptions_IdempotencyLevel[MethodOptions_IdempotencyLevel["IDEMPOTENT"] = 2] = "IDEMPOTENT";
	})(MethodOptions_IdempotencyLevel || (MethodOptions_IdempotencyLevel = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility
	*/
	var FeatureSet_VisibilityFeature_DefaultSymbolVisibility;
	(function(FeatureSet_VisibilityFeature_DefaultSymbolVisibility) {
		/**
		* @generated from enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;
		*/
		FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN";
		/**
		* Default pre-EDITION_2024, all UNSET visibility are export.
		*
		* @generated from enum value: EXPORT_ALL = 1;
		*/
		FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["EXPORT_ALL"] = 1] = "EXPORT_ALL";
		/**
		* All top-level symbols default to export, nested default to local.
		*
		* @generated from enum value: EXPORT_TOP_LEVEL = 2;
		*/
		FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["EXPORT_TOP_LEVEL"] = 2] = "EXPORT_TOP_LEVEL";
		/**
		* All symbols default to local.
		*
		* @generated from enum value: LOCAL_ALL = 3;
		*/
		FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["LOCAL_ALL"] = 3] = "LOCAL_ALL";
		/**
		* All symbols local by default. Nested types cannot be exported.
		* With special case caveat for message { enum {} reserved 1 to max; }
		* This is the recommended setting for new protos.
		*
		* @generated from enum value: STRICT = 4;
		*/
		FeatureSet_VisibilityFeature_DefaultSymbolVisibility[FeatureSet_VisibilityFeature_DefaultSymbolVisibility["STRICT"] = 4] = "STRICT";
	})(FeatureSet_VisibilityFeature_DefaultSymbolVisibility || (FeatureSet_VisibilityFeature_DefaultSymbolVisibility = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.FieldPresence
	*/
	var FeatureSet_FieldPresence;
	(function(FeatureSet_FieldPresence) {
		/**
		* @generated from enum value: FIELD_PRESENCE_UNKNOWN = 0;
		*/
		FeatureSet_FieldPresence[FeatureSet_FieldPresence["FIELD_PRESENCE_UNKNOWN"] = 0] = "FIELD_PRESENCE_UNKNOWN";
		/**
		* @generated from enum value: EXPLICIT = 1;
		*/
		FeatureSet_FieldPresence[FeatureSet_FieldPresence["EXPLICIT"] = 1] = "EXPLICIT";
		/**
		* @generated from enum value: IMPLICIT = 2;
		*/
		FeatureSet_FieldPresence[FeatureSet_FieldPresence["IMPLICIT"] = 2] = "IMPLICIT";
		/**
		* @generated from enum value: LEGACY_REQUIRED = 3;
		*/
		FeatureSet_FieldPresence[FeatureSet_FieldPresence["LEGACY_REQUIRED"] = 3] = "LEGACY_REQUIRED";
	})(FeatureSet_FieldPresence || (FeatureSet_FieldPresence = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.EnumType
	*/
	var FeatureSet_EnumType;
	(function(FeatureSet_EnumType) {
		/**
		* @generated from enum value: ENUM_TYPE_UNKNOWN = 0;
		*/
		FeatureSet_EnumType[FeatureSet_EnumType["ENUM_TYPE_UNKNOWN"] = 0] = "ENUM_TYPE_UNKNOWN";
		/**
		* @generated from enum value: OPEN = 1;
		*/
		FeatureSet_EnumType[FeatureSet_EnumType["OPEN"] = 1] = "OPEN";
		/**
		* @generated from enum value: CLOSED = 2;
		*/
		FeatureSet_EnumType[FeatureSet_EnumType["CLOSED"] = 2] = "CLOSED";
	})(FeatureSet_EnumType || (FeatureSet_EnumType = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.RepeatedFieldEncoding
	*/
	var FeatureSet_RepeatedFieldEncoding;
	(function(FeatureSet_RepeatedFieldEncoding) {
		/**
		* @generated from enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0;
		*/
		FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["REPEATED_FIELD_ENCODING_UNKNOWN"] = 0] = "REPEATED_FIELD_ENCODING_UNKNOWN";
		/**
		* @generated from enum value: PACKED = 1;
		*/
		FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["PACKED"] = 1] = "PACKED";
		/**
		* @generated from enum value: EXPANDED = 2;
		*/
		FeatureSet_RepeatedFieldEncoding[FeatureSet_RepeatedFieldEncoding["EXPANDED"] = 2] = "EXPANDED";
	})(FeatureSet_RepeatedFieldEncoding || (FeatureSet_RepeatedFieldEncoding = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.Utf8Validation
	*/
	var FeatureSet_Utf8Validation;
	(function(FeatureSet_Utf8Validation) {
		/**
		* @generated from enum value: UTF8_VALIDATION_UNKNOWN = 0;
		*/
		FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["UTF8_VALIDATION_UNKNOWN"] = 0] = "UTF8_VALIDATION_UNKNOWN";
		/**
		* @generated from enum value: VERIFY = 2;
		*/
		FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["VERIFY"] = 2] = "VERIFY";
		/**
		* @generated from enum value: NONE = 3;
		*/
		FeatureSet_Utf8Validation[FeatureSet_Utf8Validation["NONE"] = 3] = "NONE";
	})(FeatureSet_Utf8Validation || (FeatureSet_Utf8Validation = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.MessageEncoding
	*/
	var FeatureSet_MessageEncoding;
	(function(FeatureSet_MessageEncoding) {
		/**
		* @generated from enum value: MESSAGE_ENCODING_UNKNOWN = 0;
		*/
		FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["MESSAGE_ENCODING_UNKNOWN"] = 0] = "MESSAGE_ENCODING_UNKNOWN";
		/**
		* @generated from enum value: LENGTH_PREFIXED = 1;
		*/
		FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["LENGTH_PREFIXED"] = 1] = "LENGTH_PREFIXED";
		/**
		* @generated from enum value: DELIMITED = 2;
		*/
		FeatureSet_MessageEncoding[FeatureSet_MessageEncoding["DELIMITED"] = 2] = "DELIMITED";
	})(FeatureSet_MessageEncoding || (FeatureSet_MessageEncoding = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.JsonFormat
	*/
	var FeatureSet_JsonFormat;
	(function(FeatureSet_JsonFormat) {
		/**
		* @generated from enum value: JSON_FORMAT_UNKNOWN = 0;
		*/
		FeatureSet_JsonFormat[FeatureSet_JsonFormat["JSON_FORMAT_UNKNOWN"] = 0] = "JSON_FORMAT_UNKNOWN";
		/**
		* @generated from enum value: ALLOW = 1;
		*/
		FeatureSet_JsonFormat[FeatureSet_JsonFormat["ALLOW"] = 1] = "ALLOW";
		/**
		* @generated from enum value: LEGACY_BEST_EFFORT = 2;
		*/
		FeatureSet_JsonFormat[FeatureSet_JsonFormat["LEGACY_BEST_EFFORT"] = 2] = "LEGACY_BEST_EFFORT";
	})(FeatureSet_JsonFormat || (FeatureSet_JsonFormat = {}));
	/**
	* @generated from enum google.protobuf.FeatureSet.EnforceNamingStyle
	*/
	var FeatureSet_EnforceNamingStyle;
	(function(FeatureSet_EnforceNamingStyle) {
		/**
		* @generated from enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0;
		*/
		FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["ENFORCE_NAMING_STYLE_UNKNOWN"] = 0] = "ENFORCE_NAMING_STYLE_UNKNOWN";
		/**
		* @generated from enum value: STYLE2024 = 1;
		*/
		FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE2024"] = 1] = "STYLE2024";
		/**
		* @generated from enum value: STYLE_LEGACY = 2;
		*/
		FeatureSet_EnforceNamingStyle[FeatureSet_EnforceNamingStyle["STYLE_LEGACY"] = 2] = "STYLE_LEGACY";
	})(FeatureSet_EnforceNamingStyle || (FeatureSet_EnforceNamingStyle = {}));
	/**
	* Represents the identified object's effect on the element in the original
	* .proto file.
	*
	* @generated from enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic
	*/
	var GeneratedCodeInfo_Annotation_Semantic;
	(function(GeneratedCodeInfo_Annotation_Semantic) {
		/**
		* There is no effect or the effect is indescribable.
		*
		* @generated from enum value: NONE = 0;
		*/
		GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["NONE"] = 0] = "NONE";
		/**
		* The element is set or otherwise mutated.
		*
		* @generated from enum value: SET = 1;
		*/
		GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["SET"] = 1] = "SET";
		/**
		* An alias to the element is returned.
		*
		* @generated from enum value: ALIAS = 2;
		*/
		GeneratedCodeInfo_Annotation_Semantic[GeneratedCodeInfo_Annotation_Semantic["ALIAS"] = 2] = "ALIAS";
	})(GeneratedCodeInfo_Annotation_Semantic || (GeneratedCodeInfo_Annotation_Semantic = {}));
	/**
	* The full set of known editions.
	*
	* @generated from enum google.protobuf.Edition
	*/
	var Edition;
	(function(Edition) {
		/**
		* A placeholder for an unknown edition value.
		*
		* @generated from enum value: EDITION_UNKNOWN = 0;
		*/
		Edition[Edition["EDITION_UNKNOWN"] = 0] = "EDITION_UNKNOWN";
		/**
		* A placeholder edition for specifying default behaviors *before* a feature
		* was first introduced.  This is effectively an "infinite past".
		*
		* @generated from enum value: EDITION_LEGACY = 900;
		*/
		Edition[Edition["EDITION_LEGACY"] = 900] = "EDITION_LEGACY";
		/**
		* Legacy syntax "editions".  These pre-date editions, but behave much like
		* distinct editions.  These can't be used to specify the edition of proto
		* files, but feature definitions must supply proto2/proto3 defaults for
		* backwards compatibility.
		*
		* @generated from enum value: EDITION_PROTO2 = 998;
		*/
		Edition[Edition["EDITION_PROTO2"] = 998] = "EDITION_PROTO2";
		/**
		* @generated from enum value: EDITION_PROTO3 = 999;
		*/
		Edition[Edition["EDITION_PROTO3"] = 999] = "EDITION_PROTO3";
		/**
		* Editions that have been released.  The specific values are arbitrary and
		* should not be depended on, but they will always be time-ordered for easy
		* comparison.
		*
		* @generated from enum value: EDITION_2023 = 1000;
		*/
		Edition[Edition["EDITION_2023"] = 1e3] = "EDITION_2023";
		/**
		* @generated from enum value: EDITION_2024 = 1001;
		*/
		Edition[Edition["EDITION_2024"] = 1001] = "EDITION_2024";
		/**
		* A placeholder edition for developing and testing unscheduled features.
		*
		* @generated from enum value: EDITION_UNSTABLE = 9999;
		*/
		Edition[Edition["EDITION_UNSTABLE"] = 9999] = "EDITION_UNSTABLE";
		/**
		* Placeholder editions for testing feature resolution.  These should not be
		* used or relied on outside of tests.
		*
		* @generated from enum value: EDITION_1_TEST_ONLY = 1;
		*/
		Edition[Edition["EDITION_1_TEST_ONLY"] = 1] = "EDITION_1_TEST_ONLY";
		/**
		* @generated from enum value: EDITION_2_TEST_ONLY = 2;
		*/
		Edition[Edition["EDITION_2_TEST_ONLY"] = 2] = "EDITION_2_TEST_ONLY";
		/**
		* @generated from enum value: EDITION_99997_TEST_ONLY = 99997;
		*/
		Edition[Edition["EDITION_99997_TEST_ONLY"] = 99997] = "EDITION_99997_TEST_ONLY";
		/**
		* @generated from enum value: EDITION_99998_TEST_ONLY = 99998;
		*/
		Edition[Edition["EDITION_99998_TEST_ONLY"] = 99998] = "EDITION_99998_TEST_ONLY";
		/**
		* @generated from enum value: EDITION_99999_TEST_ONLY = 99999;
		*/
		Edition[Edition["EDITION_99999_TEST_ONLY"] = 99999] = "EDITION_99999_TEST_ONLY";
		/**
		* Placeholder for specifying unbounded edition support.  This should only
		* ever be used by plugins that can expect to never require any changes to
		* support a new edition.
		*
		* @generated from enum value: EDITION_MAX = 2147483647;
		*/
		Edition[Edition["EDITION_MAX"] = 2147483647] = "EDITION_MAX";
	})(Edition || (Edition = {}));
	/**
	* Describes the 'visibility' of a symbol with respect to the proto import
	* system. Symbols can only be imported when the visibility rules do not prevent
	* it (ex: local symbols cannot be imported).  Visibility modifiers can only set
	* on `message` and `enum` as they are the only types available to be referenced
	* from other files.
	*
	* @generated from enum google.protobuf.SymbolVisibility
	*/
	var SymbolVisibility;
	(function(SymbolVisibility) {
		/**
		* @generated from enum value: VISIBILITY_UNSET = 0;
		*/
		SymbolVisibility[SymbolVisibility["VISIBILITY_UNSET"] = 0] = "VISIBILITY_UNSET";
		/**
		* @generated from enum value: VISIBILITY_LOCAL = 1;
		*/
		SymbolVisibility[SymbolVisibility["VISIBILITY_LOCAL"] = 1] = "VISIBILITY_LOCAL";
		/**
		* @generated from enum value: VISIBILITY_EXPORT = 2;
		*/
		SymbolVisibility[SymbolVisibility["VISIBILITY_EXPORT"] = 2] = "VISIBILITY_EXPORT";
	})(SymbolVisibility || (SymbolVisibility = {}));
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/from-binary.js
	var readDefaults = { readUnknownFields: true };
	function makeReadOptions(options) {
		return options ? Object.assign(Object.assign({}, readDefaults), options) : readDefaults;
	}
	/**
	* Parse serialized binary data.
	*/
	function fromBinary(schema, bytes, options) {
		const msg = reflect(schema, void 0, false);
		readMessage(msg, new BinaryReader(bytes), makeReadOptions(options), false, bytes.byteLength);
		return msg.message;
	}
	/**
	* If `delimited` is false, read the length given in `lengthOrDelimitedFieldNo`.
	*
	* If `delimited` is true, read until an EndGroup tag. `lengthOrDelimitedFieldNo`
	* is the expected field number.
	*
	* @private
	*/
	function readMessage(message, reader, options, delimited, lengthOrDelimitedFieldNo) {
		var _a;
		const end = delimited ? reader.len : reader.pos + lengthOrDelimitedFieldNo;
		let fieldNo;
		let wireType;
		const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
		while (reader.pos < end) {
			[fieldNo, wireType] = reader.tag();
			if (delimited && wireType == WireType.EndGroup) break;
			const field = message.findNumber(fieldNo);
			if (!field) {
				const data = reader.skip(wireType, fieldNo);
				if (options.readUnknownFields) unknownFields.push({
					no: fieldNo,
					wireType,
					data
				});
				continue;
			}
			readField(message, reader, field, wireType, options);
		}
		if (delimited) {
			if (wireType != WireType.EndGroup || fieldNo !== lengthOrDelimitedFieldNo) throw new Error("invalid end group tag");
		}
		if (unknownFields.length > 0) message.setUnknown(unknownFields);
	}
	/**
	* @private
	*/
	function readField(message, reader, field, wireType, options) {
		var _a;
		switch (field.fieldKind) {
			case "scalar":
				message.set(field, readScalar(reader, field.scalar, field.utf8Validation));
				break;
			case "enum":
				const val = readScalar(reader, ScalarType.INT32);
				if (field.enum.open) message.set(field, val);
				else if (field.enum.values.some((v) => v.number === val)) message.set(field, val);
				else if (options.readUnknownFields) {
					const bytes = [];
					varint32write(val, bytes);
					const unknownFields = (_a = message.getUnknown()) !== null && _a !== void 0 ? _a : [];
					unknownFields.push({
						no: field.number,
						wireType,
						data: new Uint8Array(bytes)
					});
					message.setUnknown(unknownFields);
				}
				break;
			case "message":
				message.set(field, readMessageField(reader, options, field, message.get(field)));
				break;
			case "list":
				readListField(reader, wireType, message.get(field), options);
				break;
			case "map":
				readMapEntry(reader, message.get(field), options);
				break;
		}
	}
	function readMapEntry(reader, map, options) {
		const field = map.field();
		let key;
		let val;
		const len = reader.uint32();
		const end = reader.pos + len;
		while (reader.pos < end) {
			const [fieldNo] = reader.tag();
			switch (fieldNo) {
				case 1:
					key = readScalar(reader, field.mapKey, field.utf8Validation);
					break;
				case 2:
					switch (field.mapKind) {
						case "scalar":
							val = readScalar(reader, field.scalar, field.utf8Validation);
							break;
						case "enum":
							val = reader.int32();
							break;
						case "message":
							val = readMessageField(reader, options, field);
							break;
					}
					break;
			}
		}
		if (key === void 0) key = scalarZeroValue(field.mapKey, false);
		if (val === void 0) switch (field.mapKind) {
			case "scalar":
				val = scalarZeroValue(field.scalar, false);
				break;
			case "enum":
				val = field.enum.values[0].number;
				break;
			case "message":
				val = reflect(field.message, void 0, false);
				break;
		}
		map.set(key, val);
	}
	function readListField(reader, wireType, list, options) {
		var _a;
		const field = list.field();
		if (field.listKind === "message") {
			list.add(readMessageField(reader, options, field));
			return;
		}
		const scalarType = (_a = field.scalar) !== null && _a !== void 0 ? _a : ScalarType.INT32;
		if (!(wireType == WireType.LengthDelimited && scalarType != ScalarType.STRING && scalarType != ScalarType.BYTES)) {
			list.add(readScalar(reader, scalarType, field.utf8Validation));
			return;
		}
		const e = reader.uint32() + reader.pos;
		while (reader.pos < e) list.add(readScalar(reader, scalarType, field.utf8Validation));
	}
	function readMessageField(reader, options, field, mergeMessage) {
		const delimited = field.delimitedEncoding;
		const message = mergeMessage !== null && mergeMessage !== void 0 ? mergeMessage : reflect(field.message, void 0, false);
		readMessage(message, reader, options, delimited, delimited ? field.number : reader.uint32());
		return message;
	}
	function readScalar(reader, type, validateUtf8 = false) {
		switch (type) {
			case ScalarType.STRING: return reader.string(validateUtf8);
			case ScalarType.BOOL: return reader.bool();
			case ScalarType.DOUBLE: return reader.double();
			case ScalarType.FLOAT: return reader.float();
			case ScalarType.INT32: return reader.int32();
			case ScalarType.INT64: return reader.int64();
			case ScalarType.UINT64: return reader.uint64();
			case ScalarType.FIXED64: return reader.fixed64();
			case ScalarType.BYTES: return reader.bytes();
			case ScalarType.FIXED32: return reader.fixed32();
			case ScalarType.SFIXED32: return reader.sfixed32();
			case ScalarType.SFIXED64: return reader.sfixed64();
			case ScalarType.SINT64: return reader.sint64();
			case ScalarType.UINT32: return reader.uint32();
			case ScalarType.SINT32: return reader.sint32();
		}
	}
	//#endregion
	//#region ../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js
	/**
	* Hydrate a file descriptor.
	*
	* @private
	*/
	function fileDesc(b64, imports) {
		var _a;
		const root = fromBinary(FileDescriptorProtoSchema, base64Decode(b64));
		root.messageType.forEach(restoreJsonNames);
		root.dependency = (_a = imports === null || imports === void 0 ? void 0 : imports.map((f) => f.proto.name)) !== null && _a !== void 0 ? _a : [];
		return createFileRegistry(root, (protoFileName) => imports === null || imports === void 0 ? void 0 : imports.find((f) => f.proto.name === protoFileName)).getFile(root.name);
	}
	//#endregion
	//#region ../crdt/src/proto/sync_pb.ts
	/**
	* Describes the file sync.proto.
	*/
	var file_sync = fileDesc("CgpzeW5jLnByb3RvIjoKDUVuY3J5cHRlZERhdGESCgoCaXYYASABKAwSDwoHYXV0aFRhZxgCIAEoDBIMCgRkYXRhGAMgASgMIkYKB01lc3NhZ2USDwoHZGF0YXNldBgBIAEoCRILCgNyb3cYAiABKAkSDgoGY29sdW1uGAMgASgJEg0KBXZhbHVlGAQgASgJIkoKD01lc3NhZ2VFbnZlbG9wZRIRCgl0aW1lc3RhbXAYASABKAkSEwoLaXNFbmNyeXB0ZWQYAiABKAgSDwoHY29udGVudBgDIAEoDCJ2CgtTeW5jUmVxdWVzdBIiCghtZXNzYWdlcxgBIAMoCzIQLk1lc3NhZ2VFbnZlbG9wZRIOCgZmaWxlSWQYAiABKAkSDwoHZ3JvdXBJZBgDIAEoCRINCgVrZXlJZBgFIAEoCRINCgVzaW5jZRgGIAEoCUoECAQQBSJCCgxTeW5jUmVzcG9uc2USIgoIbWVzc2FnZXMYASADKAsyEC5NZXNzYWdlRW52ZWxvcGUSDgoGbWVya2xlGAIgASgJYgZwcm90bzM");
	/**
	* Describes the message EncryptedData.
	* Use `create(EncryptedDataSchema)` to create a new message.
	*/
	var EncryptedDataSchema = messageDesc(file_sync, 0);
	/**
	* Describes the message Message.
	* Use `create(MessageSchema)` to create a new message.
	*/
	var MessageSchema = messageDesc(file_sync, 1);
	/**
	* Describes the message MessageEnvelope.
	* Use `create(MessageEnvelopeSchema)` to create a new message.
	*/
	var MessageEnvelopeSchema = messageDesc(file_sync, 2);
	/**
	* Describes the message SyncRequest.
	* Use `create(SyncRequestSchema)` to create a new message.
	*/
	var SyncRequestSchema = messageDesc(file_sync, 3);
	/**
	* Describes the message SyncResponse.
	* Use `create(SyncResponseSchema)` to create a new message.
	*/
	var SyncResponseSchema = messageDesc(file_sync, 4);
	//#endregion
	//#region ../loot-core/src/server/aql/compiler.ts
	init_dist$1();
	var _uid = 0;
	function resetUid() {
		_uid = 0;
	}
	function uid(tableName) {
		_uid++;
		return tableName + _uid;
	}
	var CompileError = class extends Error {};
	function nativeDateToInt(date) {
		const pad = (x) => (x < 10 ? "0" : "") + x;
		return date.getFullYear() + pad(date.getMonth() + 1) + pad(date.getDate());
	}
	function dateToInt(date) {
		return parseInt(date.replace(/-/g, ""));
	}
	function addTombstone(schema, tableName, tableId, whereStr) {
		return schema[tableName].tombstone != null ? `${whereStr} AND ${tableId}.tombstone = 0` : whereStr;
	}
	function popPath(path) {
		const parts = path.split(".");
		return {
			path: parts.slice(0, -1).join("."),
			field: parts[parts.length - 1]
		};
	}
	function isKeyword(str) {
		return str === "group";
	}
	function quoteAlias(alias) {
		return alias.indexOf(".") === -1 && !isKeyword(alias) ? alias : `"${alias}"`;
	}
	function typed(value, type, { literal = false } = {}) {
		return {
			value,
			type,
			literal
		};
	}
	function getFieldDescription(schema, tableName, field) {
		if (schema[tableName] == null) throw new CompileError(`Table "${tableName}" does not exist in the schema`);
		const fieldDesc = schema[tableName][field];
		if (fieldDesc == null) throw new CompileError(`Field "${field}" does not exist in table "${tableName}"`);
		return fieldDesc;
	}
	function makePath(state, path) {
		const { schema, paths } = state;
		const parts = path.split(".");
		if (parts.length < 2) throw new CompileError("Invalid path: " + path);
		const initialTable = parts[0];
		const tableName = parts.slice(1).reduce((tableName, field) => {
			const table = schema[tableName];
			if (table == null) throw new CompileError(`Path error: ${tableName} table does not exist`);
			if (!table[field] || table[field].ref == null) throw new CompileError(`Field not joinable on table ${tableName}: "${field}"`);
			return table[field].ref;
		}, initialTable);
		let joinTable;
		const parentParts = parts.slice(0, -1);
		if (parentParts.length === 1) joinTable = parentParts[0];
		else {
			const parentPath = parentParts.join(".");
			const parentDesc = paths.get(parentPath);
			if (!parentDesc) throw new CompileError("Path does not exist: " + parentPath);
			joinTable = parentDesc.tableId;
		}
		return {
			tableName,
			tableId: uid(tableName),
			joinField: parts[parts.length - 1],
			joinTable
		};
	}
	function resolvePath(state, path) {
		let paths = path.split(".");
		paths = paths.reduce((acc, name) => {
			const fullName = acc.context + "." + name;
			return {
				context: fullName,
				path: [...acc.path, fullName]
			};
		}, {
			context: state.implicitTableName,
			path: []
		}).path;
		paths.forEach((path) => {
			if (!state.paths.get(path)) state.paths.set(path, makePath(state, path));
		});
		return state.paths.get(paths[paths.length - 1]);
	}
	function transformField(state, name) {
		if (typeof name !== "string") throw new CompileError("Invalid field name, must be a string");
		const { path, field: originalField } = popPath(name);
		let field = originalField;
		let pathInfo;
		if (path === "") pathInfo = {
			tableName: state.implicitTableName,
			tableId: state.implicitTableId
		};
		else pathInfo = resolvePath(state, path);
		const fieldDesc = getFieldDescription(state.schema, pathInfo.tableName, field);
		if (state.validateRefs && fieldDesc.ref && fieldDesc.type === "id" && field !== "id") {
			const refPath = state.implicitTableName + "." + name;
			let refPathInfo = state.paths.get(refPath);
			if (!refPathInfo) {
				refPathInfo = makePath(state, refPath);
				state.paths.set(refPath, refPathInfo);
			}
			field = "id";
			pathInfo = refPathInfo;
		}
		return typed(pathInfo.tableId + "." + field, fieldDesc.type);
	}
	function parseDate$1(str) {
		const m = str.match(/^(\d{4}-\d{2}-\d{2})$/);
		if (m) return typed(dateToInt(m[1]), "date", { literal: true });
		return null;
	}
	function parseMonth(str) {
		const m = str.match(/^(\d{4}-\d{2})$/);
		if (m) return typed(dateToInt(m[1]), "date", { literal: true });
		return null;
	}
	function parseYear(str) {
		const m = str.match(/^(\d{4})$/);
		if (m) return typed(dateToInt(m[1]), "date", { literal: true });
		return null;
	}
	function badDateFormat(str, type) {
		throw new CompileError(`Bad ${type} format: ${str}`);
	}
	function inferParam(param, type) {
		const existingType = param.paramType;
		if (existingType) {
			const casts = {
				date: ["string"],
				"date-month": ["date"],
				"date-year": ["date", "date-month"],
				id: ["string"],
				float: ["integer"]
			};
			if (existingType !== type && (!casts[type] || !casts[type].includes(existingType))) throw new Error(`Parameter "${param.paramName}" can't convert to ${type} (already inferred as ${existingType})`);
		} else param.paramType = type;
	}
	function castInput(state, expr, type) {
		if (expr.type === type) return expr;
		else if (expr.type === "param") {
			inferParam(expr, type);
			return typed(expr.value, type);
		} else if (expr.type === "null") {
			if (!expr.literal) throw new CompileError("A non-literal null doesn't make sense");
			if (type === "boolean") return typed(0, "boolean", { literal: true });
			return expr;
		}
		if (type === "date") {
			if (expr.type === "string") if (expr.literal) return parseDate$1(expr.value) || badDateFormat(expr.value, "date");
			else throw new CompileError("Casting string fields to dates is not supported");
			throw new CompileError(`Can't cast ${expr.type} to date`);
		} else if (type === "date-month") {
			let expr2;
			if (expr.type === "date") expr2 = expr;
			else if (expr.type === "string" || expr.type === "any") expr2 = parseMonth(expr.value) || parseDate$1(expr.value) || badDateFormat(expr.value, "date-month");
			else throw new CompileError(`Can't cast ${expr.type} to date-month`);
			if (expr2.literal) return typed(dateToInt(expr2.value.toString().slice(0, 6)), "date-month", { literal: true });
			else return typed(`CAST(SUBSTR(${expr2.value}, 1, 6) AS integer)`, "date-month");
		} else if (type === "date-year") {
			let expr2;
			if (expr.type === "date" || expr.type === "date-month") expr2 = expr;
			else if (expr.type === "string") expr2 = parseYear(expr.value) || parseMonth(expr.value) || parseDate$1(expr.value) || badDateFormat(expr.value, "date-year");
			else throw new CompileError(`Can't cast ${expr.type} to date-year`);
			if (expr2.literal) return typed(dateToInt(expr2.value.toString().slice(0, 4)), "date-year", { literal: true });
			else return typed(`CAST(SUBSTR(${expr2.value}, 1, 4) AS integer)`, "date-year");
		} else if (type === "id") {
			if (expr.type === "string") return typed(expr.value, "id", { literal: expr.literal });
		} else if (type === "float") {
			if (expr.type === "integer") return typed(expr.value, "float", { literal: expr.literal });
		}
		if (expr.type === "any") return typed(expr.value, type, { literal: expr.literal });
		throw new CompileError(`Can't convert ${expr.type} to ${type}`);
	}
	function val(state, expr, type) {
		let castedExpr = expr;
		if (type) castedExpr = castInput(state, expr, type);
		if (castedExpr.literal) {
			if (castedExpr.type === "id") return `'${castedExpr.value}'`;
			else if (castedExpr.type === "string") return `'${castedExpr.value.replace(/'/g, "''")}'`;
		}
		return castedExpr.value;
	}
	function valArray(state, arr, types) {
		return arr.map((value, idx) => val(state, value, types ? types[idx] : null));
	}
	function validateArgLength(arr, min, max) {
		if (max == null) max = min;
		if (min != null && arr.length < min) throw new CompileError("Too few arguments");
		if (max != null && arr.length > max) throw new CompileError("Too many arguments");
	}
	function saveStack(type, func) {
		return (state, ...args) => {
			if (state == null || state.compileStack == null) throw new CompileError("This function cannot track error data. It needs to accept the compiler state as the first argument.");
			state.compileStack.push({
				type,
				args
			});
			const ret = func(state, ...args);
			state.compileStack.pop();
			return ret;
		};
	}
	function prettyValue(value) {
		if (typeof value === "string") return value;
		else if (value === void 0) return "undefined";
		const str = JSON.stringify(value);
		if (str.length > 70) return JSON.stringify(value, null, 2).split("\n").join("\n  ");
		return str;
	}
	function getCompileError(error, stack) {
		if (stack.length === 0) return error;
		let stackStr = stack.slice(1).reverse().map((entry) => {
			switch (entry.type) {
				case "expr":
				case "function": return prettyValue(entry.args[0]);
				case "op": {
					const [fieldRef, opData] = entry.args;
					return prettyValue({ [fieldRef]: opData });
				}
				case "value": return prettyValue(entry.value);
				default: return "";
			}
		}).map((str) => "\n  " + str).join("");
		const rootMethod = stack[0].type;
		const methodArgs = stack[0].args[0];
		stackStr += `\n  ${rootMethod}(${prettyValue(methodArgs.length === 1 ? methodArgs[0] : methodArgs)})`;
		if (process$1.env.NODE_ENV === "production") {
			const err = new CompileError();
			err.message = `${error.message}\n\nExpression stack:` + stackStr;
			err.stack = null;
			return err;
		}
		error.message = `${error.message}\n\nExpression stack:` + stackStr;
		return error;
	}
	function compileLiteral(value) {
		if (value === void 0) throw new CompileError("`undefined` is not a valid query value");
		else if (value === null) return typed("NULL", "null", { literal: true });
		else if (value instanceof Date) return typed(nativeDateToInt(value), "date", { literal: true });
		else if (typeof value === "string") {
			value = value.replace(/\\\$/g, "$");
			return typed(value, "string", { literal: true });
		} else if (typeof value === "boolean") return typed(value ? 1 : 0, "boolean", { literal: true });
		else if (typeof value === "number") return typed(value, Number.isInteger(value) ? "integer" : "float", { literal: true });
		else if (Array.isArray(value)) return typed(value, "array", { literal: true });
		else throw new CompileError("Unsupported type of expression: " + JSON.stringify(value));
	}
	var compileExpr = saveStack("expr", (state, expr) => {
		if (typeof expr === "string") {
			if (expr[0] === "$") {
				const fieldRef = expr === "$" ? state.implicitField : expr.slice(1);
				if (fieldRef == null || fieldRef === "") throw new CompileError("Invalid field reference: " + expr);
				return transformField(state, fieldRef);
			}
			if (expr[0] === ":") {
				const param = {
					value: "?",
					type: "param",
					paramName: expr.slice(1)
				};
				state.namedParameters.push(param);
				return param;
			}
		}
		if (expr !== null) {
			if (Array.isArray(expr)) return compileLiteral(expr);
			else if (typeof expr === "object" && Object.keys(expr).find((k) => k[0] === "$")) return compileFunction(state, expr);
		}
		return compileLiteral(expr);
	});
	var compileFunction = saveStack("function", (state, func) => {
		const [name] = Object.keys(func);
		let argExprs = func[name];
		if (!Array.isArray(argExprs)) argExprs = [argExprs];
		if (name[0] !== "$") throw new CompileError(`Unknown property "${name}." Did you mean to call a function? Try prefixing it with $`);
		let args = argExprs;
		if (name !== "$condition") args = argExprs.map((arg) => compileExpr(state, arg));
		switch (name) {
			case "$sum": {
				validateArgLength(args, 1);
				const [arg1] = valArray(state, args, ["float"]);
				return typed(`SUM(${arg1})`, args[0].type);
			}
			case "$sumOver": {
				const [arg1] = valArray(state, args, ["float"]);
				return typed(`(SUM(${arg1}) OVER (${state.orders ? "ORDER BY " + compileOrderBy(state, state.orders) : ""} ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING))`, args[0].type);
			}
			case "$count": {
				validateArgLength(args, 1);
				const [arg1] = valArray(state, args);
				return typed(`COUNT(${arg1})`, "integer");
			}
			case "$substr": {
				validateArgLength(args, 2, 3);
				const [arg1, arg2, arg3] = valArray(state, args, [
					"string",
					"integer",
					"integer"
				]);
				return typed(`SUBSTR(${arg1}, ${arg2}, ${arg3})`, "string");
			}
			case "$lower": {
				validateArgLength(args, 1);
				const [arg1] = valArray(state, args, ["string"]);
				return typed(`UNICODE_LOWER(${arg1})`, "string");
			}
			case "$neg":
				validateArgLength(args, 1);
				valArray(state, args, ["float"]);
				return typed(`(-${val(state, args[0])})`, args[0].type);
			case "$abs":
				validateArgLength(args, 1);
				valArray(state, args, ["float"]);
				return typed(`ABS(${val(state, args[0])})`, args[0].type);
			case "$idiv":
				validateArgLength(args, 2);
				valArray(state, args, ["integer", "integer"]);
				return typed(`(${val(state, args[0])} / ${val(state, args[1])})`, args[0].type);
			case "$id":
				validateArgLength(args, 1);
				return typed(val(state, args[0]), args[0].type);
			case "$day":
				validateArgLength(args, 1);
				return castInput(state, args[0], "date");
			case "$month":
				validateArgLength(args, 1);
				return castInput(state, args[0], "date-month");
			case "$year":
				validateArgLength(args, 1);
				return castInput(state, args[0], "date-year");
			case "$condition":
				validateArgLength(args, 1);
				return typed(compileConditions(state, args[0]).join(" AND "), "boolean");
			case "$nocase":
				validateArgLength(args, 1);
				const [arg1] = valArray(state, args, ["string"]);
				return typed(`${arg1} COLLATE NOCASE`, args[0].type);
			case "$literal":
				validateArgLength(args, 1);
				if (!args[0].literal) throw new CompileError("Literal not passed to $literal");
				return args[0];
			default: throw new CompileError(`Unknown function: ${name}`);
		}
	});
	var compileOp = saveStack("op", (state, fieldRef, opData) => {
		const { $transform, ...opExpr } = opData;
		const [op] = Object.keys(opExpr);
		const rhs = compileExpr(state, opData[op]);
		let lhs;
		if ($transform) lhs = compileFunction({
			...state,
			implicitField: fieldRef
		}, typeof $transform === "string" ? { [$transform]: "$" } : $transform);
		else lhs = compileExpr(state, "$" + fieldRef);
		switch (op) {
			case "$gte": {
				const [left, right] = valArray(state, [lhs, rhs], [null, lhs.type]);
				return `${left} >= ${right}`;
			}
			case "$lte": {
				const [left, right] = valArray(state, [lhs, rhs], [null, lhs.type]);
				return `${left} <= ${right}`;
			}
			case "$gt": {
				const [left, right] = valArray(state, [lhs, rhs], [null, lhs.type]);
				return `${left} > ${right}`;
			}
			case "$lt": {
				const [left, right] = valArray(state, [lhs, rhs], [null, lhs.type]);
				return `${left} < ${right}`;
			}
			case "$eq": {
				if (castInput(state, rhs, lhs.type).type === "null") return `${val(state, lhs)} IS NULL`;
				const [left, right] = valArray(state, [lhs, rhs], [null, lhs.type]);
				if (rhs.type === "param") {
					const orders = state.namedParameters.map((param) => {
						return param === rhs || param === lhs ? [param, { ...param }] : param;
					});
					state.namedParameters = [].concat.apply([], orders);
					return `CASE
          WHEN ${left} IS NULL THEN ${right} IS NULL
          ELSE ${left} = ${right}
        END`;
				}
				return `${left} = ${right}`;
			}
			case "$ne": {
				if (castInput(state, rhs, lhs.type).type === "null") return `${val(state, lhs)} IS NOT NULL`;
				const [left, right] = valArray(state, [lhs, rhs], [null, lhs.type]);
				if (rhs.type === "param") {
					const orders = state.namedParameters.map((param) => {
						return param === rhs || param === lhs ? [param, { ...param }] : param;
					});
					state.namedParameters = [].concat.apply([], orders);
					return `CASE
          WHEN ${left} IS NULL THEN ${right} IS NOT NULL
          ELSE ${left} IS NOT ${right}
        END`;
				}
				return `(${left} != ${right} OR ${left} IS NULL)`;
			}
			case "$oneof": {
				const [left, right] = valArray(state, [lhs, rhs], [null, "array"]);
				const ids = [...new Set(right)];
				return `${String(left)} IN (` + ids.map((id) => `'${String(id)}'`).join(",") + ")";
			}
			case "$like": {
				const [left, right] = valArray(state, [lhs, rhs], ["string", "string"]);
				return `UNICODE_LIKE(${getNormalisedString(right)}, NORMALISE(${left}))`;
			}
			case "$regexp": {
				const [left, right] = valArray(state, [lhs, rhs], ["string", "string"]);
				return `REGEXP(${right}, ${left})`;
			}
			case "$notlike": {
				const [left, right] = valArray(state, [lhs, rhs], ["string", "string"]);
				return `(NOT UNICODE_LIKE(${getNormalisedString(right)}, NORMALISE(${left}))\n OR ${left} IS NULL)`;
			}
			default: throw new CompileError(`Unknown operator: ${op}`);
		}
	});
	function compileConditions(state, conds) {
		if (!Array.isArray(conds)) conds = Object.entries(conds).map((cond) => {
			return { [cond[0]]: cond[1] };
		});
		return conds.filter(Boolean).reduce((res, condsObj) => {
			const compiled = Object.entries(condsObj).map(([field, cond]) => {
				if (field === "$and") {
					if (!cond) return null;
					return compileAnd(state, cond);
				} else if (field === "$or") {
					if (!cond || Array.isArray(cond) && cond.length === 0) return null;
					return compileOr(state, cond);
				}
				if (typeof cond === "string" || typeof cond === "number" || typeof cond === "boolean" || cond instanceof Date || cond == null) return compileOp(state, field, { $eq: cond });
				if (Array.isArray(cond)) return cond.map((c) => compileOp(state, field, c)).join(" AND ");
				return compileOp(state, field, cond);
			}).filter(Boolean);
			return [...res, ...compiled];
		}, []);
	}
	function compileOr(state, conds) {
		if (!conds) return "0";
		const res = compileConditions(state, conds);
		if (res.length === 0) return "0";
		return "(" + res.join("\n  OR ") + ")";
	}
	function compileAnd(state, conds) {
		if (!conds) return "1";
		const res = compileConditions(state, conds);
		if (res.length === 0) return "1";
		return "(" + res.join("\n  AND ") + ")";
	}
	var compileWhere = saveStack("filter", (state, conds) => {
		return compileAnd(state, conds);
	});
	function compileJoins(state, tableRef, internalTableFilters) {
		const joins = [];
		state.paths.forEach((desc, path) => {
			const { tableName, tableId, joinField, joinTable } = state.paths.get(path);
			let on = `${tableId}.id = ${tableRef(joinTable)}.${quoteAlias(joinField)}`;
			const filters = internalTableFilters(tableName);
			if (filters.length > 0) on += " AND " + compileAnd({
				...state,
				implicitTableName: tableName,
				implicitTableId: tableId
			}, filters);
			joins.push(`LEFT JOIN ${tableRef(tableName, true)} ${tableId} ON ${addTombstone(state.schema, tableName, tableId, on)}`);
			if (state.dependencies.indexOf(tableName) === -1) state.dependencies.push(tableName);
		});
		return joins.join("\n");
	}
	function expandStar(state, expr) {
		let path;
		let pathInfo;
		if (expr === "*") pathInfo = {
			tableName: state.implicitTableName,
			tableId: state.implicitTableId
		};
		else if (expr.match(/\.\*$/)) {
			const result = popPath(expr);
			path = result.path;
			pathInfo = resolvePath(state, result.path);
		}
		const table = state.schema[pathInfo.tableName];
		if (table == null) throw new Error(`Table "${pathInfo.tableName}" does not exist`);
		return Object.keys(table).map((field) => path ? `${path}.${field}` : field);
	}
	var compileSelect = saveStack("select", (state, exprs, isAggregate, orders) => {
		if (!isAggregate && !exprs.includes("id") && !exprs.includes("*")) exprs = exprs.concat(["id"]);
		return exprs.map((expr) => {
			if (typeof expr === "string") {
				if (expr.indexOf("*") !== -1) return expandStar(state, expr).map((field) => {
					const compiled = compileExpr(state, "$" + field);
					state.outputTypes.set(field, compiled.type);
					return compiled.value + " AS " + quoteAlias(field);
				}).join(", ");
				const compiled = compileExpr(state, "$" + expr);
				state.outputTypes.set(expr, compiled.type);
				return compiled.value + " AS " + quoteAlias(expr);
			}
			const [name, value] = Object.entries(expr)[0];
			if (name[0] === "$") {
				state.compileStack.push({
					type: "value",
					value: expr
				});
				throw new CompileError(`Invalid field "${name}", are you trying to select a function? You need to name the expression`);
			}
			if (typeof value === "string") {
				const compiled = compileExpr(state, "$" + value);
				state.outputTypes.set(name, compiled.type);
				return `${compiled.value} AS ${quoteAlias(name)}`;
			}
			const compiled = compileFunction({
				...state,
				orders
			}, value);
			state.outputTypes.set(name, compiled.type);
			return compiled.value + ` AS ${quoteAlias(name)}`;
		}).join(", ");
	});
	var compileGroupBy = saveStack("groupBy", (state, exprs) => {
		return exprs.map((expr) => {
			if (typeof expr === "string") return compileExpr(state, "$" + expr).value;
			return compileFunction(state, expr).value;
		}).join(", ");
	});
	var compileOrderBy = saveStack("orderBy", (state, exprs) => {
		return exprs.map((expr) => {
			let compiled;
			let dir = null;
			if (typeof expr === "string") compiled = compileExpr(state, "$" + expr).value;
			else {
				const entries = Object.entries(expr);
				const entry = entries[0];
				if (entries.length === 1 && entry[0][0] !== "$") {
					dir = entry[1];
					compiled = compileExpr(state, "$" + entry[0]).value;
				} else {
					const { $dir, ...func } = expr;
					dir = $dir;
					compiled = compileFunction(state, func).value;
				}
			}
			if (dir != null) {
				if (dir !== "desc" && dir !== "asc") throw new CompileError("Invalid order direction: " + dir);
				return `${compiled} ${dir}`;
			}
			return compiled;
		}).join(", ");
	});
	var AGGREGATE_FUNCTIONS = ["$sum", "$count"];
	function isAggregateFunction(expr) {
		if (typeof expr !== "object" || Array.isArray(expr)) return false;
		const [name, originalArgExprs] = Object.entries(expr)[0];
		let argExprs = originalArgExprs;
		if (!Array.isArray(argExprs)) argExprs = [argExprs];
		if (AGGREGATE_FUNCTIONS.indexOf(name) !== -1) return true;
		return !!argExprs.find((ex) => isAggregateFunction(ex));
	}
	function isAggregateQuery(queryState) {
		if (queryState.groupExpressions.length > 0) return true;
		return !!queryState.selectExpressions.find((expr) => {
			if (typeof expr !== "string") {
				const [_, value] = Object.entries(expr)[0];
				return isAggregateFunction(value);
			}
			return false;
		});
	}
	function compileQuery(queryState, schema, schemaConfig = {}) {
		const { withDead, validateRefs = true, tableOptions, rawMode } = queryState;
		const { tableViews = {}, tableFilters = () => [], customizeQuery = (queryState) => queryState } = schemaConfig;
		const internalTableFilters = (name) => {
			const filters = tableFilters(name);
			for (const filter of filters) {
				if (Array.isArray(filter)) throw new CompileError("Invalid internal table filter: only object filters are supported");
				if (Object.keys(filter)[0].indexOf(".") !== -1) throw new CompileError("Invalid internal table filter: field names cannot contain paths");
			}
			return filters;
		};
		const tableRef = (name, isJoin) => {
			return (typeof tableViews === "function" ? tableViews(name, {
				withDead,
				isJoin,
				tableOptions
			}) : tableViews[name]) || name;
		};
		const tableName = queryState.table;
		const { filterExpressions, selectExpressions, groupExpressions, orderExpressions, limit, offset } = customizeQuery(queryState);
		let select = "";
		let where = "";
		let joins = "";
		let groupBy = "";
		let orderBy = "";
		const state = {
			schema,
			implicitTableName: tableName,
			implicitTableId: tableRef(tableName),
			paths: /* @__PURE__ */ new Map(),
			dependencies: [tableName],
			compileStack: [],
			outputTypes: /* @__PURE__ */ new Map(),
			validateRefs,
			namedParameters: []
		};
		resetUid();
		try {
			select = compileSelect(state, selectExpressions, isAggregateQuery(queryState), orderExpressions);
			if (filterExpressions.length > 0) where = "WHERE " + compileWhere(state, filterExpressions);
			else where = "WHERE 1";
			if (!rawMode) {
				const filters = internalTableFilters(tableName);
				if (filters.length > 0) where += " AND " + compileAnd(state, filters);
			}
			if (groupExpressions.length > 0) groupBy = "GROUP BY " + compileGroupBy(state, groupExpressions);
			if (orderExpressions.length > 0) orderBy = "ORDER BY " + compileOrderBy(state, orderExpressions);
			if (state.paths.size > 0) joins = compileJoins(state, tableRef, internalTableFilters);
		} catch (e) {
			if (e instanceof CompileError) throw getCompileError(e, state.compileStack);
			throw e;
		}
		return {
			sqlPieces: {
				select,
				from: tableRef(tableName),
				joins,
				where,
				groupBy,
				orderBy,
				limit,
				offset
			},
			state
		};
	}
	function defaultConstructQuery(queryState, compilerState, sqlPieces) {
		const s = sqlPieces;
		const where = queryState.withDead ? s.where : addTombstone(compilerState.schema, compilerState.implicitTableName, compilerState.implicitTableId, s.where);
		return `
    SELECT ${s.select} FROM ${s.from}
    ${s.joins}
    ${where}
    ${s.groupBy}
    ${s.orderBy}
    ${s.limit != null ? `LIMIT ${s.limit}` : ""}
    ${s.offset != null ? `OFFSET ${s.offset}` : ""}
  `;
	}
	//#endregion
	//#region ../loot-core/src/server/models.ts
	function requiredFields(name, row, fields, update) {
		fields.forEach((field) => {
			if (update) {
				if (row.hasOwnProperty(field) && row[field] == null) throw new ValidationError(`${name} is missing field ${String(field)}`);
			} else if (!row.hasOwnProperty(field) || row[field] == null) throw new ValidationError(`${name} is missing field ${String(field)}`);
		});
	}
	function toDateRepr(str) {
		if (typeof str !== "string") throw new Error("toDateRepr not passed a string: " + str);
		return parseInt(str.replace(/-/g, ""));
	}
	function fromDateRepr(number) {
		if (typeof number !== "number") throw new Error("fromDateRepr not passed a number: " + number);
		const dateString = number.toString();
		return dateString.slice(0, 4) + "-" + dateString.slice(4, 6) + "-" + dateString.slice(6);
	}
	var accountModel$1 = { validate(account, { update } = {}) {
		requiredFields("account", account, update ? [
			"name",
			"offbudget",
			"closed"
		] : ["name"], update);
		return account;
	} };
	var categoryModel$1 = {
		validate(category, { update } = {}) {
			requiredFields("category", category, update ? [
				"name",
				"is_income",
				"cat_group"
			] : ["name", "cat_group"], update);
			const { sort_order: _sort_order, ...rest } = category;
			return { ...rest };
		},
		toDb(category, { update } = {}) {
			return update ? convertForUpdate(schema, schemaConfig, "categories", category) : convertForInsert(schema, schemaConfig, "categories", category);
		},
		fromDb(category) {
			return convertFromSelect(schema, schemaConfig, "categories", category);
		}
	};
	var categoryGroupModel$1 = {
		validate(categoryGroup, { update } = {}) {
			requiredFields("categoryGroup", categoryGroup, update ? ["name", "is_income"] : ["name"], update);
			const { sort_order: _sort_order, ...rest } = categoryGroup;
			return { ...rest };
		},
		toDb(categoryGroup, { update } = {}) {
			return update ? convertForUpdate(schema, schemaConfig, "category_groups", categoryGroup) : convertForInsert(schema, schemaConfig, "category_groups", categoryGroup);
		},
		fromDb(categoryGroup) {
			const { categories, ...rest } = categoryGroup;
			return {
				...convertFromSelect(schema, schemaConfig, "category_groups", rest),
				categories: categories.filter((category) => category.cat_group === categoryGroup.id).map((c) => categoryModel$1.fromDb(c))
			};
		}
	};
	var payeeModel$1 = {
		validate(payee, { update } = {}) {
			requiredFields("payee", payee, update ? [] : ["name"], update);
			return payee;
		},
		toDb(payee, { update } = {}) {
			return update ? convertForUpdate(schema, schemaConfig, "payees", payee) : convertForInsert(schema, schemaConfig, "payees", payee);
		},
		fromDb(payee) {
			return convertFromSelect(schema, schemaConfig, "payees", payee);
		}
	};
	//#endregion
	//#region ../../node_modules/memoize-one/dist/memoize-one.esm.js
	var safeIsNaN = Number.isNaN || function ponyfill(value) {
		return typeof value === "number" && value !== value;
	};
	function isEqual(first, second) {
		if (first === second) return true;
		if (safeIsNaN(first) && safeIsNaN(second)) return true;
		return false;
	}
	function areInputsEqual(newInputs, lastInputs) {
		if (newInputs.length !== lastInputs.length) return false;
		for (var i = 0; i < newInputs.length; i++) if (!isEqual(newInputs[i], lastInputs[i])) return false;
		return true;
	}
	function memoizeOne(resultFn, isEqual) {
		if (isEqual === void 0) isEqual = areInputsEqual;
		var cache = null;
		function memoized() {
			var newArgs = [];
			for (var _i = 0; _i < arguments.length; _i++) newArgs[_i] = arguments[_i];
			if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) return cache.lastResult;
			var lastResult = resultFn.apply(this, newArgs);
			cache = {
				lastResult,
				lastArgs: newArgs,
				lastThis: this
			};
			return lastResult;
		}
		memoized.clear = function clear() {
			cache = null;
		};
		return memoized;
	}
	//#endregion
	//#region ../../node_modules/ua-parser-js/src/main/ua-parser.mjs
	var LIBVERSION = "2.0.9", UA_MAX_LENGTH = 500, USER_AGENT = "user-agent", EMPTY = "", UNKNOWN = "?", TYPEOF = {
		FUNCTION: "function",
		OBJECT: "object",
		STRING: "string",
		UNDEFINED: "undefined"
	}, BROWSER = "browser", CPU = "cpu", DEVICE = "device", ENGINE = "engine", OS = "os", RESULT = "result", NAME$1 = "name", TYPE = "type", VENDOR = "vendor", VERSION$1 = "version", ARCHITECTURE = "architecture", MAJOR = "major", MODEL = "model", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", XR = "xr", EMBEDDED = "embedded", FETCHER = "fetcher", INAPP = "inapp", BRANDS = "brands", FORMFACTORS = "formFactors", FULLVERLIST = "fullVersionList", PLATFORM = "platform", PLATFORMVER = "platformVersion", BITNESS = "bitness", CH = "sec-ch-ua", CH_FULL_VER_LIST = CH + "-full-version-list", CH_ARCH = CH + "-arch", CH_BITNESS = CH + "-" + BITNESS, CH_FORM_FACTORS = CH + "-form-factors", CH_MOBILE = CH + "-" + MOBILE, CH_MODEL = CH + "-" + MODEL, CH_PLATFORM = CH + "-" + PLATFORM, CH_PLATFORM_VER = CH_PLATFORM + "-version", CH_ALL_VALUES = [
		BRANDS,
		FULLVERLIST,
		MOBILE,
		MODEL,
		PLATFORM,
		PLATFORMVER,
		ARCHITECTURE,
		FORMFACTORS,
		BITNESS
	], AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", GOOGLE = "Google", HUAWEI = "Huawei", LENOVO = "Lenovo", HONOR = "Honor", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", NVIDIA = "Nvidia", ONEPLUS = "OnePlus", OPPO = "OPPO", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", CHROME = "Chrome", CHROMIUM = "Chromium", CHROMECAST = "Chromecast", EDGE = "Edge", FIREFOX = "Firefox", OPERA = "Opera", FACEBOOK = "Facebook", SOGOU = "Sogou", PREFIX_MOBILE = "Mobile ", SUFFIX_BROWSER = " Browser", WINDOWS = "Windows";
	var NAVIGATOR = typeof window !== TYPEOF.UNDEFINED && window.navigator ? window.navigator : void 0, NAVIGATOR_UADATA = NAVIGATOR && NAVIGATOR.userAgentData ? NAVIGATOR.userAgentData : void 0;
	var extend = function(defaultRgx, extensions) {
		var mergedRgx = {};
		var extraRgx = extensions;
		if (!isExtensions(extensions)) {
			extraRgx = {};
			for (var i in extensions) for (var j in extensions[i]) extraRgx[j] = extensions[i][j].concat(extraRgx[j] ? extraRgx[j] : []);
		}
		for (var k in defaultRgx) mergedRgx[k] = extraRgx[k] && extraRgx[k].length % 2 === 0 ? extraRgx[k].concat(defaultRgx[k]) : defaultRgx[k];
		return mergedRgx;
	}, enumerize = function(arr) {
		var enums = {};
		for (var i = 0; i < arr.length; i++) enums[arr[i].toUpperCase()] = arr[i];
		return enums;
	}, has$1 = function(str1, str2) {
		if (typeof str1 === TYPEOF.OBJECT && str1.length > 0) {
			for (var i in str1) if (lowerize(str2) == lowerize(str1[i])) return true;
			return false;
		}
		return isString$1(str1) ? lowerize(str2) == lowerize(str1) : false;
	}, isExtensions = function(obj, deep) {
		for (var prop in obj) return /^(browser|cpu|device|engine|os)$/.test(prop) || (deep ? isExtensions(obj[prop]) : false);
	}, isString$1 = function(val) {
		return typeof val === TYPEOF.STRING;
	}, itemListToArray = function(header) {
		if (!header) return void 0;
		var arr = [];
		var tokens = strip(/\\?\"/g, header).split(",");
		for (var i = 0; i < tokens.length; i++) if (tokens[i].indexOf(";") > -1) {
			var token = trim(tokens[i]).split(";v=");
			arr[i] = {
				brand: token[0],
				version: token[1]
			};
		} else arr[i] = trim(tokens[i]);
		return arr;
	}, lowerize = function(str) {
		return isString$1(str) ? str.toLowerCase() : str;
	}, majorize = function(version) {
		return isString$1(version) ? strip(/[^\d\.]/g, version).split(".")[0] : void 0;
	}, setProps = function(arr) {
		for (var i in arr) {
			if (!arr.hasOwnProperty(i)) continue;
			var propName = arr[i];
			if (typeof propName == TYPEOF.OBJECT && propName.length == 2) this[propName[0]] = propName[1];
			else this[propName] = void 0;
		}
		return this;
	}, strip = function(pattern, str) {
		return isString$1(str) ? str.replace(pattern, EMPTY) : str;
	}, stripQuotes = function(str) {
		return strip(/\\?\"/g, str);
	}, trim = function(str, len) {
		str = strip(/^\s\s*/, String(str));
		return typeof len === TYPEOF.UNDEFINED ? str : str.substring(0, len);
	};
	var rgxMapper = function(ua, arrays) {
		if (!ua || !arrays) return;
		var i = 0, j, k, p, q, matches, match;
		while (i < arrays.length && !matches) {
			var regex = arrays[i], props = arrays[i + 1];
			j = k = 0;
			while (j < regex.length && !matches) {
				if (!regex[j]) break;
				matches = regex[j++].exec(ua);
				if (!!matches) for (p = 0; p < props.length; p++) {
					match = matches[++k];
					q = props[p];
					if (typeof q === TYPEOF.OBJECT && q.length > 0) {
						if (q.length === 2) if (typeof q[1] == TYPEOF.FUNCTION) this[q[0]] = q[1].call(this, match);
						else this[q[0]] = q[1];
						else if (q.length >= 3) {
							if (typeof q[1] === TYPEOF.FUNCTION && !(q[1].exec && q[1].test)) if (q.length > 3) this[q[0]] = match ? q[1].apply(this, q.slice(2)) : void 0;
							else this[q[0]] = match ? q[1].call(this, match, q[2]) : void 0;
							else if (q.length == 3) this[q[0]] = match ? match.replace(q[1], q[2]) : void 0;
							else if (q.length == 4) this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : void 0;
							else if (q.length > 4) this[q[0]] = match ? q[3].apply(this, [match.replace(q[1], q[2])].concat(q.slice(4))) : void 0;
						}
					} else this[q] = match ? match : void 0;
				}
			}
			i += 2;
		}
	}, strMapper = function(str, map) {
		for (var i in map) if (typeof map[i] === TYPEOF.OBJECT && map[i].length > 0) {
			for (var j = 0; j < map[i].length; j++) if (has$1(map[i][j], str)) return i === UNKNOWN ? void 0 : i;
		} else if (has$1(map[i], str)) return i === UNKNOWN ? void 0 : i;
		return map.hasOwnProperty("*") ? map["*"] : str;
	};
	var windowsVersionMap = {
		"ME": "4.90",
		"NT 3.51": "3.51",
		"NT 4.0": "4.0",
		"2000": ["5.0", "5.01"],
		"XP": ["5.1", "5.2"],
		"Vista": "6.0",
		"7": "6.1",
		"8": "6.2",
		"8.1": "6.3",
		"10": ["6.4", "10.0"],
		"NT": ""
	}, formFactorsMap = {
		"embedded": "Automotive",
		"mobile": "Mobile",
		"tablet": ["Tablet", "EInk"],
		"smarttv": "TV",
		"wearable": "Watch",
		"xr": ["VR", "XR"],
		"?": ["Desktop", "Unknown"],
		"*": void 0
	}, browserHintsMap = {
		"Chrome": "Google Chrome",
		"Edge": "Microsoft Edge",
		"Edge WebView2": "Microsoft Edge WebView2",
		"Chrome WebView": "Android WebView",
		"Chrome Headless": "HeadlessChrome",
		"Huawei Browser": "HuaweiBrowser",
		"MIUI Browser": "Miui Browser",
		"Opera Mobi": "OperaMobile",
		"Yandex": "YaBrowser"
	};
	var defaultRegexes = {
		browser: [
			[/\b(?:crmo|crios)\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, PREFIX_MOBILE + "Chrome"]],
			[/webview.+edge\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, EDGE + " WebView"]],
			[/edg(?:e|ios|a)?\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Edge"]],
			[
				/(opera mini)\/([-\w\.]+)/i,
				/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
				/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
			],
			[NAME$1, VERSION$1],
			[/opios[\/ ]+([\w\.]+)/i],
			[VERSION$1, [NAME$1, OPERA + " Mini"]],
			[/\bop(?:rg)?x\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, OPERA + " GX"]],
			[/\bopr\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, OPERA]],
			[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Baidu"]],
			[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],
			[VERSION$1, [NAME$1, "Maxthon"]],
			[
				/(kindle)\/([\w\.]+)/i,
				/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,
				/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,
				/(?:ms|\()(ie) ([\w\.]+)/i,
				/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:hi|lg |ovi|qute)browser|palemoon)\/v?([-\w\.]+)/i,
				/(brave)(?: chrome)?\/([\d\.]+)/i,
				/(aloha|heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,
				/(qwant)(?:ios|mobile)\/([\d\.]+)/i,
				/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i
			],
			[NAME$1, VERSION$1],
			[/quark(?:pc)?\/([-\w\.]+)/i],
			[VERSION$1, [NAME$1, "Quark"]],
			[/\bddg\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "DuckDuckGo"]],
			[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],
			[VERSION$1, [NAME$1, "UCBrowser"]],
			[
				/microm.+\bqbcore\/([\w\.]+)/i,
				/\bqbcore\/([\w\.]+).+microm/i,
				/micromessenger\/([\w\.]+)/i
			],
			[VERSION$1, [NAME$1, "WeChat"]],
			[/konqueror\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Konqueror"]],
			[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],
			[VERSION$1, [NAME$1, "IE"]],
			[/ya(?:search)?browser\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Yandex"]],
			[/slbrowser\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Smart " + LENOVO + SUFFIX_BROWSER]],
			[/(av(?:ast|g|ira))\/([\w\.]+)/i],
			[[
				NAME$1,
				/(.+)/,
				"$1 Secure" + SUFFIX_BROWSER
			], VERSION$1],
			[/norton\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Norton Private" + SUFFIX_BROWSER]],
			[/\bfocus\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, FIREFOX + " Focus"]],
			[/ mms\/([\w\.]+)$/i],
			[VERSION$1, [NAME$1, OPERA + " Neon"]],
			[/ opt\/([\w\.]+)$/i],
			[VERSION$1, [NAME$1, OPERA + " Touch"]],
			[/coc_coc\w+\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Coc Coc"]],
			[/dolfin\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Dolphin"]],
			[/coast\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, OPERA + " Coast"]],
			[/miuibrowser\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, "MIUI" + SUFFIX_BROWSER]],
			[/fxios\/([\w\.-]+)/i],
			[VERSION$1, [NAME$1, PREFIX_MOBILE + FIREFOX]],
			[/\bqihoobrowser\/?([\w\.]*)/i],
			[VERSION$1, [NAME$1, "360"]],
			[/\b(qq)\/([\w\.]+)/i],
			[[
				NAME$1,
				/(.+)/,
				"$1Browser"
			], VERSION$1],
			[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],
			[[
				NAME$1,
				/(.+)/,
				"$1" + SUFFIX_BROWSER
			], VERSION$1],
			[/samsungbrowser\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, SAMSUNG + " Internet"]],
			[/metasr[\/ ]?([\d\.]+)/i],
			[VERSION$1, [NAME$1, SOGOU + " Explorer"]],
			[/(sogou)mo\w+\/([\d\.]+)/i],
			[[NAME$1, SOGOU + " Mobile"], VERSION$1],
			[
				/(electron)\/([\w\.]+) safari/i,
				/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
				/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i
			],
			[NAME$1, VERSION$1],
			[/(lbbrowser|luakit|rekonq|steam(?= (clie|tenf|gameo)))/i],
			[NAME$1],
			[/ome\/([\w\.]+).+(iron(?= saf)|360(?=[es]e$))/i],
			[VERSION$1, NAME$1],
			[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],
			[
				[NAME$1, FACEBOOK],
				VERSION$1,
				[TYPE, INAPP]
			],
			[
				/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
				/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
				/(daum)apps[\/ ]([\w\.]+)/i,
				/safari (line)\/([\w\.]+)/i,
				/\b(line)\/([\w\.]+)\/iab/i,
				/(alipay)client\/([\w\.]+)/i,
				/(twitter)(?:and| f.+e\/([\w\.]+))/i,
				/(bing)(?:web|sapphire)\/([\w\.]+)/i,
				/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i
			],
			[
				NAME$1,
				VERSION$1,
				[TYPE, INAPP]
			],
			[/\bgsa\/([\w\.]+) .*safari\//i],
			[
				VERSION$1,
				[NAME$1, "GSA"],
				[TYPE, INAPP]
			],
			[/(?:musical_ly|trill)(?:.+app_?version\/|_)([\w\.]+)/i],
			[
				VERSION$1,
				[NAME$1, "TikTok"],
				[TYPE, INAPP]
			],
			[/\[(linkedin)app\]/i],
			[NAME$1, [TYPE, INAPP]],
			[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],
			[
				[
					NAME$1,
					/(.+)/,
					"Zalo"
				],
				VERSION$1,
				[TYPE, INAPP]
			],
			[/(chromium)[\/ ]([-\w\.]+)/i],
			[NAME$1, VERSION$1],
			[/ome-(lighthouse)$/i],
			[NAME$1, [TYPE, FETCHER]],
			[/headlesschrome(?:\/([\w\.]+)| )/i],
			[VERSION$1, [NAME$1, CHROME + " Headless"]],
			[/wv\).+chrome\/([\w\.]+).+edgw\//i],
			[VERSION$1, [NAME$1, EDGE + " WebView2"]],
			[/ wv\).+(chrome)\/([\w\.]+)/i],
			[[NAME$1, CHROME + " WebView"], VERSION$1],
			[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],
			[VERSION$1, [NAME$1, "Android" + SUFFIX_BROWSER]],
			[/chrome\/([\w\.]+) mobile/i],
			[VERSION$1, [NAME$1, PREFIX_MOBILE + "Chrome"]],
			[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],
			[NAME$1, VERSION$1],
			[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],
			[VERSION$1, [NAME$1, PREFIX_MOBILE + "Safari"]],
			[/iphone .*mobile(?:\/\w+ | ?)safari/i],
			[[NAME$1, PREFIX_MOBILE + "Safari"]],
			[/version\/([\w\.\,]+) .*(safari)/i],
			[VERSION$1, NAME$1],
			[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],
			[NAME$1, [VERSION$1, "1"]],
			[/(webkit|khtml)\/([\w\.]+)/i],
			[NAME$1, VERSION$1],
			[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],
			[[NAME$1, PREFIX_MOBILE + FIREFOX], VERSION$1],
			[/(navigator|netscape\d?)\/([-\w\.]+)/i],
			[[NAME$1, "Netscape"], VERSION$1],
			[/(wolvic|librewolf)\/([\w\.]+)/i],
			[NAME$1, VERSION$1],
			[/mobile vr; rv:([\w\.]+)\).+firefox/i],
			[VERSION$1, [NAME$1, FIREFOX + " Reality"]],
			[
				/ekiohf.+(flow)\/([\w\.]+)/i,
				/(swiftfox)/i,
				/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,
				/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,
				/(firefox)\/([\w\.]+)/i,
				/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,
				/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
				/\b(links) \(([\w\.]+)/i
			],
			[NAME$1, [
				VERSION$1,
				/_/g,
				"."
			]],
			[/(cobalt)\/([\w\.]+)/i],
			[NAME$1, [
				VERSION$1,
				/[^\d\.]+./,
				EMPTY
			]]
		],
		cpu: [
			[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],
			[[ARCHITECTURE, "amd64"]],
			[/(ia32(?=;))/i, /\b((i[346]|x)86)(pc)?\b/i],
			[[ARCHITECTURE, "ia32"]],
			[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],
			[[ARCHITECTURE, "arm64"]],
			[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],
			[[ARCHITECTURE, "armhf"]],
			[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],
			[[ARCHITECTURE, "arm"]],
			[/ sun4\w[;\)]/i],
			[[ARCHITECTURE, "sparc"]],
			[
				/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,
				/((ppc|powerpc)(64)?)( mac|;|\))/i,
				/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i
			],
			[[
				ARCHITECTURE,
				/ower/,
				EMPTY,
				lowerize
			]],
			[/mc680.0/i],
			[[ARCHITECTURE, "68k"]],
			[/winnt.+\[axp/i],
			[[ARCHITECTURE, "alpha"]]
		],
		device: [
			[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],
			[
				MODEL,
				[VENDOR, SAMSUNG],
				[TYPE, TABLET]
			],
			[
				/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
				/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,
				/sec-(sgh\w+)/i
			],
			[
				MODEL,
				[VENDOR, SAMSUNG],
				[TYPE, MOBILE]
			],
			[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],
			[
				MODEL,
				[VENDOR, APPLE],
				[TYPE, MOBILE]
			],
			[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i, /\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],
			[
				MODEL,
				[VENDOR, APPLE],
				[TYPE, TABLET]
			],
			[/(macintosh);/i],
			[MODEL, [VENDOR, APPLE]],
			[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],
			[
				MODEL,
				[VENDOR, SHARP],
				[TYPE, MOBILE]
			],
			[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],
			[
				MODEL,
				[VENDOR, HONOR],
				[TYPE, TABLET]
			],
			[/honor([-\w ]+)[;\)]/i],
			[
				MODEL,
				[VENDOR, HONOR],
				[TYPE, MOBILE]
			],
			[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],
			[
				MODEL,
				[VENDOR, HUAWEI],
				[TYPE, TABLET]
			],
			[/(?:huawei) ?([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],
			[
				MODEL,
				[VENDOR, HUAWEI],
				[TYPE, MOBILE]
			],
			[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i, /\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],
			[
				[
					MODEL,
					/_/g,
					" "
				],
				[VENDOR, XIAOMI],
				[TYPE, TABLET]
			],
			[
				/\b; (\w+) build\/hm\1/i,
				/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
				/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,
				/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,
				/ ([\w ]+) miui\/v?\d/i
			],
			[
				[
					MODEL,
					/_/g,
					" "
				],
				[VENDOR, XIAOMI],
				[TYPE, MOBILE]
			],
			[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-l]\w[1m]10)\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],
			[
				MODEL,
				[VENDOR, ONEPLUS],
				[TYPE, MOBILE]
			],
			[/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],
			[
				MODEL,
				[VENDOR, OPPO],
				[TYPE, MOBILE]
			],
			[/\b(opd2(\d{3}a?))(?: bui|\))/i],
			[
				MODEL,
				[
					VENDOR,
					strMapper,
					{
						"OnePlus": [
							"203",
							"304",
							"403",
							"404",
							"413",
							"415"
						],
						"*": OPPO
					}
				],
				[TYPE, TABLET]
			],
			[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],
			[
				MODEL,
				[VENDOR, "BLU"],
				[TYPE, MOBILE]
			],
			[/; vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i],
			[
				MODEL,
				[VENDOR, "Vivo"],
				[TYPE, MOBILE]
			],
			[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],
			[
				MODEL,
				[VENDOR, "Realme"],
				[TYPE, MOBILE]
			],
			[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i, /lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],
			[
				MODEL,
				[VENDOR, LENOVO],
				[TYPE, TABLET]
			],
			[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],
			[
				MODEL,
				[VENDOR, LENOVO],
				[TYPE, MOBILE]
			],
			[
				/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
				/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,
				/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i
			],
			[
				MODEL,
				[VENDOR, MOTOROLA],
				[TYPE, MOBILE]
			],
			[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],
			[
				MODEL,
				[VENDOR, MOTOROLA],
				[TYPE, TABLET]
			],
			[/\b(?:lg)?([vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],
			[
				MODEL,
				[VENDOR, LG],
				[TYPE, TABLET]
			],
			[
				/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
				/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,
				/\blg-?([\d\w]+) bui/i
			],
			[
				MODEL,
				[VENDOR, LG],
				[TYPE, MOBILE]
			],
			[/(nokia) (t[12][01])/i],
			[
				VENDOR,
				MODEL,
				[TYPE, TABLET]
			],
			[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i, /nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],
			[
				[
					MODEL,
					/_/g,
					" "
				],
				[TYPE, MOBILE],
				[VENDOR, "Nokia"]
			],
			[/(pixel (c|tablet))\b/i],
			[
				MODEL,
				[VENDOR, GOOGLE],
				[TYPE, TABLET]
			],
			[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],
			[
				MODEL,
				[VENDOR, GOOGLE],
				[TYPE, MOBILE]
			],
			[/(google) (pixelbook( go)?)/i],
			[VENDOR, MODEL],
			[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],
			[
				MODEL,
				[VENDOR, SONY],
				[TYPE, MOBILE]
			],
			[/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i],
			[
				[MODEL, "Xperia Tablet"],
				[VENDOR, SONY],
				[TYPE, TABLET]
			],
			[
				/(alexa)webm/i,
				/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,
				/(kf[a-z]+)( bui|\)).+silk\//i
			],
			[
				MODEL,
				[VENDOR, AMAZON],
				[TYPE, TABLET]
			],
			[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],
			[
				[
					MODEL,
					/(.+)/g,
					"Fire Phone $1"
				],
				[VENDOR, AMAZON],
				[TYPE, MOBILE]
			],
			[/(playbook);[-\w\),; ]+(rim)/i],
			[
				MODEL,
				VENDOR,
				[TYPE, TABLET]
			],
			[/\b((?:bb[a-f]|st[hv])100-\d)/i, /(?:blackberry|\(bb10;) (\w+)/i],
			[
				MODEL,
				[VENDOR, BLACKBERRY],
				[TYPE, MOBILE]
			],
			[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],
			[
				MODEL,
				[VENDOR, ASUS],
				[TYPE, TABLET]
			],
			[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],
			[
				MODEL,
				[VENDOR, ASUS],
				[TYPE, MOBILE]
			],
			[/(nexus 9)/i],
			[
				MODEL,
				[VENDOR, "HTC"],
				[TYPE, TABLET]
			],
			[
				/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
				/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
				/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
			],
			[
				VENDOR,
				[
					MODEL,
					/_/g,
					" "
				],
				[TYPE, MOBILE]
			],
			[/tcl (xess p17aa)/i, /droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],
			[
				MODEL,
				[VENDOR, "TCL"],
				[TYPE, TABLET]
			],
			[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],
			[
				MODEL,
				[VENDOR, "TCL"],
				[TYPE, MOBILE]
			],
			[/(itel) ((\w+))/i],
			[
				[VENDOR, lowerize],
				MODEL,
				[
					TYPE,
					strMapper,
					{
						"tablet": ["p10001l", "w7001"],
						"*": "mobile"
					}
				]
			],
			[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],
			[
				MODEL,
				[VENDOR, "Acer"],
				[TYPE, TABLET]
			],
			[/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i],
			[
				MODEL,
				[VENDOR, "Meizu"],
				[TYPE, MOBILE]
			],
			[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],
			[
				MODEL,
				[VENDOR, "Ulefone"],
				[TYPE, MOBILE]
			],
			[/; (energy ?\w+)(?: bui|\))/i, /; energizer ([\w ]+)(?: bui|\))/i],
			[
				MODEL,
				[VENDOR, "Energizer"],
				[TYPE, MOBILE]
			],
			[/; cat (b35);/i, /; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],
			[
				MODEL,
				[VENDOR, "Cat"],
				[TYPE, MOBILE]
			],
			[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],
			[
				MODEL,
				[VENDOR, "Smartfren"],
				[TYPE, MOBILE]
			],
			[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],
			[
				MODEL,
				[VENDOR, "Nothing"],
				[TYPE, MOBILE]
			],
			[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i, /archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],
			[
				MODEL,
				[VENDOR, "Archos"],
				[TYPE, TABLET]
			],
			[/archos ([\w ]+)( b|\))/i, /; (ac[3-6]\d\w{2,8})( b|\))/i],
			[
				MODEL,
				[VENDOR, "Archos"],
				[TYPE, MOBILE]
			],
			[/; (n159v)/i],
			[
				MODEL,
				[VENDOR, "HMD"],
				[TYPE, MOBILE]
			],
			[/(imo) (tab \w+)/i, /(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],
			[
				VENDOR,
				MODEL,
				[TYPE, TABLET]
			],
			[
				/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,
				/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,
				/(hp) ([\w ]+\w)/i,
				/(microsoft); (lumia[\w ]+)/i,
				/(oppo) ?([\w ]+) bui/i,
				/(hisense) ([ehv][\w ]+)\)/i,
				/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i
			],
			[
				VENDOR,
				MODEL,
				[TYPE, MOBILE]
			],
			[
				/(kobo)\s(ereader|touch)/i,
				/(hp).+(touchpad(?!.+tablet)|tablet)/i,
				/(kindle)\/([\w\.]+)/i
			],
			[
				VENDOR,
				MODEL,
				[TYPE, TABLET]
			],
			[/(surface duo)/i],
			[
				MODEL,
				[VENDOR, MICROSOFT],
				[TYPE, TABLET]
			],
			[/droid [\d\.]+; (fp\du?)(?: b|\))/i],
			[
				MODEL,
				[VENDOR, "Fairphone"],
				[TYPE, MOBILE]
			],
			[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],
			[
				MODEL,
				[VENDOR, NVIDIA],
				[TYPE, TABLET]
			],
			[/(sprint) (\w+)/i],
			[
				VENDOR,
				MODEL,
				[TYPE, MOBILE]
			],
			[/(kin\.[onetw]{3})/i],
			[
				[
					MODEL,
					/\./g,
					" "
				],
				[VENDOR, MICROSOFT],
				[TYPE, MOBILE]
			],
			[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],
			[
				MODEL,
				[VENDOR, ZEBRA],
				[TYPE, TABLET]
			],
			[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],
			[
				MODEL,
				[VENDOR, ZEBRA],
				[TYPE, MOBILE]
			],
			[/(philips)[\w ]+tv/i, /smart-tv.+(samsung)/i],
			[VENDOR, [TYPE, SMARTTV]],
			[/hbbtv.+maple;(\d+)/i],
			[
				[
					MODEL,
					/^/,
					"SmartTV"
				],
				[VENDOR, SAMSUNG],
				[TYPE, SMARTTV]
			],
			[/(vizio)(?: |.+model\/)(\w+-\w+)/i, /tcast.+(lg)e?. ([-\w]+)/i],
			[
				VENDOR,
				MODEL,
				[TYPE, SMARTTV]
			],
			[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],
			[[VENDOR, LG], [TYPE, SMARTTV]],
			[/(apple) ?tv/i],
			[
				VENDOR,
				[MODEL, APPLE + " TV"],
				[TYPE, SMARTTV]
			],
			[/crkey.*devicetype\/chromecast/i],
			[
				[MODEL, CHROMECAST + " Third Generation"],
				[VENDOR, GOOGLE],
				[TYPE, SMARTTV]
			],
			[/crkey.*devicetype\/([^/]*)/i],
			[
				[
					MODEL,
					/^/,
					"Chromecast "
				],
				[VENDOR, GOOGLE],
				[TYPE, SMARTTV]
			],
			[/fuchsia.*crkey/i],
			[
				[MODEL, CHROMECAST + " Nest Hub"],
				[VENDOR, GOOGLE],
				[TYPE, SMARTTV]
			],
			[/crkey/i],
			[
				[MODEL, CHROMECAST],
				[VENDOR, GOOGLE],
				[TYPE, SMARTTV]
			],
			[/(portaltv)/i],
			[
				MODEL,
				[VENDOR, FACEBOOK],
				[TYPE, SMARTTV]
			],
			[/droid.+aft(\w+)( bui|\))/i],
			[
				MODEL,
				[VENDOR, AMAZON],
				[TYPE, SMARTTV]
			],
			[/(shield \w+ tv)/i],
			[
				MODEL,
				[VENDOR, NVIDIA],
				[TYPE, SMARTTV]
			],
			[/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i],
			[
				MODEL,
				[VENDOR, SHARP],
				[TYPE, SMARTTV]
			],
			[/(bravia[\w ]+)( bui|\))/i],
			[
				MODEL,
				[VENDOR, SONY],
				[TYPE, SMARTTV]
			],
			[/(mi(tv|box)-?\w+) bui/i],
			[
				MODEL,
				[VENDOR, XIAOMI],
				[TYPE, SMARTTV]
			],
			[/Hbbtv.*(technisat) (.*);/i],
			[
				VENDOR,
				MODEL,
				[TYPE, SMARTTV]
			],
			[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],
			[
				[
					VENDOR,
					/.+\/(\w+)/,
					"$1",
					strMapper,
					{ "LG": "lge" }
				],
				[MODEL, trim],
				[TYPE, SMARTTV]
			],
			[/(playstation \w+)/i],
			[
				MODEL,
				[VENDOR, SONY],
				[TYPE, CONSOLE]
			],
			[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],
			[
				MODEL,
				[VENDOR, MICROSOFT],
				[TYPE, CONSOLE]
			],
			[
				/(ouya)/i,
				/(nintendo) (\w+)/i,
				/(retroid) (pocket ([^\)]+))/i,
				/(valve).+(steam deck)/i,
				/droid.+; ((shield|rgcube|gr0006))( bui|\))/i
			],
			[
				[
					VENDOR,
					strMapper,
					{
						"Nvidia": "Shield",
						"Anbernic": "RGCUBE",
						"Logitech": "GR0006"
					}
				],
				MODEL,
				[TYPE, CONSOLE]
			],
			[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],
			[
				MODEL,
				[VENDOR, SAMSUNG],
				[TYPE, WEARABLE]
			],
			[/((pebble))app/i, /(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],
			[
				VENDOR,
				MODEL,
				[TYPE, WEARABLE]
			],
			[/(ow(?:19|20)?we?[1-3]{1,3})/i],
			[
				MODEL,
				[VENDOR, OPPO],
				[TYPE, WEARABLE]
			],
			[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],
			[
				MODEL,
				[VENDOR, APPLE],
				[TYPE, WEARABLE]
			],
			[/(opwwe\d{3})/i],
			[
				MODEL,
				[VENDOR, ONEPLUS],
				[TYPE, WEARABLE]
			],
			[/(moto 360)/i],
			[
				MODEL,
				[VENDOR, MOTOROLA],
				[TYPE, WEARABLE]
			],
			[/(smartwatch 3)/i],
			[
				MODEL,
				[VENDOR, SONY],
				[TYPE, WEARABLE]
			],
			[/(g watch r)/i],
			[
				MODEL,
				[VENDOR, LG],
				[TYPE, WEARABLE]
			],
			[/droid.+; (wt63?0{2,3})\)/i],
			[
				MODEL,
				[VENDOR, ZEBRA],
				[TYPE, WEARABLE]
			],
			[/droid.+; (glass) \d/i],
			[
				MODEL,
				[VENDOR, GOOGLE],
				[TYPE, XR]
			],
			[/(pico) ([\w ]+) os\d/i],
			[
				VENDOR,
				MODEL,
				[TYPE, XR]
			],
			[/(quest( \d| pro)?s?).+vr/i],
			[
				MODEL,
				[VENDOR, FACEBOOK],
				[TYPE, XR]
			],
			[/mobile vr; rv.+firefox/i],
			[[TYPE, XR]],
			[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],
			[VENDOR, [TYPE, EMBEDDED]],
			[/(aeobc)\b/i],
			[
				MODEL,
				[VENDOR, AMAZON],
				[TYPE, EMBEDDED]
			],
			[/(homepod).+mac os/i],
			[
				MODEL,
				[VENDOR, APPLE],
				[TYPE, EMBEDDED]
			],
			[/windows iot/i],
			[[TYPE, EMBEDDED]],
			[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],
			[MODEL, [TYPE, SMARTTV]],
			[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],
			[[TYPE, SMARTTV]],
			[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],
			[MODEL, [
				TYPE,
				strMapper,
				{
					"mobile": "Mobile",
					"xr": "VR",
					"*": TABLET
				}
			]],
			[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],
			[[TYPE, TABLET]],
			[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],
			[[TYPE, MOBILE]],
			[/droid .+?; ([\w\. -]+)( bui|\))/i],
			[MODEL, [VENDOR, "Generic"]]
		],
		engine: [
			[/windows.+ edge\/([\w\.]+)/i],
			[VERSION$1, [NAME$1, EDGE + "HTML"]],
			[/(arkweb)\/([\w\.]+)/i],
			[NAME$1, VERSION$1],
			[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],
			[VERSION$1, [NAME$1, "Blink"]],
			[
				/(presto)\/([\w\.]+)/i,
				/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,
				/ekioh(flow)\/([\w\.]+)/i,
				/(khtml|tasman|links|dillo)[\/ ]\(?([\w\.]+)/i,
				/(icab)[\/ ]([23]\.[\d\.]+)/i,
				/\b(libweb)/i
			],
			[NAME$1, VERSION$1],
			[/ladybird\//i],
			[[NAME$1, "LibWeb"]],
			[/rv\:([\w\.]{1,9})\b.+(gecko)/i],
			[VERSION$1, NAME$1]
		],
		os: [
			[/(windows nt) (6\.[23]); arm/i],
			[[
				NAME$1,
				/N/,
				"R"
			], [
				VERSION$1,
				strMapper,
				windowsVersionMap
			]],
			[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i, /(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],
			[NAME$1, VERSION$1],
			[/windows nt ?([\d\.\)]*)(?!.+xbox)/i, /\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],
			[[
				VERSION$1,
				/(;|\))/g,
				"",
				strMapper,
				windowsVersionMap
			], [NAME$1, WINDOWS]],
			[/(windows ce)\/?([\d\.]*)/i],
			[NAME$1, VERSION$1],
			[
				/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,
				/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,
				/\btvos ?([\w\.]+)/i,
				/cfnetwork\/.+darwin/i
			],
			[[
				VERSION$1,
				/_/g,
				"."
			], [NAME$1, "iOS"]],
			[/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],
			[[NAME$1, "macOS"], [
				VERSION$1,
				/_/g,
				"."
			]],
			[/android ([\d\.]+).*crkey/i],
			[VERSION$1, [NAME$1, CHROMECAST + " Android"]],
			[/fuchsia.*crkey\/([\d\.]+)/i],
			[VERSION$1, [NAME$1, CHROMECAST + " Fuchsia"]],
			[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],
			[VERSION$1, [NAME$1, CHROMECAST + " SmartSpeaker"]],
			[/linux.*crkey\/([\d\.]+)/i],
			[VERSION$1, [NAME$1, CHROMECAST + " Linux"]],
			[/crkey\/([\d\.]+)/i],
			[VERSION$1, [NAME$1, CHROMECAST]],
			[/droid ([\w\.]+)\b.+(android[- ]x86)/i],
			[VERSION$1, NAME$1],
			[/(ubuntu) ([\w\.]+) like android/i],
			[[
				NAME$1,
				/(.+)/,
				"$1 Touch"
			], VERSION$1],
			[/(harmonyos)[\/ ]?([\d\.]*)/i, /(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],
			[NAME$1, VERSION$1],
			[/\(bb(10);/i],
			[VERSION$1, [NAME$1, BLACKBERRY]],
			[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],
			[VERSION$1, [NAME$1, "Symbian"]],
			[/mozilla\/[\d\.]+ \((?:mobile[;\w ]*|tablet|tv|[^\)]*(?:viera|lg(?:l25|-d300)|alcatel ?o.+|y300-f1)); rv:([\w\.]+)\).+gecko\//i],
			[VERSION$1, [NAME$1, FIREFOX + " OS"]],
			[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i, /webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],
			[VERSION$1, [NAME$1, "webOS"]],
			[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],
			[[
				VERSION$1,
				strMapper,
				{
					"25": "120",
					"24": "108",
					"23": "94",
					"22": "87",
					"6": "79",
					"5": "68",
					"4": "53",
					"3": "38",
					"2": "538",
					"1": "537",
					"*": "TV"
				}
			], [NAME$1, "webOS"]],
			[/watch(?: ?os[,\/ ]|\d,\d\/)([\d\.]+)/i],
			[VERSION$1, [NAME$1, "watchOS"]],
			[/cros [\w]+(?:\)| ([\w\.]+)\b)/i],
			[VERSION$1, [NAME$1, "Chrome OS"]],
			[/kepler ([\w\.]+); (aft|aeo)/i],
			[VERSION$1, [NAME$1, "Vega OS"]],
			[
				/(netrange)mmh/i,
				/(nettv)\/(\d+\.[\w\.]+)/i,
				/(nintendo|playstation) (\w+)/i,
				/(xbox); +xbox ([^\);]+)/i,
				/(pico) .+os([\w\.]+)/i,
				/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
				/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,
				/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,
				/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
				/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
				/\b(aix)[; ]([1-9\.]{0,4})/i,
				/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,
				/(gnu) ?([\w\.]*)/i,
				/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
				/(haiku) ?(r\d)?/i
			],
			[NAME$1, VERSION$1],
			[/(sunos) ?([\d\.]*)/i],
			[[NAME$1, "Solaris"], VERSION$1],
			[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i],
			[NAME$1, VERSION$1]
		]
	};
	var defaultProps = (function() {
		var props = {
			init: {},
			isIgnore: {},
			isIgnoreRgx: {},
			toString: {}
		};
		setProps.call(props.init, [
			[BROWSER, [
				NAME$1,
				VERSION$1,
				MAJOR,
				TYPE
			]],
			[CPU, [ARCHITECTURE]],
			[DEVICE, [
				TYPE,
				MODEL,
				VENDOR
			]],
			[ENGINE, [NAME$1, VERSION$1]],
			[OS, [NAME$1, VERSION$1]]
		]);
		setProps.call(props.isIgnore, [
			[BROWSER, [VERSION$1, MAJOR]],
			[ENGINE, [VERSION$1]],
			[OS, [VERSION$1]]
		]);
		setProps.call(props.isIgnoreRgx, [[BROWSER, / ?browser$/i], [OS, / ?os$/i]]);
		setProps.call(props.toString, [
			[BROWSER, [NAME$1, VERSION$1]],
			[CPU, [ARCHITECTURE]],
			[DEVICE, [VENDOR, MODEL]],
			[ENGINE, [NAME$1, VERSION$1]],
			[OS, [NAME$1, VERSION$1]]
		]);
		return props;
	})();
	var createIData = function(item, itemType) {
		var init_props = defaultProps.init[itemType], is_ignoreProps = defaultProps.isIgnore[itemType] || 0, is_ignoreRgx = defaultProps.isIgnoreRgx[itemType] || 0, toString_props = defaultProps.toString[itemType] || 0;
		function IData() {
			setProps.call(this, init_props);
		}
		IData.prototype.getItem = function() {
			return item;
		};
		IData.prototype.withClientHints = function() {
			if (!NAVIGATOR_UADATA) return item.parseCH().get();
			return NAVIGATOR_UADATA.getHighEntropyValues(CH_ALL_VALUES).then(function(res) {
				return item.setCH(new UACHData(res, false)).parseCH().get();
			});
		};
		IData.prototype.withFeatureCheck = function() {
			return item.detectFeature().get();
		};
		if (itemType != RESULT) {
			IData.prototype.is = function(strToCheck) {
				var is = false;
				for (var i in this) if (this.hasOwnProperty(i) && !has$1(is_ignoreProps, i) && lowerize(is_ignoreRgx ? strip(is_ignoreRgx, this[i]) : this[i]) == lowerize(is_ignoreRgx ? strip(is_ignoreRgx, strToCheck) : strToCheck)) {
					is = true;
					if (strToCheck != TYPEOF.UNDEFINED) break;
				} else if (strToCheck == TYPEOF.UNDEFINED && is) {
					is = !is;
					break;
				}
				return is;
			};
			IData.prototype.toString = function() {
				var str = EMPTY;
				for (var i in toString_props) if (typeof this[toString_props[i]] !== TYPEOF.UNDEFINED) str += (str ? " " : EMPTY) + this[toString_props[i]];
				return str || TYPEOF.UNDEFINED;
			};
		}
		IData.prototype.then = function(cb) {
			var that = this;
			var IDataResolve = function() {
				for (var prop in that) if (that.hasOwnProperty(prop)) this[prop] = that[prop];
			};
			IDataResolve.prototype = {
				is: IData.prototype.is,
				toString: IData.prototype.toString,
				withClientHints: IData.prototype.withClientHints,
				withFeatureCheck: IData.prototype.withFeatureCheck
			};
			var resolveData = new IDataResolve();
			cb(resolveData);
			return resolveData;
		};
		return new IData();
	};
	function UACHData(uach, isHttpUACH) {
		uach = uach || {};
		setProps.call(this, CH_ALL_VALUES);
		if (isHttpUACH) setProps.call(this, [
			[BRANDS, itemListToArray(uach[CH])],
			[FULLVERLIST, itemListToArray(uach[CH_FULL_VER_LIST])],
			[MOBILE, /\?1/.test(uach[CH_MOBILE])],
			[MODEL, stripQuotes(uach[CH_MODEL])],
			[PLATFORM, stripQuotes(uach[CH_PLATFORM])],
			[PLATFORMVER, stripQuotes(uach[CH_PLATFORM_VER])],
			[ARCHITECTURE, stripQuotes(uach[CH_ARCH])],
			[FORMFACTORS, itemListToArray(uach[CH_FORM_FACTORS])],
			[BITNESS, stripQuotes(uach[CH_BITNESS])]
		]);
		else for (var prop in uach) if (this.hasOwnProperty(prop) && typeof uach[prop] !== TYPEOF.UNDEFINED) this[prop] = uach[prop];
	}
	function UAItem(itemType, ua, rgxMap, uaCH) {
		setProps.call(this, [
			["itemType", itemType],
			["ua", ua],
			["uaCH", uaCH],
			["rgxMap", rgxMap],
			["data", createIData(this, itemType)]
		]);
		return this;
	}
	UAItem.prototype.get = function(prop) {
		if (!prop) return this.data;
		return this.data.hasOwnProperty(prop) ? this.data[prop] : void 0;
	};
	UAItem.prototype.set = function(prop, val) {
		this.data[prop] = val;
		return this;
	};
	UAItem.prototype.setCH = function(ch) {
		this.uaCH = ch;
		return this;
	};
	UAItem.prototype.detectFeature = function() {
		if (NAVIGATOR && NAVIGATOR.userAgent == this.ua) switch (this.itemType) {
			case BROWSER:
				if (NAVIGATOR.brave && typeof NAVIGATOR.brave.isBrave == TYPEOF.FUNCTION) this.set(NAME$1, "Brave");
				break;
			case DEVICE:
				if (!this.get(TYPE) && NAVIGATOR_UADATA && NAVIGATOR_UADATA[MOBILE]) this.set(TYPE, MOBILE);
				if (this.get(MODEL) == "Macintosh" && NAVIGATOR && typeof NAVIGATOR.standalone !== TYPEOF.UNDEFINED && NAVIGATOR.maxTouchPoints && NAVIGATOR.maxTouchPoints > 2) this.set(MODEL, "iPad").set(TYPE, TABLET);
				break;
			case OS:
				if (!this.get(NAME$1) && NAVIGATOR_UADATA && NAVIGATOR_UADATA[PLATFORM]) this.set(NAME$1, NAVIGATOR_UADATA[PLATFORM]);
				break;
			case RESULT:
				var data = this.data;
				var detect = function(itemType) {
					return data[itemType].getItem().detectFeature().get();
				};
				this.set(BROWSER, detect(BROWSER)).set(CPU, detect(CPU)).set(DEVICE, detect(DEVICE)).set(ENGINE, detect(ENGINE)).set(OS, detect(OS));
		}
		return this;
	};
	UAItem.prototype.parseUA = function() {
		if (this.itemType != RESULT) rgxMapper.call(this.data, this.ua, this.rgxMap);
		switch (this.itemType) {
			case BROWSER:
				this.set(MAJOR, majorize(this.get(VERSION$1)));
				break;
			case OS:
				if (this.get(NAME$1) == "iOS" && this.get(VERSION$1) == "18.6") {
					var realVersion = /\) Version\/([\d\.]+)/.exec(this.ua);
					if (realVersion && parseInt(realVersion[1].substring(0, 2), 10) >= 26) this.set(VERSION$1, realVersion[1]);
				}
				break;
		}
		return this;
	};
	UAItem.prototype.parseCH = function() {
		var uaCH = this.uaCH, rgxMap = this.rgxMap;
		switch (this.itemType) {
			case BROWSER:
			case ENGINE:
				var brands = uaCH[FULLVERLIST] || uaCH[BRANDS], prevName;
				if (brands) for (var i = 0; i < brands.length; i++) {
					var brandName = brands[i].brand || brands[i], brandVersion = brands[i].version;
					if (this.itemType == BROWSER && !/not.a.brand/i.test(brandName) && (!prevName || /Chrom/.test(prevName) && brandName != CHROMIUM || prevName == EDGE && /WebView2/.test(brandName))) {
						brandName = strMapper(brandName, browserHintsMap);
						prevName = this.get(NAME$1);
						if (!(prevName && !/Chrom/.test(prevName) && /Chrom/.test(brandName))) this.set(NAME$1, brandName).set(VERSION$1, brandVersion).set(MAJOR, majorize(brandVersion));
						prevName = brandName;
					}
					if (this.itemType == ENGINE && brandName == CHROMIUM) this.set(VERSION$1, brandVersion);
				}
				break;
			case CPU:
				var archName = uaCH[ARCHITECTURE];
				if (archName) {
					if (archName && uaCH[BITNESS] == "64") archName += "64";
					rgxMapper.call(this.data, archName + ";", rgxMap);
				}
				break;
			case DEVICE:
				if (uaCH[MOBILE]) this.set(TYPE, MOBILE);
				if (uaCH[MODEL]) {
					this.set(MODEL, uaCH[MODEL]);
					if (!this.get(TYPE) || !this.get(VENDOR)) {
						var reParse = {};
						rgxMapper.call(reParse, "droid 9; " + uaCH[MODEL] + ")", rgxMap);
						if (!this.get(TYPE) && !!reParse.type) this.set(TYPE, reParse.type);
						if (!this.get(VENDOR) && !!reParse.vendor) this.set(VENDOR, reParse.vendor);
					}
				}
				if (uaCH[FORMFACTORS]) {
					var ff;
					if (typeof uaCH[FORMFACTORS] !== "string") {
						var idx = 0;
						while (!ff && idx < uaCH[FORMFACTORS].length) ff = strMapper(uaCH[FORMFACTORS][idx++], formFactorsMap);
					} else ff = strMapper(uaCH[FORMFACTORS], formFactorsMap);
					this.set(TYPE, ff);
				}
				break;
			case OS:
				var osName = uaCH[PLATFORM];
				if (osName) {
					var osVersion = uaCH[PLATFORMVER];
					if (osName == WINDOWS) osVersion = parseInt(majorize(osVersion), 10) >= 13 ? "11" : "10";
					this.set(NAME$1, osName).set(VERSION$1, osVersion);
				}
				if (this.get(NAME$1) == WINDOWS && uaCH[MODEL] == "Xbox") this.set(NAME$1, "Xbox").set(VERSION$1, void 0);
				break;
			case RESULT:
				var data = this.data;
				var parse = function(itemType) {
					return data[itemType].getItem().setCH(uaCH).parseCH().get();
				};
				this.set(BROWSER, parse(BROWSER)).set(CPU, parse(CPU)).set(DEVICE, parse(DEVICE)).set(ENGINE, parse(ENGINE)).set(OS, parse(OS));
		}
		return this;
	};
	function UAParser(ua, extensions, headers) {
		if (typeof ua === TYPEOF.OBJECT) {
			if (isExtensions(ua, true)) {
				if (typeof extensions === TYPEOF.OBJECT) headers = extensions;
				extensions = ua;
			} else {
				headers = ua;
				extensions = void 0;
			}
			ua = void 0;
		} else if (typeof ua === TYPEOF.STRING && !isExtensions(extensions, true)) {
			headers = extensions;
			extensions = void 0;
		}
		if (headers) if (typeof headers.append === TYPEOF.FUNCTION) {
			var kv = {};
			headers.forEach(function(v, k) {
				kv[String(k).toLowerCase()] = v;
			});
			headers = kv;
		} else {
			var normalized = {};
			for (var header in headers) if (headers.hasOwnProperty(header)) normalized[String(header).toLowerCase()] = headers[header];
			headers = normalized;
		}
		if (!(this instanceof UAParser)) return new UAParser(ua, extensions, headers).getResult();
		var userAgent = typeof ua === TYPEOF.STRING ? ua : headers && headers[USER_AGENT] ? headers[USER_AGENT] : NAVIGATOR && NAVIGATOR.userAgent ? NAVIGATOR.userAgent : EMPTY, httpUACH = new UACHData(headers, true), regexMap = extensions ? extend(defaultRegexes, extensions) : defaultRegexes, createItemFunc = function(itemType) {
			if (itemType == RESULT) return function() {
				return new UAItem(itemType, userAgent, regexMap, httpUACH).set("ua", userAgent).set(BROWSER, this.getBrowser()).set(CPU, this.getCPU()).set(DEVICE, this.getDevice()).set(ENGINE, this.getEngine()).set(OS, this.getOS()).get();
			};
			else return function() {
				return new UAItem(itemType, userAgent, regexMap[itemType], httpUACH).parseUA().get();
			};
		};
		setProps.call(this, [
			["getBrowser", createItemFunc(BROWSER)],
			["getCPU", createItemFunc(CPU)],
			["getDevice", createItemFunc(DEVICE)],
			["getEngine", createItemFunc(ENGINE)],
			["getOS", createItemFunc(OS)],
			["getResult", createItemFunc(RESULT)],
			["getUA", function() {
				return userAgent;
			}],
			["setUA", function(ua) {
				if (isString$1(ua)) userAgent = trim(ua, UA_MAX_LENGTH);
				return this;
			}]
		]).setUA(userAgent);
		return this;
	}
	UAParser.VERSION = LIBVERSION;
	UAParser.BROWSER = enumerize([
		NAME$1,
		VERSION$1,
		MAJOR,
		TYPE
	]);
	UAParser.CPU = enumerize([ARCHITECTURE]);
	UAParser.DEVICE = enumerize([
		MODEL,
		VENDOR,
		TYPE,
		CONSOLE,
		MOBILE,
		SMARTTV,
		TABLET,
		WEARABLE,
		EMBEDDED
	]);
	UAParser.ENGINE = UAParser.OS = enumerize([NAME$1, VERSION$1]);
	navigator.platform && navigator.platform.toLowerCase();
	navigator.platform && navigator.platform.toUpperCase().indexOf("MAC");
	var isPlaywright = navigator.userAgent.includes("playwright");
	var agent = UAParser(navigator.userAgent);
	agent.browser.name;
	agent.os.name;
	//#endregion
	//#region ../loot-core/src/shared/months.ts
	init_dist$2();
	function _parse(value) {
		if (typeof value === "string") {
			const [year, month, day] = value.split("-");
			if (day != null) return new Date(parseInt(year), parseInt(month) - 1, parseInt(day), 12);
			else if (month != null) return new Date(parseInt(year), parseInt(month) - 1, 1, 12);
			else return new Date(parseInt(year), 0, 1, 12);
		}
		if (typeof value === "number") return new Date(value);
		return value;
	}
	var parseDate = _parse;
	function yearFromDate(date) {
		return format$2(_parse(date), "yyyy");
	}
	function monthFromDate(date) {
		return format$2(_parse(date), "yyyy-MM");
	}
	function firstDayOfMonth(date) {
		return dayFromDate(startOfMonth(_parse(date)));
	}
	function dayFromDate(date) {
		return format$2(_parse(date), "yyyy-MM-dd");
	}
	function currentMonth() {
		if (global.IS_TESTING || isPlaywright) return global.currentMonth || "2017-01";
		else return format$2(/* @__PURE__ */ new Date(), "yyyy-MM");
	}
	function currentDate() {
		if (global.IS_TESTING || isPlaywright) return parse$1(currentDay(), "yyyy-MM-dd", /* @__PURE__ */ new Date());
		return /* @__PURE__ */ new Date();
	}
	function currentDay() {
		if (global.IS_TESTING || isPlaywright) return "2017-01-01";
		else return format$2(/* @__PURE__ */ new Date(), "yyyy-MM-dd");
	}
	function nextMonth(month) {
		return format$2(addMonths$1(_parse(month), 1), "yyyy-MM");
	}
	function prevMonth(month) {
		return format$2(subMonths$1(_parse(month), 1), "yyyy-MM");
	}
	function addMonths(month, n) {
		return format$2(addMonths$1(_parse(month), n), "yyyy-MM");
	}
	function addWeeks(date, n) {
		return format$2(addWeeks$1(_parse(date), n), "yyyy-MM-dd");
	}
	function differenceInCalendarMonths(month1, month2) {
		return differenceInCalendarMonths$1(_parse(month1), _parse(month2));
	}
	function differenceInCalendarDays(month1, month2) {
		return differenceInCalendarDays$1(_parse(month1), _parse(month2));
	}
	function subMonths(month, n) {
		return format$2(subMonths$1(_parse(month), n), "yyyy-MM");
	}
	function subWeeks(date, n) {
		return format$2(subWeeks$1(_parse(date), n), "yyyy-MM-dd");
	}
	function addDays(day, n) {
		return format$2(addDays$1(_parse(day), n), "yyyy-MM-dd");
	}
	function subDays(day, n) {
		return format$2(subDays$1(_parse(day), n), "yyyy-MM-dd");
	}
	function isBefore(month1, month2) {
		return isBefore$1(_parse(month1), _parse(month2));
	}
	function isAfter(month1, month2) {
		return isAfter$1(_parse(month1), _parse(month2));
	}
	function bounds(month) {
		return {
			start: parseInt(format$2(startOfMonth(_parse(month)), "yyyyMMdd")),
			end: parseInt(format$2(endOfMonth(_parse(month)), "yyyyMMdd"))
		};
	}
	function _range(start, end, inclusive = false) {
		const months = [];
		let month = monthFromDate(start);
		const endMonth = monthFromDate(end);
		while (isBefore$1(_parse(month), _parse(endMonth))) {
			months.push(month);
			month = addMonths(month, 1);
		}
		if (inclusive) months.push(month);
		return months;
	}
	function range(start, end) {
		return _range(start, end);
	}
	function rangeInclusive(start, end) {
		return _range(start, end, true);
	}
	function _dayRange(start, end, inclusive = false) {
		const days = [];
		let day = start;
		while (isBefore$1(_parse(day), _parse(end))) {
			days.push(dayFromDate(day));
			day = addDays(day, 1);
		}
		if (inclusive) days.push(dayFromDate(day));
		return days;
	}
	function dayRangeInclusive(start, end) {
		return _dayRange(start, end, true);
	}
	function getYear(month) {
		return month.slice(0, 4);
	}
	function getMonth(day) {
		return day.slice(0, 7);
	}
	function getDay(day) {
		return Number(format$2(_parse(day), "dd"));
	}
	function getMonthEnd(day) {
		return subDays(nextMonth(day.slice(0, 7)) + "-01", 1);
	}
	function getYearEnd(month) {
		return getYear(month) + "-12";
	}
	function sheetForMonth(month) {
		return "budget" + month.replace("-", "");
	}
	function format$1(month, format, locale) {
		return format$2(_parse(month), format, { locale });
	}
	memoizeOne((format) => {
		return new RegExp(format.replace(/d+/g, "\\d{1,2}").replace(/M+/g, "\\d{1,2}").replace(/y+/g, "\\d{4}"));
	});
	memoizeOne((format) => {
		return format.replace(/y+/g, "").replace(/[^\w]$/, "").replace(/^[^\w]/, "");
	});
	memoizeOne((format) => {
		const regex = format.replace(/y+/g, "").replace(/[^\w]$/, "").replace(/^[^\w]/, "").replace(/d+/g, "\\d{1,2}").replace(/M+/g, "\\d{1,2}");
		return new RegExp("^" + regex + "$");
	});
	memoizeOne((format) => {
		return format.replace(/d+/g, "").replace(/[^\w]$/, "").replace(/^[^\w]/, "").replace(/\/\//, "/").replace(/\.\./, ".").replace(/--/, "-");
	});
	memoizeOne((format) => {
		const regex = format.replace(/d+/g, "").replace(/[^\w]$/, "").replace(/^[^\w]/, "").replace(/\/\//, "/").replace(/M+/g, "\\d{1,2}").replace(/y+/g, "\\d{2,4}");
		return new RegExp("^" + regex + "$");
	});
	memoizeOne((format) => {
		return format.replace(/y+/g, "yy");
	});
	memoizeOne((format) => {
		const regex = format.replace(/[^\w]$/, "").replace(/^[^\w]/, "").replace(/d+/g, "\\d{1,2}").replace(/M+/g, "\\d{1,2}").replace(/y+/g, "\\d{2}");
		return new RegExp("^" + regex + "$");
	});
	//#endregion
	//#region ../loot-core/src/server/aql/schema-helpers.ts
	function isRequired(name, fieldDesc) {
		return fieldDesc.required || name === "id";
	}
	function convertInputType(value, type) {
		if (value === void 0) throw new Error("Query value cannot be undefined");
		else if (value === null) {
			if (type === "boolean") return 0;
			return null;
		}
		switch (type) {
			case "date":
				if (value instanceof Date) return toDateRepr(dayFromDate(value));
				else if (value.match(/^\d{4}-\d{2}-\d{2}$/) == null || value < "1995-01-01") throw new Error("Invalid date: " + value);
				return toDateRepr(value);
			case "date-month": return toDateRepr(value.slice(0, 7));
			case "date-year": return toDateRepr(value.slice(0, 4));
			case "boolean": return value ? 1 : 0;
			case "id":
				if (typeof value !== "string" && value !== null) throw new Error("Invalid id, must be string: " + value);
				return value;
			case "integer": if (typeof value === "number" && Number.isInteger(value)) return value;
			else throw new Error("Can't convert to integer: " + JSON.stringify(value));
			case "json": return JSON.stringify(value);
			default:
		}
		return value;
	}
	function convertOutputType(value, type) {
		if (value === null) {
			if (type === "boolean") return false;
			return null;
		}
		switch (type) {
			case "date": return fromDateRepr(value);
			case "date-month": return fromDateRepr(value).slice(0, 7);
			case "date-year": return fromDateRepr(value).slice(0, 4);
			case "boolean": return value === 1;
			case "json":
			case "json/fallback": try {
				return JSON.parse(value);
			} catch {
				return type === "json/fallback" ? value : null;
			}
			default:
		}
		return value;
	}
	function conform(schema, schemaConfig, table, obj, { skipNull = false } = {}) {
		const tableSchema = schema[table];
		if (tableSchema == null) throw new Error(`Table "${table}" does not exist`);
		const views = schemaConfig.views || {};
		const fieldRef = (field) => {
			if (views[table] && views[table].fields) return views[table].fields[field] || field;
			return field;
		};
		return Object.fromEntries(Object.keys(obj).map((field) => {
			if (field[0] === "_") return null;
			const fieldDesc = tableSchema[field];
			if (fieldDesc == null) throw new Error(`Field "${field}" does not exist on table ${table}: ${JSON.stringify(obj)}`);
			if (isRequired(field, fieldDesc) && obj[field] == null) throw new Error(`"${field}" is required for table "${table}": ${JSON.stringify(obj)}`);
			if (obj[field] === void 0) return null;
			if (skipNull && obj[field] == null) return null;
			return [fieldRef(field), convertInputType(obj[field], fieldDesc.type)];
		}).filter(Boolean));
	}
	function convertForInsert(schema, schemaConfig, table, rawObj) {
		const obj = { ...rawObj };
		const tableSchema = schema[table];
		if (tableSchema == null) throw new Error(`Error inserting: table "${table}" does not exist`);
		Object.keys(tableSchema).forEach((field) => {
			const fieldDesc = tableSchema[field];
			if (obj[field] == null) {
				if (fieldDesc.default !== void 0) obj[field] = typeof fieldDesc.default === "function" ? fieldDesc.default() : fieldDesc.default;
				else if (isRequired(field, fieldDesc)) throw new Error(`"${field}" is required for table "${table}": ${JSON.stringify(obj)}`);
			}
		});
		return conform(schema, schemaConfig, table, obj, { skipNull: true });
	}
	function convertForUpdate(schema, schemaConfig, table, rawObj) {
		const obj = { ...rawObj };
		if (schema[table] == null) throw new Error(`Error updating: table "${table}" does not exist`);
		return conform(schema, schemaConfig, table, obj);
	}
	function convertFromSelect(schema, schemaConfig, table, obj) {
		const tableSchema = schema[table];
		if (tableSchema == null) throw new Error(`Table "${table}" does not exist`);
		const fields = Object.keys(tableSchema);
		const result = {};
		for (let i = 0; i < fields.length; i++) {
			const fieldName = fields[i];
			const fieldDesc = tableSchema[fieldName];
			result[fieldName] = convertOutputType(obj[fieldName], fieldDesc.type);
		}
		return result;
	}
	//#endregion
	//#region ../loot-core/src/server/aql/exec.ts
	function applyTypes(data, outputTypes) {
		for (let i = 0; i < data.length; i++) {
			const item = data[i];
			Object.keys(item).forEach((name) => {
				item[name] = convertOutputType(item[name], outputTypes.get(name));
			});
		}
	}
	async function execQuery$1(queryState, compilerState, sqlPieces, params, outputTypes) {
		const data = await all(defaultConstructQuery(queryState, compilerState, sqlPieces), params);
		applyTypes(data, outputTypes);
		return data;
	}
	async function runCompiledAqlQuery(queryState, sqlPieces, compilerState, { params = {}, executors = {} } = {}) {
		const paramArray = compilerState.namedParameters.map((param) => {
			const name = param.paramName;
			if (params[name] === void 0) throw new Error(`Parameter ${name} not provided to query`);
			return convertInputType(params[name], param.paramType);
		});
		let data = [];
		if (executors[compilerState.implicitTableName]) data = await executors[compilerState.implicitTableName](compilerState, queryState, sqlPieces, paramArray, compilerState.outputTypes);
		else data = await execQuery$1(queryState, compilerState, sqlPieces, paramArray, compilerState.outputTypes);
		if (queryState.calculation) if (data.length > 0) {
			const row = data[0];
			return row[Object.keys(row)[0]] || 0;
		} else return null;
		return data;
	}
	async function compileAndRunAqlQuery(schema, schemaConfig, queryState, options) {
		const { sqlPieces, state } = compileQuery(queryState, schema, schemaConfig);
		return {
			data: await runCompiledAqlQuery(queryState, sqlPieces, state, options),
			dependencies: state.dependencies
		};
	}
	//#endregion
	//#region ../loot-core/src/server/aql/schema/index.ts
	function f(type, opts) {
		return {
			type,
			...opts
		};
	}
	var schema = {
		transactions: {
			id: f("id"),
			is_parent: f("boolean"),
			is_child: f("boolean"),
			parent_id: f("id"),
			account: f("id", {
				ref: "accounts",
				required: true
			}),
			category: f("id", { ref: "categories" }),
			amount: f("integer", {
				default: 0,
				required: true
			}),
			payee: f("id", { ref: "payees" }),
			notes: f("string"),
			date: f("date", { required: true }),
			imported_id: f("string"),
			error: f("json"),
			imported_payee: f("string"),
			starting_balance_flag: f("boolean"),
			transfer_id: f("id"),
			sort_order: f("float", { default: () => Date.now() }),
			cleared: f("boolean", { default: true }),
			reconciled: f("boolean", { default: false }),
			tombstone: f("boolean"),
			schedule: f("id", { ref: "schedules" }),
			raw_synced_data: f("string")
		},
		payees: {
			id: f("id"),
			name: f("string", { required: true }),
			transfer_acct: f("id", { ref: "accounts" }),
			tombstone: f("boolean"),
			favorite: f("boolean"),
			learn_categories: f("boolean")
		},
		accounts: {
			id: f("id"),
			name: f("string", { required: true }),
			offbudget: f("boolean"),
			closed: f("boolean"),
			sort_order: f("float"),
			tombstone: f("boolean"),
			account_id: f("string"),
			official_name: f("string"),
			account_sync_source: f("string"),
			last_reconciled: f("string"),
			last_sync: f("string")
		},
		categories: {
			id: f("id"),
			name: f("string"),
			is_income: f("boolean"),
			hidden: f("boolean"),
			group: f("id", { ref: "category_groups" }),
			goal_def: f("string"),
			cleanup_def: f("string"),
			template_settings: f("json", { default: { source: "notes" } }),
			sort_order: f("float"),
			tombstone: f("boolean")
		},
		category_groups: {
			id: f("id"),
			name: f("string"),
			is_income: f("boolean"),
			hidden: f("boolean"),
			sort_order: f("float"),
			tombstone: f("boolean")
		},
		cleanup_groups: {
			id: f("id"),
			name: f("string"),
			tombstone: f("boolean")
		},
		schedules: {
			id: f("id"),
			name: f("string"),
			rule: f("id", {
				ref: "rules",
				required: true
			}),
			next_date: f("date"),
			completed: f("boolean"),
			posts_transaction: f("boolean"),
			custom_upcoming_length: f("string"),
			tombstone: f("boolean"),
			_payee: f("id", { ref: "payees" }),
			_account: f("id", { ref: "accounts" }),
			_amount: f("json/fallback"),
			_amountOp: f("string"),
			_date: f("json/fallback"),
			_conditions: f("json"),
			_actions: f("json")
		},
		rules: {
			id: f("id"),
			stage: f("string"),
			conditions_op: f("string"),
			conditions: f("json"),
			actions: f("json"),
			tombstone: f("boolean")
		},
		notes: {
			id: f("id"),
			note: f("string")
		},
		preferences: {
			id: f("id"),
			value: f("string")
		},
		transaction_filters: {
			id: f("id"),
			name: f("string"),
			conditions_op: f("string"),
			conditions: f("json"),
			tombstone: f("boolean")
		},
		custom_reports: {
			id: f("id"),
			name: f("string"),
			start_date: f("string", { default: "2023-06" }),
			end_date: f("string", { default: "2023-09" }),
			date_static: f("integer", { default: 0 }),
			date_range: f("string"),
			mode: f("string", { default: "total" }),
			group_by: f("string", { default: "Category" }),
			sort_by: f("string", { default: "desc" }),
			balance_type: f("string", { default: "Expense" }),
			show_empty: f("integer", { default: 0 }),
			show_offbudget: f("integer", { default: 0 }),
			show_hidden: f("integer", { default: 0 }),
			show_uncategorized: f("integer", { default: 0 }),
			trim_intervals: f("integer", { default: 0 }),
			include_current: f("integer", { default: 0 }),
			graph_type: f("string", { default: "BarGraph" }),
			conditions: f("json"),
			conditions_op: f("string"),
			metadata: f("json"),
			interval: f("string", { default: "Monthly" }),
			color_scheme: f("json"),
			tombstone: f("boolean")
		},
		reflect_budgets: {
			id: f("id"),
			month: f("integer"),
			category: f("string"),
			amount: f("integer"),
			carryover: f("integer"),
			goal: f("integer"),
			long_goal: f("integer")
		},
		zero_budgets: {
			id: f("id"),
			month: f("integer"),
			category: f("string", { ref: "categories" }),
			amount: f("integer"),
			carryover: f("integer"),
			goal: f("integer"),
			long_goal: f("integer")
		},
		dashboard_pages: {
			id: f("id"),
			name: f("string"),
			tombstone: f("boolean")
		},
		dashboard: {
			id: f("id"),
			dashboard_page_id: f("id", { ref: "dashboard_pages" }),
			type: f("string", { required: true }),
			width: f("integer", { required: true }),
			height: f("integer", { required: true }),
			x: f("integer", { required: true }),
			y: f("integer", { required: true }),
			meta: f("json"),
			tombstone: f("boolean")
		},
		payee_locations: {
			id: f("id"),
			payee_id: f("id", {
				ref: "payees",
				required: true
			}),
			latitude: f("float", { required: true }),
			longitude: f("float", { required: true }),
			created_at: f("integer", { required: true }),
			tombstone: f("boolean")
		}
	};
	var schemaConfig = {
		tableViews(name, { isJoin, withDead, tableOptions = { splits: void 0 } }) {
			switch (name) {
				case "transactions": {
					if (isJoin) return "v_transactions_internal_alive";
					const splitType = tableOptions.splits || "inline";
					if (!withDead && (splitType === "inline" || splitType === "none")) return "v_transactions_internal_alive";
					return "v_transactions_internal";
				}
				case "schedules": return "v_schedules";
				case "categories": return "v_categories";
				case "payees": return "v_payees";
				default:
			}
			return name;
		},
		customizeQuery(queryState) {
			const { table: tableName } = queryState;
			function orderBy(orders) {
				if (orders.length > 0) return orders.concat(["id"]);
				switch (tableName) {
					case "transactions": return [
						{ date: "desc" },
						"starting_balance_flag",
						{ sort_order: "desc" },
						"id"
					];
					case "category_groups": return [
						"is_income",
						"sort_order",
						"id"
					];
					case "categories": return ["sort_order", "id"];
					case "payees": return [{
						$condition: { transfer_acct: null },
						$dir: "desc"
					}, { $nocase: "$name" }];
					case "accounts": return ["sort_order", "name"];
					case "schedules": return [{ $condition: { completed: true } }, "next_date"];
					default:
				}
				return [];
			}
			return {
				...queryState,
				orderExpressions: orderBy(queryState.orderExpressions)
			};
		},
		views: {
			payees: { v_payees: (internalFields) => {
				return `
          SELECT ${internalFields({ name: "COALESCE(__accounts.name, _.name)" })} FROM payees _
          LEFT JOIN accounts __accounts ON (_.transfer_acct = __accounts.id AND __accounts.tombstone = 0)
          -- We never want to show transfer payees that are pointing to deleted accounts.
          -- Either this is not a transfer payee, if the account exists
          WHERE _.transfer_acct IS NULL OR __accounts.id IS NOT NULL
        `;
			} },
			categories: {
				fields: { group: "cat_group" },
				v_categories: (internalFields) => {
					return `SELECT ${internalFields({ group: "cat_group" })} FROM categories _`;
				}
			},
			schedules: { v_schedules: (internalFields) => {
				return `
        SELECT ${internalFields({
					next_date: `
            CASE
              WHEN _nd.local_next_date_ts = _nd.base_next_date_ts THEN _nd.local_next_date
              ELSE _nd.base_next_date
            END
          `,
					_payee: `pm.targetId`,
					_account: `json_extract(_rules.conditions, _paths.account || '.value')`,
					_amount: `json_extract(_rules.conditions, _paths.amount || '.value')`,
					_amountOp: `json_extract(_rules.conditions, _paths.amount || '.op')`,
					_date: `json_extract(_rules.conditions, _paths.date || '.value')`,
					_conditions: "_rules.conditions",
					_actions: "_rules.actions"
				})} FROM schedules _
        LEFT JOIN schedules_next_date _nd ON _nd.schedule_id = _.id
        LEFT JOIN schedules_json_paths _paths ON _paths.schedule_id = _.id
        LEFT JOIN rules _rules ON _rules.id = _.rule
        LEFT JOIN payee_mapping pm ON pm.id = json_extract(_rules.conditions, _paths.payee || '.value')
        `;
			} },
			transactions: {
				fields: {
					is_parent: "isParent",
					is_child: "isChild",
					account: "acct",
					imported_id: "financial_id",
					imported_payee: "imported_description",
					transfer_id: "transferred_id",
					payee: "description"
				},
				v_transactions_internal: (internalFields) => {
					return `
          SELECT ${internalFields({
						payee: "pm.targetId",
						category: `CASE WHEN _.isParent = 1 THEN NULL ELSE cm.transferId END`,
						amount: `IFNULL(_.amount, 0)`,
						parent_id: "CASE WHEN _.isChild = 0 THEN NULL ELSE _.parent_id END"
					})} FROM transactions _
          LEFT JOIN category_mapping cm ON cm.id = _.category
          LEFT JOIN payee_mapping pm ON pm.id = _.description
          WHERE
           _.date IS NOT NULL AND
           _.acct IS NOT NULL AND
           (_.isChild = 0 OR _.parent_id IS NOT NULL)
        `;
				},
				v_transactions_internal_alive: `
        SELECT _.* FROM v_transactions_internal _
        LEFT JOIN transactions t2 ON (_.is_child = 1 AND t2.id = _.parent_id)
        WHERE IFNULL(_.tombstone, 0) = 0 AND (_.is_child = 0 OR t2.tombstone = 0)
      `,
				v_transactions: (_, publicFields) => {
					return `
          SELECT ${publicFields({
						payee: "p.id",
						category: "c.id",
						account: "a.id"
					})} FROM v_transactions_internal_alive _
          LEFT JOIN payees p ON (p.id = _.payee AND p.tombstone = 0)
          LEFT JOIN categories c ON (c.id = _.category AND c.tombstone = 0)
          LEFT JOIN accounts a ON (a.id = _.account AND a.tombstone = 0)
          ORDER BY _.date desc, _.starting_balance_flag, _.sort_order desc, _.id;
        `;
				}
			}
		}
	};
	//#endregion
	//#region ../loot-core/src/server/db/util.ts
	async function incrFetch(runQuery, terms, compare, makeQuery, params = []) {
		const pageCount = 500;
		let results = [];
		let fetchedIds = /* @__PURE__ */ new Set();
		for (let i = 0; i < terms.length; i += pageCount) {
			const slice = terms.slice(i, i + pageCount).filter((id) => !fetchedIds.has(id));
			if (slice.length > 0) {
				const rows = await runQuery(makeQuery("(" + slice.map((id) => compare(id)).join(" OR ") + ")"), params, true);
				fetchedIds = new Set([...fetchedIds, ...slice]);
				results = results.concat(rows);
			}
		}
		return results;
	}
	function whereIn(ids, field) {
		const ids2 = [...new Set(ids)];
		return `${field} IN (` + ids2.map((id) => `'${id}'`).join(",") + ")";
	}
	//#endregion
	//#region ../loot-core/src/server/aql/schema/executors.ts
	function toGroup(parents, children, mapper = (x) => x) {
		return parents.reduce((list, parent) => {
			const childs = children.get(parent.id) || [];
			list.push({
				...mapper(parent),
				subtransactions: childs.map(mapper)
			});
			return list;
		}, []);
	}
	function execTransactions(compilerState, queryState, sqlPieces, params, outputTypes) {
		const tableOptions = queryState.tableOptions || {};
		const splitType = tableOptions.splits ? tableOptions.splits : "inline";
		if (!isValidSplitsOption(splitType)) throw new Error(`Invalid "splits" option for transactions: "${splitType}"`);
		if (splitType === "all" || splitType === "inline" || splitType === "none") return execTransactionsBasic(compilerState, queryState, sqlPieces, params, splitType, outputTypes);
		else if (splitType === "grouped") return execTransactionsGrouped(compilerState, queryState, sqlPieces, params, outputTypes);
	}
	function _isUnhappy(filter) {
		for (const key of Object.keys(filter)) if (key === "$or" || key === "$and") {
			if (filter[key] && _isUnhappy(filter[key])) return true;
		} else if (!(key.indexOf("account") === 0 || key === "date")) return true;
		return false;
	}
	function isHappyPathQuery(queryState) {
		return queryState.filterExpressions.find(_isUnhappy) == null;
	}
	async function execTransactionsGrouped(compilerState, queryState, sqlPieces, params, outputTypes) {
		const { withDead } = queryState;
		const whereDead = withDead ? "" : `AND ${sqlPieces.from}.tombstone = 0`;
		if (isAggregateQuery(queryState)) {
			const s = { ...sqlPieces };
			s.where = `${s.where} AND ${s.from}.is_parent = 0`;
			if (!withDead) s.from = "v_transactions_internal_alive v_transactions_internal";
			return execQuery$1(queryState, compilerState, s, params, outputTypes);
		}
		let rows;
		let matched = null;
		if (isHappyPathQuery(queryState)) rows = await all(`
      SELECT ${sqlPieces.from}.id as group_id
      FROM ${sqlPieces.from}
      ${sqlPieces.joins}
      ${sqlPieces.where} AND is_child = 0 ${whereDead}
      ${sqlPieces.orderBy}
      ${sqlPieces.limit != null ? `LIMIT ${sqlPieces.limit}` : ""}
      ${sqlPieces.offset != null ? `OFFSET ${sqlPieces.offset}` : ""}
    `, params);
		else {
			rows = await all(`
      SELECT group_id, matched FROM (
        SELECT
          group_id,
          GROUP_CONCAT(id) as matched
          FROM (
            SELECT ${sqlPieces.from}.id, IFNULL(${sqlPieces.from}.parent_id, ${sqlPieces.from}.id) as group_id
            FROM ${sqlPieces.from}
            LEFT JOIN transactions _t2 ON ${sqlPieces.from}.is_child = 1 AND _t2.id = ${sqlPieces.from}.parent_id
            ${sqlPieces.joins}
            ${sqlPieces.where} AND ${sqlPieces.from}.tombstone = 0 AND IFNULL(_t2.tombstone, 0) = 0
          )
        GROUP BY group_id
      )
      LEFT JOIN ${sqlPieces.from} ON ${sqlPieces.from}.id = group_id
      ${sqlPieces.joins}
      ${sqlPieces.orderBy}
      ${sqlPieces.limit != null ? `LIMIT ${sqlPieces.limit}` : ""}
      ${sqlPieces.offset != null ? `OFFSET ${sqlPieces.offset}` : ""}
    `, params);
			matched = new Set([].concat.apply([], rows.map((row) => row.matched.split(","))));
		}
		const where = whereIn(rows.map((row) => row.group_id), `IFNULL(${sqlPieces.from}.parent_id, ${sqlPieces.from}.id)`);
		const { parents, children } = (await all(`
    SELECT ${sqlPieces.select}, parent_id AS _parent_id FROM ${sqlPieces.from}
    ${sqlPieces.joins}
    WHERE ${where} ${whereDead}
    ${sqlPieces.orderBy}
  `)).reduce((acc, trans) => {
			const pid = trans._parent_id;
			delete trans._parent_id;
			if (pid == null) acc.parents.push(trans);
			else {
				const arr = acc.children.get(pid) || [];
				arr.push(trans);
				acc.children.set(pid, arr);
			}
			return acc;
		}, {
			parents: [],
			children: /* @__PURE__ */ new Map()
		});
		const mapper = (trans) => {
			Object.keys(trans).forEach((name) => {
				trans[name] = convertOutputType(trans[name], outputTypes.get(name));
			});
			if (matched && !matched.has(trans.id)) trans._unmatched = true;
			return trans;
		};
		return toGroup(parents, children, mapper);
	}
	async function execTransactionsBasic(compilerState, queryState, sqlPieces, params, splitType, outputTypes) {
		const s = { ...sqlPieces };
		if (splitType !== "all") if (splitType === "none") s.where = `${s.where} AND ${s.from}.parent_id IS NULL`;
		else s.where = `${s.where} AND ${s.from}.is_parent = 0`;
		return execQuery$1(queryState, compilerState, s, params, outputTypes);
	}
	function isValidSplitsOption(splits) {
		return [
			"all",
			"inline",
			"none",
			"grouped"
		].includes(splits);
	}
	async function execCategoryGroups(compilerState, queryState, sqlPieces, params, outputTypes) {
		const tableOptions = queryState.tableOptions || {};
		const categoriesOption = tableOptions.categories ? tableOptions.categories : "all";
		if (!isValidCategoriesOption(categoriesOption)) throw new Error(`Invalid "categories" option for category_groups: "${categoriesOption}"`);
		if (categoriesOption !== "none") return execCategoryGroupsWithCategories(compilerState, queryState, sqlPieces, params, categoriesOption, outputTypes);
		return execCategoryGroupsBasic(compilerState, queryState, sqlPieces, params, outputTypes);
	}
	async function execCategoryGroupsWithCategories(compilerState, queryState, sqlPieces, params, categoriesOption, outputTypes) {
		const categoryGroups = await execCategoryGroupsBasic(compilerState, queryState, sqlPieces, params, outputTypes);
		if (categoriesOption === "none") return categoryGroups;
		const { data: categories } = await aqlQuery(q("categories").filter({ group: { $oneof: categoryGroups.map((cg) => cg.id) } }).select("*"));
		return categoryGroups.map((group) => {
			const cats = categories.filter((cat) => cat.group === group.id);
			return {
				...group,
				categories: cats
			};
		});
	}
	async function execCategoryGroupsBasic(compilerState, queryState, sqlPieces, params, outputTypes) {
		return execQuery$1(queryState, compilerState, sqlPieces, params, outputTypes);
	}
	function isValidCategoriesOption(categories) {
		return ["all", "none"].includes(categories);
	}
	var schemaExecutors = {
		transactions: execTransactions,
		category_groups: execCategoryGroups
	};
	//#endregion
	//#region ../loot-core/src/server/aql/views.ts
	function selectFields(fields) {
		return Object.keys(fields).map((as) => {
			let field = fields[as];
			const needsAs = field !== as;
			if (!field.match(/[ .]/)) field = `_.${field}`;
			return needsAs ? `${field} AS ${quoteAlias(as)}` : `${field}`;
		}).join(", ");
	}
	function makeViews(schema, schemaConfig) {
		const views = schemaConfig.views;
		const viewStrs = [];
		Object.keys(views).forEach((table) => {
			const { fields: fieldMappings = {}, ...tableViews } = views[table];
			const publicFields = Object.fromEntries(Object.keys(schema[table]).map((name) => [name, name]));
			const internalFields = {
				...publicFields,
				...fieldMappings
			};
			Object.keys(tableViews).forEach((viewName) => {
				const publicMaker = (overrides) => {
					return selectFields({
						...publicFields,
						...overrides
					});
				};
				const internalMaker = (overrides) => {
					return selectFields({
						...internalFields,
						...overrides
					});
				};
				let sql;
				if (typeof tableViews[viewName] === "function") sql = tableViews[viewName](internalMaker, publicMaker);
				else sql = tableViews[viewName];
				sql = sql.trim().replace(/;$/, "");
				viewStrs.push(`
        DROP VIEW IF EXISTS ${viewName};
        CREATE VIEW ${viewName} AS ${sql};
      `);
			});
		});
		return viewStrs.join("\n");
	}
	//#endregion
	//#region ../loot-core/src/server/aql/index.ts
	function aqlCompiledQuery(queryState, sqlPieces, compilerState, params) {
		return runCompiledAqlQuery(queryState, sqlPieces, compilerState, {
			params,
			executors: schemaExecutors
		});
	}
	function aqlQuery(query, params) {
		if (query instanceof Query) query = query.serialize();
		return compileAndRunAqlQuery(schema, schemaConfig, query, {
			params,
			executors: schemaExecutors
		});
	}
	//#endregion
	//#region ../loot-core/src/server/spreadsheet/graph-data-structure.ts
	function Graph$1() {
		const graph = {
			addNode,
			removeNode,
			adjacent,
			adjacentIncoming,
			addEdge,
			removeEdge,
			removeIncomingEdges,
			topologicalSort,
			generateDOT,
			getEdges
		};
		const edges = /* @__PURE__ */ new Map();
		const incomingEdges = /* @__PURE__ */ new Map();
		function getEdges() {
			return {
				edges,
				incomingEdges
			};
		}
		function addNode(node) {
			edges.set(node, adjacent(node));
			incomingEdges.set(node, adjacentIncoming(node));
			return graph;
		}
		function removeIncomingEdges(node) {
			const incoming = adjacentIncoming(node);
			incomingEdges.set(node, /* @__PURE__ */ new Set());
			const iter = incoming.values();
			let cur = iter.next();
			while (!cur.done) {
				removeEdge(cur.value, node);
				cur = iter.next();
			}
		}
		function removeNode(node) {
			removeIncomingEdges(node);
			edges.delete(node);
			incomingEdges.delete(node);
			return graph;
		}
		function adjacent(node) {
			return edges.get(node) || /* @__PURE__ */ new Set();
		}
		function adjacentIncoming(node) {
			return incomingEdges.get(node) || /* @__PURE__ */ new Set();
		}
		function addEdge(node1, node2) {
			addNode(node1);
			addNode(node2);
			adjacent(node1).add(node2);
			adjacentIncoming(node2).add(node1);
			return graph;
		}
		function removeEdge(node1, node2) {
			if (edges.has(node1)) adjacent(node1).delete(node2);
			if (incomingEdges.has(node2)) adjacentIncoming(node2).delete(node1);
			return graph;
		}
		function topologicalSort(sourceNodes) {
			const visited = /* @__PURE__ */ new Set();
			const sorted = [];
			sourceNodes.forEach((name) => {
				if (!visited.has(name)) topologicalSortIterable(name, visited, sorted);
			});
			return sorted;
		}
		function topologicalSortIterable(name, visited, sorted) {
			const stackTrace = [];
			stackTrace.push({
				count: -1,
				value: name,
				parent: "",
				level: 0
			});
			while (stackTrace.length > 0) {
				const current = stackTrace.slice(-1)[0];
				const adjacents = adjacent(current.value);
				if (current.count === -1) current.count = adjacents.size;
				if (current.count > 0) {
					const iter = adjacents.values();
					let cur = iter.next();
					while (!cur.done) {
						if (!visited.has(cur.value)) stackTrace.push({
							count: -1,
							parent: current.value,
							value: cur.value,
							level: current.level + 1
						});
						else current.count--;
						cur = iter.next();
					}
				} else {
					if (!visited.has(current.value)) {
						visited.add(current.value);
						sorted.unshift(current.value);
					}
					const removed = stackTrace.pop();
					for (let i = 0; i < stackTrace.length; i++) if (stackTrace[i].value === removed.parent) stackTrace[i].count--;
				}
			}
		}
		function generateDOT() {
			const edgeStrings = [];
			edges.forEach(function(adj, edge) {
				if (adj.length !== 0) edgeStrings.push(`${edge} -> {${adj.join(",")}}`);
			});
			return `
    digraph G {
      ${edgeStrings.join("\n").replace(/!/g, "_")}
    }
    `;
		}
		return graph;
	}
	//#endregion
	//#region ../loot-core/src/server/spreadsheet/util.ts
	function unresolveName(name) {
		const idx = name.indexOf("!");
		if (idx !== -1) return {
			sheet: name.slice(0, idx),
			name: name.slice(idx + 1)
		};
		return {
			sheet: null,
			name
		};
	}
	function resolveName(sheet, name) {
		return sheet + "!" + name;
	}
	//#endregion
	//#region ../loot-core/src/server/spreadsheet/spreadsheet.ts
	var Spreadsheet = class {
		constructor(saveCache, setCacheStatus) {
			_defineProperty(this, "_meta", void 0);
			_defineProperty(this, "cacheBarrier", void 0);
			_defineProperty(this, "computeQueue", void 0);
			_defineProperty(this, "dirtyCells", void 0);
			_defineProperty(this, "events", void 0);
			_defineProperty(this, "graph", void 0);
			_defineProperty(this, "nodes", void 0);
			_defineProperty(this, "running", void 0);
			_defineProperty(this, "saveCache", void 0);
			_defineProperty(this, "setCacheStatus", void 0);
			_defineProperty(this, "transactionDepth", void 0);
			this.graph = new Graph$1();
			this.nodes = /* @__PURE__ */ new Map();
			this.transactionDepth = 0;
			this.saveCache = saveCache;
			this.setCacheStatus = setCacheStatus;
			this.dirtyCells = [];
			this.computeQueue = [];
			this.events = mitt_default();
			this._meta = {
				createdMonths: /* @__PURE__ */ new Set(),
				budgetType: "envelope"
			};
		}
		meta() {
			return this._meta;
		}
		setMeta(meta) {
			this._meta = meta;
		}
		_getNode(name) {
			const { sheet } = unresolveName(name);
			if (!this.nodes.has(name)) this.nodes.set(name, {
				name,
				expr: null,
				value: null,
				sheet
			});
			return this.nodes.get(name);
		}
		getNode(name) {
			return this._getNode(name);
		}
		hasCell(name) {
			return this.nodes.has(name);
		}
		add(name, expr) {
			this.set(name, expr);
		}
		getNodes() {
			return this.nodes;
		}
		serialize() {
			return {
				graph: this.graph.getEdges(),
				nodes: [...this.nodes.entries()]
			};
		}
		transaction(func) {
			this.startTransaction();
			try {
				func();
			} catch (e) {
				logger.log(e);
			}
			return this.endTransaction();
		}
		startTransaction() {
			this.transactionDepth++;
		}
		endTransaction() {
			this.transactionDepth--;
			if (this.transactionDepth === 0) {
				const cells = this.dirtyCells;
				this.dirtyCells = [];
				this.queueComputation(this.graph.topologicalSort(cells));
			}
			return [];
		}
		queueComputation(cellNames) {
			this.computeQueue = this.computeQueue.concat(cellNames);
			Promise.resolve().then(() => {
				if (!this.running) this.runComputations();
			});
		}
		runComputations(idx = 0) {
			this.running = true;
			while (idx < this.computeQueue.length) {
				const name = this.computeQueue[idx];
				let node;
				let result;
				try {
					node = this.getNode(name);
					if (node._run) {
						const args = node._dependencies.map((dep) => {
							return this.getNode(dep).value;
						});
						result = node._run(...args);
						if (result instanceof Promise) logger.warn(`dynamic cell ${name} returned a promise! this is discouraged because errors are not handled properly`);
					} else if (node.sql) result = aqlCompiledQuery(node.query, node.sql.sqlPieces, node.sql.state);
					else {
						idx++;
						continue;
					}
				} catch (e) {
					logger.log("Error while evaluating " + name + ":", e);
					this.running = false;
					this.computeQueue = [];
					return;
				}
				if (result instanceof Promise) {
					result.then((value) => {
						node.value = value;
						this.runComputations(idx + 1);
					}, (err) => {
						logger.warn(`Failed running ${node.name}!`, err);
						this.runComputations(idx + 1);
					});
					return;
				} else node.value = result;
				idx++;
			}
			if (idx === this.computeQueue.length) {
				this.events.emit("change", { names: this.computeQueue });
				if (typeof this.saveCache === "function") this.saveCache(this.computeQueue);
				this.markCacheSafe();
				this.running = false;
				this.computeQueue = [];
			}
		}
		markCacheSafe() {
			if (!this.cacheBarrier) {
				if (this.setCacheStatus) this.setCacheStatus({ clean: true });
			}
		}
		markCacheDirty() {
			if (this.setCacheStatus) this.setCacheStatus({ clean: false });
		}
		startCacheBarrier() {
			this.cacheBarrier = true;
			this.markCacheDirty();
		}
		endCacheBarrier() {
			this.cacheBarrier = false;
			if (!(this.running || this.computeQueue.length > 0)) this.markCacheSafe();
		}
		addEventListener(name, func) {
			this.events.on(name, func);
			return () => this.events.off(name, func);
		}
		onFinish(func) {
			if (this.transactionDepth !== 0) throw new Error("onFinish called while inside a spreadsheet transaction. This is not allowed as it will lead to race conditions");
			if (!this.running && this.computeQueue.length === 0) {
				func([]);
				return () => {};
			}
			const remove = this.addEventListener("change", (...args) => {
				remove();
				return func(...args);
			});
			return remove;
		}
		unload() {
			this.events.all.clear();
		}
		getValue(name) {
			return this.getNode(name).value;
		}
		getExpr(name) {
			return this.getNode(name).expr;
		}
		getCellValue(sheet, name) {
			return this.getNode(resolveName(sheet, name)).value;
		}
		getCellExpr(sheet, name) {
			return this.getNode(resolveName(sheet, name)).expr;
		}
		getCellValueLoose(sheetName, cellName) {
			const name = resolveName(sheetName, cellName);
			if (this.nodes.has(name)) return this.getNode(name).value;
			return null;
		}
		bootup(onReady) {
			this.onFinish(() => {
				onReady();
			});
		}
		load(name, value) {
			const node = this._getNode(name);
			node.expr = value;
			node.value = value;
		}
		create(name, value) {
			return this.transaction(() => {
				const node = this._getNode(name);
				node.expr = value;
				node.value = value;
				this._markDirty(name);
			});
		}
		set(name, value) {
			this.create(name, value);
		}
		recompute(name) {
			this.transaction(() => {
				this.dirtyCells.push(name);
			});
		}
		recomputeAll() {
			this.transaction(() => {
				this.dirtyCells = [...this.nodes.keys()];
			});
		}
		createQuery(sheetName, cellName, query) {
			const name = resolveName(sheetName, cellName);
			const node = this._getNode(name);
			if (node.query !== query) {
				node.query = query;
				const { sqlPieces, state } = compileQuery(node.query, schema, schemaConfig);
				node.sql = {
					sqlPieces,
					state
				};
				this.transaction(() => {
					this._markDirty(name);
				});
			}
		}
		createStatic(sheetName, cellName, initialValue) {
			const name = resolveName(sheetName, cellName);
			if (!this.nodes.has(name)) this.create(name, initialValue);
		}
		createDynamic(sheetName, cellName, { dependencies = [], run, initialValue, refresh = false }) {
			const name = resolveName(sheetName, cellName);
			const node = this._getNode(name);
			if (node.dynamic) return;
			node.dynamic = true;
			node._run = run;
			dependencies = dependencies.map((dep) => {
				let resolved;
				if (!unresolveName(dep).sheet) resolved = resolveName(sheetName, dep);
				else resolved = dep;
				return resolved;
			});
			node._dependencies = dependencies;
			this.graph.removeIncomingEdges(name);
			dependencies.forEach((dep) => {
				this.graph.addEdge(dep, name);
			});
			if (node.value == null || refresh) this.transaction(() => {
				node.value = initialValue;
				this._markDirty(name);
			});
		}
		clearSheet(sheetName) {
			for (const [name, node] of this.nodes.entries()) if (node.sheet === sheetName) this.nodes.delete(name);
		}
		voidCell(sheetName, name, voidValue = null) {
			const node = this.getNode(resolveName(sheetName, name));
			node._run = null;
			node.dynamic = false;
			node.value = voidValue;
		}
		deleteCell(sheetName, name) {
			this.voidCell(sheetName, name);
			this.nodes.delete(resolveName(sheetName, name));
		}
		addDependencies(sheetName, cellName, deps) {
			const name = resolveName(sheetName, cellName);
			deps = deps.map((dep) => {
				if (!unresolveName(dep).sheet) return resolveName(sheetName, dep);
				return dep;
			});
			const node = this.getNode(name);
			const newDeps = deps.filter((dep) => (node._dependencies || []).indexOf(dep) === -1);
			if (newDeps.length > 0) {
				node._dependencies = (node._dependencies || []).concat(newDeps);
				newDeps.forEach((dep) => {
					this.graph.addEdge(dep, name);
				});
				this.recompute(name);
			}
		}
		removeDependencies(sheetName, cellName, deps) {
			const name = resolveName(sheetName, cellName);
			deps = deps.map((dep) => {
				if (!unresolveName(dep).sheet) return resolveName(sheetName, dep);
				return dep;
			});
			const node = this.getNode(name);
			node._dependencies = (node._dependencies || []).filter((dep) => deps.indexOf(dep) === -1);
			deps.forEach((dep) => {
				this.graph.removeEdge(dep, name);
			});
			this.recompute(name);
		}
		_markDirty(name) {
			this.dirtyCells.push(name);
		}
		triggerDatabaseChanges(oldValues, newValues) {
			const tables = new Set([...oldValues.keys(), ...newValues.keys()]);
			this.startTransaction();
			this.nodes.forEach((node) => {
				if (node.sql && node.sql.state.dependencies.some((dep) => tables.has(dep))) this._markDirty(node.name);
			});
			this.endTransaction();
		}
	};
	//#endregion
	//#region ../loot-core/src/server/sheet.ts
	init_dist$1();
	var globalSheet;
	var globalOnChange;
	var globalCacheDb;
	function get$2() {
		return globalSheet;
	}
	async function updateSpreadsheetCache(rawDb, names) {
		transaction$1(rawDb, () => {
			names.forEach((name) => {
				const node = globalSheet._getNode(name);
				if (node.sql == null) runQuery$1(rawDb, "INSERT OR REPLACE INTO kvcache (key, value) VALUES (?, ?)", [name, JSON.stringify(node.value)]);
			});
		});
	}
	function setCacheStatus(mainDb, cacheDb, { clean }) {
		if (clean) {
			const num = Math.random() * 1e7;
			runQuery$1(cacheDb, "INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)", [num]);
			if (mainDb) runQuery$1(mainDb, "INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)", [num]);
		} else runQuery$1(cacheDb, "DELETE FROM kvcache_key");
	}
	function isCacheDirty(mainDb, cacheDb) {
		let rows = runQuery$1(cacheDb, "SELECT key FROM kvcache_key WHERE id = 1", [], true);
		const num = rows.length === 0 ? null : rows[0].key;
		if (num == null) return true;
		if (mainDb) {
			const rows = runQuery$1(mainDb, "SELECT key FROM kvcache_key WHERE id = 1", [], true);
			if (rows.length === 0 || rows[0].key !== num) return true;
		}
		rows = runQuery$1(cacheDb, "SELECT * FROM kvcache LIMIT 1", [], true);
		return rows.length === 0;
	}
	async function loadSpreadsheet(db, onSheetChange) {
		const cacheEnabled = process$1.env.NODE_ENV !== "test";
		const mainDb = db.getDatabase();
		let cacheDb;
		cacheDb = mainDb;
		let sheet;
		if (cacheEnabled) sheet = new Spreadsheet(updateSpreadsheetCache.bind(null, cacheDb), setCacheStatus.bind(null, mainDb, cacheDb));
		else sheet = new Spreadsheet();
		captureBreadcrumb({
			message: "loading spreadsheet",
			category: "server"
		});
		globalSheet = sheet;
		globalOnChange = onSheetChange;
		if (onSheetChange) sheet.addEventListener("change", onSheetChange);
		if (cacheEnabled && !isCacheDirty(mainDb, cacheDb)) {
			const cachedRows = runQuery$1(cacheDb, "SELECT * FROM kvcache", [], true);
			logger.log(`Loaded spreadsheet from cache (${cachedRows.length} items)`);
			for (const row of cachedRows) {
				const parsed = JSON.parse(row.value);
				sheet.load(row.key, parsed);
			}
		} else {
			logger.log("Loading fresh spreadsheet");
			await loadUserBudgets(db);
		}
		captureBreadcrumb({
			message: "loaded spreadsheet",
			category: "server"
		});
		return sheet;
	}
	function unloadSpreadsheet() {
		if (globalSheet) {
			globalSheet.unload();
			globalSheet = null;
		}
		if (globalCacheDb) {
			closeDatabase$1(globalCacheDb);
			globalCacheDb = null;
		}
	}
	async function reloadSpreadsheet(db) {
		if (globalSheet) {
			unloadSpreadsheet();
			return loadSpreadsheet(db, globalOnChange);
		}
	}
	async function loadUserBudgets(db) {
		const sheet = globalSheet;
		const { value: budgetType = "envelope" } = await db.first("SELECT value from preferences WHERE id = ?", ["budgetType"]) ?? {};
		const table = budgetType === "tracking" ? "reflect_budgets" : "zero_budgets";
		const budgets = await db.all(`
      SELECT * FROM ${table} b
      LEFT JOIN categories c ON c.id = b.category
      WHERE c.tombstone = 0
    `);
		sheet.startTransaction();
		for (const budget of budgets) if (budget.month && budget.category) {
			const sheetName = `budget${budget.month}`;
			sheet.set(`${sheetName}!budget-${budget.category}`, budget.amount);
			sheet.set(`${sheetName}!carryover-${budget.category}`, budget.carryover === 1 ? true : false);
			sheet.set(`${sheetName}!goal-${budget.category}`, budget.goal);
			sheet.set(`${sheetName}!long-goal-${budget.category}`, budget.long_goal);
		}
		if (budgetType !== "tracking") {
			const budgetMonths = await db.all("SELECT * FROM zero_budget_months");
			for (const budgetMonth of budgetMonths) {
				const sheetName = sheetForMonth(budgetMonth.id);
				sheet.set(`${sheetName}!buffered`, budgetMonth.buffered);
			}
		}
		sheet.endTransaction();
	}
	function getCell$1(sheet, name) {
		return globalSheet._getNode(resolveName(sheet, name));
	}
	function getCellValue(sheet, name) {
		return globalSheet.getValue(resolveName(sheet, name));
	}
	function startTransaction() {
		if (globalSheet) globalSheet.startTransaction();
	}
	function endTransaction() {
		if (globalSheet) globalSheet.endTransaction();
	}
	function waitOnSpreadsheet() {
		return new Promise((resolve) => {
			if (globalSheet) globalSheet.onFinish(resolve);
			else resolve(void 0);
		});
	}
	//#endregion
	//#region ../loot-core/src/shared/currencies.ts
	var currencies = [
		{
			code: "",
			name: "None",
			symbol: "",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "AED",
			name: "UAE Dirham",
			symbol: "د.إ",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: false
		},
		{
			code: "ARS",
			name: "Argentinian Peso",
			symbol: "Arg$",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: true
		},
		{
			code: "AUD",
			name: "Australian Dollar",
			symbol: "A$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "BRL",
			name: "Brazilian Real",
			symbol: "R$",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: true
		},
		{
			code: "BYN",
			name: "Belarusian Ruble",
			symbol: "Br",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "CAD",
			name: "Canadian Dollar",
			symbol: "CA$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "CHF",
			name: "Swiss Franc",
			symbol: "Fr.",
			decimalPlaces: 2,
			numberFormat: "apostrophe-dot",
			symbolFirst: true
		},
		{
			code: "CLP",
			name: "Chilean Peso",
			symbol: "CLP$",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: true
		},
		{
			code: "CNY",
			name: "Yuan Renminbi",
			symbol: "¥",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "COP",
			name: "Colombian Peso",
			symbol: "Col$",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: true
		},
		{
			code: "CRC",
			name: "Costa Rican Colón",
			symbol: "₡",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: true
		},
		{
			code: "CZK",
			name: "Czech Koruna",
			symbol: "Kč",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "DKK",
			name: "Danish Krone",
			symbol: "kr",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: false
		},
		{
			code: "DOP",
			name: "Dominican Peso",
			symbol: "RD$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "EGP",
			name: "Egyptian Pound",
			symbol: "ج.م",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: false
		},
		{
			code: "EUR",
			name: "Euro",
			symbol: "€",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: false
		},
		{
			code: "GBP",
			name: "Pound Sterling",
			symbol: "£",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "GTQ",
			name: "Guatemalan Quetzal",
			symbol: "Q",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "HKD",
			name: "Hong Kong Dollar",
			symbol: "HK$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "HUF",
			name: "Hungarian Forint",
			symbol: "Ft",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "IDR",
			name: "Indonesian Rupiah",
			symbol: "Rp",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: true
		},
		{
			code: "INR",
			name: "Indian Rupee",
			symbol: "₹",
			decimalPlaces: 2,
			numberFormat: "comma-dot-in",
			symbolFirst: true
		},
		{
			code: "JMD",
			name: "Jamaican Dollar",
			symbol: "J$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "JPY",
			name: "Japanese Yen",
			symbol: "¥",
			decimalPlaces: 0,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "KRW",
			name: "South Korean Won",
			symbol: "₩",
			decimalPlaces: 0,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "LKR",
			name: "Sri Lankan Rupee",
			symbol: "Rs.",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "MDL",
			name: "Moldovan Leu",
			symbol: "L",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: false
		},
		{
			code: "MYR",
			name: "Malaysian Ringgit",
			symbol: "RM",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "PHP",
			name: "Philippine Peso",
			symbol: "₱",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "PLN",
			name: "Polish Złoty",
			symbol: "zł",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "QAR",
			name: "Qatari Riyal",
			symbol: "ر.ق",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: false
		},
		{
			code: "RON",
			name: "Romanian Leu",
			symbol: "lei",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: false
		},
		{
			code: "RSD",
			name: "Serbian Dinar",
			symbol: "дин",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: false
		},
		{
			code: "RUB",
			name: "Russian Ruble",
			symbol: "₽",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "SAR",
			name: "Saudi Riyal",
			symbol: "ر.س",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: false
		},
		{
			code: "SEK",
			name: "Swedish Krona",
			symbol: "kr",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "SGD",
			name: "Singapore Dollar",
			symbol: "S$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "THB",
			name: "Thai Baht",
			symbol: "฿",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "TRY",
			name: "Turkish Lira",
			symbol: "₺",
			decimalPlaces: 2,
			numberFormat: "dot-comma",
			symbolFirst: true
		},
		{
			code: "TWD",
			name: "New Taiwan Dollar",
			symbol: "NT$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "UAH",
			name: "Ukrainian Hryvnia",
			symbol: "₴",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		},
		{
			code: "USD",
			name: "US Dollar",
			symbol: "$",
			decimalPlaces: 2,
			numberFormat: "comma-dot",
			symbolFirst: true
		},
		{
			code: "UZS",
			name: "Uzbek Soum",
			symbol: "UZS",
			decimalPlaces: 2,
			numberFormat: "space-comma",
			symbolFirst: false
		}
	];
	function getCurrency(code) {
		return currencies.find((c) => c.code === code) || currencies[0];
	}
	//#endregion
	//#region ../../node_modules/date-fns/locale/af/_lib/formatDistance.js
	var formatDistanceLocale$82 = {
		lessThanXSeconds: {
			one: "minder as 'n sekonde",
			other: "minder as {{count}} sekondes"
		},
		xSeconds: {
			one: "1 sekonde",
			other: "{{count}} sekondes"
		},
		halfAMinute: "'n halwe minuut",
		lessThanXMinutes: {
			one: "minder as 'n minuut",
			other: "minder as {{count}} minute"
		},
		xMinutes: {
			one: "'n minuut",
			other: "{{count}} minute"
		},
		aboutXHours: {
			one: "ongeveer 1 uur",
			other: "ongeveer {{count}} ure"
		},
		xHours: {
			one: "1 uur",
			other: "{{count}} ure"
		},
		xDays: {
			one: "1 dag",
			other: "{{count}} dae"
		},
		aboutXWeeks: {
			one: "ongeveer 1 week",
			other: "ongeveer {{count}} weke"
		},
		xWeeks: {
			one: "1 week",
			other: "{{count}} weke"
		},
		aboutXMonths: {
			one: "ongeveer 1 maand",
			other: "ongeveer {{count}} maande"
		},
		xMonths: {
			one: "1 maand",
			other: "{{count}} maande"
		},
		aboutXYears: {
			one: "ongeveer 1 jaar",
			other: "ongeveer {{count}} jaar"
		},
		xYears: {
			one: "1 jaar",
			other: "{{count}} jaar"
		},
		overXYears: {
			one: "meer as 1 jaar",
			other: "meer as {{count}} jaar"
		},
		almostXYears: {
			one: "byna 1 jaar",
			other: "byna {{count}} jaar"
		}
	};
	var formatDistance$83 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$82[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "oor " + result;
		else return result + " gelede";
		return result;
	};
	var formatLong$91 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "yyyy/MM/dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'om' {{time}}",
				long: "{{date}} 'om' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/af/_lib/formatRelative.js
	var formatRelativeLocale$83 = {
		lastWeek: "'verlede' eeee 'om' p",
		yesterday: "'gister om' p",
		today: "'vandag om' p",
		tomorrow: "'môre om' p",
		nextWeek: "eeee 'om' p",
		other: "P"
	};
	var formatRelative$83 = (token, _date, _baseDate, _options) => formatRelativeLocale$83[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/af/_lib/localize.js
	var eraValues$83 = {
		narrow: ["vC", "nC"],
		abbreviated: ["vC", "nC"],
		wide: ["voor Christus", "na Christus"]
	};
	var quarterValues$83 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1ste kwartaal",
			"2de kwartaal",
			"3de kwartaal",
			"4de kwartaal"
		]
	};
	var monthValues$83 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Feb",
			"Mrt",
			"Apr",
			"Mei",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Okt",
			"Nov",
			"Des"
		],
		wide: [
			"Januarie",
			"Februarie",
			"Maart",
			"April",
			"Mei",
			"Junie",
			"Julie",
			"Augustus",
			"September",
			"Oktober",
			"November",
			"Desember"
		]
	};
	var dayValues$83 = {
		narrow: [
			"S",
			"M",
			"D",
			"W",
			"D",
			"V",
			"S"
		],
		short: [
			"So",
			"Ma",
			"Di",
			"Wo",
			"Do",
			"Vr",
			"Sa"
		],
		abbreviated: [
			"Son",
			"Maa",
			"Din",
			"Woe",
			"Don",
			"Vry",
			"Sat"
		],
		wide: [
			"Sondag",
			"Maandag",
			"Dinsdag",
			"Woensdag",
			"Donderdag",
			"Vrydag",
			"Saterdag"
		]
	};
	var dayPeriodValues$83 = {
		narrow: {
			am: "vm",
			pm: "nm",
			midnight: "middernag",
			noon: "middaguur",
			morning: "oggend",
			afternoon: "middag",
			evening: "laat middag",
			night: "aand"
		},
		abbreviated: {
			am: "vm",
			pm: "nm",
			midnight: "middernag",
			noon: "middaguur",
			morning: "oggend",
			afternoon: "middag",
			evening: "laat middag",
			night: "aand"
		},
		wide: {
			am: "vm",
			pm: "nm",
			midnight: "middernag",
			noon: "middaguur",
			morning: "oggend",
			afternoon: "middag",
			evening: "laat middag",
			night: "aand"
		}
	};
	var formattingDayPeriodValues$67 = {
		narrow: {
			am: "vm",
			pm: "nm",
			midnight: "middernag",
			noon: "uur die middag",
			morning: "uur die oggend",
			afternoon: "uur die middag",
			evening: "uur die aand",
			night: "uur die aand"
		},
		abbreviated: {
			am: "vm",
			pm: "nm",
			midnight: "middernag",
			noon: "uur die middag",
			morning: "uur die oggend",
			afternoon: "uur die middag",
			evening: "uur die aand",
			night: "uur die aand"
		},
		wide: {
			am: "vm",
			pm: "nm",
			midnight: "middernag",
			noon: "uur die middag",
			morning: "uur die oggend",
			afternoon: "uur die middag",
			evening: "uur die aand",
			night: "uur die aand"
		}
	};
	var ordinalNumber$83 = (dirtyNumber) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 < 20) switch (rem100) {
			case 1:
			case 8: return number + "ste";
			default: return number + "de";
		}
		return number + "ste";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/af.js
	/**
	* @category Locales
	* @summary Afrikaans locale.
	* @language Afrikaans
	* @iso-639-2 afr
	* @author Marnus Weststrate [@marnusw](https://github.com/marnusw)
	*/
	var af = {
		code: "af",
		formatDistance: formatDistance$83,
		formatLong: formatLong$91,
		formatRelative: formatRelative$83,
		localize: {
			ordinalNumber: ordinalNumber$83,
			era: buildLocalizeFn({
				values: eraValues$83,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$83,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$83,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$83,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$83,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$67,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(ste|de)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^([vn]\.? ?C\.?)/,
					abbreviated: /^([vn]\. ?C\.?)/,
					wide: /^((voor|na) Christus)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^v/, /^n/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^K[1234]/i,
					wide: /^[1234](st|d)e kwartaal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(Jan|Feb|Mrt|Apr|Mei|Jun|Jul|Aug|Sep|Okt|Nov|Dec)\.?/i,
					wide: /^(Januarie|Februarie|Maart|April|Mei|Junie|Julie|Augustus|September|Oktober|November|Desember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^J/i,
						/^F/i,
						/^M/i,
						/^A/i,
						/^M/i,
						/^J/i,
						/^J/i,
						/^A/i,
						/^S/i,
						/^O/i,
						/^N/i,
						/^D/i
					],
					any: [
						/^Jan/i,
						/^Feb/i,
						/^Mrt/i,
						/^Apr/i,
						/^Mei/i,
						/^Jun/i,
						/^Jul/i,
						/^Aug/i,
						/^Sep/i,
						/^Okt/i,
						/^Nov/i,
						/^Dec/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smdwv]/i,
					short: /^(So|Ma|Di|Wo|Do|Vr|Sa)/i,
					abbreviated: /^(Son|Maa|Din|Woe|Don|Vry|Sat)/i,
					wide: /^(Sondag|Maandag|Dinsdag|Woensdag|Donderdag|Vrydag|Saterdag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^S/i,
						/^M/i,
						/^D/i,
						/^W/i,
						/^D/i,
						/^V/i,
						/^S/i
					],
					any: [
						/^So/i,
						/^Ma/i,
						/^Di/i,
						/^Wo/i,
						/^Do/i,
						/^Vr/i,
						/^Sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(vm|nm|middernag|(?:uur )?die (oggend|middag|aand))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^vm/i,
					pm: /^nm/i,
					midnight: /^middernag/i,
					noon: /^middaguur/i,
					morning: /oggend/i,
					afternoon: /middag/i,
					evening: /laat middag/i,
					night: /aand/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar/_lib/formatDistance.js
	var formatDistanceLocale$81 = {
		lessThanXSeconds: {
			one: "أقل من ثانية",
			two: "أقل من ثانيتين",
			threeToTen: "أقل من {{count}} ثواني",
			other: "أقل من {{count}} ثانية"
		},
		xSeconds: {
			one: "ثانية واحدة",
			two: "ثانيتان",
			threeToTen: "{{count}} ثواني",
			other: "{{count}} ثانية"
		},
		halfAMinute: "نصف دقيقة",
		lessThanXMinutes: {
			one: "أقل من دقيقة",
			two: "أقل من دقيقتين",
			threeToTen: "أقل من {{count}} دقائق",
			other: "أقل من {{count}} دقيقة"
		},
		xMinutes: {
			one: "دقيقة واحدة",
			two: "دقيقتان",
			threeToTen: "{{count}} دقائق",
			other: "{{count}} دقيقة"
		},
		aboutXHours: {
			one: "ساعة واحدة تقريباً",
			two: "ساعتين تقريبا",
			threeToTen: "{{count}} ساعات تقريباً",
			other: "{{count}} ساعة تقريباً"
		},
		xHours: {
			one: "ساعة واحدة",
			two: "ساعتان",
			threeToTen: "{{count}} ساعات",
			other: "{{count}} ساعة"
		},
		xDays: {
			one: "يوم واحد",
			two: "يومان",
			threeToTen: "{{count}} أيام",
			other: "{{count}} يوم"
		},
		aboutXWeeks: {
			one: "أسبوع واحد تقريبا",
			two: "أسبوعين تقريبا",
			threeToTen: "{{count}} أسابيع تقريبا",
			other: "{{count}} أسبوعا تقريبا"
		},
		xWeeks: {
			one: "أسبوع واحد",
			two: "أسبوعان",
			threeToTen: "{{count}} أسابيع",
			other: "{{count}} أسبوعا"
		},
		aboutXMonths: {
			one: "شهر واحد تقريباً",
			two: "شهرين تقريبا",
			threeToTen: "{{count}} أشهر تقريبا",
			other: "{{count}} شهرا تقريباً"
		},
		xMonths: {
			one: "شهر واحد",
			two: "شهران",
			threeToTen: "{{count}} أشهر",
			other: "{{count}} شهرا"
		},
		aboutXYears: {
			one: "سنة واحدة تقريباً",
			two: "سنتين تقريبا",
			threeToTen: "{{count}} سنوات تقريباً",
			other: "{{count}} سنة تقريباً"
		},
		xYears: {
			one: "سنة واحد",
			two: "سنتان",
			threeToTen: "{{count}} سنوات",
			other: "{{count}} سنة"
		},
		overXYears: {
			one: "أكثر من سنة",
			two: "أكثر من سنتين",
			threeToTen: "أكثر من {{count}} سنوات",
			other: "أكثر من {{count}} سنة"
		},
		almostXYears: {
			one: "ما يقارب سنة واحدة",
			two: "ما يقارب سنتين",
			threeToTen: "ما يقارب {{count}} سنوات",
			other: "ما يقارب {{count}} سنة"
		}
	};
	var formatDistance$82 = (token, count, options) => {
		const usageGroup = formatDistanceLocale$81[token];
		let result;
		if (typeof usageGroup === "string") result = usageGroup;
		else if (count === 1) result = usageGroup.one;
		else if (count === 2) result = usageGroup.two;
		else if (count <= 10) result = usageGroup.threeToTen.replace("{{count}}", String(count));
		else result = usageGroup.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "خلال " + result;
		else return "منذ " + result;
		return result;
	};
	var formatLong$90 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE، do MMMM y",
				long: "do MMMM y",
				medium: "d MMM y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss",
				long: "HH:mm:ss",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'عند الساعة' {{time}}",
				long: "{{date}} 'عند الساعة' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar/_lib/formatRelative.js
	var formatRelativeLocale$82 = {
		lastWeek: "eeee 'الماضي عند الساعة' p",
		yesterday: "'الأمس عند الساعة' p",
		today: "'اليوم عند الساعة' p",
		tomorrow: "'غدا عند الساعة' p",
		nextWeek: "eeee 'القادم عند الساعة' p",
		other: "P"
	};
	var formatRelative$82 = (token) => formatRelativeLocale$82[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar/_lib/localize.js
	var eraValues$82 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م.", "ب.م."],
		wide: ["قبل الميلاد", "بعد الميلاد"]
	};
	var quarterValues$82 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ر1",
			"ر2",
			"ر3",
			"ر4"
		],
		wide: [
			"الربع الأول",
			"الربع الثاني",
			"الربع الثالث",
			"الربع الرابع"
		]
	};
	var monthValues$82 = {
		narrow: [
			"ي",
			"ف",
			"م",
			"أ",
			"م",
			"ي",
			"ي",
			"أ",
			"س",
			"أ",
			"ن",
			"د"
		],
		abbreviated: [
			"يناير",
			"فبراير",
			"مارس",
			"أبريل",
			"مايو",
			"يونيو",
			"يوليو",
			"أغسطس",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		],
		wide: [
			"يناير",
			"فبراير",
			"مارس",
			"أبريل",
			"مايو",
			"يونيو",
			"يوليو",
			"أغسطس",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		]
	};
	var dayValues$82 = {
		narrow: [
			"ح",
			"ن",
			"ث",
			"ر",
			"خ",
			"ج",
			"س"
		],
		short: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		abbreviated: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		wide: [
			"الأحد",
			"الاثنين",
			"الثلاثاء",
			"الأربعاء",
			"الخميس",
			"الجمعة",
			"السبت"
		]
	};
	var dayPeriodValues$82 = {
		narrow: {
			am: "ص",
			pm: "م",
			morning: "الصباح",
			noon: "الظهر",
			afternoon: "بعد الظهر",
			evening: "المساء",
			night: "الليل",
			midnight: "منتصف الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			morning: "الصباح",
			noon: "الظهر",
			afternoon: "بعد الظهر",
			evening: "المساء",
			night: "الليل",
			midnight: "منتصف الليل"
		},
		wide: {
			am: "ص",
			pm: "م",
			morning: "الصباح",
			noon: "الظهر",
			afternoon: "بعد الظهر",
			evening: "المساء",
			night: "الليل",
			midnight: "منتصف الليل"
		}
	};
	var formattingDayPeriodValues$66 = {
		narrow: {
			am: "ص",
			pm: "م",
			morning: "في الصباح",
			noon: "الظهر",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل",
			midnight: "منتصف الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			morning: "في الصباح",
			noon: "الظهر",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل",
			midnight: "منتصف الليل"
		},
		wide: {
			am: "ص",
			pm: "م",
			morning: "في الصباح",
			noon: "الظهر",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل",
			midnight: "منتصف الليل"
		}
	};
	var ordinalNumber$82 = (num) => String(num);
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar.js
	/**
	* @category Locales
	* @summary Arabic locale (Modern Standard Arabic - Al-fussha).
	* @language Modern Standard Arabic
	* @iso-639-2 ara
	* @author Abdallah Hassan [@AbdallahAHO](https://github.com/AbdallahAHO)
	* @author Koussay Haj Kacem [@essana3](https://github.com/essana3)
	*/
	var ar = {
		code: "ar",
		formatDistance: formatDistance$82,
		formatLong: formatLong$90,
		formatRelative: formatRelative$82,
		localize: {
			ordinalNumber: ordinalNumber$82,
			era: buildLocalizeFn({
				values: eraValues$82,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$82,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$82,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$82,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$82,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$66,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /[قب]/,
					abbreviated: /[قب]\.م\./,
					wide: /(قبل|بعد) الميلاد/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/قبل/, /بعد/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /ر[1234]/,
					wide: /الربع (الأول|الثاني|الثالث|الرابع)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[أيفمسند]/,
					abbreviated: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
					wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ي/i,
						/^ف/i,
						/^م/i,
						/^أ/i,
						/^م/i,
						/^ي/i,
						/^ي/i,
						/^أ/i,
						/^س/i,
						/^أ/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^يناير/i,
						/^فبراير/i,
						/^مارس/i,
						/^أبريل/i,
						/^مايو/i,
						/^يونيو/i,
						/^يوليو/i,
						/^أغسطس/i,
						/^سبتمبر/i,
						/^أكتوبر/i,
						/^نوفمبر/i,
						/^ديسمبر/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[حنثرخجس]/i,
					short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ح/i,
						/^ن/i,
						/^ث/i,
						/^ر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					],
					wide: [
						/^الأحد/i,
						/^الاثنين/i,
						/^الثلاثاء/i,
						/^الأربعاء/i,
						/^الخميس/i,
						/^الجمعة/i,
						/^السبت/i
					],
					any: [
						/^أح/i,
						/^اث/i,
						/^ث/i,
						/^أر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ص|م|منتصف الليل|الظهر|بعد الظهر|في الصباح|في المساء|في الليل)/,
					any: /^(ص|م|منتصف الليل|الظهر|بعد الظهر|في الصباح|في المساء|في الليل)/
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ص/,
					pm: /^م/,
					midnight: /منتصف الليل/,
					noon: /الظهر/,
					afternoon: /بعد الظهر/,
					morning: /في الصباح/,
					evening: /في المساء/,
					night: /في الليل/
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 6,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-DZ/_lib/formatDistance.js
	var formatDistanceLocale$80 = {
		lessThanXSeconds: {
			one: "أقل من ثانية واحدة",
			two: "أقل من ثانتين",
			threeToTen: "أقل من {{count}} ثواني",
			other: "أقل من {{count}} ثانية"
		},
		xSeconds: {
			one: "ثانية واحدة",
			two: "ثانتين",
			threeToTen: "{{count}} ثواني",
			other: "{{count}} ثانية"
		},
		halfAMinute: "نصف دقيقة",
		lessThanXMinutes: {
			one: "أقل من دقيقة",
			two: "أقل من دقيقتين",
			threeToTen: "أقل من {{count}} دقائق",
			other: "أقل من {{count}} دقيقة"
		},
		xMinutes: {
			one: "دقيقة واحدة",
			two: "دقيقتين",
			threeToTen: "{{count}} دقائق",
			other: "{{count}} دقيقة"
		},
		aboutXHours: {
			one: "ساعة واحدة تقريباً",
			two: "ساعتين تقريباً",
			threeToTen: "{{count}} ساعات تقريباً",
			other: "{{count}} ساعة تقريباً"
		},
		xHours: {
			one: "ساعة واحدة",
			two: "ساعتين",
			threeToTen: "{{count}} ساعات",
			other: "{{count}} ساعة"
		},
		xDays: {
			one: "يوم واحد",
			two: "يومين",
			threeToTen: "{{count}} أيام",
			other: "{{count}} يوم"
		},
		aboutXWeeks: {
			one: "أسبوع واحد تقريباً",
			two: "أسبوعين تقريباً",
			threeToTen: "{{count}} أسابيع تقريباً",
			other: "{{count}} أسبوع تقريباً"
		},
		xWeeks: {
			one: "أسبوع واحد",
			two: "أسبوعين",
			threeToTen: "{{count}} أسابيع",
			other: "{{count}} أسبوع"
		},
		aboutXMonths: {
			one: "شهر واحد تقريباً",
			two: "شهرين تقريباً",
			threeToTen: "{{count}} أشهر تقريباً",
			other: "{{count}} شهر تقريباً"
		},
		xMonths: {
			one: "شهر واحد",
			two: "شهرين",
			threeToTen: "{{count}} أشهر",
			other: "{{count}} شهر"
		},
		aboutXYears: {
			one: "عام واحد تقريباً",
			two: "عامين تقريباً",
			threeToTen: "{{count}} أعوام تقريباً",
			other: "{{count}} عام تقريباً"
		},
		xYears: {
			one: "عام واحد",
			two: "عامين",
			threeToTen: "{{count}} أعوام",
			other: "{{count}} عام"
		},
		overXYears: {
			one: "أكثر من عام",
			two: "أكثر من عامين",
			threeToTen: "أكثر من {{count}} أعوام",
			other: "أكثر من {{count}} عام"
		},
		almostXYears: {
			one: "عام واحد تقريباً",
			two: "عامين تقريباً",
			threeToTen: "{{count}} أعوام تقريباً",
			other: "{{count}} عام تقريباً"
		}
	};
	var formatDistance$81 = (token, count, options) => {
		options = options || {};
		const usageGroup = formatDistanceLocale$80[token];
		let result;
		if (typeof usageGroup === "string") result = usageGroup;
		else if (count === 1) result = usageGroup.one;
		else if (count === 2) result = usageGroup.two;
		else if (count <= 10) result = usageGroup.threeToTen.replace("{{count}}", String(count));
		else result = usageGroup.other.replace("{{count}}", String(count));
		if (options.addSuffix) if (options.comparison && options.comparison > 0) return "في خلال " + result;
		else return "منذ " + result;
		return result;
	};
	var formatLong$89 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'عند' {{time}}",
				long: "{{date}} 'عند' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-DZ/_lib/formatRelative.js
	var formatRelativeLocale$81 = {
		lastWeek: "'أخر' eeee 'عند' p",
		yesterday: "'أمس عند' p",
		today: "'اليوم عند' p",
		tomorrow: "'غداً عند' p",
		nextWeek: "eeee 'عند' p",
		other: "P"
	};
	var formatRelative$81 = (token, _date, _baseDate, _options) => {
		return formatRelativeLocale$81[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-DZ/_lib/localize.js
	var eraValues$81 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م.", "ب.م."],
		wide: ["قبل الميلاد", "بعد الميلاد"]
	};
	var quarterValues$81 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ر1",
			"ر2",
			"ر3",
			"ر4"
		],
		wide: [
			"الربع الأول",
			"الربع الثاني",
			"الربع الثالث",
			"الربع الرابع"
		]
	};
	var monthValues$81 = {
		narrow: [
			"ج",
			"ف",
			"م",
			"أ",
			"م",
			"ج",
			"ج",
			"أ",
			"س",
			"أ",
			"ن",
			"د"
		],
		abbreviated: [
			"جانـ",
			"فيفـ",
			"مارس",
			"أفريل",
			"مايـ",
			"جوانـ",
			"جويـ",
			"أوت",
			"سبتـ",
			"أكتـ",
			"نوفـ",
			"ديسـ"
		],
		wide: [
			"جانفي",
			"فيفري",
			"مارس",
			"أفريل",
			"ماي",
			"جوان",
			"جويلية",
			"أوت",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		]
	};
	var dayValues$81 = {
		narrow: [
			"ح",
			"ن",
			"ث",
			"ر",
			"خ",
			"ج",
			"س"
		],
		short: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		abbreviated: [
			"أحد",
			"اثنـ",
			"ثلا",
			"أربـ",
			"خميـ",
			"جمعة",
			"سبت"
		],
		wide: [
			"الأحد",
			"الاثنين",
			"الثلاثاء",
			"الأربعاء",
			"الخميس",
			"الجمعة",
			"السبت"
		]
	};
	var dayPeriodValues$81 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		}
	};
	var formattingDayPeriodValues$65 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "في الصباح",
			afternoon: "بعد الظـهر",
			evening: "في المساء",
			night: "في الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "في الصباح",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظـهر",
			evening: "في المساء",
			night: "في الليل"
		}
	};
	var ordinalNumber$81 = (dirtyNumber) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-DZ.js
	/**
	* @category Locales
	* @summary Arabic locale (Algerian Arabic).
	* @language Algerian Arabic
	* @iso-639-2 ara
	* @author Badreddine Boumaza [@badre429](https://github.com/badre429)
	* @author Ahmed ElShahat [@elshahat](https://github.com/elshahat)
	*/
	var arDZ = {
		code: "ar-DZ",
		formatDistance: formatDistance$81,
		formatLong: formatLong$89,
		formatRelative: formatRelative$81,
		localize: {
			ordinalNumber: ordinalNumber$81,
			era: buildLocalizeFn({
				values: eraValues$81,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$81,
				defaultWidth: "wide",
				argumentCallback: (quarter) => Number(quarter) - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$81,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$81,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$81,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$65,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ق|ب)/i,
					abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
					wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^قبل/i, /^بعد/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ر[1234]/i,
					wide: /^الربع [1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => Number(index) + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[جفمأسند]/i,
					abbreviated: /^(جان|فيف|مار|أفر|ماي|جوا|جوي|أوت|سبت|أكت|نوف|ديس)/i,
					wide: /^(جانفي|فيفري|مارس|أفريل|ماي|جوان|جويلية|أوت|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ج/i,
						/^ف/i,
						/^م/i,
						/^أ/i,
						/^م/i,
						/^ج/i,
						/^ج/i,
						/^أ/i,
						/^س/i,
						/^أ/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^جان/i,
						/^فيف/i,
						/^مار/i,
						/^أفر/i,
						/^ماي/i,
						/^جوا/i,
						/^جوي/i,
						/^أوت/i,
						/^سبت/i,
						/^أكت/i,
						/^نوف/i,
						/^ديس/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[حنثرخجس]/i,
					short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					abbreviated: /^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,
					wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ح/i,
						/^ن/i,
						/^ث/i,
						/^ر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					],
					wide: [
						/^الأحد/i,
						/^الاثنين/i,
						/^الثلاثاء/i,
						/^الأربعاء/i,
						/^الخميس/i,
						/^الجمعة/i,
						/^السبت/i
					],
					any: [
						/^أح/i,
						/^اث/i,
						/^ث/i,
						/^أر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
					any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mi/i,
					noon: /^no/i,
					morning: /morning/i,
					afternoon: /afternoon/i,
					evening: /evening/i,
					night: /night/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-EG/_lib/formatDistance.js
	var formatDistanceLocale$79 = {
		lessThanXSeconds: {
			one: "أقل من ثانية",
			two: "أقل من ثانيتين",
			threeToTen: "أقل من {{count}} ثواني",
			other: "أقل من {{count}} ثانية"
		},
		xSeconds: {
			one: "ثانية",
			two: "ثانيتين",
			threeToTen: "{{count}} ثواني",
			other: "{{count}} ثانية"
		},
		halfAMinute: "نص دقيقة",
		lessThanXMinutes: {
			one: "أقل من دقيقة",
			two: "أقل من دقيقتين",
			threeToTen: "أقل من {{count}} دقايق",
			other: "أقل من {{count}} دقيقة"
		},
		xMinutes: {
			one: "دقيقة",
			two: "دقيقتين",
			threeToTen: "{{count}} دقايق",
			other: "{{count}} دقيقة"
		},
		aboutXHours: {
			one: "حوالي ساعة",
			two: "حوالي ساعتين",
			threeToTen: "حوالي {{count}} ساعات",
			other: "حوالي {{count}} ساعة"
		},
		xHours: {
			one: "ساعة",
			two: "ساعتين",
			threeToTen: "{{count}} ساعات",
			other: "{{count}} ساعة"
		},
		xDays: {
			one: "يوم",
			two: "يومين",
			threeToTen: "{{count}} أيام",
			other: "{{count}} يوم"
		},
		aboutXWeeks: {
			one: "حوالي أسبوع",
			two: "حوالي أسبوعين",
			threeToTen: "حوالي {{count}} أسابيع",
			other: "حوالي {{count}} أسبوع"
		},
		xWeeks: {
			one: "أسبوع",
			two: "أسبوعين",
			threeToTen: "{{count}} أسابيع",
			other: "{{count}} أسبوع"
		},
		aboutXMonths: {
			one: "حوالي شهر",
			two: "حوالي شهرين",
			threeToTen: "حوالي {{count}} أشهر",
			other: "حوالي {{count}} شهر"
		},
		xMonths: {
			one: "شهر",
			two: "شهرين",
			threeToTen: "{{count}} أشهر",
			other: "{{count}} شهر"
		},
		aboutXYears: {
			one: "حوالي سنة",
			two: "حوالي سنتين",
			threeToTen: "حوالي {{count}} سنين",
			other: "حوالي {{count}} سنة"
		},
		xYears: {
			one: "عام",
			two: "عامين",
			threeToTen: "{{count}} أعوام",
			other: "{{count}} عام"
		},
		overXYears: {
			one: "أكثر من سنة",
			two: "أكثر من سنتين",
			threeToTen: "أكثر من {{count}} سنين",
			other: "أكثر من {{count}} سنة"
		},
		almostXYears: {
			one: "عام تقريبًا",
			two: "عامين تقريبًا",
			threeToTen: "{{count}} أعوام تقريبًا",
			other: "{{count}} عام تقريبًا"
		}
	};
	var formatDistance$80 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$79[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 2) result = tokenValue.two;
		else if (count <= 10) result = tokenValue.threeToTen.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return `في خلال ${result}`;
		else return `منذ ${result}`;
		return result;
	};
	var formatLong$88 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE، do MMMM y",
				long: "do MMMM y",
				medium: "dd/MMM/y",
				short: "d/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'الساعة' {{time}}",
				long: "{{date}} 'الساعة' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-EG/_lib/formatRelative.js
	var formatRelativeLocale$80 = {
		lastWeek: "eeee 'اللي جاي الساعة' p",
		yesterday: "'إمبارح الساعة' p",
		today: "'النهاردة الساعة' p",
		tomorrow: "'بكرة الساعة' p",
		nextWeek: "eeee 'الساعة' p",
		other: "P"
	};
	var formatRelative$80 = (token, _date, _baseDate, _options) => formatRelativeLocale$80[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-EG/_lib/localize.js
	var eraValues$80 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م", "ب.م"],
		wide: ["قبل الميلاد", "بعد الميلاد"]
	};
	var quarterValues$80 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ر1",
			"ر2",
			"ر3",
			"ر4"
		],
		wide: [
			"الربع الأول",
			"الربع الثاني",
			"الربع الثالث",
			"الربع الرابع"
		]
	};
	var monthValues$80 = {
		narrow: [
			"ي",
			"ف",
			"م",
			"أ",
			"م",
			"ي",
			"ي",
			"أ",
			"س",
			"أ",
			"ن",
			"د"
		],
		abbreviated: [
			"ينا",
			"فبر",
			"مارس",
			"أبريل",
			"مايو",
			"يونـ",
			"يولـ",
			"أغسـ",
			"سبتـ",
			"أكتـ",
			"نوفـ",
			"ديسـ"
		],
		wide: [
			"يناير",
			"فبراير",
			"مارس",
			"أبريل",
			"مايو",
			"يونيو",
			"يوليو",
			"أغسطس",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		]
	};
	var dayValues$80 = {
		narrow: [
			"ح",
			"ن",
			"ث",
			"ر",
			"خ",
			"ج",
			"س"
		],
		short: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		abbreviated: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		wide: [
			"الأحد",
			"الاثنين",
			"الثلاثاء",
			"الأربعاء",
			"الخميس",
			"الجمعة",
			"السبت"
		]
	};
	var dayPeriodValues$80 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءً",
			night: "ليلاً"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهراً",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءً",
			night: "ليلاً"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهراً",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءً",
			night: "ليلاً"
		}
	};
	var formattingDayPeriodValues$64 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "في الصباح",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهراً",
			morning: "في الصباح",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			morning: "في الصباح",
			noon: "ظهراً",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل"
		}
	};
	var ordinalNumber$80 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-EG.js
	/**
	* @category Locales
	* @summary Arabic locale (Egypt).
	* @language Arabic
	* @iso-639-2 ara
	* @author AbdAllah AbdElFattah [@AbdAllahAbdElFattah13](https://github.com/AbdAllahAbdElFattah13)
	*/
	var arEG = {
		code: "ar-EG",
		formatDistance: formatDistance$80,
		formatLong: formatLong$88,
		formatRelative: formatRelative$80,
		localize: {
			ordinalNumber: ordinalNumber$80,
			era: buildLocalizeFn({
				values: eraValues$80,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$80,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$80,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$80,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$80,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$64,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)/,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ق|ب)/g,
					abbreviated: /^(ق.م|ب.م)/g,
					wide: /^(قبل الميلاد|بعد الميلاد)/g
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^ق/g, /^ب/g] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/,
					abbreviated: /^ر[1234]/,
					wide: /^الربع (الأول|الثاني|الثالث|الرابع)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					wide: [
						/الربع الأول/,
						/الربع الثاني/,
						/الربع الثالث/,
						/الربع الرابع/
					],
					any: [
						/1/,
						/2/,
						/3/,
						/4/
					]
				},
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(ي|ف|م|أ|س|ن|د)/,
					abbreviated: /^(ينا|فبر|مارس|أبريل|مايو|يونـ|يولـ|أغسـ|سبتـ|أكتـ|نوفـ|ديسـ)/,
					wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ي/,
						/^ف/,
						/^م/,
						/^أ/,
						/^م/,
						/^ي/,
						/^ي/,
						/^أ/,
						/^س/,
						/^أ/,
						/^ن/,
						/^د/
					],
					any: [
						/^ينا/,
						/^فبر/,
						/^مارس/,
						/^أبريل/,
						/^مايو/,
						/^يون/,
						/^يول/,
						/^أغس/,
						/^سبت/,
						/^أكت/,
						/^نوف/,
						/^ديس/
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ح|ن|ث|ر|خ|ج|س)/,
					short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
					abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
					wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ح/,
						/^ن/,
						/^ث/,
						/^ر/,
						/^خ/,
						/^ج/,
						/^س/
					],
					any: [
						/أحد/,
						/اثنين/,
						/ثلاثاء/,
						/أربعاء/,
						/خميس/,
						/جمعة/,
						/سبت/
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ص|م|ن|ظ|في الصباح|بعد الظهر|في المساء|في الليل)/,
					abbreviated: /^(ص|م|نصف الليل|ظهراً|في الصباح|بعد الظهر|في المساء|في الليل)/,
					wide: /^(ص|م|نصف الليل|في الصباح|ظهراً|بعد الظهر|في المساء|في الليل)/,
					any: /^(ص|م|صباح|ظهر|مساء|ليل)/
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ص/,
					pm: /^م/,
					midnight: /^ن/,
					noon: /^ظ/,
					morning: /^ص/,
					afternoon: /^بعد/,
					evening: /^م/,
					night: /^ل/
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-MA/_lib/formatDistance.js
	var formatDistanceLocale$78 = {
		lessThanXSeconds: {
			one: "أقل من ثانية واحدة",
			two: "أقل من ثانتين",
			threeToTen: "أقل من {{count}} ثواني",
			other: "أقل من {{count}} ثانية"
		},
		xSeconds: {
			one: "ثانية واحدة",
			two: "ثانتين",
			threeToTen: "{{count}} ثواني",
			other: "{{count}} ثانية"
		},
		halfAMinute: "نصف دقيقة",
		lessThanXMinutes: {
			one: "أقل من دقيقة",
			two: "أقل من دقيقتين",
			threeToTen: "أقل من {{count}} دقائق",
			other: "أقل من {{count}} دقيقة"
		},
		xMinutes: {
			one: "دقيقة واحدة",
			two: "دقيقتين",
			threeToTen: "{{count}} دقائق",
			other: "{{count}} دقيقة"
		},
		aboutXHours: {
			one: "ساعة واحدة تقريباً",
			two: "ساعتين تقريباً",
			threeToTen: "{{count}} ساعات تقريباً",
			other: "{{count}} ساعة تقريباً"
		},
		xHours: {
			one: "ساعة واحدة",
			two: "ساعتين",
			threeToTen: "{{count}} ساعات",
			other: "{{count}} ساعة"
		},
		xDays: {
			one: "يوم واحد",
			two: "يومين",
			threeToTen: "{{count}} أيام",
			other: "{{count}} يوم"
		},
		aboutXWeeks: {
			one: "أسبوع واحد تقريباً",
			two: "أسبوعين تقريباً",
			threeToTen: "{{count}} أسابيع تقريباً",
			other: "{{count}} أسبوع تقريباً"
		},
		xWeeks: {
			one: "أسبوع واحد",
			two: "أسبوعين",
			threeToTen: "{{count}} أسابيع",
			other: "{{count}} أسبوع"
		},
		aboutXMonths: {
			one: "شهر واحد تقريباً",
			two: "شهرين تقريباً",
			threeToTen: "{{count}} أشهر تقريباً",
			other: "{{count}} شهر تقريباً"
		},
		xMonths: {
			one: "شهر واحد",
			two: "شهرين",
			threeToTen: "{{count}} أشهر",
			other: "{{count}} شهر"
		},
		aboutXYears: {
			one: "عام واحد تقريباً",
			two: "عامين تقريباً",
			threeToTen: "{{count}} أعوام تقريباً",
			other: "{{count}} عام تقريباً"
		},
		xYears: {
			one: "عام واحد",
			two: "عامين",
			threeToTen: "{{count}} أعوام",
			other: "{{count}} عام"
		},
		overXYears: {
			one: "أكثر من عام",
			two: "أكثر من عامين",
			threeToTen: "أكثر من {{count}} أعوام",
			other: "أكثر من {{count}} عام"
		},
		almostXYears: {
			one: "عام واحد تقريباً",
			two: "عامين تقريباً",
			threeToTen: "{{count}} أعوام تقريباً",
			other: "{{count}} عام تقريباً"
		}
	};
	var formatDistance$79 = (token, count, options) => {
		options = options || {};
		const usageGroup = formatDistanceLocale$78[token];
		let result;
		if (typeof usageGroup === "string") result = usageGroup;
		else if (count === 1) result = usageGroup.one;
		else if (count === 2) result = usageGroup.two;
		else if (count <= 10) result = usageGroup.threeToTen.replace("{{count}}", String(count));
		else result = usageGroup.other.replace("{{count}}", String(count));
		if (options.addSuffix) if (options.comparison && options.comparison > 0) return "في خلال " + result;
		else return "منذ " + result;
		return result;
	};
	var formatLong$87 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'عند' {{time}}",
				long: "{{date}} 'عند' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-MA/_lib/formatRelative.js
	var formatRelativeLocale$79 = {
		lastWeek: "'أخر' eeee 'عند' p",
		yesterday: "'أمس عند' p",
		today: "'اليوم عند' p",
		tomorrow: "'غداً عند' p",
		nextWeek: "eeee 'عند' p",
		other: "P"
	};
	var formatRelative$79 = (token, _date, _baseDate, _options) => {
		return formatRelativeLocale$79[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-MA/_lib/localize.js
	var eraValues$79 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م.", "ب.م."],
		wide: ["قبل الميلاد", "بعد الميلاد"]
	};
	var quarterValues$79 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ر1",
			"ر2",
			"ر3",
			"ر4"
		],
		wide: [
			"الربع الأول",
			"الربع الثاني",
			"الربع الثالث",
			"الربع الرابع"
		]
	};
	var monthValues$79 = {
		narrow: [
			"ي",
			"ف",
			"م",
			"أ",
			"م",
			"ي",
			"ي",
			"غ",
			"ش",
			"أ",
			"ن",
			"د"
		],
		abbreviated: [
			"ينا",
			"فبر",
			"مارس",
			"أبريل",
			"ماي",
			"يونـ",
			"يولـ",
			"غشت",
			"شتنـ",
			"أكتـ",
			"نونـ",
			"دجنـ"
		],
		wide: [
			"يناير",
			"فبراير",
			"مارس",
			"أبريل",
			"ماي",
			"يونيو",
			"يوليوز",
			"غشت",
			"شتنبر",
			"أكتوبر",
			"نونبر",
			"دجنبر"
		]
	};
	var dayValues$79 = {
		narrow: [
			"ح",
			"ن",
			"ث",
			"ر",
			"خ",
			"ج",
			"س"
		],
		short: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		abbreviated: [
			"أحد",
			"اثنـ",
			"ثلا",
			"أربـ",
			"خميـ",
			"جمعة",
			"سبت"
		],
		wide: [
			"الأحد",
			"الإثنين",
			"الثلاثاء",
			"الأربعاء",
			"الخميس",
			"الجمعة",
			"السبت"
		]
	};
	var dayPeriodValues$79 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		}
	};
	var formattingDayPeriodValues$63 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "في الصباح",
			afternoon: "بعد الظـهر",
			evening: "في المساء",
			night: "في الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "في الصباح",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظـهر",
			evening: "في المساء",
			night: "في الليل"
		}
	};
	var ordinalNumber$79 = (dirtyNumber) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-MA.js
	/**
	* @category Locales
	* @summary Arabic locale (Moroccan Arabic).
	* @language Moroccan Arabic
	* @iso-639-2 ara
	* @author Achraf Rrami [@rramiachraf](https://github.com/rramiachraf)
	*/
	var arMA = {
		code: "ar-MA",
		formatDistance: formatDistance$79,
		formatLong: formatLong$87,
		formatRelative: formatRelative$79,
		localize: {
			ordinalNumber: ordinalNumber$79,
			era: buildLocalizeFn({
				values: eraValues$79,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$79,
				defaultWidth: "wide",
				argumentCallback: (quarter) => Number(quarter) - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$79,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$79,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$79,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$63,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ق|ب)/i,
					abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
					wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^قبل/i, /^بعد/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ر[1234]/i,
					wide: /^الربع [1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => Number(index) + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[يفمأمسند]/i,
					abbreviated: /^(ين|ف|مار|أب|ماي|يون|يول|غش|شت|أك|ن|د)/i,
					wide: /^(ين|ف|مار|أب|ماي|يون|يول|غش|شت|أك|ن|د)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ي/i,
						/^ف/i,
						/^م/i,
						/^أ/i,
						/^م/i,
						/^ي/i,
						/^ي/i,
						/^غ/i,
						/^ش/i,
						/^أ/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^ين/i,
						/^فب/i,
						/^مار/i,
						/^أب/i,
						/^ماي/i,
						/^يون/i,
						/^يول/i,
						/^غشت/i,
						/^ش/i,
						/^أك/i,
						/^ن/i,
						/^د/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[حنثرخجس]/i,
					short: /^(أحد|إثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					abbreviated: /^(أحد|إثن|ثلا|أرب|خمي|جمعة|سبت)/i,
					wide: /^(الأحد|الإثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ح/i,
						/^ن/i,
						/^ث/i,
						/^ر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					],
					wide: [
						/^الأحد/i,
						/^الإثنين/i,
						/^الثلاثاء/i,
						/^الأربعاء/i,
						/^الخميس/i,
						/^الجمعة/i,
						/^السبت/i
					],
					any: [
						/^أح/i,
						/^إث/i,
						/^ث/i,
						/^أر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
					any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mi/i,
					noon: /^no/i,
					morning: /morning/i,
					afternoon: /afternoon/i,
					evening: /evening/i,
					night: /night/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-SA/_lib/formatDistance.js
	var formatDistanceLocale$77 = {
		lessThanXSeconds: {
			one: "أقل من ثانية واحدة",
			two: "أقل من ثانتين",
			threeToTen: "أقل من {{count}} ثواني",
			other: "أقل من {{count}} ثانية"
		},
		xSeconds: {
			one: "ثانية واحدة",
			two: "ثانتين",
			threeToTen: "{{count}} ثواني",
			other: "{{count}} ثانية"
		},
		halfAMinute: "نصف دقيقة",
		lessThanXMinutes: {
			one: "أقل من دقيقة",
			two: "أقل من دقيقتين",
			threeToTen: "أقل من {{count}} دقائق",
			other: "أقل من {{count}} دقيقة"
		},
		xMinutes: {
			one: "دقيقة واحدة",
			two: "دقيقتين",
			threeToTen: "{{count}} دقائق",
			other: "{{count}} دقيقة"
		},
		aboutXHours: {
			one: "ساعة واحدة تقريباً",
			two: "ساعتين تقريباً",
			threeToTen: "{{count}} ساعات تقريباً",
			other: "{{count}} ساعة تقريباً"
		},
		xHours: {
			one: "ساعة واحدة",
			two: "ساعتين",
			threeToTen: "{{count}} ساعات",
			other: "{{count}} ساعة"
		},
		xDays: {
			one: "يوم واحد",
			two: "يومين",
			threeToTen: "{{count}} أيام",
			other: "{{count}} يوم"
		},
		aboutXWeeks: {
			one: "أسبوع واحد تقريباً",
			two: "أسبوعين تقريباً",
			threeToTen: "{{count}} أسابيع تقريباً",
			other: "{{count}} أسبوع تقريباً"
		},
		xWeeks: {
			one: "أسبوع واحد",
			two: "أسبوعين",
			threeToTen: "{{count}} أسابيع",
			other: "{{count}} أسبوع"
		},
		aboutXMonths: {
			one: "شهر واحد تقريباً",
			two: "شهرين تقريباً",
			threeToTen: "{{count}} أشهر تقريباً",
			other: "{{count}} شهر تقريباً"
		},
		xMonths: {
			one: "شهر واحد",
			two: "شهرين",
			threeToTen: "{{count}} أشهر",
			other: "{{count}} شهر"
		},
		aboutXYears: {
			one: "عام واحد تقريباً",
			two: "عامين تقريباً",
			threeToTen: "{{count}} أعوام تقريباً",
			other: "{{count}} عام تقريباً"
		},
		xYears: {
			one: "عام واحد",
			two: "عامين",
			threeToTen: "{{count}} أعوام",
			other: "{{count}} عام"
		},
		overXYears: {
			one: "أكثر من عام",
			two: "أكثر من عامين",
			threeToTen: "أكثر من {{count}} أعوام",
			other: "أكثر من {{count}} عام"
		},
		almostXYears: {
			one: "عام واحد تقريباً",
			two: "عامين تقريباً",
			threeToTen: "{{count}} أعوام تقريباً",
			other: "{{count}} عام تقريباً"
		}
	};
	var formatDistance$78 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$77[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 2) result = tokenValue.two;
		else if (count <= 10) result = tokenValue.threeToTen.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "في خلال " + result;
		else return "منذ " + result;
		return result;
	};
	var formatLong$86 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'عند' {{time}}",
				long: "{{date}} 'عند' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-SA/_lib/formatRelative.js
	var formatRelativeLocale$78 = {
		lastWeek: "'أخر' eeee 'عند' p",
		yesterday: "'أمس عند' p",
		today: "'اليوم عند' p",
		tomorrow: "'غداً عند' p",
		nextWeek: "eeee 'عند' p",
		other: "P"
	};
	var formatRelative$78 = (token, _date, _baseDate, _options) => formatRelativeLocale$78[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-SA/_lib/localize.js
	var eraValues$78 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م.", "ب.م."],
		wide: ["قبل الميلاد", "بعد الميلاد"]
	};
	var quarterValues$78 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ر1",
			"ر2",
			"ر3",
			"ر4"
		],
		wide: [
			"الربع الأول",
			"الربع الثاني",
			"الربع الثالث",
			"الربع الرابع"
		]
	};
	var monthValues$78 = {
		narrow: [
			"ي",
			"ف",
			"م",
			"أ",
			"م",
			"ي",
			"ي",
			"أ",
			"س",
			"أ",
			"ن",
			"د"
		],
		abbreviated: [
			"ينا",
			"فبر",
			"مارس",
			"أبريل",
			"مايو",
			"يونـ",
			"يولـ",
			"أغسـ",
			"سبتـ",
			"أكتـ",
			"نوفـ",
			"ديسـ"
		],
		wide: [
			"يناير",
			"فبراير",
			"مارس",
			"أبريل",
			"مايو",
			"يونيو",
			"يوليو",
			"أغسطس",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		]
	};
	var dayValues$78 = {
		narrow: [
			"ح",
			"ن",
			"ث",
			"ر",
			"خ",
			"ج",
			"س"
		],
		short: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		abbreviated: [
			"أحد",
			"اثنـ",
			"ثلا",
			"أربـ",
			"خميـ",
			"جمعة",
			"سبت"
		],
		wide: [
			"الأحد",
			"الاثنين",
			"الثلاثاء",
			"الأربعاء",
			"الخميس",
			"الجمعة",
			"السبت"
		]
	};
	var dayPeriodValues$78 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظهر",
			evening: "مساءاً",
			night: "ليلاً"
		}
	};
	var formattingDayPeriodValues$62 = {
		narrow: {
			am: "ص",
			pm: "م",
			midnight: "ن",
			noon: "ظ",
			morning: "في الصباح",
			afternoon: "بعد الظـهر",
			evening: "في المساء",
			night: "في الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "في الصباح",
			afternoon: "بعد الظهر",
			evening: "في المساء",
			night: "في الليل"
		},
		wide: {
			am: "ص",
			pm: "م",
			midnight: "نصف الليل",
			noon: "ظهر",
			morning: "صباحاً",
			afternoon: "بعد الظـهر",
			evening: "في المساء",
			night: "في الليل"
		}
	};
	var ordinalNumber$78 = (dirtyNumber) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-SA.js
	/**
	* @category Locales
	* @summary Arabic locale (Sauid Arabic).
	* @language Arabic
	* @iso-639-2 ara
	* @author Dhaifallah Alwadani [@dalwadani](https://github.com/dalwadani)
	*/
	var arSA = {
		code: "ar-SA",
		formatDistance: formatDistance$78,
		formatLong: formatLong$86,
		formatRelative: formatRelative$78,
		localize: {
			ordinalNumber: ordinalNumber$78,
			era: buildLocalizeFn({
				values: eraValues$78,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$78,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$78,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$78,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$78,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$62,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ق|ب)/i,
					abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,
					wide: /^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^قبل/i, /^بعد/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ر[1234]/i,
					wide: /^الربع [1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[يفمأمسند]/i,
					abbreviated: /^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i,
					wide: /^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ي/i,
						/^ف/i,
						/^م/i,
						/^أ/i,
						/^م/i,
						/^ي/i,
						/^ي/i,
						/^أ/i,
						/^س/i,
						/^أ/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^ين/i,
						/^ف/i,
						/^مار/i,
						/^أب/i,
						/^ماي/i,
						/^يون/i,
						/^يول/i,
						/^أغ/i,
						/^س/i,
						/^أك/i,
						/^ن/i,
						/^د/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[حنثرخجس]/i,
					short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					abbreviated: /^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,
					wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ح/i,
						/^ن/i,
						/^ث/i,
						/^ر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					],
					wide: [
						/^الأحد/i,
						/^الاثنين/i,
						/^الثلاثاء/i,
						/^الأربعاء/i,
						/^الخميس/i,
						/^الجمعة/i,
						/^السبت/i
					],
					any: [
						/^أح/i,
						/^اث/i,
						/^ث/i,
						/^أر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
					any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mi/i,
					noon: /^no/i,
					morning: /morning/i,
					afternoon: /afternoon/i,
					evening: /evening/i,
					night: /night/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-TN/_lib/formatDistance.js
	var formatDistanceLocale$76 = {
		lessThanXSeconds: {
			one: "أقل من ثانية",
			two: "أقل من زوز ثواني",
			threeToTen: "أقل من {{count}} ثواني",
			other: "أقل من {{count}} ثانية"
		},
		xSeconds: {
			one: "ثانية",
			two: "زوز ثواني",
			threeToTen: "{{count}} ثواني",
			other: "{{count}} ثانية"
		},
		halfAMinute: "نص دقيقة",
		lessThanXMinutes: {
			one: "أقل من دقيقة",
			two: "أقل من دقيقتين",
			threeToTen: "أقل من {{count}} دقايق",
			other: "أقل من {{count}} دقيقة"
		},
		xMinutes: {
			one: "دقيقة",
			two: "دقيقتين",
			threeToTen: "{{count}} دقايق",
			other: "{{count}} دقيقة"
		},
		aboutXHours: {
			one: "ساعة تقريب",
			two: "ساعتين تقريب",
			threeToTen: "{{count}} سوايع تقريب",
			other: "{{count}} ساعة تقريب"
		},
		xHours: {
			one: "ساعة",
			two: "ساعتين",
			threeToTen: "{{count}} سوايع",
			other: "{{count}} ساعة"
		},
		xDays: {
			one: "نهار",
			two: "نهارين",
			threeToTen: "{{count}} أيام",
			other: "{{count}} يوم"
		},
		aboutXWeeks: {
			one: "جمعة تقريب",
			two: "جمعتين تقريب",
			threeToTen: "{{count}} جماع تقريب",
			other: "{{count}} جمعة تقريب"
		},
		xWeeks: {
			one: "جمعة",
			two: "جمعتين",
			threeToTen: "{{count}} جماع",
			other: "{{count}} جمعة"
		},
		aboutXMonths: {
			one: "شهر تقريب",
			two: "شهرين تقريب",
			threeToTen: "{{count}} أشهرة تقريب",
			other: "{{count}} شهر تقريب"
		},
		xMonths: {
			one: "شهر",
			two: "شهرين",
			threeToTen: "{{count}} أشهرة",
			other: "{{count}} شهر"
		},
		aboutXYears: {
			one: "عام تقريب",
			two: "عامين تقريب",
			threeToTen: "{{count}} أعوام تقريب",
			other: "{{count}} عام تقريب"
		},
		xYears: {
			one: "عام",
			two: "عامين",
			threeToTen: "{{count}} أعوام",
			other: "{{count}} عام"
		},
		overXYears: {
			one: "أكثر من عام",
			two: "أكثر من عامين",
			threeToTen: "أكثر من {{count}} أعوام",
			other: "أكثر من {{count}} عام"
		},
		almostXYears: {
			one: "عام تقريب",
			two: "عامين تقريب",
			threeToTen: "{{count}} أعوام تقريب",
			other: "{{count}} عام تقريب"
		}
	};
	var formatDistance$77 = (token, count, options) => {
		const usageGroup = formatDistanceLocale$76[token];
		let result;
		if (typeof usageGroup === "string") result = usageGroup;
		else if (count === 1) result = usageGroup.one;
		else if (count === 2) result = usageGroup.two;
		else if (count <= 10) result = usageGroup.threeToTen.replace("{{count}}", String(count));
		else result = usageGroup.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "في " + result;
		else return "عندو " + result;
		return result;
	};
	var formatLong$85 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE، do MMMM y",
				long: "do MMMM y",
				medium: "d MMM y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss",
				long: "HH:mm:ss",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'مع' {{time}}",
				long: "{{date}} 'مع' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-TN/_lib/formatRelative.js
	var formatRelativeLocale$77 = {
		lastWeek: "eeee 'إلي فات مع' p",
		yesterday: "'البارح مع' p",
		today: "'اليوم مع' p",
		tomorrow: "'غدوة مع' p",
		nextWeek: "eeee 'الجمعة الجاية مع' p 'نهار'",
		other: "P"
	};
	var formatRelative$77 = (token) => formatRelativeLocale$77[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-TN/_lib/localize.js
	var eraValues$77 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م.", "ب.م."],
		wide: ["قبل الميلاد", "بعد الميلاد"]
	};
	var quarterValues$77 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ر1",
			"ر2",
			"ر3",
			"ر4"
		],
		wide: [
			"الربع الأول",
			"الربع الثاني",
			"الربع الثالث",
			"الربع الرابع"
		]
	};
	var monthValues$77 = {
		narrow: [
			"د",
			"ن",
			"أ",
			"س",
			"أ",
			"ج",
			"ج",
			"م",
			"أ",
			"م",
			"ف",
			"ج"
		],
		abbreviated: [
			"جانفي",
			"فيفري",
			"مارس",
			"أفريل",
			"ماي",
			"جوان",
			"جويلية",
			"أوت",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		],
		wide: [
			"جانفي",
			"فيفري",
			"مارس",
			"أفريل",
			"ماي",
			"جوان",
			"جويلية",
			"أوت",
			"سبتمبر",
			"أكتوبر",
			"نوفمبر",
			"ديسمبر"
		]
	};
	var dayValues$77 = {
		narrow: [
			"ح",
			"ن",
			"ث",
			"ر",
			"خ",
			"ج",
			"س"
		],
		short: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		abbreviated: [
			"أحد",
			"اثنين",
			"ثلاثاء",
			"أربعاء",
			"خميس",
			"جمعة",
			"سبت"
		],
		wide: [
			"الأحد",
			"الاثنين",
			"الثلاثاء",
			"الأربعاء",
			"الخميس",
			"الجمعة",
			"السبت"
		]
	};
	var dayPeriodValues$77 = {
		narrow: {
			am: "ص",
			pm: "ع",
			morning: "الصباح",
			noon: "القايلة",
			afternoon: "بعد القايلة",
			evening: "العشية",
			night: "الليل",
			midnight: "نص الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "ع",
			morning: "الصباح",
			noon: "القايلة",
			afternoon: "بعد القايلة",
			evening: "العشية",
			night: "الليل",
			midnight: "نص الليل"
		},
		wide: {
			am: "ص",
			pm: "ع",
			morning: "الصباح",
			noon: "القايلة",
			afternoon: "بعد القايلة",
			evening: "العشية",
			night: "الليل",
			midnight: "نص الليل"
		}
	};
	var formattingDayPeriodValues$61 = {
		narrow: {
			am: "ص",
			pm: "ع",
			morning: "في الصباح",
			noon: "في القايلة",
			afternoon: "بعد القايلة",
			evening: "في العشية",
			night: "في الليل",
			midnight: "نص الليل"
		},
		abbreviated: {
			am: "ص",
			pm: "ع",
			morning: "في الصباح",
			noon: "في القايلة",
			afternoon: "بعد القايلة",
			evening: "في العشية",
			night: "في الليل",
			midnight: "نص الليل"
		},
		wide: {
			am: "ص",
			pm: "ع",
			morning: "في الصباح",
			noon: "في القايلة",
			afternoon: "بعد القايلة",
			evening: "في العشية",
			night: "في الليل",
			midnight: "نص الليل"
		}
	};
	var ordinalNumber$77 = (num) => String(num);
	//#endregion
	//#region ../../node_modules/date-fns/locale/ar-TN.js
	/**
	* @category Locales
	* @summary Arabic locale (Tunisian Arabic).
	* @language Arabic
	* @iso-639-2 ara
	* @author Koussay Haj Kacem [@essana3](https://github.com/essana3)
	*/
	var arTN = {
		code: "ar-TN",
		formatDistance: formatDistance$77,
		formatLong: formatLong$85,
		formatRelative: formatRelative$77,
		localize: {
			ordinalNumber: ordinalNumber$77,
			era: buildLocalizeFn({
				values: eraValues$77,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$77,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$77,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$77,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$77,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$61,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /[قب]/,
					abbreviated: /[قب]\.م\./,
					wide: /(قبل|بعد) الميلاد/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/قبل/, /بعد/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /ر[1234]/,
					wide: /الربع (الأول|الثاني|الثالث|الرابع)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[جفمأسند]/,
					abbreviated: /^(جانفي|فيفري|مارس|أفريل|ماي|جوان|جويلية|أوت|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
					wide: /^(جانفي|فيفري|مارس|أفريل|ماي|جوان|جويلية|أوت|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ج/i,
						/^ف/i,
						/^م/i,
						/^أ/i,
						/^م/i,
						/^ج/i,
						/^ج/i,
						/^أ/i,
						/^س/i,
						/^أ/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^جانفي/i,
						/^فيفري/i,
						/^مارس/i,
						/^أفريل/i,
						/^ماي/i,
						/^جوان/i,
						/^جويلية/i,
						/^أوت/i,
						/^سبتمبر/i,
						/^أكتوبر/i,
						/^نوفمبر/i,
						/^ديسمبر/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[حنثرخجس]/i,
					short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,
					wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ح/i,
						/^ن/i,
						/^ث/i,
						/^ر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					],
					wide: [
						/^الأحد/i,
						/^الاثنين/i,
						/^الثلاثاء/i,
						/^الأربعاء/i,
						/^الخميس/i,
						/^الجمعة/i,
						/^السبت/i
					],
					any: [
						/^أح/i,
						/^اث/i,
						/^ث/i,
						/^أر/i,
						/^خ/i,
						/^ج/i,
						/^س/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ص|ع|ن ل|ل|(في|مع) (صباح|قايلة|عشية|ليل))/,
					any: /^([صع]|نص الليل|قايلة|(في|مع) (صباح|قايلة|عشية|ليل))/
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ص/,
					pm: /^ع/,
					midnight: /نص الليل/,
					noon: /قايلة/,
					afternoon: /بعد القايلة/,
					morning: /صباح/,
					evening: /عشية/,
					night: /ليل/
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/az/_lib/formatDistance.js
	var formatDistanceLocale$75 = {
		lessThanXSeconds: {
			one: "bir saniyədən az",
			other: "{{count}} bir saniyədən az"
		},
		xSeconds: {
			one: "1 saniyə",
			other: "{{count}} saniyə"
		},
		halfAMinute: "yarım dəqiqə",
		lessThanXMinutes: {
			one: "bir dəqiqədən az",
			other: "{{count}} bir dəqiqədən az"
		},
		xMinutes: {
			one: "bir dəqiqə",
			other: "{{count}} dəqiqə"
		},
		aboutXHours: {
			one: "təxminən 1 saat",
			other: "təxminən {{count}} saat"
		},
		xHours: {
			one: "1 saat",
			other: "{{count}} saat"
		},
		xDays: {
			one: "1 gün",
			other: "{{count}} gün"
		},
		aboutXWeeks: {
			one: "təxminən 1 həftə",
			other: "təxminən {{count}} həftə"
		},
		xWeeks: {
			one: "1 həftə",
			other: "{{count}} həftə"
		},
		aboutXMonths: {
			one: "təxminən 1 ay",
			other: "təxminən {{count}} ay"
		},
		xMonths: {
			one: "1 ay",
			other: "{{count}} ay"
		},
		aboutXYears: {
			one: "təxminən 1 il",
			other: "təxminən {{count}} il"
		},
		xYears: {
			one: "1 il",
			other: "{{count}} il"
		},
		overXYears: {
			one: "1 ildən çox",
			other: "{{count}} ildən çox"
		},
		almostXYears: {
			one: "demək olar ki 1 il",
			other: "demək olar ki {{count}} il"
		}
	};
	var formatDistance$76 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$75[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " sonra";
		else return result + " əvvəl";
		return result;
	};
	var formatLong$84 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y 'il'",
				long: "do MMMM y 'il'",
				medium: "d MMM y 'il'",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}} - 'də'",
				long: "{{date}} {{time}} - 'də'",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/az/_lib/formatRelative.js
	var formatRelativeLocale$76 = {
		lastWeek: "'sonuncu' eeee p -'də'",
		yesterday: "'dünən' p -'də'",
		today: "'bugün' p -'də'",
		tomorrow: "'sabah' p -'də'",
		nextWeek: "eeee p -'də'",
		other: "P"
	};
	var formatRelative$76 = (token, _date, _baseDate, _options) => formatRelativeLocale$76[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/az/_lib/localize.js
	var eraValues$76 = {
		narrow: ["e.ə", "b.e"],
		abbreviated: ["e.ə", "b.e"],
		wide: ["eramızdan əvvəl", "bizim era"]
	};
	var quarterValues$76 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1ci kvartal",
			"2ci kvartal",
			"3cü kvartal",
			"4cü kvartal"
		]
	};
	var monthValues$76 = {
		narrow: [
			"Y",
			"F",
			"M",
			"A",
			"M",
			"İ",
			"İ",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Yan",
			"Fev",
			"Mar",
			"Apr",
			"May",
			"İyun",
			"İyul",
			"Avq",
			"Sen",
			"Okt",
			"Noy",
			"Dek"
		],
		wide: [
			"Yanvar",
			"Fevral",
			"Mart",
			"Aprel",
			"May",
			"İyun",
			"İyul",
			"Avqust",
			"Sentyabr",
			"Oktyabr",
			"Noyabr",
			"Dekabr"
		]
	};
	var dayValues$76 = {
		narrow: [
			"B.",
			"B.e",
			"Ç.a",
			"Ç.",
			"C.a",
			"C.",
			"Ş."
		],
		short: [
			"B.",
			"B.e",
			"Ç.a",
			"Ç.",
			"C.a",
			"C.",
			"Ş."
		],
		abbreviated: [
			"Baz",
			"Baz.e",
			"Çər.a",
			"Çər",
			"Cüm.a",
			"Cüm",
			"Şə"
		],
		wide: [
			"Bazar",
			"Bazar ertəsi",
			"Çərşənbə axşamı",
			"Çərşənbə",
			"Cümə axşamı",
			"Cümə",
			"Şənbə"
		]
	};
	var dayPeriodValues$76 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "gecəyarı",
			noon: "gün",
			morning: "səhər",
			afternoon: "gündüz",
			evening: "axşam",
			night: "gecə"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "gecəyarı",
			noon: "gün",
			morning: "səhər",
			afternoon: "gündüz",
			evening: "axşam",
			night: "gecə"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "gecəyarı",
			noon: "gün",
			morning: "səhər",
			afternoon: "gündüz",
			evening: "axşam",
			night: "gecə"
		}
	};
	var formattingDayPeriodValues$60 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "gecəyarı",
			noon: "gün",
			morning: "səhər",
			afternoon: "gündüz",
			evening: "axşam",
			night: "gecə"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "gecəyarı",
			noon: "gün",
			morning: "səhər",
			afternoon: "gündüz",
			evening: "axşam",
			night: "gecə"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "gecəyarı",
			noon: "gün",
			morning: "səhər",
			afternoon: "gündüz",
			evening: "axşam",
			night: "gecə"
		}
	};
	var suffixes$1 = {
		1: "-inci",
		5: "-inci",
		8: "-inci",
		70: "-inci",
		80: "-inci",
		2: "-nci",
		7: "-nci",
		20: "-nci",
		50: "-nci",
		3: "-üncü",
		4: "-üncü",
		100: "-üncü",
		6: "-ncı",
		9: "-uncu",
		10: "-uncu",
		30: "-uncu",
		60: "-ıncı",
		90: "-ıncı"
	};
	var getSuffix = (number) => {
		if (number === 0) return number + "-ıncı";
		const a = number % 10;
		const b = number % 100 - a;
		const c = number >= 100 ? 100 : null;
		if (suffixes$1[a]) return suffixes$1[a];
		else if (suffixes$1[b]) return suffixes$1[b];
		else if (c !== null) return suffixes$1[c];
		return "";
	};
	var ordinalNumber$76 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		return number + getSuffix(number);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/az.js
	/**
	* @category Locales
	* @summary Azerbaijani locale.
	* @language Azerbaijani
	* @iso-639-2 aze
	*/
	var az = {
		code: "az",
		formatDistance: formatDistance$76,
		formatLong: formatLong$84,
		formatRelative: formatRelative$76,
		localize: {
			ordinalNumber: ordinalNumber$76,
			era: buildLocalizeFn({
				values: eraValues$76,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$76,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$76,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$76,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$76,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$60,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?(ci|inci|nci|uncu|üncü|ncı))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(b|a)$/i,
					abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)$/i,
					wide: /^(bizim eradan əvvəl|bizim era)$/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^b$/i, /^(a|c)$/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]$/i,
					abbreviated: /^K[1234]$/i,
					wide: /^[1234](ci)? kvartal$/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[(?-i)yfmaisond]$/i,
					abbreviated: /^(Yan|Fev|Mar|Apr|May|İyun|İyul|Avq|Sen|Okt|Noy|Dek)$/i,
					wide: /^(Yanvar|Fevral|Mart|Aprel|May|İyun|İyul|Avgust|Sentyabr|Oktyabr|Noyabr|Dekabr)$/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^[(?-i)y]$/i,
						/^[(?-i)f]$/i,
						/^[(?-i)m]$/i,
						/^[(?-i)a]$/i,
						/^[(?-i)m]$/i,
						/^[(?-i)i]$/i,
						/^[(?-i)i]$/i,
						/^[(?-i)a]$/i,
						/^[(?-i)s]$/i,
						/^[(?-i)o]$/i,
						/^[(?-i)n]$/i,
						/^[(?-i)d]$/i
					],
					abbreviated: [
						/^Yan$/i,
						/^Fev$/i,
						/^Mar$/i,
						/^Apr$/i,
						/^May$/i,
						/^İyun$/i,
						/^İyul$/i,
						/^Avg$/i,
						/^Sen$/i,
						/^Okt$/i,
						/^Noy$/i,
						/^Dek$/i
					],
					wide: [
						/^Yanvar$/i,
						/^Fevral$/i,
						/^Mart$/i,
						/^Aprel$/i,
						/^May$/i,
						/^İyun$/i,
						/^İyul$/i,
						/^Avgust$/i,
						/^Sentyabr$/i,
						/^Oktyabr$/i,
						/^Noyabr$/i,
						/^Dekabr$/i
					]
				},
				defaultParseWidth: "narrow"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
					short: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
					abbreviated: /^(Baz\.e|Çər|Çər\.a|Cüm|Cüm\.a|Şə)$/i,
					wide: /^(Bazar|Bazar ertəsi|Çərşənbə axşamı|Çərşənbə|Cümə axşamı|Cümə|Şənbə)$/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^B\.$/i,
						/^B\.e$/i,
						/^Ç\.a$/i,
						/^Ç\.$/i,
						/^C\.a$/i,
						/^C\.$/i,
						/^Ş\.$/i
					],
					abbreviated: [
						/^Baz$/i,
						/^Baz\.e$/i,
						/^Çər\.a$/i,
						/^Çər$/i,
						/^Cüm\.a$/i,
						/^Cüm$/i,
						/^Şə$/i
					],
					wide: [
						/^Bazar$/i,
						/^Bazar ertəsi$/i,
						/^Çərşənbə axşamı$/i,
						/^Çərşənbə$/i,
						/^Cümə axşamı$/i,
						/^Cümə$/i,
						/^Şənbə$/i
					],
					any: [
						/^B\.$/i,
						/^B\.e$/i,
						/^Ç\.a$/i,
						/^Ç\.$/i,
						/^C\.a$/i,
						/^C\.$/i,
						/^Ş\.$/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i,
					any: /^(am|pm|a\.m\.|p\.m\.|AM|PM|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a$/i,
					pm: /^p$/i,
					midnight: /^gecəyarı$/i,
					noon: /^gün$/i,
					morning: /səhər$/i,
					afternoon: /gündüz$/i,
					evening: /axşam$/i,
					night: /gecə$/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be/_lib/formatDistance.js
	function declension$6(scheme, count) {
		if (scheme.one !== void 0 && count === 1) return scheme.one;
		const rem10 = count % 10;
		const rem100 = count % 100;
		if (rem10 === 1 && rem100 !== 11) return scheme.singularNominative.replace("{{count}}", String(count));
		else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) return scheme.singularGenitive.replace("{{count}}", String(count));
		else return scheme.pluralGenitive.replace("{{count}}", String(count));
	}
	function buildLocalizeTokenFn$4(scheme) {
		return (count, options) => {
			if (options && options.addSuffix) if (options.comparison && options.comparison > 0) if (scheme.future) return declension$6(scheme.future, count);
			else return "праз " + declension$6(scheme.regular, count);
			else if (scheme.past) return declension$6(scheme.past, count);
			else return declension$6(scheme.regular, count) + " таму";
			else return declension$6(scheme.regular, count);
		};
	}
	var halfAMinute$1 = (_, options) => {
		if (options && options.addSuffix) if (options.comparison && options.comparison > 0) return "праз паўхвіліны";
		else return "паўхвіліны таму";
		return "паўхвіліны";
	};
	var formatDistanceLocale$74 = {
		lessThanXSeconds: buildLocalizeTokenFn$4({
			regular: {
				one: "менш за секунду",
				singularNominative: "менш за {{count}} секунду",
				singularGenitive: "менш за {{count}} секунды",
				pluralGenitive: "менш за {{count}} секунд"
			},
			future: {
				one: "менш, чым праз секунду",
				singularNominative: "менш, чым праз {{count}} секунду",
				singularGenitive: "менш, чым праз {{count}} секунды",
				pluralGenitive: "менш, чым праз {{count}} секунд"
			}
		}),
		xSeconds: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "{{count}} секунда",
				singularGenitive: "{{count}} секунды",
				pluralGenitive: "{{count}} секунд"
			},
			past: {
				singularNominative: "{{count}} секунду таму",
				singularGenitive: "{{count}} секунды таму",
				pluralGenitive: "{{count}} секунд таму"
			},
			future: {
				singularNominative: "праз {{count}} секунду",
				singularGenitive: "праз {{count}} секунды",
				pluralGenitive: "праз {{count}} секунд"
			}
		}),
		halfAMinute: halfAMinute$1,
		lessThanXMinutes: buildLocalizeTokenFn$4({
			regular: {
				one: "менш за хвіліну",
				singularNominative: "менш за {{count}} хвіліну",
				singularGenitive: "менш за {{count}} хвіліны",
				pluralGenitive: "менш за {{count}} хвілін"
			},
			future: {
				one: "менш, чым праз хвіліну",
				singularNominative: "менш, чым праз {{count}} хвіліну",
				singularGenitive: "менш, чым праз {{count}} хвіліны",
				pluralGenitive: "менш, чым праз {{count}} хвілін"
			}
		}),
		xMinutes: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "{{count}} хвіліна",
				singularGenitive: "{{count}} хвіліны",
				pluralGenitive: "{{count}} хвілін"
			},
			past: {
				singularNominative: "{{count}} хвіліну таму",
				singularGenitive: "{{count}} хвіліны таму",
				pluralGenitive: "{{count}} хвілін таму"
			},
			future: {
				singularNominative: "праз {{count}} хвіліну",
				singularGenitive: "праз {{count}} хвіліны",
				pluralGenitive: "праз {{count}} хвілін"
			}
		}),
		aboutXHours: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "каля {{count}} гадзіны",
				singularGenitive: "каля {{count}} гадзін",
				pluralGenitive: "каля {{count}} гадзін"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} гадзіну",
				singularGenitive: "прыблізна праз {{count}} гадзіны",
				pluralGenitive: "прыблізна праз {{count}} гадзін"
			}
		}),
		xHours: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "{{count}} гадзіна",
				singularGenitive: "{{count}} гадзіны",
				pluralGenitive: "{{count}} гадзін"
			},
			past: {
				singularNominative: "{{count}} гадзіну таму",
				singularGenitive: "{{count}} гадзіны таму",
				pluralGenitive: "{{count}} гадзін таму"
			},
			future: {
				singularNominative: "праз {{count}} гадзіну",
				singularGenitive: "праз {{count}} гадзіны",
				pluralGenitive: "праз {{count}} гадзін"
			}
		}),
		xDays: buildLocalizeTokenFn$4({ regular: {
			singularNominative: "{{count}} дзень",
			singularGenitive: "{{count}} дні",
			pluralGenitive: "{{count}} дзён"
		} }),
		aboutXWeeks: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "каля {{count}} тыдні",
				singularGenitive: "каля {{count}} тыдняў",
				pluralGenitive: "каля {{count}} тыдняў"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} тыдзень",
				singularGenitive: "прыблізна праз {{count}} тыдні",
				pluralGenitive: "прыблізна праз {{count}} тыдняў"
			}
		}),
		xWeeks: buildLocalizeTokenFn$4({ regular: {
			singularNominative: "{{count}} тыдзень",
			singularGenitive: "{{count}} тыдні",
			pluralGenitive: "{{count}} тыдняў"
		} }),
		aboutXMonths: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "каля {{count}} месяца",
				singularGenitive: "каля {{count}} месяцаў",
				pluralGenitive: "каля {{count}} месяцаў"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} месяц",
				singularGenitive: "прыблізна праз {{count}} месяцы",
				pluralGenitive: "прыблізна праз {{count}} месяцаў"
			}
		}),
		xMonths: buildLocalizeTokenFn$4({ regular: {
			singularNominative: "{{count}} месяц",
			singularGenitive: "{{count}} месяцы",
			pluralGenitive: "{{count}} месяцаў"
		} }),
		aboutXYears: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "каля {{count}} года",
				singularGenitive: "каля {{count}} гадоў",
				pluralGenitive: "каля {{count}} гадоў"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} год",
				singularGenitive: "прыблізна праз {{count}} гады",
				pluralGenitive: "прыблізна праз {{count}} гадоў"
			}
		}),
		xYears: buildLocalizeTokenFn$4({ regular: {
			singularNominative: "{{count}} год",
			singularGenitive: "{{count}} гады",
			pluralGenitive: "{{count}} гадоў"
		} }),
		overXYears: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "больш за {{count}} год",
				singularGenitive: "больш за {{count}} гады",
				pluralGenitive: "больш за {{count}} гадоў"
			},
			future: {
				singularNominative: "больш, чым праз {{count}} год",
				singularGenitive: "больш, чым праз {{count}} гады",
				pluralGenitive: "больш, чым праз {{count}} гадоў"
			}
		}),
		almostXYears: buildLocalizeTokenFn$4({
			regular: {
				singularNominative: "амаль {{count}} год",
				singularGenitive: "амаль {{count}} гады",
				pluralGenitive: "амаль {{count}} гадоў"
			},
			future: {
				singularNominative: "амаль праз {{count}} год",
				singularGenitive: "амаль праз {{count}} гады",
				pluralGenitive: "амаль праз {{count}} гадоў"
			}
		})
	};
	var formatDistance$75 = (token, count, options) => {
		options = options || {};
		return formatDistanceLocale$74[token](count, options);
	};
	var formatLong$83 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM y 'г.'",
				long: "d MMMM y 'г.'",
				medium: "d MMM y 'г.'",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}}, {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be/_lib/formatRelative.js
	var accusativeWeekdays$7 = [
		"нядзелю",
		"панядзелак",
		"аўторак",
		"сераду",
		"чацвер",
		"пятніцу",
		"суботу"
	];
	function lastWeek$8(day) {
		const weekday = accusativeWeekdays$7[day];
		switch (day) {
			case 0:
			case 3:
			case 5:
			case 6: return "'у мінулую " + weekday + " а' p";
			case 1:
			case 2:
			case 4: return "'у мінулы " + weekday + " а' p";
		}
	}
	function thisWeek$8(day) {
		return "'у " + accusativeWeekdays$7[day] + " а' p";
	}
	function nextWeek$8(day) {
		const weekday = accusativeWeekdays$7[day];
		switch (day) {
			case 0:
			case 3:
			case 5:
			case 6: return "'у наступную " + weekday + " а' p";
			case 1:
			case 2:
			case 4: return "'у наступны " + weekday + " а' p";
		}
	}
	var lastWeekFormat$2 = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek$8(day);
		else return lastWeek$8(day);
	};
	var nextWeekFormat$2 = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek$8(day);
		else return nextWeek$8(day);
	};
	var formatRelativeLocale$75 = {
		lastWeek: lastWeekFormat$2,
		yesterday: "'учора а' p",
		today: "'сёння а' p",
		tomorrow: "'заўтра а' p",
		nextWeek: nextWeekFormat$2,
		other: "P"
	};
	var formatRelative$75 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$75[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be/_lib/localize.js
	var eraValues$75 = {
		narrow: ["да н.э.", "н.э."],
		abbreviated: ["да н. э.", "н. э."],
		wide: ["да нашай эры", "нашай эры"]
	};
	var quarterValues$75 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-ы кв.",
			"2-і кв.",
			"3-і кв.",
			"4-ы кв."
		],
		wide: [
			"1-ы квартал",
			"2-і квартал",
			"3-і квартал",
			"4-ы квартал"
		]
	};
	var monthValues$75 = {
		narrow: [
			"С",
			"Л",
			"С",
			"К",
			"М",
			"Ч",
			"Л",
			"Ж",
			"В",
			"К",
			"Л",
			"С"
		],
		abbreviated: [
			"студз.",
			"лют.",
			"сак.",
			"крас.",
			"май",
			"чэрв.",
			"ліп.",
			"жн.",
			"вер.",
			"кастр.",
			"ліст.",
			"снеж."
		],
		wide: [
			"студзень",
			"люты",
			"сакавік",
			"красавік",
			"май",
			"чэрвень",
			"ліпень",
			"жнівень",
			"верасень",
			"кастрычнік",
			"лістапад",
			"снежань"
		]
	};
	var formattingMonthValues$18 = {
		narrow: [
			"С",
			"Л",
			"С",
			"К",
			"М",
			"Ч",
			"Л",
			"Ж",
			"В",
			"К",
			"Л",
			"С"
		],
		abbreviated: [
			"студз.",
			"лют.",
			"сак.",
			"крас.",
			"мая",
			"чэрв.",
			"ліп.",
			"жн.",
			"вер.",
			"кастр.",
			"ліст.",
			"снеж."
		],
		wide: [
			"студзеня",
			"лютага",
			"сакавіка",
			"красавіка",
			"мая",
			"чэрвеня",
			"ліпеня",
			"жніўня",
			"верасня",
			"кастрычніка",
			"лістапада",
			"снежня"
		]
	};
	var dayValues$75 = {
		narrow: [
			"Н",
			"П",
			"А",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"нд",
			"пн",
			"аў",
			"ср",
			"чц",
			"пт",
			"сб"
		],
		abbreviated: [
			"нядз",
			"пан",
			"аўт",
			"сер",
			"чац",
			"пят",
			"суб"
		],
		wide: [
			"нядзеля",
			"панядзелак",
			"аўторак",
			"серада",
			"чацвер",
			"пятніца",
			"субота"
		]
	};
	var dayPeriodValues$75 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дзень",
			evening: "веч.",
			night: "ноч"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дзень",
			evening: "веч.",
			night: "ноч"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўнач",
			noon: "поўдзень",
			morning: "раніца",
			afternoon: "дзень",
			evening: "вечар",
			night: "ноч"
		}
	};
	var formattingDayPeriodValues$59 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дня",
			evening: "веч.",
			night: "ночы"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дня",
			evening: "веч.",
			night: "ночы"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўнач",
			noon: "поўдзень",
			morning: "раніцы",
			afternoon: "дня",
			evening: "вечара",
			night: "ночы"
		}
	};
	var ordinalNumber$75 = (dirtyNumber, options) => {
		const unit = String(options?.unit);
		const number = Number(dirtyNumber);
		let suffix;
		/** Though it's an incorrect ordinal form of a date we use it here for consistency with other similar locales (ru, uk)
		*  For date-month combinations should be used `d` formatter.
		*  Correct:   `d MMMM` (4 верасня)
		*  Incorrect: `do MMMM` (4-га верасня)
		*
		*  But following the consistency leads to mistakes for literal uses of `do` formatter (ordinal day of month).
		*  So for phrase "5th day of month" (`do дзень месяца`)
		*  library will produce:            `5-га дзень месяца`
		*  but correct spelling should be:  `5-ы дзень месяца`
		*
		*  So I guess there should be a stand-alone and a formatting version of "day of month" formatters
		*/
		if (unit === "date") suffix = "-га";
		else if (unit === "hour" || unit === "minute" || unit === "second") suffix = "-я";
		else suffix = (number % 10 === 2 || number % 10 === 3) && number % 100 !== 12 && number % 100 !== 13 ? "-і" : "-ы";
		return number + suffix;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be.js
	/**
	* @category Locales
	* @summary Belarusian locale.
	* @language Belarusian
	* @iso-639-2 bel
	* @author Kiryl Anokhin [@alyrik](https://github.com/alyrik)
	* @author Martin Wind [@arvigeus](https://github.com/mawi12345)
	*/
	var be = {
		code: "be",
		formatDistance: formatDistance$75,
		formatLong: formatLong$83,
		formatRelative: formatRelative$75,
		localize: {
			ordinalNumber: ordinalNumber$75,
			era: buildLocalizeFn({
				values: eraValues$75,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$75,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$75,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$18,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$75,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$75,
				defaultWidth: "any",
				formattingValues: formattingDayPeriodValues$59,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((да )?н\.?\s?э\.?)/i,
					abbreviated: /^((да )?н\.?\s?э\.?)/i,
					wide: /^(да нашай эры|нашай эры|наша эра)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^д/i, /^н/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?[ыі]?)? кв.?/i,
					wide: /^[1234](-?[ыі]?)? квартал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[слкмчжв]/i,
					abbreviated: /^(студз|лют|сак|крас|ма[йя]|чэрв|ліп|жн|вер|кастр|ліст|снеж)\.?/i,
					wide: /^(студзен[ья]|лют(ы|ага)|сакавіка?|красавіка?|ма[йя]|чэрвен[ья]|ліпен[ья]|жні(вень|ўня)|верас(ень|ня)|кастрычніка?|лістапада?|снеж(ань|ня))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^с/i,
						/^л/i,
						/^с/i,
						/^к/i,
						/^м/i,
						/^ч/i,
						/^л/i,
						/^ж/i,
						/^в/i,
						/^к/i,
						/^л/i,
						/^с/i
					],
					any: [
						/^ст/i,
						/^лю/i,
						/^са/i,
						/^кр/i,
						/^ма/i,
						/^ч/i,
						/^ліп/i,
						/^ж/i,
						/^в/i,
						/^ка/i,
						/^ліс/i,
						/^сн/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[нпасч]/i,
					short: /^(нд|ня|пн|па|аў|ат|ср|се|чц|ча|пт|пя|сб|су)\.?/i,
					abbreviated: /^(нядз?|ндз|пнд|пан|аўт|срд|сер|чцв|чац|птн|пят|суб).?/i,
					wide: /^(нядзел[яі]|панядзел(ак|ка)|аўтор(ак|ка)|серад[аы]|чацв(ер|ярга)|пятніц[аы]|субот[аы])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^н/i,
						/^п/i,
						/^а/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i
					],
					any: [
						/^н/i,
						/^п[ан]/i,
						/^а/i,
						/^с[ер]/i,
						/^ч/i,
						/^п[ят]/i,
						/^с[уб]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
					abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
					wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^дп/i,
					pm: /^пп/i,
					midnight: /^поўн/i,
					noon: /^поўд/i,
					morning: /^р/i,
					afternoon: /^д[зн]/i,
					evening: /^в/i,
					night: /^н/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be-tarask/_lib/formatDistance.js
	function declension$5(scheme, count) {
		if (scheme.one !== void 0 && count === 1) return scheme.one;
		const rem10 = count % 10;
		const rem100 = count % 100;
		if (rem10 === 1 && rem100 !== 11) return scheme.singularNominative.replace("{{count}}", String(count));
		else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) return scheme.singularGenitive.replace("{{count}}", String(count));
		else return scheme.pluralGenitive.replace("{{count}}", String(count));
	}
	function buildLocalizeTokenFn$3(scheme) {
		return (count, options) => {
			if (options && options.addSuffix) if (options.comparison && options.comparison > 0) if (scheme.future) return declension$5(scheme.future, count);
			else return "праз " + declension$5(scheme.regular, count);
			else if (scheme.past) return declension$5(scheme.past, count);
			else return declension$5(scheme.regular, count) + " таму";
			else return declension$5(scheme.regular, count);
		};
	}
	var halfAMinute = (_, options) => {
		if (options && options.addSuffix) if (options.comparison && options.comparison > 0) return "праз паўхвіліны";
		else return "паўхвіліны таму";
		return "паўхвіліны";
	};
	var formatDistanceLocale$73 = {
		lessThanXSeconds: buildLocalizeTokenFn$3({
			regular: {
				one: "менш за секунду",
				singularNominative: "менш за {{count}} секунду",
				singularGenitive: "менш за {{count}} секунды",
				pluralGenitive: "менш за {{count}} секунд"
			},
			future: {
				one: "менш, чым праз секунду",
				singularNominative: "менш, чым праз {{count}} секунду",
				singularGenitive: "менш, чым праз {{count}} секунды",
				pluralGenitive: "менш, чым праз {{count}} секунд"
			}
		}),
		xSeconds: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "{{count}} секунда",
				singularGenitive: "{{count}} секунды",
				pluralGenitive: "{{count}} секунд"
			},
			past: {
				singularNominative: "{{count}} секунду таму",
				singularGenitive: "{{count}} секунды таму",
				pluralGenitive: "{{count}} секунд таму"
			},
			future: {
				singularNominative: "праз {{count}} секунду",
				singularGenitive: "праз {{count}} секунды",
				pluralGenitive: "праз {{count}} секунд"
			}
		}),
		halfAMinute,
		lessThanXMinutes: buildLocalizeTokenFn$3({
			regular: {
				one: "менш за хвіліну",
				singularNominative: "менш за {{count}} хвіліну",
				singularGenitive: "менш за {{count}} хвіліны",
				pluralGenitive: "менш за {{count}} хвілін"
			},
			future: {
				one: "менш, чым праз хвіліну",
				singularNominative: "менш, чым праз {{count}} хвіліну",
				singularGenitive: "менш, чым праз {{count}} хвіліны",
				pluralGenitive: "менш, чым праз {{count}} хвілін"
			}
		}),
		xMinutes: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "{{count}} хвіліна",
				singularGenitive: "{{count}} хвіліны",
				pluralGenitive: "{{count}} хвілін"
			},
			past: {
				singularNominative: "{{count}} хвіліну таму",
				singularGenitive: "{{count}} хвіліны таму",
				pluralGenitive: "{{count}} хвілін таму"
			},
			future: {
				singularNominative: "праз {{count}} хвіліну",
				singularGenitive: "праз {{count}} хвіліны",
				pluralGenitive: "праз {{count}} хвілін"
			}
		}),
		aboutXHours: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "каля {{count}} гадзіны",
				singularGenitive: "каля {{count}} гадзін",
				pluralGenitive: "каля {{count}} гадзін"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} гадзіну",
				singularGenitive: "прыблізна праз {{count}} гадзіны",
				pluralGenitive: "прыблізна праз {{count}} гадзін"
			}
		}),
		xHours: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "{{count}} гадзіна",
				singularGenitive: "{{count}} гадзіны",
				pluralGenitive: "{{count}} гадзін"
			},
			past: {
				singularNominative: "{{count}} гадзіну таму",
				singularGenitive: "{{count}} гадзіны таму",
				pluralGenitive: "{{count}} гадзін таму"
			},
			future: {
				singularNominative: "праз {{count}} гадзіну",
				singularGenitive: "праз {{count}} гадзіны",
				pluralGenitive: "праз {{count}} гадзін"
			}
		}),
		xDays: buildLocalizeTokenFn$3({ regular: {
			singularNominative: "{{count}} дзень",
			singularGenitive: "{{count}} дні",
			pluralGenitive: "{{count}} дзён"
		} }),
		aboutXWeeks: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "каля {{count}} тыдні",
				singularGenitive: "каля {{count}} тыдняў",
				pluralGenitive: "каля {{count}} тыдняў"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} тыдзень",
				singularGenitive: "прыблізна праз {{count}} тыдні",
				pluralGenitive: "прыблізна праз {{count}} тыдняў"
			}
		}),
		xWeeks: buildLocalizeTokenFn$3({ regular: {
			singularNominative: "{{count}} тыдзень",
			singularGenitive: "{{count}} тыдні",
			pluralGenitive: "{{count}} тыдняў"
		} }),
		aboutXMonths: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "каля {{count}} месяца",
				singularGenitive: "каля {{count}} месяцаў",
				pluralGenitive: "каля {{count}} месяцаў"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} месяц",
				singularGenitive: "прыблізна праз {{count}} месяцы",
				pluralGenitive: "прыблізна праз {{count}} месяцаў"
			}
		}),
		xMonths: buildLocalizeTokenFn$3({ regular: {
			singularNominative: "{{count}} месяц",
			singularGenitive: "{{count}} месяцы",
			pluralGenitive: "{{count}} месяцаў"
		} }),
		aboutXYears: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "каля {{count}} года",
				singularGenitive: "каля {{count}} гадоў",
				pluralGenitive: "каля {{count}} гадоў"
			},
			future: {
				singularNominative: "прыблізна праз {{count}} год",
				singularGenitive: "прыблізна праз {{count}} гады",
				pluralGenitive: "прыблізна праз {{count}} гадоў"
			}
		}),
		xYears: buildLocalizeTokenFn$3({ regular: {
			singularNominative: "{{count}} год",
			singularGenitive: "{{count}} гады",
			pluralGenitive: "{{count}} гадоў"
		} }),
		overXYears: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "больш за {{count}} год",
				singularGenitive: "больш за {{count}} гады",
				pluralGenitive: "больш за {{count}} гадоў"
			},
			future: {
				singularNominative: "больш, чым праз {{count}} год",
				singularGenitive: "больш, чым праз {{count}} гады",
				pluralGenitive: "больш, чым праз {{count}} гадоў"
			}
		}),
		almostXYears: buildLocalizeTokenFn$3({
			regular: {
				singularNominative: "амаль {{count}} год",
				singularGenitive: "амаль {{count}} гады",
				pluralGenitive: "амаль {{count}} гадоў"
			},
			future: {
				singularNominative: "амаль праз {{count}} год",
				singularGenitive: "амаль праз {{count}} гады",
				pluralGenitive: "амаль праз {{count}} гадоў"
			}
		})
	};
	var formatDistance$74 = (token, count, options) => {
		options = options || {};
		return formatDistanceLocale$73[token](count, options);
	};
	var formatLong$82 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM y 'г.'",
				long: "d MMMM y 'г.'",
				medium: "d MMM y 'г.'",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}}, {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be-tarask/_lib/formatRelative.js
	var accusativeWeekdays$6 = [
		"нядзелю",
		"панядзелак",
		"аўторак",
		"сераду",
		"чацьвер",
		"пятніцу",
		"суботу"
	];
	function lastWeek$7(day) {
		const weekday = accusativeWeekdays$6[day];
		switch (day) {
			case 0:
			case 3:
			case 5:
			case 6: return "'у мінулую " + weekday + " а' p";
			case 1:
			case 2:
			case 4: return "'у мінулы " + weekday + " а' p";
		}
	}
	function thisWeek$7(day) {
		return "'у " + accusativeWeekdays$6[day] + " а' p";
	}
	function nextWeek$7(day) {
		const weekday = accusativeWeekdays$6[day];
		switch (day) {
			case 0:
			case 3:
			case 5:
			case 6: return "'у наступную " + weekday + " а' p";
			case 1:
			case 2:
			case 4: return "'у наступны " + weekday + " а' p";
		}
	}
	var lastWeekFormat$1 = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek$7(day);
		else return lastWeek$7(day);
	};
	var nextWeekFormat$1 = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek$7(day);
		else return nextWeek$7(day);
	};
	var formatRelativeLocale$74 = {
		lastWeek: lastWeekFormat$1,
		yesterday: "'учора а' p",
		today: "'сёньня а' p",
		tomorrow: "'заўтра а' p",
		nextWeek: nextWeekFormat$1,
		other: "P"
	};
	var formatRelative$74 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$74[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be-tarask/_lib/localize.js
	var eraValues$74 = {
		narrow: ["да н.э.", "н.э."],
		abbreviated: ["да н. э.", "н. э."],
		wide: ["да нашай эры", "нашай эры"]
	};
	var quarterValues$74 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-ы кв.",
			"2-і кв.",
			"3-і кв.",
			"4-ы кв."
		],
		wide: [
			"1-ы квартал",
			"2-і квартал",
			"3-і квартал",
			"4-ы квартал"
		]
	};
	var monthValues$74 = {
		narrow: [
			"С",
			"Л",
			"С",
			"К",
			"Т",
			"Ч",
			"Л",
			"Ж",
			"В",
			"К",
			"Л",
			"С"
		],
		abbreviated: [
			"студз.",
			"лют.",
			"сак.",
			"крас.",
			"трав.",
			"чэрв.",
			"ліп.",
			"жн.",
			"вер.",
			"кастр.",
			"ліст.",
			"сьнеж."
		],
		wide: [
			"студзень",
			"люты",
			"сакавік",
			"красавік",
			"травень",
			"чэрвень",
			"ліпень",
			"жнівень",
			"верасень",
			"кастрычнік",
			"лістапад",
			"сьнежань"
		]
	};
	var formattingMonthValues$17 = {
		narrow: [
			"С",
			"Л",
			"С",
			"К",
			"Т",
			"Ч",
			"Л",
			"Ж",
			"В",
			"К",
			"Л",
			"С"
		],
		abbreviated: [
			"студз.",
			"лют.",
			"сак.",
			"крас.",
			"трав.",
			"чэрв.",
			"ліп.",
			"жн.",
			"вер.",
			"кастр.",
			"ліст.",
			"сьнеж."
		],
		wide: [
			"студзеня",
			"лютага",
			"сакавіка",
			"красавіка",
			"траўня",
			"чэрвеня",
			"ліпеня",
			"жніўня",
			"верасня",
			"кастрычніка",
			"лістапада",
			"сьнежня"
		]
	};
	var dayValues$74 = {
		narrow: [
			"Н",
			"П",
			"А",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"нд",
			"пн",
			"аў",
			"ср",
			"чц",
			"пт",
			"сб"
		],
		abbreviated: [
			"нядз",
			"пан",
			"аўт",
			"сер",
			"чаць",
			"пят",
			"суб"
		],
		wide: [
			"нядзеля",
			"панядзелак",
			"аўторак",
			"серада",
			"чацьвер",
			"пятніца",
			"субота"
		]
	};
	var dayPeriodValues$74 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дзень",
			evening: "веч.",
			night: "ноч"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дзень",
			evening: "веч.",
			night: "ноч"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўнач",
			noon: "поўдзень",
			morning: "раніца",
			afternoon: "дзень",
			evening: "вечар",
			night: "ноч"
		}
	};
	var formattingDayPeriodValues$58 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дня",
			evening: "веч.",
			night: "ночы"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўн.",
			noon: "поўд.",
			morning: "ран.",
			afternoon: "дня",
			evening: "веч.",
			night: "ночы"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "поўнач",
			noon: "поўдзень",
			morning: "раніцы",
			afternoon: "дня",
			evening: "вечара",
			night: "ночы"
		}
	};
	var ordinalNumber$74 = (dirtyNumber, options) => {
		const unit = String(options?.unit);
		const number = Number(dirtyNumber);
		let suffix;
		/** Though it's an incorrect ordinal form of a date we use it here for consistency with other similar locales (ru, uk)
		*  For date-month combinations should be used `d` formatter.
		*  Correct:   `d MMMM` (4 верасня)
		*  Incorrect: `do MMMM` (4-га верасня)
		*
		*  But following the consistency leads to mistakes for literal uses of `do` formatter (ordinal day of month).
		*  So for phrase "5th day of month" (`do дзень месяца`)
		*  library will produce:            `5-га дзень месяца`
		*  but correct spelling should be:  `5-ы дзень месяца`
		*
		*  So I guess there should be a stand-alone and a formatting version of "day of month" formatters
		*/
		if (unit === "date") suffix = "-га";
		else if (unit === "hour" || unit === "minute" || unit === "second") suffix = "-я";
		else suffix = (number % 10 === 2 || number % 10 === 3) && number % 100 !== 12 && number % 100 !== 13 ? "-і" : "-ы";
		return number + suffix;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/be-tarask.js
	/**
	* @category Locales
	* @summary Belarusian Classic locale.
	* @language Belarusian Classic
	* @iso-639-2 bel
	* @author Ryhor Nopears [@nopears](https://github.com/nopears)
	*/
	var beTarask = {
		code: "be-tarask",
		formatDistance: formatDistance$74,
		formatLong: formatLong$82,
		formatRelative: formatRelative$74,
		localize: {
			ordinalNumber: ordinalNumber$74,
			era: buildLocalizeFn({
				values: eraValues$74,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$74,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$74,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$17,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$74,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$74,
				defaultWidth: "any",
				formattingValues: formattingDayPeriodValues$58,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((да )?н\.?\s?э\.?)/i,
					abbreviated: /^((да )?н\.?\s?э\.?)/i,
					wide: /^(да нашай эры|нашай эры|наша эра)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^д/i, /^н/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?[ыі]?)? кв.?/i,
					wide: /^[1234](-?[ыі]?)? квартал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[слкмчжв]/i,
					abbreviated: /^(студз|лют|сак|крас|тр(ав)?|чэрв|ліп|жн|вер|кастр|ліст|сьнеж)\.?/i,
					wide: /^(студзен[ья]|лют(ы|ага)|сакавіка?|красавіка?|тра(вень|ўня)|чэрвен[ья]|ліпен[ья]|жні(вень|ўня)|верас(ень|ня)|кастрычніка?|лістапада?|сьнеж(ань|ня))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^с/i,
						/^л/i,
						/^с/i,
						/^к/i,
						/^т/i,
						/^ч/i,
						/^л/i,
						/^ж/i,
						/^в/i,
						/^к/i,
						/^л/i,
						/^с/i
					],
					any: [
						/^ст/i,
						/^лю/i,
						/^са/i,
						/^кр/i,
						/^тр/i,
						/^ч/i,
						/^ліп/i,
						/^ж/i,
						/^в/i,
						/^ка/i,
						/^ліс/i,
						/^сн/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[нпасч]/i,
					short: /^(нд|ня|пн|па|аў|ат|ср|се|чц|ча|пт|пя|сб|су)\.?/i,
					abbreviated: /^(нядз?|ндз|пнд|пан|аўт|срд|сер|чцьв|чаць|птн|пят|суб).?/i,
					wide: /^(нядзел[яі]|панядзел(ак|ка)|аўтор(ак|ка)|серад[аы]|чацьв(ер|ярга)|пятніц[аы]|субот[аы])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^н/i,
						/^п/i,
						/^а/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i
					],
					any: [
						/^н/i,
						/^п[ан]/i,
						/^а/i,
						/^с[ер]/i,
						/^ч/i,
						/^п[ят]/i,
						/^с[уб]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
					abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
					wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^дп/i,
					pm: /^пп/i,
					midnight: /^поўн/i,
					noon: /^поўд/i,
					morning: /^р/i,
					afternoon: /^д[зн]/i,
					evening: /^в/i,
					night: /^н/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bg/_lib/formatDistance.js
	var formatDistanceLocale$72 = {
		lessThanXSeconds: {
			one: "по-малко от секунда",
			other: "по-малко от {{count}} секунди"
		},
		xSeconds: {
			one: "1 секунда",
			other: "{{count}} секунди"
		},
		halfAMinute: "половин минута",
		lessThanXMinutes: {
			one: "по-малко от минута",
			other: "по-малко от {{count}} минути"
		},
		xMinutes: {
			one: "1 минута",
			other: "{{count}} минути"
		},
		aboutXHours: {
			one: "около час",
			other: "около {{count}} часа"
		},
		xHours: {
			one: "1 час",
			other: "{{count}} часа"
		},
		xDays: {
			one: "1 ден",
			other: "{{count}} дни"
		},
		aboutXWeeks: {
			one: "около седмица",
			other: "около {{count}} седмици"
		},
		xWeeks: {
			one: "1 седмица",
			other: "{{count}} седмици"
		},
		aboutXMonths: {
			one: "около месец",
			other: "около {{count}} месеца"
		},
		xMonths: {
			one: "1 месец",
			other: "{{count}} месеца"
		},
		aboutXYears: {
			one: "около година",
			other: "около {{count}} години"
		},
		xYears: {
			one: "1 година",
			other: "{{count}} години"
		},
		overXYears: {
			one: "над година",
			other: "над {{count}} години"
		},
		almostXYears: {
			one: "почти година",
			other: "почти {{count}} години"
		}
	};
	var formatDistance$73 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$72[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "след " + result;
		else return "преди " + result;
		return result;
	};
	var formatLong$81 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, dd MMMM yyyy",
				long: "dd MMMM yyyy",
				medium: "dd MMM yyyy",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}} {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bg/_lib/formatRelative.js
	var weekdays$3 = [
		"неделя",
		"понеделник",
		"вторник",
		"сряда",
		"четвъртък",
		"петък",
		"събота"
	];
	function lastWeek$6(day) {
		const weekday = weekdays$3[day];
		switch (day) {
			case 0:
			case 3:
			case 6: return "'миналата " + weekday + " в' p";
			case 1:
			case 2:
			case 4:
			case 5: return "'миналия " + weekday + " в' p";
		}
	}
	function thisWeek$6(day) {
		const weekday = weekdays$3[day];
		if (day === 2) return "'във " + weekday + " в' p";
		else return "'в " + weekday + " в' p";
	}
	function nextWeek$6(day) {
		const weekday = weekdays$3[day];
		switch (day) {
			case 0:
			case 3:
			case 6: return "'следващата " + weekday + " в' p";
			case 1:
			case 2:
			case 4:
			case 5: return "'следващия " + weekday + " в' p";
		}
	}
	var lastWeekFormatToken = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek$6(day);
		else return lastWeek$6(day);
	};
	var nextWeekFormatToken = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek$6(day);
		else return nextWeek$6(day);
	};
	var formatRelativeLocale$73 = {
		lastWeek: lastWeekFormatToken,
		yesterday: "'вчера в' p",
		today: "'днес в' p",
		tomorrow: "'утре в' p",
		nextWeek: nextWeekFormatToken,
		other: "P"
	};
	var formatRelative$73 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$73[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bg/_lib/localize.js
	var eraValues$73 = {
		narrow: ["пр.н.е.", "н.е."],
		abbreviated: ["преди н. е.", "н. е."],
		wide: ["преди новата ера", "новата ера"]
	};
	var quarterValues$73 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-во тримес.",
			"2-ро тримес.",
			"3-то тримес.",
			"4-то тримес."
		],
		wide: [
			"1-во тримесечие",
			"2-ро тримесечие",
			"3-то тримесечие",
			"4-то тримесечие"
		]
	};
	var monthValues$73 = {
		abbreviated: [
			"яну",
			"фев",
			"мар",
			"апр",
			"май",
			"юни",
			"юли",
			"авг",
			"сеп",
			"окт",
			"ное",
			"дек"
		],
		wide: [
			"януари",
			"февруари",
			"март",
			"април",
			"май",
			"юни",
			"юли",
			"август",
			"септември",
			"октомври",
			"ноември",
			"декември"
		]
	};
	var dayValues$73 = {
		narrow: [
			"Н",
			"П",
			"В",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"нд",
			"пн",
			"вт",
			"ср",
			"чт",
			"пт",
			"сб"
		],
		abbreviated: [
			"нед",
			"пон",
			"вто",
			"сря",
			"чет",
			"пет",
			"съб"
		],
		wide: [
			"неделя",
			"понеделник",
			"вторник",
			"сряда",
			"четвъртък",
			"петък",
			"събота"
		]
	};
	var dayPeriodValues$73 = { wide: {
		am: "преди обяд",
		pm: "след обяд",
		midnight: "в полунощ",
		noon: "на обяд",
		morning: "сутринта",
		afternoon: "следобед",
		evening: "вечерта",
		night: "през нощта"
	} };
	function isFeminine(unit) {
		return unit === "year" || unit === "week" || unit === "minute" || unit === "second";
	}
	function isNeuter(unit) {
		return unit === "quarter";
	}
	function numberWithSuffix(number, unit, masculine, feminine, neuter) {
		const suffix = isNeuter(unit) ? neuter : isFeminine(unit) ? feminine : masculine;
		return number + "-" + suffix;
	}
	var ordinalNumber$73 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const unit = options?.unit;
		if (number === 0) return numberWithSuffix(0, unit, "ев", "ева", "ево");
		else if (number % 1e3 === 0) return numberWithSuffix(number, unit, "ен", "на", "но");
		else if (number % 100 === 0) return numberWithSuffix(number, unit, "тен", "тна", "тно");
		const rem100 = number % 100;
		if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
			case 1: return numberWithSuffix(number, unit, "ви", "ва", "во");
			case 2: return numberWithSuffix(number, unit, "ри", "ра", "ро");
			case 7:
			case 8: return numberWithSuffix(number, unit, "ми", "ма", "мо");
		}
		return numberWithSuffix(number, unit, "ти", "та", "то");
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bg.js
	/**
	* @category Locales
	* @summary Bulgarian locale.
	* @language Bulgarian
	* @iso-639-2 bul
	* @author Nikolay Stoynov [@arvigeus](https://github.com/arvigeus)
	* @author Tsvetan Ovedenski [@fintara](https://github.com/fintara)
	*/
	var bg = {
		code: "bg",
		formatDistance: formatDistance$73,
		formatLong: formatLong$81,
		formatRelative: formatRelative$73,
		localize: {
			ordinalNumber: ordinalNumber$73,
			era: buildLocalizeFn({
				values: eraValues$73,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$73,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$73,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$73,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$73,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((пр)?н\.?\s?е\.?)/i,
					abbreviated: /^((пр)?н\.?\s?е\.?)/i,
					wide: /^(преди новата ера|новата ера|нова ера)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^п/i, /^н/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?[врт]?o?)? тримес.?/i,
					wide: /^[1234](-?[врт]?о?)? тримесечие/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					abbreviated: /^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,
					wide: /^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^я/i,
					/^ф/i,
					/^мар/i,
					/^ап/i,
					/^май/i,
					/^юн/i,
					/^юл/i,
					/^ав/i,
					/^се/i,
					/^окт/i,
					/^но/i,
					/^де/i
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[нпвсч]/i,
					short: /^(нд|пн|вт|ср|чт|пт|сб)/i,
					abbreviated: /^(нед|пон|вто|сря|чет|пет|съб)/i,
					wide: /^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^н/i,
						/^п/i,
						/^в/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i
					],
					any: [
						/^н[ед]/i,
						/^п[он]/i,
						/^вт/i,
						/^ср/i,
						/^ч[ет]/i,
						/^п[ет]/i,
						/^с[ъб]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(преди о|след о|в по|на о|през|веч|сут|следо)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^преди о/i,
					pm: /^след о/i,
					midnight: /^в пол/i,
					noon: /^на об/i,
					morning: /^сут/i,
					afternoon: /^следо/i,
					evening: /^веч/i,
					night: /^през н/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bn/_lib/localize.js
	var numberValues$1 = {
		locale: {
			1: "১",
			2: "২",
			3: "৩",
			4: "৪",
			5: "৫",
			6: "৬",
			7: "৭",
			8: "৮",
			9: "৯",
			0: "০"
		},
		number: {
			"১": "1",
			"২": "2",
			"৩": "3",
			"৪": "4",
			"৫": "5",
			"৬": "6",
			"৭": "7",
			"৮": "8",
			"৯": "9",
			"০": "0"
		}
	};
	var eraValues$72 = {
		narrow: ["খ্রিঃপূঃ", "খ্রিঃ"],
		abbreviated: ["খ্রিঃপূর্ব", "খ্রিঃ"],
		wide: ["খ্রিস্টপূর্ব", "খ্রিস্টাব্দ"]
	};
	var quarterValues$72 = {
		narrow: [
			"১",
			"২",
			"৩",
			"৪"
		],
		abbreviated: [
			"১ত্রৈ",
			"২ত্রৈ",
			"৩ত্রৈ",
			"৪ত্রৈ"
		],
		wide: [
			"১ম ত্রৈমাসিক",
			"২য় ত্রৈমাসিক",
			"৩য় ত্রৈমাসিক",
			"৪র্থ ত্রৈমাসিক"
		]
	};
	var monthValues$72 = {
		narrow: [
			"জানু",
			"ফেব্রু",
			"মার্চ",
			"এপ্রিল",
			"মে",
			"জুন",
			"জুলাই",
			"আগস্ট",
			"সেপ্ট",
			"অক্টো",
			"নভে",
			"ডিসে"
		],
		abbreviated: [
			"জানু",
			"ফেব্রু",
			"মার্চ",
			"এপ্রিল",
			"মে",
			"জুন",
			"জুলাই",
			"আগস্ট",
			"সেপ্ট",
			"অক্টো",
			"নভে",
			"ডিসে"
		],
		wide: [
			"জানুয়ারি",
			"ফেব্রুয়ারি",
			"মার্চ",
			"এপ্রিল",
			"মে",
			"জুন",
			"জুলাই",
			"আগস্ট",
			"সেপ্টেম্বর",
			"অক্টোবর",
			"নভেম্বর",
			"ডিসেম্বর"
		]
	};
	var dayValues$72 = {
		narrow: [
			"র",
			"সো",
			"ম",
			"বু",
			"বৃ",
			"শু",
			"শ"
		],
		short: [
			"রবি",
			"সোম",
			"মঙ্গল",
			"বুধ",
			"বৃহ",
			"শুক্র",
			"শনি"
		],
		abbreviated: [
			"রবি",
			"সোম",
			"মঙ্গল",
			"বুধ",
			"বৃহ",
			"শুক্র",
			"শনি"
		],
		wide: [
			"রবিবার",
			"সোমবার",
			"মঙ্গলবার",
			"বুধবার",
			"বৃহস্পতিবার ",
			"শুক্রবার",
			"শনিবার"
		]
	};
	var dayPeriodValues$72 = {
		narrow: {
			am: "পূ",
			pm: "অপ",
			midnight: "মধ্যরাত",
			noon: "মধ্যাহ্ন",
			morning: "সকাল",
			afternoon: "বিকাল",
			evening: "সন্ধ্যা",
			night: "রাত"
		},
		abbreviated: {
			am: "পূর্বাহ্ন",
			pm: "অপরাহ্ন",
			midnight: "মধ্যরাত",
			noon: "মধ্যাহ্ন",
			morning: "সকাল",
			afternoon: "বিকাল",
			evening: "সন্ধ্যা",
			night: "রাত"
		},
		wide: {
			am: "পূর্বাহ্ন",
			pm: "অপরাহ্ন",
			midnight: "মধ্যরাত",
			noon: "মধ্যাহ্ন",
			morning: "সকাল",
			afternoon: "বিকাল",
			evening: "সন্ধ্যা",
			night: "রাত"
		}
	};
	var formattingDayPeriodValues$57 = {
		narrow: {
			am: "পূ",
			pm: "অপ",
			midnight: "মধ্যরাত",
			noon: "মধ্যাহ্ন",
			morning: "সকাল",
			afternoon: "বিকাল",
			evening: "সন্ধ্যা",
			night: "রাত"
		},
		abbreviated: {
			am: "পূর্বাহ্ন",
			pm: "অপরাহ্ন",
			midnight: "মধ্যরাত",
			noon: "মধ্যাহ্ন",
			morning: "সকাল",
			afternoon: "বিকাল",
			evening: "সন্ধ্যা",
			night: "রাত"
		},
		wide: {
			am: "পূর্বাহ্ন",
			pm: "অপরাহ্ন",
			midnight: "মধ্যরাত",
			noon: "মধ্যাহ্ন",
			morning: "সকাল",
			afternoon: "বিকাল",
			evening: "সন্ধ্যা",
			night: "রাত"
		}
	};
	function dateOrdinalNumber(number, localeNumber) {
		if (number > 18 && number <= 31) return localeNumber + "শে";
		else switch (number) {
			case 1: return localeNumber + "লা";
			case 2:
			case 3: return localeNumber + "রা";
			case 4: return localeNumber + "ঠা";
			default: return localeNumber + "ই";
		}
	}
	var ordinalNumber$72 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const localeNumber = numberToLocale$1(number);
		if (options?.unit === "date") return dateOrdinalNumber(number, localeNumber);
		if (number > 10 || number === 0) return localeNumber + "তম";
		switch (number % 10) {
			case 2:
			case 3: return localeNumber + "য়";
			case 4: return localeNumber + "র্থ";
			case 6: return localeNumber + "ষ্ঠ";
			default: return localeNumber + "ম";
		}
	};
	function numberToLocale$1(enNumber) {
		return enNumber.toString().replace(/\d/g, function(match) {
			return numberValues$1.locale[match];
		});
	}
	var localize$72 = {
		ordinalNumber: ordinalNumber$72,
		era: buildLocalizeFn({
			values: eraValues$72,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$72,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$72,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$72,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$72,
			defaultWidth: "wide",
			formattingValues: formattingDayPeriodValues$57,
			defaultFormattingWidth: "wide"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bn/_lib/formatDistance.js
	var formatDistanceLocale$71 = {
		lessThanXSeconds: {
			one: "প্রায় ১ সেকেন্ড",
			other: "প্রায় {{count}} সেকেন্ড"
		},
		xSeconds: {
			one: "১ সেকেন্ড",
			other: "{{count}} সেকেন্ড"
		},
		halfAMinute: "আধ মিনিট",
		lessThanXMinutes: {
			one: "প্রায় ১ মিনিট",
			other: "প্রায় {{count}} মিনিট"
		},
		xMinutes: {
			one: "১ মিনিট",
			other: "{{count}} মিনিট"
		},
		aboutXHours: {
			one: "প্রায় ১ ঘন্টা",
			other: "প্রায় {{count}} ঘন্টা"
		},
		xHours: {
			one: "১ ঘন্টা",
			other: "{{count}} ঘন্টা"
		},
		xDays: {
			one: "১ দিন",
			other: "{{count}} দিন"
		},
		aboutXWeeks: {
			one: "প্রায় ১ সপ্তাহ",
			other: "প্রায় {{count}} সপ্তাহ"
		},
		xWeeks: {
			one: "১ সপ্তাহ",
			other: "{{count}} সপ্তাহ"
		},
		aboutXMonths: {
			one: "প্রায় ১ মাস",
			other: "প্রায় {{count}} মাস"
		},
		xMonths: {
			one: "১ মাস",
			other: "{{count}} মাস"
		},
		aboutXYears: {
			one: "প্রায় ১ বছর",
			other: "প্রায় {{count}} বছর"
		},
		xYears: {
			one: "১ বছর",
			other: "{{count}} বছর"
		},
		overXYears: {
			one: "১ বছরের বেশি",
			other: "{{count}} বছরের বেশি"
		},
		almostXYears: {
			one: "প্রায় ১ বছর",
			other: "প্রায় {{count}} বছর"
		}
	};
	var formatDistance$72 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$71[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", numberToLocale$1(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " এর মধ্যে";
		else return result + " আগে";
		return result;
	};
	var formatLong$80 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}} 'সময়'",
				long: "{{date}} {{time}} 'সময়'",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bn/_lib/formatRelative.js
	var formatRelativeLocale$72 = {
		lastWeek: "'গত' eeee 'সময়' p",
		yesterday: "'গতকাল' 'সময়' p",
		today: "'আজ' 'সময়' p",
		tomorrow: "'আগামীকাল' 'সময়' p",
		nextWeek: "eeee 'সময়' p",
		other: "P"
	};
	var formatRelative$72 = (token, _date, _baseDate, _options) => formatRelativeLocale$72[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/bn.js
	/**
	* @category Locales
	* @summary Bengali locale.
	* @language Bengali
	* @iso-639-2 ben
	* @author Touhidur Rahman [@touhidrahman](https://github.com/touhidrahman)
	* @author Farhad Yasir [@nutboltu](https://github.com/nutboltu)
	*/
	var bn = {
		code: "bn",
		formatDistance: formatDistance$72,
		formatLong: formatLong$80,
		formatRelative: formatRelative$72,
		localize: localize$72,
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(ম|য়|র্থ|ষ্ঠ|শে|ই|তম)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(খ্রিঃপূঃ|খ্রিঃ)/i,
					abbreviated: /^(খ্রিঃপূর্ব|খ্রিঃ)/i,
					wide: /^(খ্রিস্টপূর্ব|খ্রিস্টাব্দ)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [/^খ্রিঃপূঃ/i, /^খ্রিঃ/i],
					abbreviated: [/^খ্রিঃপূর্ব/i, /^খ্রিঃ/i],
					wide: [/^খ্রিস্টপূর্ব/i, /^খ্রিস্টাব্দ/i]
				},
				defaultParseWidth: "wide"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[১২৩৪]/i,
					abbreviated: /^[১২৩৪]ত্রৈ/i,
					wide: /^[১২৩৪](ম|য়|র্থ)? ত্রৈমাসিক/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/১/i,
					/২/i,
					/৩/i,
					/৪/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,
					abbreviated: /^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,
					wide: /^(জানুয়ারি|ফেব্রুয়ারি|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্টেম্বর|অক্টোবর|নভেম্বর|ডিসেম্বর)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^জানু/i,
					/^ফেব্রু/i,
					/^মার্চ/i,
					/^এপ্রিল/i,
					/^মে/i,
					/^জুন/i,
					/^জুলাই/i,
					/^আগস্ট/i,
					/^সেপ্ট/i,
					/^অক্টো/i,
					/^নভে/i,
					/^ডিসে/i
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(র|সো|ম|বু|বৃ|শু|শ)+/i,
					short: /^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,
					abbreviated: /^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,
					wide: /^(রবিবার|সোমবার|মঙ্গলবার|বুধবার|বৃহস্পতিবার |শুক্রবার|শনিবার)+/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^র/i,
						/^সো/i,
						/^ম/i,
						/^বু/i,
						/^বৃ/i,
						/^শু/i,
						/^শ/i
					],
					short: [
						/^রবি/i,
						/^সোম/i,
						/^মঙ্গল/i,
						/^বুধ/i,
						/^বৃহ/i,
						/^শুক্র/i,
						/^শনি/i
					],
					abbreviated: [
						/^রবি/i,
						/^সোম/i,
						/^মঙ্গল/i,
						/^বুধ/i,
						/^বৃহ/i,
						/^শুক্র/i,
						/^শনি/i
					],
					wide: [
						/^রবিবার/i,
						/^সোমবার/i,
						/^মঙ্গলবার/i,
						/^বুধবার/i,
						/^বৃহস্পতিবার /i,
						/^শুক্রবার/i,
						/^শনিবার/i
					]
				},
				defaultParseWidth: "wide"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(পূ|অপ|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
					abbreviated: /^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,
					wide: /^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^পূ/i,
					pm: /^অপ/i,
					midnight: /^মধ্যরাত/i,
					noon: /^মধ্যাহ্ন/i,
					morning: /সকাল/i,
					afternoon: /বিকাল/i,
					evening: /সন্ধ্যা/i,
					night: /রাত/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bs/_lib/formatDistance.js
	var formatDistanceLocale$70 = {
		lessThanXSeconds: {
			one: {
				standalone: "manje od 1 sekunde",
				withPrepositionAgo: "manje od 1 sekunde",
				withPrepositionIn: "manje od 1 sekundu"
			},
			dual: "manje od {{count}} sekunde",
			other: "manje od {{count}} sekundi"
		},
		xSeconds: {
			one: {
				standalone: "1 sekunda",
				withPrepositionAgo: "1 sekunde",
				withPrepositionIn: "1 sekundu"
			},
			dual: "{{count}} sekunde",
			other: "{{count}} sekundi"
		},
		halfAMinute: "pola minute",
		lessThanXMinutes: {
			one: {
				standalone: "manje od 1 minute",
				withPrepositionAgo: "manje od 1 minute",
				withPrepositionIn: "manje od 1 minutu"
			},
			dual: "manje od {{count}} minute",
			other: "manje od {{count}} minuta"
		},
		xMinutes: {
			one: {
				standalone: "1 minuta",
				withPrepositionAgo: "1 minute",
				withPrepositionIn: "1 minutu"
			},
			dual: "{{count}} minute",
			other: "{{count}} minuta"
		},
		aboutXHours: {
			one: {
				standalone: "oko 1 sat",
				withPrepositionAgo: "oko 1 sat",
				withPrepositionIn: "oko 1 sat"
			},
			dual: "oko {{count}} sata",
			other: "oko {{count}} sati"
		},
		xHours: {
			one: {
				standalone: "1 sat",
				withPrepositionAgo: "1 sat",
				withPrepositionIn: "1 sat"
			},
			dual: "{{count}} sata",
			other: "{{count}} sati"
		},
		xDays: {
			one: {
				standalone: "1 dan",
				withPrepositionAgo: "1 dan",
				withPrepositionIn: "1 dan"
			},
			dual: "{{count}} dana",
			other: "{{count}} dana"
		},
		aboutXWeeks: {
			one: {
				standalone: "oko 1 sedmicu",
				withPrepositionAgo: "oko 1 sedmicu",
				withPrepositionIn: "oko 1 sedmicu"
			},
			dual: "oko {{count}} sedmice",
			other: "oko {{count}} sedmice"
		},
		xWeeks: {
			one: {
				standalone: "1 sedmicu",
				withPrepositionAgo: "1 sedmicu",
				withPrepositionIn: "1 sedmicu"
			},
			dual: "{{count}} sedmice",
			other: "{{count}} sedmice"
		},
		aboutXMonths: {
			one: {
				standalone: "oko 1 mjesec",
				withPrepositionAgo: "oko 1 mjesec",
				withPrepositionIn: "oko 1 mjesec"
			},
			dual: "oko {{count}} mjeseca",
			other: "oko {{count}} mjeseci"
		},
		xMonths: {
			one: {
				standalone: "1 mjesec",
				withPrepositionAgo: "1 mjesec",
				withPrepositionIn: "1 mjesec"
			},
			dual: "{{count}} mjeseca",
			other: "{{count}} mjeseci"
		},
		aboutXYears: {
			one: {
				standalone: "oko 1 godinu",
				withPrepositionAgo: "oko 1 godinu",
				withPrepositionIn: "oko 1 godinu"
			},
			dual: "oko {{count}} godine",
			other: "oko {{count}} godina"
		},
		xYears: {
			one: {
				standalone: "1 godina",
				withPrepositionAgo: "1 godine",
				withPrepositionIn: "1 godinu"
			},
			dual: "{{count}} godine",
			other: "{{count}} godina"
		},
		overXYears: {
			one: {
				standalone: "preko 1 godinu",
				withPrepositionAgo: "preko 1 godinu",
				withPrepositionIn: "preko 1 godinu"
			},
			dual: "preko {{count}} godine",
			other: "preko {{count}} godina"
		},
		almostXYears: {
			one: {
				standalone: "gotovo 1 godinu",
				withPrepositionAgo: "gotovo 1 godinu",
				withPrepositionIn: "gotovo 1 godinu"
			},
			dual: "gotovo {{count}} godine",
			other: "gotovo {{count}} godina"
		}
	};
	var formatDistance$71 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$70[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) if (options?.addSuffix) if (options.comparison && options.comparison > 0) result = tokenValue.one.withPrepositionIn;
		else result = tokenValue.one.withPrepositionAgo;
		else result = tokenValue.one.standalone;
		else if (count % 10 > 1 && count % 10 < 5 && String(count).substr(-2, 1) !== "1") result = tokenValue.dual.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "za " + result;
		else return "prije " + result;
		return result;
	};
	var formatLong$79 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d. MMMM yyyy.",
				long: "d. MMMM yyyy.",
				medium: "d. MMM yy.",
				short: "dd. MM. yy."
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss (zzzz)",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'u' {{time}}",
				long: "{{date}} 'u' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bs/_lib/formatRelative.js
	var formatRelativeLocale$71 = {
		lastWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'prošle nedjelje u' p";
				case 3: return "'prošle srijede u' p";
				case 6: return "'prošle subote u' p";
				default: return "'prošli' EEEE 'u' p";
			}
		},
		yesterday: "'juče u' p",
		today: "'danas u' p",
		tomorrow: "'sutra u' p",
		nextWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'sljedeće nedjelje u' p";
				case 3: return "'sljedeću srijedu u' p";
				case 6: return "'sljedeću subotu u' p";
				default: return "'sljedeći' EEEE 'u' p";
			}
		},
		other: "P"
	};
	var formatRelative$71 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$71[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bs/_lib/localize.js
	var eraValues$71 = {
		narrow: ["pr.n.e.", "AD"],
		abbreviated: ["pr. Hr.", "po. Hr."],
		wide: ["Prije Hrista", "Poslije Hrista"]
	};
	var quarterValues$71 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4."
		],
		abbreviated: [
			"1. kv.",
			"2. kv.",
			"3. kv.",
			"4. kv."
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$71 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"maj",
			"jun",
			"jul",
			"avg",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"januar",
			"februar",
			"mart",
			"april",
			"maj",
			"juni",
			"juli",
			"avgust",
			"septembar",
			"oktobar",
			"novembar",
			"decembar"
		]
	};
	var formattingMonthValues$16 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"maj",
			"jun",
			"jul",
			"avg",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"januar",
			"februar",
			"mart",
			"april",
			"maj",
			"juni",
			"juli",
			"avgust",
			"septembar",
			"oktobar",
			"novembar",
			"decembar"
		]
	};
	var dayValues$71 = {
		narrow: [
			"N",
			"P",
			"U",
			"S",
			"Č",
			"P",
			"S"
		],
		short: [
			"ned",
			"pon",
			"uto",
			"sre",
			"čet",
			"pet",
			"sub"
		],
		abbreviated: [
			"ned",
			"pon",
			"uto",
			"sre",
			"čet",
			"pet",
			"sub"
		],
		wide: [
			"nedjelja",
			"ponedjeljak",
			"utorak",
			"srijeda",
			"četvrtak",
			"petak",
			"subota"
		]
	};
	var dayPeriodValues$71 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "poslije podne",
			evening: "uveče",
			night: "noću"
		}
	};
	var formattingDayPeriodValues$56 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "poslije podne",
			evening: "uveče",
			night: "noću"
		}
	};
	var ordinalNumber$71 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		return String(number) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/bs.js
	/**
	* @category Locales
	* @summary Bosnian locale.
	* @language Bosnian
	* @iso-639-2 bos
	* @author Branislav Lazić [@branislavlazic](https://github.com/branislavlazic)
	*/
	var bs = {
		code: "bs",
		formatDistance: formatDistance$71,
		formatLong: formatLong$79,
		formatRelative: formatRelative$71,
		localize: {
			ordinalNumber: ordinalNumber$71,
			era: buildLocalizeFn({
				values: eraValues$71,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$71,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$71,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$16,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$71,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$71,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$56,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(pr\.n\.e\.|AD)/i,
					abbreviated: /^(pr\.\s?Hr\.|po\.\s?Hr\.)/i,
					wide: /^(Prije Hrista|prije nove ere|Poslije Hrista|nova era)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^pr/i, /^(po|nova)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]\.\s?kv\.?/i,
					wide: /^[1234]\. kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(10|11|12|[123456789])\./i,
					abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|avg|sep|okt|nov|dec)/i,
					wide: /^((januar|januara)|(februar|februara)|(mart|marta)|(april|aprila)|(maj|maja)|(juni|juna)|(juli|jula)|(avgust|avgusta)|(septembar|septembra)|(oktobar|oktobra)|(novembar|novembra)|(decembar|decembra))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^1/i,
						/^2/i,
						/^3/i,
						/^4/i,
						/^5/i,
						/^6/i,
						/^7/i,
						/^8/i,
						/^9/i,
						/^10/i,
						/^11/i,
						/^12/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^avg/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[npusčc]/i,
					short: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
					abbreviated: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
					wide: /^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^w/i,
						/^t/i,
						/^f/i,
						/^s/i
					],
					any: [
						/^su/i,
						/^m/i,
						/^tu/i,
						/^w/i,
						/^th/i,
						/^f/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|ponoc|ponoć|(po)?podne|uvece|uveče|noću|poslije podne|ujutru)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^pono/i,
					noon: /^pod/i,
					morning: /jutro/i,
					afternoon: /(poslije\s|po)+podne/i,
					evening: /(uvece|uveče)/i,
					night: /(nocu|noću)/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ca/_lib/formatDistance.js
	/**
	* Davant de les xifres que es diuen amb vocal inicial, 1 i 11, s'apostrofen els articles el i la i la preposició de igual que si estiguessin escrits amb lletres.
	*    l'1 de juliol ('l'u')
	*    l'11 de novembre ('l'onze')
	*    l'11a clàusula del contracte ('l'onzena')
	*    la contractació d'11 jugadors ('d'onze')
	*    l'aval d'11.000 socis ('d'onze mil')
	*
	* Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=apostrofaci%25F3+davant+xifres&action=Principal&method=detall_completa&numPagina=1&idHit=11236&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=11236&titol=apostrofaci%F3%20davant%20de%20xifres%20%2F%20apostrofaci%F3%20davant%20de%201%20i%2011&numeroResultat=1&clickLink=detall&tipusCerca=cerca.normes
	*/
	var formatDistanceLocale$69 = {
		lessThanXSeconds: {
			one: "menys d'un segon",
			eleven: "menys d'onze segons",
			other: "menys de {{count}} segons"
		},
		xSeconds: {
			one: "1 segon",
			other: "{{count}} segons"
		},
		halfAMinute: "mig minut",
		lessThanXMinutes: {
			one: "menys d'un minut",
			eleven: "menys d'onze minuts",
			other: "menys de {{count}} minuts"
		},
		xMinutes: {
			one: "1 minut",
			other: "{{count}} minuts"
		},
		aboutXHours: {
			one: "aproximadament una hora",
			other: "aproximadament {{count}} hores"
		},
		xHours: {
			one: "1 hora",
			other: "{{count}} hores"
		},
		xDays: {
			one: "1 dia",
			other: "{{count}} dies"
		},
		aboutXWeeks: {
			one: "aproximadament una setmana",
			other: "aproximadament {{count}} setmanes"
		},
		xWeeks: {
			one: "1 setmana",
			other: "{{count}} setmanes"
		},
		aboutXMonths: {
			one: "aproximadament un mes",
			other: "aproximadament {{count}} mesos"
		},
		xMonths: {
			one: "1 mes",
			other: "{{count}} mesos"
		},
		aboutXYears: {
			one: "aproximadament un any",
			other: "aproximadament {{count}} anys"
		},
		xYears: {
			one: "1 any",
			other: "{{count}} anys"
		},
		overXYears: {
			one: "més d'un any",
			eleven: "més d'onze anys",
			other: "més de {{count}} anys"
		},
		almostXYears: {
			one: "gairebé un any",
			other: "gairebé {{count}} anys"
		}
	};
	var formatDistance$70 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$69[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 11 && tokenValue.eleven) result = tokenValue.eleven;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "en " + result;
		else return "fa " + result;
		return result;
	};
	var formatLong$78 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d 'de' MMMM y",
				long: "d 'de' MMMM y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'a les' {{time}}",
				long: "{{date}} 'a les' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ca/_lib/formatRelative.js
	var formatRelativeLocale$70 = {
		lastWeek: "'el' eeee 'passat a la' LT",
		yesterday: "'ahir a la' p",
		today: "'avui a la' p",
		tomorrow: "'demà a la' p",
		nextWeek: "eeee 'a la' p",
		other: "P"
	};
	var formatRelativeLocalePlural$3 = {
		lastWeek: "'el' eeee 'passat a les' p",
		yesterday: "'ahir a les' p",
		today: "'avui a les' p",
		tomorrow: "'demà a les' p",
		nextWeek: "eeee 'a les' p",
		other: "P"
	};
	var formatRelative$70 = (token, date, _baseDate, _options) => {
		if (date.getHours() !== 1) return formatRelativeLocalePlural$3[token];
		return formatRelativeLocale$70[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ca/_lib/localize.js
	/**
	* General information
	* Reference: https://aplicacions.llengua.gencat.cat
	* Reference: https://www.uoc.edu/portal/ca/servei-linguistic/convencions/abreviacions/simbols/simbols-habituals.html
	*/
	/**
	* Abans de Crist: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=abans+de+crist&action=Principal&method=detall_completa&numPagina=1&idHit=6876&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=6876&titol=abans%20de%20Crist%20(abreviatura)%20/%20abans%20de%20Crist%20(sigla)&numeroResultat=1&clickLink=detall&tipusCerca=cerca.fitxes
	* Desprest de Crist: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=despr%E9s+de+crist&action=Principal&method=detall_completa&numPagina=1&idHit=6879&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=6879&titol=despr%E9s%20de%20Crist%20(sigla)%20/%20despr%E9s%20de%20Crist%20(abreviatura)&numeroResultat=1&clickLink=detall&tipusCerca=cerca.fitxes
	*/
	var eraValues$70 = {
		narrow: ["aC", "dC"],
		abbreviated: ["a. de C.", "d. de C."],
		wide: ["abans de Crist", "després de Crist"]
	};
	var quarterValues$70 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"1r trimestre",
			"2n trimestre",
			"3r trimestre",
			"4t trimestre"
		]
	};
	/**
	* Dins d'un text convé fer servir la forma sencera dels mesos, ja que sempre és més clar el mot sencer que l'abreviatura, encara que aquesta sigui força coneguda.
	* Cal reservar, doncs, les abreviatures per a les llistes o classificacions, els gràfics, les taules o quadres estadístics, els textos publicitaris, etc.
	*
	* Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=abreviacions+mesos&action=Principal&method=detall_completa&numPagina=1&idHit=8402&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=8402&titol=abreviatures%20dels%20mesos%20de%20l%27any&numeroResultat=5&clickLink=detall&tipusCerca=cerca.fitxes
	*/
	var monthValues$70 = {
		narrow: [
			"GN",
			"FB",
			"MÇ",
			"AB",
			"MG",
			"JN",
			"JL",
			"AG",
			"ST",
			"OC",
			"NV",
			"DS"
		],
		abbreviated: [
			"gen.",
			"febr.",
			"març",
			"abr.",
			"maig",
			"juny",
			"jul.",
			"ag.",
			"set.",
			"oct.",
			"nov.",
			"des."
		],
		wide: [
			"gener",
			"febrer",
			"març",
			"abril",
			"maig",
			"juny",
			"juliol",
			"agost",
			"setembre",
			"octubre",
			"novembre",
			"desembre"
		]
	};
	/**
	* Les abreviatures dels dies de la setmana comencen totes amb la lletra d.
	* Tot seguit porten la consonant següent a la i, excepte en el cas de dimarts, dimecres i diumenge, en què aquesta consonant és la m i, per tant, hi podria haver confusió.
	* Per evitar-ho, s'ha substituït la m per una t (en el cas de dimarts), una c (en el cas de dimecres) i una g (en el cas de diumenge), respectivament.
	*
	* Seguint la norma general d'ús de les abreviatures, les dels dies de la setmana sempre porten punt final.
	* Igualment, van amb la primera lletra en majúscula quan la paraula sencera també hi aniria.
	* En canvi, van amb la primera lletra en minúscula quan la inicial de la paraula sencera també hi aniria.
	*
	* Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?input_cercar=abreviatures+dies&action=Principal&method=detall_completa&numPagina=1&idHit=8387&database=FITXES_PUB&tipusFont=Fitxes%20de%20l%27Optimot&idFont=8387&titol=abreviatures%20dels%20dies%20de%20la%20setmana&numeroResultat=1&clickLink=detall&tipusCerca=cerca.tot
	*/
	var dayValues$70 = {
		narrow: [
			"dg.",
			"dl.",
			"dt.",
			"dm.",
			"dj.",
			"dv.",
			"ds."
		],
		short: [
			"dg.",
			"dl.",
			"dt.",
			"dm.",
			"dj.",
			"dv.",
			"ds."
		],
		abbreviated: [
			"dg.",
			"dl.",
			"dt.",
			"dm.",
			"dj.",
			"dv.",
			"ds."
		],
		wide: [
			"diumenge",
			"dilluns",
			"dimarts",
			"dimecres",
			"dijous",
			"divendres",
			"dissabte"
		]
	};
	/**
	* Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/index.html?action=Principal&method=detall&input_cercar=parts+del+dia&numPagina=1&database=FITXES_PUB&idFont=12801&idHit=12801&tipusFont=Fitxes+de+l%27Optimot&numeroResultat=1&databases_avansada=&categories_avansada=&clickLink=detall&titol=Nom+de+les+parts+del+dia&tematica=&tipusCerca=cerca.fitxes
	*/
	var dayPeriodValues$70 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "mitjanit",
			noon: "migdia",
			morning: "matí",
			afternoon: "tarda",
			evening: "vespre",
			night: "nit"
		},
		abbreviated: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "mitjanit",
			noon: "migdia",
			morning: "matí",
			afternoon: "tarda",
			evening: "vespre",
			night: "nit"
		},
		wide: {
			am: "ante meridiem",
			pm: "post meridiem",
			midnight: "mitjanit",
			noon: "migdia",
			morning: "matí",
			afternoon: "tarda",
			evening: "vespre",
			night: "nit"
		}
	};
	var formattingDayPeriodValues$55 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "de la mitjanit",
			noon: "del migdia",
			morning: "del matí",
			afternoon: "de la tarda",
			evening: "del vespre",
			night: "de la nit"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "de la mitjanit",
			noon: "del migdia",
			morning: "del matí",
			afternoon: "de la tarda",
			evening: "del vespre",
			night: "de la nit"
		},
		wide: {
			am: "ante meridiem",
			pm: "post meridiem",
			midnight: "de la mitjanit",
			noon: "del migdia",
			morning: "del matí",
			afternoon: "de la tarda",
			evening: "del vespre",
			night: "de la nit"
		}
	};
	/**
	* Quan van en singular, els nombres ordinals es representen, en forma d’abreviatura, amb la xifra seguida de l’última lletra del mot desplegat.
	* És optatiu posar punt després de la lletra.
	*
	* Reference: https://aplicacions.llengua.gencat.cat/llc/AppJava/pdf/abrevia.pdf#page=18
	*/
	var ordinalNumber$70 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
			case 1: return number + "r";
			case 2: return number + "n";
			case 3: return number + "r";
			case 4: return number + "t";
		}
		return number + "è";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ca.js
	/**
	* @category Locales
	* @summary Catalan locale.
	* @language Catalan
	* @iso-639-2 cat
	* @author Guillermo Grau [@guigrpa](https://github.com/guigrpa)
	* @author Alex Vizcaino [@avizcaino](https://github.com/avizcaino)
	*/
	var ca = {
		code: "ca",
		formatDistance: formatDistance$70,
		formatLong: formatLong$78,
		formatRelative: formatRelative$70,
		localize: {
			ordinalNumber: ordinalNumber$70,
			era: buildLocalizeFn({
				values: eraValues$70,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$70,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$70,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$70,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$70,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$55,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(è|r|n|r|t)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(aC|dC)/i,
					abbreviated: /^(a. de C.|d. de C.)/i,
					wide: /^(abans de Crist|despr[eé]s de Crist)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [/^aC/i, /^dC/i],
					abbreviated: [/^(a. de C.)/i, /^(d. de C.)/i],
					wide: [/^(abans de Crist)/i, /^(despr[eé]s de Crist)/i]
				},
				defaultParseWidth: "wide"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^T[1234]/i,
					wide: /^[1234](è|r|n|r|t)? trimestre/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(GN|FB|MÇ|AB|MG|JN|JL|AG|ST|OC|NV|DS)/i,
					abbreviated: /^(gen.|febr.|març|abr.|maig|juny|jul.|ag.|set.|oct.|nov.|des.)/i,
					wide: /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^GN/i,
						/^FB/i,
						/^MÇ/i,
						/^AB/i,
						/^MG/i,
						/^JN/i,
						/^JL/i,
						/^AG/i,
						/^ST/i,
						/^OC/i,
						/^NV/i,
						/^DS/i
					],
					abbreviated: [
						/^gen./i,
						/^febr./i,
						/^març/i,
						/^abr./i,
						/^maig/i,
						/^juny/i,
						/^jul./i,
						/^ag./i,
						/^set./i,
						/^oct./i,
						/^nov./i,
						/^des./i
					],
					wide: [
						/^gener/i,
						/^febrer/i,
						/^març/i,
						/^abril/i,
						/^maig/i,
						/^juny/i,
						/^juliol/i,
						/^agost/i,
						/^setembre/i,
						/^octubre/i,
						/^novembre/i,
						/^desembre/i
					]
				},
				defaultParseWidth: "wide"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,
					short: /^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,
					abbreviated: /^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,
					wide: /^(diumenge|dilluns|dimarts|dimecres|dijous|divendres|dissabte)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^dg./i,
						/^dl./i,
						/^dt./i,
						/^dm./i,
						/^dj./i,
						/^dv./i,
						/^ds./i
					],
					abbreviated: [
						/^dg./i,
						/^dl./i,
						/^dt./i,
						/^dm./i,
						/^dj./i,
						/^dv./i,
						/^ds./i
					],
					wide: [
						/^diumenge/i,
						/^dilluns/i,
						/^dimarts/i,
						/^dimecres/i,
						/^dijous/i,
						/^divendres/i,
						/^disssabte/i
					]
				},
				defaultParseWidth: "wide"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mn|md|(del|de la) (matí|tarda|vespre|nit))/i,
					abbreviated: /^([ap]\.?\s?m\.?|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i,
					wide: /^(ante meridiem|post meridiem|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mitjanit/i,
					noon: /^migdia/i,
					morning: /matí/i,
					afternoon: /tarda/i,
					evening: /vespre/i,
					night: /nit/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ckb/_lib/formatDistance.js
	var formatDistanceLocale$68 = {
		lessThanXSeconds: {
			one: "کەمتر لە یەک چرکە",
			other: "کەمتر لە {{count}} چرکە"
		},
		xSeconds: {
			one: "1 چرکە",
			other: "{{count}} چرکە"
		},
		halfAMinute: "نیو کاتژمێر",
		lessThanXMinutes: {
			one: "کەمتر لە یەک خولەک",
			other: "کەمتر لە {{count}} خولەک"
		},
		xMinutes: {
			one: "1 خولەک",
			other: "{{count}} خولەک"
		},
		aboutXHours: {
			one: "دەوروبەری 1 کاتژمێر",
			other: "دەوروبەری {{count}} کاتژمێر"
		},
		xHours: {
			one: "1 کاتژمێر",
			other: "{{count}} کاتژمێر"
		},
		xDays: {
			one: "1 ڕۆژ",
			other: "{{count}} ژۆژ"
		},
		aboutXWeeks: {
			one: "دەوروبەری 1 هەفتە",
			other: "دوروبەری {{count}} هەفتە"
		},
		xWeeks: {
			one: "1 هەفتە",
			other: "{{count}} هەفتە"
		},
		aboutXMonths: {
			one: "داوروبەری 1 مانگ",
			other: "دەوروبەری {{count}} مانگ"
		},
		xMonths: {
			one: "1 مانگ",
			other: "{{count}} مانگ"
		},
		aboutXYears: {
			one: "دەوروبەری  1 ساڵ",
			other: "دەوروبەری {{count}} ساڵ"
		},
		xYears: {
			one: "1 ساڵ",
			other: "{{count}} ساڵ"
		},
		overXYears: {
			one: "زیاتر لە ساڵێک",
			other: "زیاتر لە {{count}} ساڵ"
		},
		almostXYears: {
			one: "بەنزیکەیی ساڵێک  ",
			other: "بەنزیکەیی {{count}} ساڵ"
		}
	};
	var formatDistance$69 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$68[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "لە ماوەی " + result + "دا";
		else return result + "پێش ئێستا";
		return result;
	};
	var formatLong$77 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'کاتژمێر' {{time}}",
				long: "{{date}} 'کاتژمێر' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ckb/_lib/formatRelative.js
	var formatRelativeLocale$69 = {
		lastWeek: "'هەفتەی ڕابردوو' eeee 'کاتژمێر' p",
		yesterday: "'دوێنێ کاتژمێر' p",
		today: "'ئەمڕۆ کاتژمێر' p",
		tomorrow: "'بەیانی کاتژمێر' p",
		nextWeek: "eeee 'کاتژمێر' p",
		other: "P"
	};
	var formatRelative$69 = (token, _date, _baseDate, _options) => formatRelativeLocale$69[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ckb/_lib/localize.js
	var eraValues$69 = {
		narrow: ["پ", "د"],
		abbreviated: ["پ-ز", "د-ز"],
		wide: ["پێش زاین", "دوای زاین"]
	};
	var quarterValues$69 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"چ1م",
			"چ2م",
			"چ3م",
			"چ4م"
		],
		wide: [
			"چارەگی یەکەم",
			"چارەگی دووەم",
			"چارەگی سێیەم",
			"چارەگی چوارەم"
		]
	};
	var monthValues$69 = {
		narrow: [
			"ک-د",
			"ش",
			"ئا",
			"ن",
			"م",
			"ح",
			"ت",
			"ئا",
			"ئە",
			"تش-ی",
			"تش-د",
			"ک-ی"
		],
		abbreviated: [
			"کان-دوو",
			"شوب",
			"ئاد",
			"نیس",
			"مایس",
			"حوز",
			"تەم",
			"ئاب",
			"ئەل",
			"تش-یەک",
			"تش-دوو",
			"کان-یەک"
		],
		wide: [
			"کانوونی دووەم",
			"شوبات",
			"ئادار",
			"نیسان",
			"مایس",
			"حوزەیران",
			"تەمموز",
			"ئاب",
			"ئەیلول",
			"تشرینی یەکەم",
			"تشرینی دووەم",
			"کانوونی یەکەم"
		]
	};
	var dayValues$69 = {
		narrow: [
			"ی-ش",
			"د-ش",
			"س-ش",
			"چ-ش",
			"پ-ش",
			"هە",
			"ش"
		],
		short: [
			"یە-شە",
			"دوو-شە",
			"سێ-شە",
			"چو-شە",
			"پێ-شە",
			"هەی",
			"شە"
		],
		abbreviated: [
			"یەک-شەم",
			"دوو-شەم",
			"سێ-شەم",
			"چوار-شەم",
			"پێنج-شەم",
			"هەینی",
			"شەمە"
		],
		wide: [
			"یەک شەمە",
			"دوو شەمە",
			"سێ شەمە",
			"چوار شەمە",
			"پێنج شەمە",
			"هەینی",
			"شەمە"
		]
	};
	var dayPeriodValues$69 = {
		narrow: {
			am: "پ",
			pm: "د",
			midnight: "ن-ش",
			noon: "ن",
			morning: "بەیانی",
			afternoon: "دوای نیوەڕۆ",
			evening: "ئێوارە",
			night: "شەو"
		},
		abbreviated: {
			am: "پ-ن",
			pm: "د-ن",
			midnight: "نیوە شەو",
			noon: "نیوەڕۆ",
			morning: "بەیانی",
			afternoon: "دوای نیوەڕۆ",
			evening: "ئێوارە",
			night: "شەو"
		},
		wide: {
			am: "پێش نیوەڕۆ",
			pm: "دوای نیوەڕۆ",
			midnight: "نیوە شەو",
			noon: "نیوەڕۆ",
			morning: "بەیانی",
			afternoon: "دوای نیوەڕۆ",
			evening: "ئێوارە",
			night: "شەو"
		}
	};
	var formattingDayPeriodValues$54 = {
		narrow: {
			am: "پ",
			pm: "د",
			midnight: "ن-ش",
			noon: "ن",
			morning: "لە بەیانیدا",
			afternoon: "لە دوای نیوەڕۆدا",
			evening: "لە ئێوارەدا",
			night: "لە شەودا"
		},
		abbreviated: {
			am: "پ-ن",
			pm: "د-ن",
			midnight: "نیوە شەو",
			noon: "نیوەڕۆ",
			morning: "لە بەیانیدا",
			afternoon: "لە دوای نیوەڕۆدا",
			evening: "لە ئێوارەدا",
			night: "لە شەودا"
		},
		wide: {
			am: "پێش نیوەڕۆ",
			pm: "دوای نیوەڕۆ",
			midnight: "نیوە شەو",
			noon: "نیوەڕۆ",
			morning: "لە بەیانیدا",
			afternoon: "لە دوای نیوەڕۆدا",
			evening: "لە ئێوارەدا",
			night: "لە شەودا"
		}
	};
	var ordinalNumber$69 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ckb.js
	/**
	* @type {Locale}
	* @category Locales
	* @summary Central Kurdish locale.
	* @language Central Kurdish
	* @iso-639-2 kur
	* @author Revan Sarbast [@Revan99]{@link https://github.com/Revan99}
	*/
	var ckb = {
		code: "ckb",
		formatDistance: formatDistance$69,
		formatLong: formatLong$77,
		formatRelative: formatRelative$69,
		localize: {
			ordinalNumber: ordinalNumber$69,
			era: buildLocalizeFn({
				values: eraValues$69,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$69,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$69,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$69,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$69,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$54,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(پ|د)/i,
					abbreviated: /^(پ-ز|د.ز)/i,
					wide: /^(پێش زاین| دوای زاین)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^د/g, /^پ/g] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^م[1234]چ/i,
					wide: /^(یەکەم|دووەم|سێیەم| چوارەم) (چارەگی)? quarter/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					wide: [
						/چارەگی یەکەم/,
						/چارەگی دووەم/,
						/چارەگی سيیەم/,
						/چارەگی چوارەم/
					],
					any: [
						/1/i,
						/2/i,
						/3/i,
						/4/i
					]
				},
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(ک-د|ش|ئا|ن|م|ح|ت|ئە|تش-ی|تش-د|ک-ی)/i,
					abbreviated: /^(کان-دوو|شوب|ئاد|نیس|مایس|حوز|تەم|ئاب|ئەل|تش-یەک|تش-دوو|کان-یەک)/i,
					wide: /^(کانوونی دووەم|شوبات|ئادار|نیسان|مایس|حوزەیران|تەمموز|ئاب|ئەیلول|تشرینی یەکەم|تشرینی دووەم|کانوونی یەکەم)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ک-د/i,
						/^ش/i,
						/^ئا/i,
						/^ن/i,
						/^م/i,
						/^ح/i,
						/^ت/i,
						/^ئا/i,
						/^ئە/i,
						/^تش-ی/i,
						/^تش-د/i,
						/^ک-ی/i
					],
					any: [
						/^کان-دوو/i,
						/^شوب/i,
						/^ئاد/i,
						/^نیس/i,
						/^مایس/i,
						/^حوز/i,
						/^تەم/i,
						/^ئاب/i,
						/^ئەل/i,
						/^تش-یەک/i,
						/^تش-دوو/i,
						/^|کان-یەک/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ش|ی|د|س|چ|پ|هە)/i,
					short: /^(یە-شە|دوو-شە|سێ-شە|چو-شە|پێ-شە|هە|شە)/i,
					abbreviated: /^(یەک-شەم|دوو-شەم|سێ-شەم|چوار-شەم|پێنخ-شەم|هەینی|شەمە)/i,
					wide: /^(یەک شەمە|دوو شەمە|سێ شەمە|چوار شەمە|پێنج شەمە|هەینی|شەمە)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^w/i,
						/^t/i,
						/^f/i,
						/^s/i
					],
					any: [
						/^su/i,
						/^m/i,
						/^tu/i,
						/^w/i,
						/^th/i,
						/^f/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(پ|د|ن-ش|ن| (بەیانی|دوای نیوەڕۆ|ئێوارە|شەو))/i,
					abbreviated: /^(پ-ن|د-ن|نیوە شەو|نیوەڕۆ|بەیانی|دوای نیوەڕۆ|ئێوارە|شەو)/,
					wide: /^(پێش نیوەڕۆ|دوای نیوەڕۆ|نیوەڕۆ|نیوە شەو|لەبەیانیدا|لەدواینیوەڕۆدا|لە ئێوارەدا|لە شەودا)/,
					any: /^(پ|د|بەیانی|نیوەڕۆ|ئێوارە|شەو)/
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^د/i,
					pm: /^پ/i,
					midnight: /^ن-ش/i,
					noon: /^ن/i,
					morning: /بەیانی/i,
					afternoon: /دواینیوەڕۆ/i,
					evening: /ئێوارە/i,
					night: /شەو/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cs/_lib/formatDistance.js
	var formatDistanceLocale$67 = {
		lessThanXSeconds: {
			one: {
				regular: "méně než 1 sekunda",
				past: "před méně než 1 sekundou",
				future: "za méně než 1 sekundu"
			},
			few: {
				regular: "méně než {{count}} sekundy",
				past: "před méně než {{count}} sekundami",
				future: "za méně než {{count}} sekundy"
			},
			many: {
				regular: "méně než {{count}} sekund",
				past: "před méně než {{count}} sekundami",
				future: "za méně než {{count}} sekund"
			}
		},
		xSeconds: {
			one: {
				regular: "1 sekunda",
				past: "před 1 sekundou",
				future: "za 1 sekundu"
			},
			few: {
				regular: "{{count}} sekundy",
				past: "před {{count}} sekundami",
				future: "za {{count}} sekundy"
			},
			many: {
				regular: "{{count}} sekund",
				past: "před {{count}} sekundami",
				future: "za {{count}} sekund"
			}
		},
		halfAMinute: {
			type: "other",
			other: {
				regular: "půl minuty",
				past: "před půl minutou",
				future: "za půl minuty"
			}
		},
		lessThanXMinutes: {
			one: {
				regular: "méně než 1 minuta",
				past: "před méně než 1 minutou",
				future: "za méně než 1 minutu"
			},
			few: {
				regular: "méně než {{count}} minuty",
				past: "před méně než {{count}} minutami",
				future: "za méně než {{count}} minuty"
			},
			many: {
				regular: "méně než {{count}} minut",
				past: "před méně než {{count}} minutami",
				future: "za méně než {{count}} minut"
			}
		},
		xMinutes: {
			one: {
				regular: "1 minuta",
				past: "před 1 minutou",
				future: "za 1 minutu"
			},
			few: {
				regular: "{{count}} minuty",
				past: "před {{count}} minutami",
				future: "za {{count}} minuty"
			},
			many: {
				regular: "{{count}} minut",
				past: "před {{count}} minutami",
				future: "za {{count}} minut"
			}
		},
		aboutXHours: {
			one: {
				regular: "přibližně 1 hodina",
				past: "přibližně před 1 hodinou",
				future: "přibližně za 1 hodinu"
			},
			few: {
				regular: "přibližně {{count}} hodiny",
				past: "přibližně před {{count}} hodinami",
				future: "přibližně za {{count}} hodiny"
			},
			many: {
				regular: "přibližně {{count}} hodin",
				past: "přibližně před {{count}} hodinami",
				future: "přibližně za {{count}} hodin"
			}
		},
		xHours: {
			one: {
				regular: "1 hodina",
				past: "před 1 hodinou",
				future: "za 1 hodinu"
			},
			few: {
				regular: "{{count}} hodiny",
				past: "před {{count}} hodinami",
				future: "za {{count}} hodiny"
			},
			many: {
				regular: "{{count}} hodin",
				past: "před {{count}} hodinami",
				future: "za {{count}} hodin"
			}
		},
		xDays: {
			one: {
				regular: "1 den",
				past: "před 1 dnem",
				future: "za 1 den"
			},
			few: {
				regular: "{{count}} dny",
				past: "před {{count}} dny",
				future: "za {{count}} dny"
			},
			many: {
				regular: "{{count}} dní",
				past: "před {{count}} dny",
				future: "za {{count}} dní"
			}
		},
		aboutXWeeks: {
			one: {
				regular: "přibližně 1 týden",
				past: "přibližně před 1 týdnem",
				future: "přibližně za 1 týden"
			},
			few: {
				regular: "přibližně {{count}} týdny",
				past: "přibližně před {{count}} týdny",
				future: "přibližně za {{count}} týdny"
			},
			many: {
				regular: "přibližně {{count}} týdnů",
				past: "přibližně před {{count}} týdny",
				future: "přibližně za {{count}} týdnů"
			}
		},
		xWeeks: {
			one: {
				regular: "1 týden",
				past: "před 1 týdnem",
				future: "za 1 týden"
			},
			few: {
				regular: "{{count}} týdny",
				past: "před {{count}} týdny",
				future: "za {{count}} týdny"
			},
			many: {
				regular: "{{count}} týdnů",
				past: "před {{count}} týdny",
				future: "za {{count}} týdnů"
			}
		},
		aboutXMonths: {
			one: {
				regular: "přibližně 1 měsíc",
				past: "přibližně před 1 měsícem",
				future: "přibližně za 1 měsíc"
			},
			few: {
				regular: "přibližně {{count}} měsíce",
				past: "přibližně před {{count}} měsíci",
				future: "přibližně za {{count}} měsíce"
			},
			many: {
				regular: "přibližně {{count}} měsíců",
				past: "přibližně před {{count}} měsíci",
				future: "přibližně za {{count}} měsíců"
			}
		},
		xMonths: {
			one: {
				regular: "1 měsíc",
				past: "před 1 měsícem",
				future: "za 1 měsíc"
			},
			few: {
				regular: "{{count}} měsíce",
				past: "před {{count}} měsíci",
				future: "za {{count}} měsíce"
			},
			many: {
				regular: "{{count}} měsíců",
				past: "před {{count}} měsíci",
				future: "za {{count}} měsíců"
			}
		},
		aboutXYears: {
			one: {
				regular: "přibližně 1 rok",
				past: "přibližně před 1 rokem",
				future: "přibližně za 1 rok"
			},
			few: {
				regular: "přibližně {{count}} roky",
				past: "přibližně před {{count}} roky",
				future: "přibližně za {{count}} roky"
			},
			many: {
				regular: "přibližně {{count}} roků",
				past: "přibližně před {{count}} roky",
				future: "přibližně za {{count}} roků"
			}
		},
		xYears: {
			one: {
				regular: "1 rok",
				past: "před 1 rokem",
				future: "za 1 rok"
			},
			few: {
				regular: "{{count}} roky",
				past: "před {{count}} roky",
				future: "za {{count}} roky"
			},
			many: {
				regular: "{{count}} roků",
				past: "před {{count}} roky",
				future: "za {{count}} roků"
			}
		},
		overXYears: {
			one: {
				regular: "více než 1 rok",
				past: "před více než 1 rokem",
				future: "za více než 1 rok"
			},
			few: {
				regular: "více než {{count}} roky",
				past: "před více než {{count}} roky",
				future: "za více než {{count}} roky"
			},
			many: {
				regular: "více než {{count}} roků",
				past: "před více než {{count}} roky",
				future: "za více než {{count}} roků"
			}
		},
		almostXYears: {
			one: {
				regular: "skoro 1 rok",
				past: "skoro před 1 rokem",
				future: "skoro za 1 rok"
			},
			few: {
				regular: "skoro {{count}} roky",
				past: "skoro před {{count}} roky",
				future: "skoro za {{count}} roky"
			},
			many: {
				regular: "skoro {{count}} roků",
				past: "skoro před {{count}} roky",
				future: "skoro za {{count}} roků"
			}
		}
	};
	var formatDistance$68 = (token, count, options) => {
		let pluralResult;
		const tokenValue = formatDistanceLocale$67[token];
		if (tokenValue.type === "other") pluralResult = tokenValue.other;
		else if (count === 1) pluralResult = tokenValue.one;
		else if (count > 1 && count < 5) pluralResult = tokenValue.few;
		else pluralResult = tokenValue.many;
		const suffixExist = options?.addSuffix === true;
		const comparison = options?.comparison;
		let timeResult;
		if (suffixExist && comparison === -1) timeResult = pluralResult.past;
		else if (suffixExist && comparison === 1) timeResult = pluralResult.future;
		else timeResult = pluralResult.regular;
		return timeResult.replace("{{count}}", String(count));
	};
	var formatLong$76 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d. MMMM yyyy",
				long: "d. MMMM yyyy",
				medium: "d. M. yyyy",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'v' {{time}}",
				long: "{{date}} 'v' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cs/_lib/formatRelative.js
	var accusativeWeekdays$5 = [
		"neděli",
		"pondělí",
		"úterý",
		"středu",
		"čtvrtek",
		"pátek",
		"sobotu"
	];
	var formatRelativeLocale$68 = {
		lastWeek: "'poslední' eeee 've' p",
		yesterday: "'včera v' p",
		today: "'dnes v' p",
		tomorrow: "'zítra v' p",
		nextWeek: (date) => {
			return "'v " + accusativeWeekdays$5[date.getDay()] + " o' p";
		},
		other: "P"
	};
	var formatRelative$68 = (token, date) => {
		const format = formatRelativeLocale$68[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cs/_lib/localize.js
	var eraValues$68 = {
		narrow: ["př. n. l.", "n. l."],
		abbreviated: ["př. n. l.", "n. l."],
		wide: ["před naším letopočtem", "našeho letopočtu"]
	};
	var quarterValues$68 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1. čtvrtletí",
			"2. čtvrtletí",
			"3. čtvrtletí",
			"4. čtvrtletí"
		],
		wide: [
			"1. čtvrtletí",
			"2. čtvrtletí",
			"3. čtvrtletí",
			"4. čtvrtletí"
		]
	};
	var monthValues$68 = {
		narrow: [
			"L",
			"Ú",
			"B",
			"D",
			"K",
			"Č",
			"Č",
			"S",
			"Z",
			"Ř",
			"L",
			"P"
		],
		abbreviated: [
			"led",
			"úno",
			"bře",
			"dub",
			"kvě",
			"čvn",
			"čvc",
			"srp",
			"zář",
			"říj",
			"lis",
			"pro"
		],
		wide: [
			"leden",
			"únor",
			"březen",
			"duben",
			"květen",
			"červen",
			"červenec",
			"srpen",
			"září",
			"říjen",
			"listopad",
			"prosinec"
		]
	};
	var formattingMonthValues$15 = {
		narrow: [
			"L",
			"Ú",
			"B",
			"D",
			"K",
			"Č",
			"Č",
			"S",
			"Z",
			"Ř",
			"L",
			"P"
		],
		abbreviated: [
			"led",
			"úno",
			"bře",
			"dub",
			"kvě",
			"čvn",
			"čvc",
			"srp",
			"zář",
			"říj",
			"lis",
			"pro"
		],
		wide: [
			"ledna",
			"února",
			"března",
			"dubna",
			"května",
			"června",
			"července",
			"srpna",
			"září",
			"října",
			"listopadu",
			"prosince"
		]
	};
	var dayValues$68 = {
		narrow: [
			"ne",
			"po",
			"út",
			"st",
			"čt",
			"pá",
			"so"
		],
		short: [
			"ne",
			"po",
			"út",
			"st",
			"čt",
			"pá",
			"so"
		],
		abbreviated: [
			"ned",
			"pon",
			"úte",
			"stř",
			"čtv",
			"pát",
			"sob"
		],
		wide: [
			"neděle",
			"pondělí",
			"úterý",
			"středa",
			"čtvrtek",
			"pátek",
			"sobota"
		]
	};
	var dayPeriodValues$68 = {
		narrow: {
			am: "dop.",
			pm: "odp.",
			midnight: "půlnoc",
			noon: "poledne",
			morning: "ráno",
			afternoon: "odpoledne",
			evening: "večer",
			night: "noc"
		},
		abbreviated: {
			am: "dop.",
			pm: "odp.",
			midnight: "půlnoc",
			noon: "poledne",
			morning: "ráno",
			afternoon: "odpoledne",
			evening: "večer",
			night: "noc"
		},
		wide: {
			am: "dopoledne",
			pm: "odpoledne",
			midnight: "půlnoc",
			noon: "poledne",
			morning: "ráno",
			afternoon: "odpoledne",
			evening: "večer",
			night: "noc"
		}
	};
	var formattingDayPeriodValues$53 = {
		narrow: {
			am: "dop.",
			pm: "odp.",
			midnight: "půlnoc",
			noon: "poledne",
			morning: "ráno",
			afternoon: "odpoledne",
			evening: "večer",
			night: "noc"
		},
		abbreviated: {
			am: "dop.",
			pm: "odp.",
			midnight: "půlnoc",
			noon: "poledne",
			morning: "ráno",
			afternoon: "odpoledne",
			evening: "večer",
			night: "noc"
		},
		wide: {
			am: "dopoledne",
			pm: "odpoledne",
			midnight: "půlnoc",
			noon: "poledne",
			morning: "ráno",
			afternoon: "odpoledne",
			evening: "večer",
			night: "noc"
		}
	};
	var ordinalNumber$68 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cs.js
	/**
	* @category Locales
	* @summary Czech locale.
	* @language Czech
	* @iso-639-2 ces
	* @author David Rus [@davidrus](https://github.com/davidrus)
	* @author Pavel Hrách [@SilenY](https://github.com/SilenY)
	* @author Jozef Bíroš [@JozefBiros](https://github.com/JozefBiros)
	*/
	var cs = {
		code: "cs",
		formatDistance: formatDistance$68,
		formatLong: formatLong$76,
		formatRelative: formatRelative$68,
		localize: {
			ordinalNumber: ordinalNumber$68,
			era: buildLocalizeFn({
				values: eraValues$68,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$68,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$68,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$15,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$68,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$68,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$53,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\.?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,
					abbreviated: /^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,
					wide: /^(p[řr](\.|ed) Kristem|p[řr](\.|ed) na[šs][íi]m letopo[čc]tem|po Kristu|na[šs]eho letopo[čc]tu)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^p[řr]/i, /^(po|n)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]\. [čc]tvrtlet[íi]/i,
					wide: /^[1234]\. [čc]tvrtlet[íi]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[lúubdkčcszřrlp]/i,
					abbreviated: /^(led|[úu]no|b[řr]e|dub|kv[ěe]|[čc]vn|[čc]vc|srp|z[áa][řr]|[řr][íi]j|lis|pro)/i,
					wide: /^(leden|ledna|[úu]nora?|b[řr]ezen|b[řr]ezna|duben|dubna|kv[ěe]ten|kv[ěe]tna|[čc]erven(ec|ce)?|[čc]ervna|srpen|srpna|z[áa][řr][íi]|[řr][íi]jen|[řr][íi]jna|listopad(a|u)?|prosinec|prosince)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^l/i,
						/^[úu]/i,
						/^b/i,
						/^d/i,
						/^k/i,
						/^[čc]/i,
						/^[čc]/i,
						/^s/i,
						/^z/i,
						/^[řr]/i,
						/^l/i,
						/^p/i
					],
					any: [
						/^led/i,
						/^[úu]n/i,
						/^b[řr]e/i,
						/^dub/i,
						/^kv[ěe]/i,
						/^[čc]vn|[čc]erven(?!\w)|[čc]ervna/i,
						/^[čc]vc|[čc]erven(ec|ce)/i,
						/^srp/i,
						/^z[áa][řr]/i,
						/^[řr][íi]j/i,
						/^lis/i,
						/^pro/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[npuúsčps]/i,
					short: /^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,
					abbreviated: /^(ned|pon|[úu]te|st[rř]|[čc]tv|p[áa]t|sob)/i,
					wide: /^(ned[ěe]le|pond[ěe]l[íi]|[úu]ter[ýy]|st[řr]eda|[čc]tvrtek|p[áa]tek|sobota)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^n/i,
						/^p/i,
						/^[úu]/i,
						/^s/i,
						/^[čc]/i,
						/^p/i,
						/^s/i
					],
					any: [
						/^ne/i,
						/^po/i,
						/^[úu]t/i,
						/^st/i,
						/^[čc]t/i,
						/^p[áa]/i,
						/^so/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^dopoledne|dop\.?|odpoledne|odp\.?|p[ůu]lnoc|poledne|r[áa]no|odpoledne|ve[čc]er|(v )?noci?/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^dop/i,
					pm: /^odp/i,
					midnight: /^p[ůu]lnoc/i,
					noon: /^poledne/i,
					morning: /r[áa]no/i,
					afternoon: /odpoledne/i,
					evening: /ve[čc]er/i,
					night: /noc/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cy/_lib/formatDistance.js
	var formatDistanceLocale$66 = {
		lessThanXSeconds: {
			one: "llai na eiliad",
			other: "llai na {{count}} eiliad"
		},
		xSeconds: {
			one: "1 eiliad",
			other: "{{count}} eiliad"
		},
		halfAMinute: "hanner munud",
		lessThanXMinutes: {
			one: "llai na munud",
			two: "llai na 2 funud",
			other: "llai na {{count}} munud"
		},
		xMinutes: {
			one: "1 munud",
			two: "2 funud",
			other: "{{count}} munud"
		},
		aboutXHours: {
			one: "tua 1 awr",
			other: "tua {{count}} awr"
		},
		xHours: {
			one: "1 awr",
			other: "{{count}} awr"
		},
		xDays: {
			one: "1 diwrnod",
			two: "2 ddiwrnod",
			other: "{{count}} diwrnod"
		},
		aboutXWeeks: {
			one: "tua 1 wythnos",
			two: "tua pythefnos",
			other: "tua {{count}} wythnos"
		},
		xWeeks: {
			one: "1 wythnos",
			two: "pythefnos",
			other: "{{count}} wythnos"
		},
		aboutXMonths: {
			one: "tua 1 mis",
			two: "tua 2 fis",
			other: "tua {{count}} mis"
		},
		xMonths: {
			one: "1 mis",
			two: "2 fis",
			other: "{{count}} mis"
		},
		aboutXYears: {
			one: "tua 1 flwyddyn",
			two: "tua 2 flynedd",
			other: "tua {{count}} mlynedd"
		},
		xYears: {
			one: "1 flwyddyn",
			two: "2 flynedd",
			other: "{{count}} mlynedd"
		},
		overXYears: {
			one: "dros 1 flwyddyn",
			two: "dros 2 flynedd",
			other: "dros {{count}} mlynedd"
		},
		almostXYears: {
			one: "bron 1 flwyddyn",
			two: "bron 2 flynedd",
			other: "bron {{count}} mlynedd"
		}
	};
	var formatDistance$67 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$66[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 2 && !!tokenValue.two) result = tokenValue.two;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "mewn " + result;
		else return result + " yn ôl";
		return result;
	};
	var formatLong$75 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'am' {{time}}",
				long: "{{date}} 'am' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cy/_lib/formatRelative.js
	var formatRelativeLocale$67 = {
		lastWeek: "eeee 'diwethaf am' p",
		yesterday: "'ddoe am' p",
		today: "'heddiw am' p",
		tomorrow: "'yfory am' p",
		nextWeek: "eeee 'am' p",
		other: "P"
	};
	var formatRelative$67 = (token, _date, _baseDate, _options) => formatRelativeLocale$67[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/cy/_lib/localize.js
	var eraValues$67 = {
		narrow: ["C", "O"],
		abbreviated: ["CC", "OC"],
		wide: ["Cyn Crist", "Ar ôl Crist"]
	};
	var quarterValues$67 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Ch1",
			"Ch2",
			"Ch3",
			"Ch4"
		],
		wide: [
			"Chwarter 1af",
			"2ail chwarter",
			"3ydd chwarter",
			"4ydd chwarter"
		]
	};
	var monthValues$67 = {
		narrow: [
			"I",
			"Ch",
			"Ma",
			"E",
			"Mi",
			"Me",
			"G",
			"A",
			"Md",
			"H",
			"T",
			"Rh"
		],
		abbreviated: [
			"Ion",
			"Chwe",
			"Maw",
			"Ebr",
			"Mai",
			"Meh",
			"Gor",
			"Aws",
			"Med",
			"Hyd",
			"Tach",
			"Rhag"
		],
		wide: [
			"Ionawr",
			"Chwefror",
			"Mawrth",
			"Ebrill",
			"Mai",
			"Mehefin",
			"Gorffennaf",
			"Awst",
			"Medi",
			"Hydref",
			"Tachwedd",
			"Rhagfyr"
		]
	};
	var dayValues$67 = {
		narrow: [
			"S",
			"Ll",
			"M",
			"M",
			"I",
			"G",
			"S"
		],
		short: [
			"Su",
			"Ll",
			"Ma",
			"Me",
			"Ia",
			"Gw",
			"Sa"
		],
		abbreviated: [
			"Sul",
			"Llun",
			"Maw",
			"Mer",
			"Iau",
			"Gwe",
			"Sad"
		],
		wide: [
			"dydd Sul",
			"dydd Llun",
			"dydd Mawrth",
			"dydd Mercher",
			"dydd Iau",
			"dydd Gwener",
			"dydd Sadwrn"
		]
	};
	var dayPeriodValues$67 = {
		narrow: {
			am: "b",
			pm: "h",
			midnight: "hn",
			noon: "hd",
			morning: "bore",
			afternoon: "prynhawn",
			evening: "gyda'r nos",
			night: "nos"
		},
		abbreviated: {
			am: "yb",
			pm: "yh",
			midnight: "hanner nos",
			noon: "hanner dydd",
			morning: "bore",
			afternoon: "prynhawn",
			evening: "gyda'r nos",
			night: "nos"
		},
		wide: {
			am: "y.b.",
			pm: "y.h.",
			midnight: "hanner nos",
			noon: "hanner dydd",
			morning: "bore",
			afternoon: "prynhawn",
			evening: "gyda'r nos",
			night: "nos"
		}
	};
	var formattingDayPeriodValues$52 = {
		narrow: {
			am: "b",
			pm: "h",
			midnight: "hn",
			noon: "hd",
			morning: "yn y bore",
			afternoon: "yn y prynhawn",
			evening: "gyda'r nos",
			night: "yn y nos"
		},
		abbreviated: {
			am: "yb",
			pm: "yh",
			midnight: "hanner nos",
			noon: "hanner dydd",
			morning: "yn y bore",
			afternoon: "yn y prynhawn",
			evening: "gyda'r nos",
			night: "yn y nos"
		},
		wide: {
			am: "y.b.",
			pm: "y.h.",
			midnight: "hanner nos",
			noon: "hanner dydd",
			morning: "yn y bore",
			afternoon: "yn y prynhawn",
			evening: "gyda'r nos",
			night: "yn y nos"
		}
	};
	var ordinalNumber$67 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		if (number < 20) switch (number) {
			case 0: return number + "fed";
			case 1: return number + "af";
			case 2: return number + "ail";
			case 3:
			case 4: return number + "ydd";
			case 5:
			case 6: return number + "ed";
			case 7:
			case 8:
			case 9:
			case 10:
			case 12:
			case 15:
			case 18: return number + "fed";
			case 11:
			case 13:
			case 14:
			case 16:
			case 17:
			case 19: return number + "eg";
		}
		else if (number >= 50 && number <= 60 || number === 80 || number >= 100) return number + "fed";
		return number + "ain";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/cy.js
	/**
	* @category Locales
	* @summary Welsh locale.
	* @language Welsh
	* @iso-639-2 cym
	* @author Elwyn Malethan [@elmomalmo](https://github.com/elmomalmo)
	*/
	var cy = {
		code: "cy",
		formatDistance: formatDistance$67,
		formatLong: formatLong$75,
		formatRelative: formatRelative$67,
		localize: {
			ordinalNumber: ordinalNumber$67,
			era: buildLocalizeFn({
				values: eraValues$67,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$67,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$67,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$67,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$67,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$52,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(af|ail|ydd|ed|fed|eg|ain)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(c|o)/i,
					abbreviated: /^(c\.?\s?c\.?|o\.?\s?c\.?)/i,
					wide: /^(cyn christ|ar ôl crist|ar ol crist)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					wide: [/^c/i, /^(ar ôl crist|ar ol crist)/i],
					any: [/^c/i, /^o/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ch[1234]/i,
					wide: /^(chwarter 1af)|([234](ail|ydd)? chwarter)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(i|ch|m|e|g|a|h|t|rh)/i,
					abbreviated: /^(ion|chwe|maw|ebr|mai|meh|gor|aws|med|hyd|tach|rhag)/i,
					wide: /^(ionawr|chwefror|mawrth|ebrill|mai|mehefin|gorffennaf|awst|medi|hydref|tachwedd|rhagfyr)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^i/i,
						/^ch/i,
						/^m/i,
						/^e/i,
						/^m/i,
						/^m/i,
						/^g/i,
						/^a/i,
						/^m/i,
						/^h/i,
						/^t/i,
						/^rh/i
					],
					any: [
						/^io/i,
						/^ch/i,
						/^maw/i,
						/^e/i,
						/^mai/i,
						/^meh/i,
						/^g/i,
						/^a/i,
						/^med/i,
						/^h/i,
						/^t/i,
						/^rh/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(s|ll|m|i|g)/i,
					short: /^(su|ll|ma|me|ia|gw|sa)/i,
					abbreviated: /^(sul|llun|maw|mer|iau|gwe|sad)/i,
					wide: /^dydd (sul|llun|mawrth|mercher|iau|gwener|sadwrn)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^ll/i,
						/^m/i,
						/^m/i,
						/^i/i,
						/^g/i,
						/^s/i
					],
					wide: [
						/^dydd su/i,
						/^dydd ll/i,
						/^dydd ma/i,
						/^dydd me/i,
						/^dydd i/i,
						/^dydd g/i,
						/^dydd sa/i
					],
					any: [
						/^su/i,
						/^ll/i,
						/^ma/i,
						/^me/i,
						/^i/i,
						/^g/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(b|h|hn|hd|(yn y|y|yr|gyda'r) (bore|prynhawn|nos|hwyr))/i,
					any: /^(y\.?\s?[bh]\.?|hanner nos|hanner dydd|(yn y|y|yr|gyda'r) (bore|prynhawn|nos|hwyr))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^b|(y\.?\s?b\.?)/i,
					pm: /^h|(y\.?\s?h\.?)|(yr hwyr)/i,
					midnight: /^hn|hanner nos/i,
					noon: /^hd|hanner dydd/i,
					morning: /bore/i,
					afternoon: /prynhawn/i,
					evening: /^gyda'r nos$/i,
					night: /blah/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/da/_lib/formatDistance.js
	var formatDistanceLocale$65 = {
		lessThanXSeconds: {
			one: "mindre end ét sekund",
			other: "mindre end {{count}} sekunder"
		},
		xSeconds: {
			one: "1 sekund",
			other: "{{count}} sekunder"
		},
		halfAMinute: "ét halvt minut",
		lessThanXMinutes: {
			one: "mindre end ét minut",
			other: "mindre end {{count}} minutter"
		},
		xMinutes: {
			one: "1 minut",
			other: "{{count}} minutter"
		},
		aboutXHours: {
			one: "cirka 1 time",
			other: "cirka {{count}} timer"
		},
		xHours: {
			one: "1 time",
			other: "{{count}} timer"
		},
		xDays: {
			one: "1 dag",
			other: "{{count}} dage"
		},
		aboutXWeeks: {
			one: "cirka 1 uge",
			other: "cirka {{count}} uger"
		},
		xWeeks: {
			one: "1 uge",
			other: "{{count}} uger"
		},
		aboutXMonths: {
			one: "cirka 1 måned",
			other: "cirka {{count}} måneder"
		},
		xMonths: {
			one: "1 måned",
			other: "{{count}} måneder"
		},
		aboutXYears: {
			one: "cirka 1 år",
			other: "cirka {{count}} år"
		},
		xYears: {
			one: "1 år",
			other: "{{count}} år"
		},
		overXYears: {
			one: "over 1 år",
			other: "over {{count}} år"
		},
		almostXYears: {
			one: "næsten 1 år",
			other: "næsten {{count}} år"
		}
	};
	var formatDistance$66 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$65[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "om " + result;
		else return result + " siden";
		return result;
	};
	var formatLong$74 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE 'den' d. MMMM y",
				long: "d. MMMM y",
				medium: "d. MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'kl'. {{time}}",
				long: "{{date}} 'kl'. {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/da/_lib/formatRelative.js
	var formatRelativeLocale$66 = {
		lastWeek: "'sidste' eeee 'kl.' p",
		yesterday: "'i går kl.' p",
		today: "'i dag kl.' p",
		tomorrow: "'i morgen kl.' p",
		nextWeek: "'på' eeee 'kl.' p",
		other: "P"
	};
	var formatRelative$66 = (token, _date, _baseDate, _options) => formatRelativeLocale$66[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/da/_lib/localize.js
	var eraValues$66 = {
		narrow: ["fvt", "vt"],
		abbreviated: ["f.v.t.", "v.t."],
		wide: ["før vesterlandsk tidsregning", "vesterlandsk tidsregning"]
	};
	var quarterValues$66 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1. kvt.",
			"2. kvt.",
			"3. kvt.",
			"4. kvt."
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$66 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mar.",
			"apr.",
			"maj",
			"jun.",
			"jul.",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"januar",
			"februar",
			"marts",
			"april",
			"maj",
			"juni",
			"juli",
			"august",
			"september",
			"oktober",
			"november",
			"december"
		]
	};
	var dayValues$66 = {
		narrow: [
			"S",
			"M",
			"T",
			"O",
			"T",
			"F",
			"L"
		],
		short: [
			"sø",
			"ma",
			"ti",
			"on",
			"to",
			"fr",
			"lø"
		],
		abbreviated: [
			"søn.",
			"man.",
			"tir.",
			"ons.",
			"tor.",
			"fre.",
			"lør."
		],
		wide: [
			"søndag",
			"mandag",
			"tirsdag",
			"onsdag",
			"torsdag",
			"fredag",
			"lørdag"
		]
	};
	var dayPeriodValues$66 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "midnat",
			noon: "middag",
			morning: "morgen",
			afternoon: "eftermiddag",
			evening: "aften",
			night: "nat"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "midnat",
			noon: "middag",
			morning: "morgen",
			afternoon: "eftermiddag",
			evening: "aften",
			night: "nat"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnat",
			noon: "middag",
			morning: "morgen",
			afternoon: "eftermiddag",
			evening: "aften",
			night: "nat"
		}
	};
	var formattingDayPeriodValues$51 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "midnat",
			noon: "middag",
			morning: "om morgenen",
			afternoon: "om eftermiddagen",
			evening: "om aftenen",
			night: "om natten"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "midnat",
			noon: "middag",
			morning: "om morgenen",
			afternoon: "om eftermiddagen",
			evening: "om aftenen",
			night: "om natten"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnat",
			noon: "middag",
			morning: "om morgenen",
			afternoon: "om eftermiddagen",
			evening: "om aftenen",
			night: "om natten"
		}
	};
	var ordinalNumber$66 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/da.js
	/**
	* @category Locales
	* @summary Danish locale.
	* @language Danish
	* @iso-639-2 dan
	* @author Mathias Wøbbe [@MathiasKandelborg](https://github.com/MathiasKandelborg)
	* @author Anders B. Hansen [@Andersbiha](https://github.com/Andersbiha)
	* @author [@kgram](https://github.com/kgram)
	* @author [@stefanbugge](https://github.com/stefanbugge)
	*/
	var da = {
		code: "da",
		formatDistance: formatDistance$66,
		formatLong: formatLong$74,
		formatRelative: formatRelative$66,
		localize: {
			ordinalNumber: ordinalNumber$66,
			era: buildLocalizeFn({
				values: eraValues$66,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$66,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$66,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$66,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$66,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$51,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(\.)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(fKr|fvt|eKr|vt)/i,
					abbreviated: /^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,
					wide: /^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^f/i, /^(v|e)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]. kvt\./i,
					wide: /^[1234]\.? kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
					wide: /^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtofl]/i,
					short: /^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,
					abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
					wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^o/i,
						/^t/i,
						/^f/i,
						/^l/i
					],
					any: [
						/^s/i,
						/^m/i,
						/^ti/i,
						/^o/i,
						/^to/i,
						/^f/i,
						/^l/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,
					any: /^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /midnat/i,
					noon: /middag/i,
					morning: /morgen/i,
					afternoon: /eftermiddag/i,
					evening: /aften/i,
					night: /nat/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/de/_lib/formatDistance.js
	var formatDistanceLocale$64 = {
		lessThanXSeconds: {
			standalone: {
				one: "weniger als 1 Sekunde",
				other: "weniger als {{count}} Sekunden"
			},
			withPreposition: {
				one: "weniger als 1 Sekunde",
				other: "weniger als {{count}} Sekunden"
			}
		},
		xSeconds: {
			standalone: {
				one: "1 Sekunde",
				other: "{{count}} Sekunden"
			},
			withPreposition: {
				one: "1 Sekunde",
				other: "{{count}} Sekunden"
			}
		},
		halfAMinute: {
			standalone: "eine halbe Minute",
			withPreposition: "einer halben Minute"
		},
		lessThanXMinutes: {
			standalone: {
				one: "weniger als 1 Minute",
				other: "weniger als {{count}} Minuten"
			},
			withPreposition: {
				one: "weniger als 1 Minute",
				other: "weniger als {{count}} Minuten"
			}
		},
		xMinutes: {
			standalone: {
				one: "1 Minute",
				other: "{{count}} Minuten"
			},
			withPreposition: {
				one: "1 Minute",
				other: "{{count}} Minuten"
			}
		},
		aboutXHours: {
			standalone: {
				one: "etwa 1 Stunde",
				other: "etwa {{count}} Stunden"
			},
			withPreposition: {
				one: "etwa 1 Stunde",
				other: "etwa {{count}} Stunden"
			}
		},
		xHours: {
			standalone: {
				one: "1 Stunde",
				other: "{{count}} Stunden"
			},
			withPreposition: {
				one: "1 Stunde",
				other: "{{count}} Stunden"
			}
		},
		xDays: {
			standalone: {
				one: "1 Tag",
				other: "{{count}} Tage"
			},
			withPreposition: {
				one: "1 Tag",
				other: "{{count}} Tagen"
			}
		},
		aboutXWeeks: {
			standalone: {
				one: "etwa 1 Woche",
				other: "etwa {{count}} Wochen"
			},
			withPreposition: {
				one: "etwa 1 Woche",
				other: "etwa {{count}} Wochen"
			}
		},
		xWeeks: {
			standalone: {
				one: "1 Woche",
				other: "{{count}} Wochen"
			},
			withPreposition: {
				one: "1 Woche",
				other: "{{count}} Wochen"
			}
		},
		aboutXMonths: {
			standalone: {
				one: "etwa 1 Monat",
				other: "etwa {{count}} Monate"
			},
			withPreposition: {
				one: "etwa 1 Monat",
				other: "etwa {{count}} Monaten"
			}
		},
		xMonths: {
			standalone: {
				one: "1 Monat",
				other: "{{count}} Monate"
			},
			withPreposition: {
				one: "1 Monat",
				other: "{{count}} Monaten"
			}
		},
		aboutXYears: {
			standalone: {
				one: "etwa 1 Jahr",
				other: "etwa {{count}} Jahre"
			},
			withPreposition: {
				one: "etwa 1 Jahr",
				other: "etwa {{count}} Jahren"
			}
		},
		xYears: {
			standalone: {
				one: "1 Jahr",
				other: "{{count}} Jahre"
			},
			withPreposition: {
				one: "1 Jahr",
				other: "{{count}} Jahren"
			}
		},
		overXYears: {
			standalone: {
				one: "mehr als 1 Jahr",
				other: "mehr als {{count}} Jahre"
			},
			withPreposition: {
				one: "mehr als 1 Jahr",
				other: "mehr als {{count}} Jahren"
			}
		},
		almostXYears: {
			standalone: {
				one: "fast 1 Jahr",
				other: "fast {{count}} Jahre"
			},
			withPreposition: {
				one: "fast 1 Jahr",
				other: "fast {{count}} Jahren"
			}
		}
	};
	var formatDistance$65 = (token, count, options) => {
		let result;
		const tokenValue = options?.addSuffix ? formatDistanceLocale$64[token].withPreposition : formatDistanceLocale$64[token].standalone;
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
		else return "vor " + result;
		return result;
	};
	var formatLong$73 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y",
				long: "do MMMM y",
				medium: "do MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'um' {{time}}",
				long: "{{date}} 'um' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/de/_lib/formatRelative.js
	var formatRelativeLocale$65 = {
		lastWeek: "'letzten' eeee 'um' p",
		yesterday: "'gestern um' p",
		today: "'heute um' p",
		tomorrow: "'morgen um' p",
		nextWeek: "eeee 'um' p",
		other: "P"
	};
	var formatRelative$65 = (token, _date, _baseDate, _options) => formatRelativeLocale$65[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/de/_lib/localize.js
	var eraValues$65 = {
		narrow: ["v.Chr.", "n.Chr."],
		abbreviated: ["v.Chr.", "n.Chr."],
		wide: ["vor Christus", "nach Christus"]
	};
	var quarterValues$65 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. Quartal",
			"2. Quartal",
			"3. Quartal",
			"4. Quartal"
		]
	};
	var monthValues$65 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Feb",
			"Mär",
			"Apr",
			"Mai",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Okt",
			"Nov",
			"Dez"
		],
		wide: [
			"Januar",
			"Februar",
			"März",
			"April",
			"Mai",
			"Juni",
			"Juli",
			"August",
			"September",
			"Oktober",
			"November",
			"Dezember"
		]
	};
	var formattingMonthValues$14 = {
		narrow: monthValues$65.narrow,
		abbreviated: [
			"Jan.",
			"Feb.",
			"März",
			"Apr.",
			"Mai",
			"Juni",
			"Juli",
			"Aug.",
			"Sep.",
			"Okt.",
			"Nov.",
			"Dez."
		],
		wide: monthValues$65.wide
	};
	var dayValues$65 = {
		narrow: [
			"S",
			"M",
			"D",
			"M",
			"D",
			"F",
			"S"
		],
		short: [
			"So",
			"Mo",
			"Di",
			"Mi",
			"Do",
			"Fr",
			"Sa"
		],
		abbreviated: [
			"So.",
			"Mo.",
			"Di.",
			"Mi.",
			"Do.",
			"Fr.",
			"Sa."
		],
		wide: [
			"Sonntag",
			"Montag",
			"Dienstag",
			"Mittwoch",
			"Donnerstag",
			"Freitag",
			"Samstag"
		]
	};
	var dayPeriodValues$65 = {
		narrow: {
			am: "vm.",
			pm: "nm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "Morgen",
			afternoon: "Nachm.",
			evening: "Abend",
			night: "Nacht"
		},
		abbreviated: {
			am: "vorm.",
			pm: "nachm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "Morgen",
			afternoon: "Nachmittag",
			evening: "Abend",
			night: "Nacht"
		},
		wide: {
			am: "vormittags",
			pm: "nachmittags",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "Morgen",
			afternoon: "Nachmittag",
			evening: "Abend",
			night: "Nacht"
		}
	};
	var formattingDayPeriodValues$50 = {
		narrow: {
			am: "vm.",
			pm: "nm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "morgens",
			afternoon: "nachm.",
			evening: "abends",
			night: "nachts"
		},
		abbreviated: {
			am: "vorm.",
			pm: "nachm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "morgens",
			afternoon: "nachmittags",
			evening: "abends",
			night: "nachts"
		},
		wide: {
			am: "vormittags",
			pm: "nachmittags",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "morgens",
			afternoon: "nachmittags",
			evening: "abends",
			night: "nachts"
		}
	};
	var ordinalNumber$65 = (dirtyNumber) => {
		return Number(dirtyNumber) + ".";
	};
	var localize$65 = {
		ordinalNumber: ordinalNumber$65,
		era: buildLocalizeFn({
			values: eraValues$65,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$65,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$65,
			formattingValues: formattingMonthValues$14,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$65,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$65,
			defaultWidth: "wide",
			formattingValues: formattingDayPeriodValues$50,
			defaultFormattingWidth: "wide"
		})
	};
	var match$64 = {
		ordinalNumber: buildMatchPatternFn({
			matchPattern: /^(\d+)(\.)?/i,
			parsePattern: /\d+/i,
			valueCallback: (value) => parseInt(value)
		}),
		era: buildMatchFn({
			matchPatterns: {
				narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
				abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
				wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [/^v/i, /^n/i] },
			defaultParseWidth: "any"
		}),
		quarter: buildMatchFn({
			matchPatterns: {
				narrow: /^[1234]/i,
				abbreviated: /^q[1234]/i,
				wide: /^[1234](\.)? Quartal/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [
				/1/i,
				/2/i,
				/3/i,
				/4/i
			] },
			defaultParseWidth: "any",
			valueCallback: (index) => index + 1
		}),
		month: buildMatchFn({
			matchPatterns: {
				narrow: /^[jfmasond]/i,
				abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
				wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^j/i,
					/^f/i,
					/^m/i,
					/^a/i,
					/^m/i,
					/^j/i,
					/^j/i,
					/^a/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				],
				any: [
					/^j[aä]/i,
					/^f/i,
					/^mär/i,
					/^ap/i,
					/^mai/i,
					/^jun/i,
					/^jul/i,
					/^au/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				]
			},
			defaultParseWidth: "any"
		}),
		day: buildMatchFn({
			matchPatterns: {
				narrow: /^[smdmf]/i,
				short: /^(so|mo|di|mi|do|fr|sa)/i,
				abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
				wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [
				/^so/i,
				/^mo/i,
				/^di/i,
				/^mi/i,
				/^do/i,
				/^f/i,
				/^sa/i
			] },
			defaultParseWidth: "any"
		}),
		dayPeriod: buildMatchFn({
			matchPatterns: {
				narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
				abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
				wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: {
				am: /^v/i,
				pm: /^n/i,
				midnight: /^Mitte/i,
				noon: /^Mitta/i,
				morning: /morgens/i,
				afternoon: /nachmittags/i,
				evening: /abends/i,
				night: /nachts/i
			} },
			defaultParseWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/de.js
	/**
	* @category Locales
	* @summary German locale.
	* @language German
	* @iso-639-2 deu
	* @author Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu)
	* @author Asia [@asia-t](https://github.com/asia-t)
	* @author Van Vuong Ngo [@vanvuongngo](https://github.com/vanvuongngo)
	* @author RomanErnst [@pex](https://github.com/pex)
	* @author Philipp Keck [@Philipp91](https://github.com/Philipp91)
	*/
	var de = {
		code: "de",
		formatDistance: formatDistance$65,
		formatLong: formatLong$73,
		formatRelative: formatRelative$65,
		localize: localize$65,
		match: match$64,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/de-AT/_lib/localize.js
	var eraValues$64 = {
		narrow: ["v.Chr.", "n.Chr."],
		abbreviated: ["v.Chr.", "n.Chr."],
		wide: ["vor Christus", "nach Christus"]
	};
	var quarterValues$64 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. Quartal",
			"2. Quartal",
			"3. Quartal",
			"4. Quartal"
		]
	};
	var monthValues$64 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jän",
			"Feb",
			"Mär",
			"Apr",
			"Mai",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Okt",
			"Nov",
			"Dez"
		],
		wide: [
			"Jänner",
			"Februar",
			"März",
			"April",
			"Mai",
			"Juni",
			"Juli",
			"August",
			"September",
			"Oktober",
			"November",
			"Dezember"
		]
	};
	var formattingMonthValues$13 = {
		narrow: monthValues$64.narrow,
		abbreviated: [
			"Jän.",
			"Feb.",
			"März",
			"Apr.",
			"Mai",
			"Juni",
			"Juli",
			"Aug.",
			"Sep.",
			"Okt.",
			"Nov.",
			"Dez."
		],
		wide: monthValues$64.wide
	};
	var dayValues$64 = {
		narrow: [
			"S",
			"M",
			"D",
			"M",
			"D",
			"F",
			"S"
		],
		short: [
			"So",
			"Mo",
			"Di",
			"Mi",
			"Do",
			"Fr",
			"Sa"
		],
		abbreviated: [
			"So.",
			"Mo.",
			"Di.",
			"Mi.",
			"Do.",
			"Fr.",
			"Sa."
		],
		wide: [
			"Sonntag",
			"Montag",
			"Dienstag",
			"Mittwoch",
			"Donnerstag",
			"Freitag",
			"Samstag"
		]
	};
	var dayPeriodValues$64 = {
		narrow: {
			am: "vm.",
			pm: "nm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "Morgen",
			afternoon: "Nachm.",
			evening: "Abend",
			night: "Nacht"
		},
		abbreviated: {
			am: "vorm.",
			pm: "nachm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "Morgen",
			afternoon: "Nachmittag",
			evening: "Abend",
			night: "Nacht"
		},
		wide: {
			am: "vormittags",
			pm: "nachmittags",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "Morgen",
			afternoon: "Nachmittag",
			evening: "Abend",
			night: "Nacht"
		}
	};
	var formattingDayPeriodValues$49 = {
		narrow: {
			am: "vm.",
			pm: "nm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "morgens",
			afternoon: "nachm.",
			evening: "abends",
			night: "nachts"
		},
		abbreviated: {
			am: "vorm.",
			pm: "nachm.",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "morgens",
			afternoon: "nachmittags",
			evening: "abends",
			night: "nachts"
		},
		wide: {
			am: "vormittags",
			pm: "nachmittags",
			midnight: "Mitternacht",
			noon: "Mittag",
			morning: "morgens",
			afternoon: "nachmittags",
			evening: "abends",
			night: "nachts"
		}
	};
	var ordinalNumber$64 = (dirtyNumber) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/de-AT.js
	/**
	* @category Locales
	* @summary German locale (Austria).
	* @language German
	* @iso-639-2 deu
	* @author Christoph Tobias Stenglein [@cstenglein](https://github.com/cstenglein)
	*/
	var deAT = {
		code: "de-AT",
		formatDistance: formatDistance$65,
		formatLong: formatLong$73,
		formatRelative: formatRelative$65,
		localize: {
			ordinalNumber: ordinalNumber$64,
			era: buildLocalizeFn({
				values: eraValues$64,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$64,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$64,
				formattingValues: formattingMonthValues$13,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$64,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$64,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$49,
				defaultFormattingWidth: "wide"
			})
		},
		match: match$64,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/el/_lib/formatDistance.js
	var formatDistanceLocale$63 = {
		lessThanXSeconds: {
			one: "λιγότερο από ένα δευτερόλεπτο",
			other: "λιγότερο από {{count}} δευτερόλεπτα"
		},
		xSeconds: {
			one: "1 δευτερόλεπτο",
			other: "{{count}} δευτερόλεπτα"
		},
		halfAMinute: "μισό λεπτό",
		lessThanXMinutes: {
			one: "λιγότερο από ένα λεπτό",
			other: "λιγότερο από {{count}} λεπτά"
		},
		xMinutes: {
			one: "1 λεπτό",
			other: "{{count}} λεπτά"
		},
		aboutXHours: {
			one: "περίπου 1 ώρα",
			other: "περίπου {{count}} ώρες"
		},
		xHours: {
			one: "1 ώρα",
			other: "{{count}} ώρες"
		},
		xDays: {
			one: "1 ημέρα",
			other: "{{count}} ημέρες"
		},
		aboutXWeeks: {
			one: "περίπου 1 εβδομάδα",
			other: "περίπου {{count}} εβδομάδες"
		},
		xWeeks: {
			one: "1 εβδομάδα",
			other: "{{count}} εβδομάδες"
		},
		aboutXMonths: {
			one: "περίπου 1 μήνας",
			other: "περίπου {{count}} μήνες"
		},
		xMonths: {
			one: "1 μήνας",
			other: "{{count}} μήνες"
		},
		aboutXYears: {
			one: "περίπου 1 χρόνο",
			other: "περίπου {{count}} χρόνια"
		},
		xYears: {
			one: "1 χρόνο",
			other: "{{count}} χρόνια"
		},
		overXYears: {
			one: "πάνω από 1 χρόνο",
			other: "πάνω από {{count}} χρόνια"
		},
		almostXYears: {
			one: "περίπου 1 χρόνο",
			other: "περίπου {{count}} χρόνια"
		}
	};
	var formatDistance$64 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$63[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "σε " + result;
		else return result + " πριν";
		return result;
	};
	var formatLong$72 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "d/M/yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} - {{time}}",
				long: "{{date}} - {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/el/_lib/formatRelative.js
	var formatRelativeLocale$64 = {
		lastWeek: (date) => {
			switch (date.getDay()) {
				case 6: return "'το προηγούμενο' eeee 'στις' p";
				default: return "'την προηγούμενη' eeee 'στις' p";
			}
		},
		yesterday: "'χθες στις' p",
		today: "'σήμερα στις' p",
		tomorrow: "'αύριο στις' p",
		nextWeek: "eeee 'στις' p",
		other: "P"
	};
	var formatRelative$64 = (token, date) => {
		const format = formatRelativeLocale$64[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/el/_lib/localize.js
	var eraValues$63 = {
		narrow: ["πΧ", "μΧ"],
		abbreviated: ["π.Χ.", "μ.Χ."],
		wide: ["προ Χριστού", "μετά Χριστόν"]
	};
	var quarterValues$63 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Τ1",
			"Τ2",
			"Τ3",
			"Τ4"
		],
		wide: [
			"1ο τρίμηνο",
			"2ο τρίμηνο",
			"3ο τρίμηνο",
			"4ο τρίμηνο"
		]
	};
	var monthValues$63 = {
		narrow: [
			"Ι",
			"Φ",
			"Μ",
			"Α",
			"Μ",
			"Ι",
			"Ι",
			"Α",
			"Σ",
			"Ο",
			"Ν",
			"Δ"
		],
		abbreviated: [
			"Ιαν",
			"Φεβ",
			"Μάρ",
			"Απρ",
			"Μάι",
			"Ιούν",
			"Ιούλ",
			"Αύγ",
			"Σεπ",
			"Οκτ",
			"Νοέ",
			"Δεκ"
		],
		wide: [
			"Ιανουάριος",
			"Φεβρουάριος",
			"Μάρτιος",
			"Απρίλιος",
			"Μάιος",
			"Ιούνιος",
			"Ιούλιος",
			"Αύγουστος",
			"Σεπτέμβριος",
			"Οκτώβριος",
			"Νοέμβριος",
			"Δεκέμβριος"
		]
	};
	var formattingMonthValues$12 = {
		narrow: [
			"Ι",
			"Φ",
			"Μ",
			"Α",
			"Μ",
			"Ι",
			"Ι",
			"Α",
			"Σ",
			"Ο",
			"Ν",
			"Δ"
		],
		abbreviated: [
			"Ιαν",
			"Φεβ",
			"Μαρ",
			"Απρ",
			"Μαΐ",
			"Ιουν",
			"Ιουλ",
			"Αυγ",
			"Σεπ",
			"Οκτ",
			"Νοε",
			"Δεκ"
		],
		wide: [
			"Ιανουαρίου",
			"Φεβρουαρίου",
			"Μαρτίου",
			"Απριλίου",
			"Μαΐου",
			"Ιουνίου",
			"Ιουλίου",
			"Αυγούστου",
			"Σεπτεμβρίου",
			"Οκτωβρίου",
			"Νοεμβρίου",
			"Δεκεμβρίου"
		]
	};
	var dayValues$63 = {
		narrow: [
			"Κ",
			"Δ",
			"T",
			"Τ",
			"Π",
			"Π",
			"Σ"
		],
		short: [
			"Κυ",
			"Δε",
			"Τρ",
			"Τε",
			"Πέ",
			"Πα",
			"Σά"
		],
		abbreviated: [
			"Κυρ",
			"Δευ",
			"Τρί",
			"Τετ",
			"Πέμ",
			"Παρ",
			"Σάβ"
		],
		wide: [
			"Κυριακή",
			"Δευτέρα",
			"Τρίτη",
			"Τετάρτη",
			"Πέμπτη",
			"Παρασκευή",
			"Σάββατο"
		]
	};
	var dayPeriodValues$63 = {
		narrow: {
			am: "πμ",
			pm: "μμ",
			midnight: "μεσάνυχτα",
			noon: "μεσημέρι",
			morning: "πρωί",
			afternoon: "απόγευμα",
			evening: "βράδυ",
			night: "νύχτα"
		},
		abbreviated: {
			am: "π.μ.",
			pm: "μ.μ.",
			midnight: "μεσάνυχτα",
			noon: "μεσημέρι",
			morning: "πρωί",
			afternoon: "απόγευμα",
			evening: "βράδυ",
			night: "νύχτα"
		},
		wide: {
			am: "π.μ.",
			pm: "μ.μ.",
			midnight: "μεσάνυχτα",
			noon: "μεσημέρι",
			morning: "πρωί",
			afternoon: "απόγευμα",
			evening: "βράδυ",
			night: "νύχτα"
		}
	};
	var ordinalNumber$63 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const unit = options?.unit;
		let suffix;
		if (unit === "year" || unit === "month") suffix = "ος";
		else if (unit === "week" || unit === "dayOfYear" || unit === "day" || unit === "hour" || unit === "date") suffix = "η";
		else suffix = "ο";
		return number + suffix;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/el.js
	/**
	* @category Locales
	* @summary Greek locale.
	* @language Greek
	* @iso-639-2 ell
	* @author Fanis Katsimpas [@fanixk](https://github.com/fanixk)
	* @author Theodoros Orfanidis [@teoulas](https://github.com/teoulas)
	*/
	var el = {
		code: "el",
		formatDistance: formatDistance$64,
		formatLong: formatLong$72,
		formatRelative: formatRelative$64,
		localize: {
			ordinalNumber: ordinalNumber$63,
			era: buildLocalizeFn({
				values: eraValues$63,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$63,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$63,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$12,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$63,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$63,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(ος|η|ο)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(πΧ|μΧ)/i,
					abbreviated: /^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,
					wide: /^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^π/i, /^(μ|κ)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^τ[1234]/i,
					wide: /^[1234]ο? τρ(ί|ι)μηνο/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[ιφμαμιιασονδ]/i,
					abbreviated: /^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,
					wide: /^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ι/i,
						/^φ/i,
						/^μ/i,
						/^α/i,
						/^μ/i,
						/^ι/i,
						/^ι/i,
						/^α/i,
						/^σ/i,
						/^ο/i,
						/^ν/i,
						/^δ/i
					],
					any: [
						/^ια/i,
						/^φ/i,
						/^μ[άα]ρ/i,
						/^απ/i,
						/^μ[άα][ιΐ]/i,
						/^ιο[ύυ]ν/i,
						/^ιο[ύυ]λ/i,
						/^α[ύυ]/i,
						/^σ/i,
						/^ο/i,
						/^ν/i,
						/^δ/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[κδτπσ]/i,
					short: /^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,
					abbreviated: /^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,
					wide: /^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^κ/i,
						/^δ/i,
						/^τ/i,
						/^τ/i,
						/^π/i,
						/^π/i,
						/^σ/i
					],
					any: [
						/^κ/i,
						/^δ/i,
						/^τρ/i,
						/^τε/i,
						/^π[εέ]/i,
						/^π[αά]/i,
						/^σ/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,
					any: /^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^πμ|π\.\s?μ\./i,
					pm: /^μμ|μ\.\s?μ\./i,
					midnight: /^μεσάν/i,
					noon: /^μεσημ(έ|ε)/i,
					morning: /πρω(ί|ι)/i,
					afternoon: /απ(ό|ο)γευμα/i,
					evening: /βρ(ά|α)δυ/i,
					night: /ν(ύ|υ)χτα/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-AU.js
	/**
	* @category Locales
	* @summary English locale (Australia).
	* @language English
	* @iso-639-2 eng
	* @author Julien Malige [@JulienMalige](https://github.com/JulienMalige)
	*/
	var enAU = {
		code: "en-AU",
		formatDistance: formatDistance$84,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE, d MMMM yyyy",
					long: "d MMMM yyyy",
					medium: "d MMM yyyy",
					short: "dd/MM/yyyy"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "h:mm:ss a zzzz",
					long: "h:mm:ss a z",
					medium: "h:mm:ss a",
					short: "h:mm a"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} 'at' {{time}}",
					long: "{{date}} 'at' {{time}}",
					medium: "{{date}}, {{time}}",
					short: "{{date}}, {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-CA/_lib/formatDistance.js
	var formatDistanceLocale$62 = {
		lessThanXSeconds: {
			one: "less than a second",
			other: "less than {{count}} seconds"
		},
		xSeconds: {
			one: "a second",
			other: "{{count}} seconds"
		},
		halfAMinute: "half a minute",
		lessThanXMinutes: {
			one: "less than a minute",
			other: "less than {{count}} minutes"
		},
		xMinutes: {
			one: "a minute",
			other: "{{count}} minutes"
		},
		aboutXHours: {
			one: "about an hour",
			other: "about {{count}} hours"
		},
		xHours: {
			one: "an hour",
			other: "{{count}} hours"
		},
		xDays: {
			one: "a day",
			other: "{{count}} days"
		},
		aboutXWeeks: {
			one: "about a week",
			other: "about {{count}} weeks"
		},
		xWeeks: {
			one: "a week",
			other: "{{count}} weeks"
		},
		aboutXMonths: {
			one: "about a month",
			other: "about {{count}} months"
		},
		xMonths: {
			one: "a month",
			other: "{{count}} months"
		},
		aboutXYears: {
			one: "about a year",
			other: "about {{count}} years"
		},
		xYears: {
			one: "a year",
			other: "{{count}} years"
		},
		overXYears: {
			one: "over a year",
			other: "over {{count}} years"
		},
		almostXYears: {
			one: "almost a year",
			other: "almost {{count}} years"
		}
	};
	var formatDistance$63 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$62[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
		else return result + " ago";
		return result;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-CA.js
	/**
	* @category Locales
	* @summary English locale (Canada).
	* @language English
	* @iso-639-2 eng
	* @author Mark Owsiak [@markowsiak](https://github.com/markowsiak)
	* @author Marco Imperatore [@mimperatore](https://github.com/mimperatore)
	*/
	var enCA = {
		code: "en-CA",
		formatDistance: formatDistance$63,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE, MMMM do, yyyy",
					long: "MMMM do, yyyy",
					medium: "MMM d, yyyy",
					short: "yyyy-MM-dd"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "h:mm:ss a zzzz",
					long: "h:mm:ss a z",
					medium: "h:mm:ss a",
					short: "h:mm a"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} 'at' {{time}}",
					long: "{{date}} 'at' {{time}}",
					medium: "{{date}}, {{time}}",
					short: "{{date}}, {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	var formatLong$69 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'at' {{time}}",
				long: "{{date}} 'at' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-GB.js
	/**
	* @category Locales
	* @summary English locale (United Kingdom).
	* @language English
	* @iso-639-2 eng
	* @author Alex [@glintik](https://github.com/glintik)
	*/
	var enGB = {
		code: "en-GB",
		formatDistance: formatDistance$84,
		formatLong: formatLong$69,
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-IE.js
	/**
	* @category Locales
	* @summary English locale (Ireland).
	* @language English
	* @iso-639-2 eng
	* @author Tetiana [@tan75](https://github.com/tan75)
	*/
	var enIE = {
		code: "en-IE",
		formatDistance: formatDistance$84,
		formatLong: formatLong$69,
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-IN.js
	/**
	* @category Locales
	* @summary English locale (India).
	* @language English
	* @iso-639-2 eng
	* @author Galeel Bhasha Satthar [@gbhasha](https://github.com/gbhasha)
	*/
	var enIN = {
		code: "en-IN",
		formatDistance: formatDistance$84,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE, d MMMM yyyy",
					long: "d MMMM, yyyy",
					medium: "d MMM, yyyy",
					short: "dd/MM/yyyy"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "h:mm:ss a zzzz",
					long: "h:mm:ss a z",
					medium: "h:mm:ss a",
					short: "h:mm a"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} 'at' {{time}}",
					long: "{{date}} 'at' {{time}}",
					medium: "{{date}}, {{time}}",
					short: "{{date}}, {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-NZ.js
	/**
	* @category Locales
	* @summary English locale (New Zealand).
	* @language English
	* @iso-639-2 eng
	* @author Murray Lucas [@muntact](https://github.com/muntact)
	*/
	var enNZ = {
		code: "en-NZ",
		formatDistance: formatDistance$84,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE, d MMMM yyyy",
					long: "d MMMM yyyy",
					medium: "d MMM yyyy",
					short: "dd/MM/yyyy"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "h:mm:ss a zzzz",
					long: "h:mm:ss a z",
					medium: "h:mm:ss a",
					short: "h:mm a"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} 'at' {{time}}",
					long: "{{date}} 'at' {{time}}",
					medium: "{{date}}, {{time}}",
					short: "{{date}}, {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/en-ZA.js
	/**
	* @category Locales
	* @summary English locale (South Africa).
	* @language English
	* @iso-639-2 eng
	* @author Shaila Kavrakova [@shaykav](https://github.com/shaykav)
	*/
	var enZA = {
		code: "en-ZA",
		formatDistance: formatDistance$84,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE, dd MMMM yyyy",
					long: "dd MMMM yyyy",
					medium: "dd MMM yyyy",
					short: "yyyy/MM/dd"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "HH:mm:ss zzzz",
					long: "HH:mm:ss z",
					medium: "HH:mm:ss",
					short: "HH:mm"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} 'at' {{time}}",
					long: "{{date}} 'at' {{time}}",
					medium: "{{date}}, {{time}}",
					short: "{{date}}, {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$84,
		localize: localize$84,
		match: match$83,
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eo/_lib/formatDistance.js
	var formatDistanceLocale$61 = {
		lessThanXSeconds: {
			one: "malpli ol sekundo",
			other: "malpli ol {{count}} sekundoj"
		},
		xSeconds: {
			one: "1 sekundo",
			other: "{{count}} sekundoj"
		},
		halfAMinute: "duonminuto",
		lessThanXMinutes: {
			one: "malpli ol minuto",
			other: "malpli ol {{count}} minutoj"
		},
		xMinutes: {
			one: "1 minuto",
			other: "{{count}} minutoj"
		},
		aboutXHours: {
			one: "proksimume 1 horo",
			other: "proksimume {{count}} horoj"
		},
		xHours: {
			one: "1 horo",
			other: "{{count}} horoj"
		},
		xDays: {
			one: "1 tago",
			other: "{{count}} tagoj"
		},
		aboutXMonths: {
			one: "proksimume 1 monato",
			other: "proksimume {{count}} monatoj"
		},
		xWeeks: {
			one: "1 semajno",
			other: "{{count}} semajnoj"
		},
		aboutXWeeks: {
			one: "proksimume 1 semajno",
			other: "proksimume {{count}} semajnoj"
		},
		xMonths: {
			one: "1 monato",
			other: "{{count}} monatoj"
		},
		aboutXYears: {
			one: "proksimume 1 jaro",
			other: "proksimume {{count}} jaroj"
		},
		xYears: {
			one: "1 jaro",
			other: "{{count}} jaroj"
		},
		overXYears: {
			one: "pli ol 1 jaro",
			other: "pli ol {{count}} jaroj"
		},
		almostXYears: {
			one: "preskaŭ 1 jaro",
			other: "preskaŭ {{count}} jaroj"
		}
	};
	var formatDistance$62 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$61[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options?.comparison && options.comparison > 0) return "post " + result;
		else return "antaŭ " + result;
		return result;
	};
	var formatLong$65 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do 'de' MMMM y",
				long: "y-MMMM-dd",
				medium: "y-MMM-dd",
				short: "yyyy-MM-dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "Ho 'horo kaj' m:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}} {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eo/_lib/formatRelative.js
	var formatRelativeLocale$63 = {
		lastWeek: "'pasinta' eeee 'je' p",
		yesterday: "'hieraŭ je' p",
		today: "'hodiaŭ je' p",
		tomorrow: "'morgaŭ je' p",
		nextWeek: "eeee 'je' p",
		other: "P"
	};
	var formatRelative$63 = (token, _date, _baseDate, _options) => formatRelativeLocale$63[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/eo/_lib/localize.js
	var eraValues$62 = {
		narrow: ["aK", "pK"],
		abbreviated: ["a.K.E.", "p.K.E."],
		wide: ["antaŭ Komuna Erao", "Komuna Erao"]
	};
	var quarterValues$62 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1-a kvaronjaro",
			"2-a kvaronjaro",
			"3-a kvaronjaro",
			"4-a kvaronjaro"
		]
	};
	var monthValues$62 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"maj",
			"jun",
			"jul",
			"aŭg",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"januaro",
			"februaro",
			"marto",
			"aprilo",
			"majo",
			"junio",
			"julio",
			"aŭgusto",
			"septembro",
			"oktobro",
			"novembro",
			"decembro"
		]
	};
	var dayValues$62 = {
		narrow: [
			"D",
			"L",
			"M",
			"M",
			"Ĵ",
			"V",
			"S"
		],
		short: [
			"di",
			"lu",
			"ma",
			"me",
			"ĵa",
			"ve",
			"sa"
		],
		abbreviated: [
			"dim",
			"lun",
			"mar",
			"mer",
			"ĵaŭ",
			"ven",
			"sab"
		],
		wide: [
			"dimanĉo",
			"lundo",
			"mardo",
			"merkredo",
			"ĵaŭdo",
			"vendredo",
			"sabato"
		]
	};
	var dayPeriodValues$62 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "noktomezo",
			noon: "tagmezo",
			morning: "matene",
			afternoon: "posttagmeze",
			evening: "vespere",
			night: "nokte"
		},
		abbreviated: {
			am: "a.t.m.",
			pm: "p.t.m.",
			midnight: "noktomezo",
			noon: "tagmezo",
			morning: "matene",
			afternoon: "posttagmeze",
			evening: "vespere",
			night: "nokte"
		},
		wide: {
			am: "antaŭtagmeze",
			pm: "posttagmeze",
			midnight: "noktomezo",
			noon: "tagmezo",
			morning: "matene",
			afternoon: "posttagmeze",
			evening: "vespere",
			night: "nokte"
		}
	};
	var ordinalNumber$62 = (dirtyNumber) => {
		return Number(dirtyNumber) + "-a";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eo.js
	/**
	* @category Locales
	* @summary Esperanto locale.
	* @language Esperanto
	* @iso-639-2 epo
	* @author date-fns
	*/
	var eo = {
		code: "eo",
		formatDistance: formatDistance$62,
		formatLong: formatLong$65,
		formatRelative: formatRelative$63,
		localize: {
			ordinalNumber: ordinalNumber$62,
			era: buildLocalizeFn({
				values: eraValues$62,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$62,
				defaultWidth: "wide",
				argumentCallback: function(quarter) {
					return Number(quarter) - 1;
				}
			}),
			month: buildLocalizeFn({
				values: monthValues$62,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$62,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$62,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?a)?/i,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^([ap]k)/i,
					abbreviated: /^([ap]\.?\s?k\.?\s?e\.?)/i,
					wide: /^((antaǔ |post )?komuna erao)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^a/i, /^[kp]/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^k[1234]/i,
					wide: /^[1234](-?a)? kvaronjaro/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: function(index) {
					return index + 1;
				}
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|a(ŭ|ux|uh|u)g|sep|okt|nov|dec)/i,
					wide: /^(januaro|februaro|marto|aprilo|majo|junio|julio|a(ŭ|ux|uh|u)gusto|septembro|oktobro|novembro|decembro)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^a(u|ŭ)/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dlmĵjvs]/i,
					short: /^(di|lu|ma|me|(ĵ|jx|jh|j)a|ve|sa)/i,
					abbreviated: /^(dim|lun|mar|mer|(ĵ|jx|jh|j)a(ŭ|ux|uh|u)|ven|sab)/i,
					wide: /^(diman(ĉ|cx|ch|c)o|lundo|mardo|merkredo|(ĵ|jx|jh|j)a(ŭ|ux|uh|u)do|vendredo|sabato)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^m/i,
						/^(j|ĵ)/i,
						/^v/i,
						/^s/i
					],
					any: [
						/^d/i,
						/^l/i,
						/^ma/i,
						/^me/i,
						/^(j|ĵ)/i,
						/^v/i,
						/^s/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^([ap]|(posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo])/i,
					abbreviated: /^([ap][.\s]?t[.\s]?m[.\s]?|(posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo])/i,
					wide: /^(anta(ŭ|ux)tagmez|posttagmez|noktomez|tagmez|maten|vesper|nokt)[eo]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^noktom/i,
					noon: /^t/i,
					morning: /^m/i,
					afternoon: /^posttagmeze/i,
					evening: /^v/i,
					night: /^n/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/es/_lib/formatDistance.js
	var formatDistanceLocale$60 = {
		lessThanXSeconds: {
			one: "menos de un segundo",
			other: "menos de {{count}} segundos"
		},
		xSeconds: {
			one: "1 segundo",
			other: "{{count}} segundos"
		},
		halfAMinute: "medio minuto",
		lessThanXMinutes: {
			one: "menos de un minuto",
			other: "menos de {{count}} minutos"
		},
		xMinutes: {
			one: "1 minuto",
			other: "{{count}} minutos"
		},
		aboutXHours: {
			one: "alrededor de 1 hora",
			other: "alrededor de {{count}} horas"
		},
		xHours: {
			one: "1 hora",
			other: "{{count}} horas"
		},
		xDays: {
			one: "1 día",
			other: "{{count}} días"
		},
		aboutXWeeks: {
			one: "alrededor de 1 semana",
			other: "alrededor de {{count}} semanas"
		},
		xWeeks: {
			one: "1 semana",
			other: "{{count}} semanas"
		},
		aboutXMonths: {
			one: "alrededor de 1 mes",
			other: "alrededor de {{count}} meses"
		},
		xMonths: {
			one: "1 mes",
			other: "{{count}} meses"
		},
		aboutXYears: {
			one: "alrededor de 1 año",
			other: "alrededor de {{count}} años"
		},
		xYears: {
			one: "1 año",
			other: "{{count}} años"
		},
		overXYears: {
			one: "más de 1 año",
			other: "más de {{count}} años"
		},
		almostXYears: {
			one: "casi 1 año",
			other: "casi {{count}} años"
		}
	};
	var formatDistance$61 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$60[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "en " + result;
		else return "hace " + result;
		return result;
	};
	var formatLong$64 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d 'de' MMMM 'de' y",
				long: "d 'de' MMMM 'de' y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'a las' {{time}}",
				long: "{{date}} 'a las' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/es/_lib/formatRelative.js
	var formatRelativeLocale$62 = {
		lastWeek: "'el' eeee 'pasado a la' p",
		yesterday: "'ayer a la' p",
		today: "'hoy a la' p",
		tomorrow: "'mañana a la' p",
		nextWeek: "eeee 'a la' p",
		other: "P"
	};
	var formatRelativeLocalePlural$2 = {
		lastWeek: "'el' eeee 'pasado a las' p",
		yesterday: "'ayer a las' p",
		today: "'hoy a las' p",
		tomorrow: "'mañana a las' p",
		nextWeek: "eeee 'a las' p",
		other: "P"
	};
	var formatRelative$62 = (token, date, _baseDate, _options) => {
		if (date.getHours() !== 1) return formatRelativeLocalePlural$2[token];
		else return formatRelativeLocale$62[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/es/_lib/localize.js
	var eraValues$61 = {
		narrow: ["AC", "DC"],
		abbreviated: ["AC", "DC"],
		wide: ["antes de cristo", "después de cristo"]
	};
	var quarterValues$61 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"1º trimestre",
			"2º trimestre",
			"3º trimestre",
			"4º trimestre"
		]
	};
	var monthValues$61 = {
		narrow: [
			"e",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"ene",
			"feb",
			"mar",
			"abr",
			"may",
			"jun",
			"jul",
			"ago",
			"sep",
			"oct",
			"nov",
			"dic"
		],
		wide: [
			"enero",
			"febrero",
			"marzo",
			"abril",
			"mayo",
			"junio",
			"julio",
			"agosto",
			"septiembre",
			"octubre",
			"noviembre",
			"diciembre"
		]
	};
	var dayValues$61 = {
		narrow: [
			"d",
			"l",
			"m",
			"m",
			"j",
			"v",
			"s"
		],
		short: [
			"do",
			"lu",
			"ma",
			"mi",
			"ju",
			"vi",
			"sá"
		],
		abbreviated: [
			"dom",
			"lun",
			"mar",
			"mié",
			"jue",
			"vie",
			"sáb"
		],
		wide: [
			"domingo",
			"lunes",
			"martes",
			"miércoles",
			"jueves",
			"viernes",
			"sábado"
		]
	};
	var dayPeriodValues$61 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "md",
			morning: "mañana",
			afternoon: "tarde",
			evening: "tarde",
			night: "noche"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "medianoche",
			noon: "mediodia",
			morning: "mañana",
			afternoon: "tarde",
			evening: "tarde",
			night: "noche"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "medianoche",
			noon: "mediodia",
			morning: "mañana",
			afternoon: "tarde",
			evening: "tarde",
			night: "noche"
		}
	};
	var formattingDayPeriodValues$48 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "md",
			morning: "de la mañana",
			afternoon: "de la tarde",
			evening: "de la tarde",
			night: "de la noche"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "medianoche",
			noon: "mediodia",
			morning: "de la mañana",
			afternoon: "de la tarde",
			evening: "de la tarde",
			night: "de la noche"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "medianoche",
			noon: "mediodia",
			morning: "de la mañana",
			afternoon: "de la tarde",
			evening: "de la tarde",
			night: "de la noche"
		}
	};
	var ordinalNumber$61 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "º";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/es.js
	/**
	* @category Locales
	* @summary Spanish locale.
	* @language Spanish
	* @iso-639-2 spa
	* @author Juan Angosto [@juanangosto](https://github.com/juanangosto)
	* @author Guillermo Grau [@guigrpa](https://github.com/guigrpa)
	* @author Fernando Agüero [@fjaguero](https://github.com/fjaguero)
	* @author Gastón Haro [@harogaston](https://github.com/harogaston)
	* @author Yago Carballo [@YagoCarballo](https://github.com/YagoCarballo)
	*/
	var es = {
		code: "es",
		formatDistance: formatDistance$61,
		formatLong: formatLong$64,
		formatRelative: formatRelative$62,
		localize: {
			ordinalNumber: ordinalNumber$61,
			era: buildLocalizeFn({
				values: eraValues$61,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$61,
				defaultWidth: "wide",
				argumentCallback: (quarter) => Number(quarter) - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$61,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$61,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$61,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$48,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(º)?/i,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ac|dc|a|d)/i,
					abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
					wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					any: [/^ac/i, /^dc/i],
					wide: [/^(antes de cristo|antes de la era com[uú]n)/i, /^(despu[eé]s de cristo|era com[uú]n)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^T[1234]/i,
					wide: /^[1234](º)? trimestre/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[efmajsond]/i,
					abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
					wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^e/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^en/i,
						/^feb/i,
						/^mar/i,
						/^abr/i,
						/^may/i,
						/^jun/i,
						/^jul/i,
						/^ago/i,
						/^sep/i,
						/^oct/i,
						/^nov/i,
						/^dic/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dlmjvs]/i,
					short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
					abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
					wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^m/i,
						/^j/i,
						/^v/i,
						/^s/i
					],
					any: [
						/^do/i,
						/^lu/i,
						/^ma/i,
						/^mi/i,
						/^ju/i,
						/^vi/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
					any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mn/i,
					noon: /^md/i,
					morning: /mañana/i,
					afternoon: /tarde/i,
					evening: /tarde/i,
					night: /noche/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/et/_lib/formatDistance.js
	var formatDistanceLocale$59 = {
		lessThanXSeconds: {
			standalone: {
				one: "vähem kui üks sekund",
				other: "vähem kui {{count}} sekundit"
			},
			withPreposition: {
				one: "vähem kui ühe sekundi",
				other: "vähem kui {{count}} sekundi"
			}
		},
		xSeconds: {
			standalone: {
				one: "üks sekund",
				other: "{{count}} sekundit"
			},
			withPreposition: {
				one: "ühe sekundi",
				other: "{{count}} sekundi"
			}
		},
		halfAMinute: {
			standalone: "pool minutit",
			withPreposition: "poole minuti"
		},
		lessThanXMinutes: {
			standalone: {
				one: "vähem kui üks minut",
				other: "vähem kui {{count}} minutit"
			},
			withPreposition: {
				one: "vähem kui ühe minuti",
				other: "vähem kui {{count}} minuti"
			}
		},
		xMinutes: {
			standalone: {
				one: "üks minut",
				other: "{{count}} minutit"
			},
			withPreposition: {
				one: "ühe minuti",
				other: "{{count}} minuti"
			}
		},
		aboutXHours: {
			standalone: {
				one: "umbes üks tund",
				other: "umbes {{count}} tundi"
			},
			withPreposition: {
				one: "umbes ühe tunni",
				other: "umbes {{count}} tunni"
			}
		},
		xHours: {
			standalone: {
				one: "üks tund",
				other: "{{count}} tundi"
			},
			withPreposition: {
				one: "ühe tunni",
				other: "{{count}} tunni"
			}
		},
		xDays: {
			standalone: {
				one: "üks päev",
				other: "{{count}} päeva"
			},
			withPreposition: {
				one: "ühe päeva",
				other: "{{count}} päeva"
			}
		},
		aboutXWeeks: {
			standalone: {
				one: "umbes üks nädal",
				other: "umbes {{count}} nädalat"
			},
			withPreposition: {
				one: "umbes ühe nädala",
				other: "umbes {{count}} nädala"
			}
		},
		xWeeks: {
			standalone: {
				one: "üks nädal",
				other: "{{count}} nädalat"
			},
			withPreposition: {
				one: "ühe nädala",
				other: "{{count}} nädala"
			}
		},
		aboutXMonths: {
			standalone: {
				one: "umbes üks kuu",
				other: "umbes {{count}} kuud"
			},
			withPreposition: {
				one: "umbes ühe kuu",
				other: "umbes {{count}} kuu"
			}
		},
		xMonths: {
			standalone: {
				one: "üks kuu",
				other: "{{count}} kuud"
			},
			withPreposition: {
				one: "ühe kuu",
				other: "{{count}} kuu"
			}
		},
		aboutXYears: {
			standalone: {
				one: "umbes üks aasta",
				other: "umbes {{count}} aastat"
			},
			withPreposition: {
				one: "umbes ühe aasta",
				other: "umbes {{count}} aasta"
			}
		},
		xYears: {
			standalone: {
				one: "üks aasta",
				other: "{{count}} aastat"
			},
			withPreposition: {
				one: "ühe aasta",
				other: "{{count}} aasta"
			}
		},
		overXYears: {
			standalone: {
				one: "rohkem kui üks aasta",
				other: "rohkem kui {{count}} aastat"
			},
			withPreposition: {
				one: "rohkem kui ühe aasta",
				other: "rohkem kui {{count}} aasta"
			}
		},
		almostXYears: {
			standalone: {
				one: "peaaegu üks aasta",
				other: "peaaegu {{count}} aastat"
			},
			withPreposition: {
				one: "peaaegu ühe aasta",
				other: "peaaegu {{count}} aasta"
			}
		}
	};
	var formatDistance$60 = (token, count, options) => {
		const usageGroup = options?.addSuffix ? formatDistanceLocale$59[token].withPreposition : formatDistanceLocale$59[token].standalone;
		let result;
		if (typeof usageGroup === "string") result = usageGroup;
		else if (count === 1) result = usageGroup.one;
		else result = usageGroup.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " pärast";
		else return result + " eest";
		return result;
	};
	var formatLong$63 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d. MMMM y",
				long: "d. MMMM y",
				medium: "d. MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'kell' {{time}}",
				long: "{{date}} 'kell' {{time}}",
				medium: "{{date}}. {{time}}",
				short: "{{date}}. {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/et/_lib/formatRelative.js
	var formatRelativeLocale$61 = {
		lastWeek: "'eelmine' eeee 'kell' p",
		yesterday: "'eile kell' p",
		today: "'täna kell' p",
		tomorrow: "'homme kell' p",
		nextWeek: "'järgmine' eeee 'kell' p",
		other: "P"
	};
	var formatRelative$61 = (token, _date, _baseDate, _options) => formatRelativeLocale$61[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/et/_lib/localize.js
	var eraValues$60 = {
		narrow: ["e.m.a", "m.a.j"],
		abbreviated: ["e.m.a", "m.a.j"],
		wide: ["enne meie ajaarvamist", "meie ajaarvamise järgi"]
	};
	var quarterValues$60 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$60 = {
		narrow: [
			"J",
			"V",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jaan",
			"veebr",
			"märts",
			"apr",
			"mai",
			"juuni",
			"juuli",
			"aug",
			"sept",
			"okt",
			"nov",
			"dets"
		],
		wide: [
			"jaanuar",
			"veebruar",
			"märts",
			"aprill",
			"mai",
			"juuni",
			"juuli",
			"august",
			"september",
			"oktoober",
			"november",
			"detsember"
		]
	};
	var dayValues$60 = {
		narrow: [
			"P",
			"E",
			"T",
			"K",
			"N",
			"R",
			"L"
		],
		short: [
			"P",
			"E",
			"T",
			"K",
			"N",
			"R",
			"L"
		],
		abbreviated: [
			"pühap.",
			"esmasp.",
			"teisip.",
			"kolmap.",
			"neljap.",
			"reede.",
			"laup."
		],
		wide: [
			"pühapäev",
			"esmaspäev",
			"teisipäev",
			"kolmapäev",
			"neljapäev",
			"reede",
			"laupäev"
		]
	};
	var dayPeriodValues$60 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "kesköö",
			noon: "keskpäev",
			morning: "hommik",
			afternoon: "pärastlõuna",
			evening: "õhtu",
			night: "öö"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "kesköö",
			noon: "keskpäev",
			morning: "hommik",
			afternoon: "pärastlõuna",
			evening: "õhtu",
			night: "öö"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "kesköö",
			noon: "keskpäev",
			morning: "hommik",
			afternoon: "pärastlõuna",
			evening: "õhtu",
			night: "öö"
		}
	};
	var formattingDayPeriodValues$47 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "keskööl",
			noon: "keskpäeval",
			morning: "hommikul",
			afternoon: "pärastlõunal",
			evening: "õhtul",
			night: "öösel"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "keskööl",
			noon: "keskpäeval",
			morning: "hommikul",
			afternoon: "pärastlõunal",
			evening: "õhtul",
			night: "öösel"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "keskööl",
			noon: "keskpäeval",
			morning: "hommikul",
			afternoon: "pärastlõunal",
			evening: "õhtul",
			night: "öösel"
		}
	};
	var ordinalNumber$60 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/et.js
	/**
	* @category Locales
	* @summary Estonian locale.
	* @language Estonian
	* @iso-639-2 est
	* @author Priit Hansen [@HansenPriit](https://github.com/priithansen)
	*/
	var et = {
		code: "et",
		formatDistance: formatDistance$60,
		formatLong: formatLong$63,
		formatRelative: formatRelative$61,
		localize: {
			ordinalNumber: ordinalNumber$60,
			era: buildLocalizeFn({
				values: eraValues$60,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$60,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$60,
				defaultWidth: "wide",
				formattingValues: monthValues$60,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$60,
				defaultWidth: "wide",
				formattingValues: dayValues$60,
				defaultFormattingWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$60,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$47,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^\d+\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(e\.m\.a|m\.a\.j|eKr|pKr)/i,
					abbreviated: /^(e\.m\.a|m\.a\.j|eKr|pKr)/i,
					wide: /^(enne meie ajaarvamist|meie ajaarvamise järgi|enne Kristust|pärast Kristust)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^e/i, /^(m|p)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^K[1234]/i,
					wide: /^[1234](\.)? kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jvmasond]/i,
					abbreviated: /^(jaan|veebr|märts|apr|mai|juuni|juuli|aug|sept|okt|nov|dets)/i,
					wide: /^(jaanuar|veebruar|märts|aprill|mai|juuni|juuli|august|september|oktoober|november|detsember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^v/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^v/i,
						/^mär/i,
						/^ap/i,
						/^mai/i,
						/^juun/i,
						/^juul/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[petknrl]/i,
					short: /^[petknrl]/i,
					abbreviated: /^(püh?|esm?|tei?|kolm?|nel?|ree?|laup?)\.?/i,
					wide: /^(pühapäev|esmaspäev|teisipäev|kolmapäev|neljapäev|reede|laupäev)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^p/i,
					/^e/i,
					/^t/i,
					/^k/i,
					/^n/i,
					/^r/i,
					/^l/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|keskööl?|keskpäev(al)?|hommik(ul)?|pärastlõunal?|õhtul?|öö(sel)?)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^keskö/i,
					noon: /^keskp/i,
					morning: /hommik/i,
					afternoon: /pärastlõuna/i,
					evening: /õhtu/i,
					night: /öö/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eu/_lib/formatDistance.js
	var formatDistanceLocale$58 = {
		lessThanXSeconds: {
			one: "segundo bat baino gutxiago",
			other: "{{count}} segundo baino gutxiago"
		},
		xSeconds: {
			one: "1 segundo",
			other: "{{count}} segundo"
		},
		halfAMinute: "minutu erdi",
		lessThanXMinutes: {
			one: "minutu bat baino gutxiago",
			other: "{{count}} minutu baino gutxiago"
		},
		xMinutes: {
			one: "1 minutu",
			other: "{{count}} minutu"
		},
		aboutXHours: {
			one: "1 ordu gutxi gorabehera",
			other: "{{count}} ordu gutxi gorabehera"
		},
		xHours: {
			one: "1 ordu",
			other: "{{count}} ordu"
		},
		xDays: {
			one: "1 egun",
			other: "{{count}} egun"
		},
		aboutXWeeks: {
			one: "aste 1 inguru",
			other: "{{count}} aste inguru"
		},
		xWeeks: {
			one: "1 aste",
			other: "{{count}} astean"
		},
		aboutXMonths: {
			one: "1 hilabete gutxi gorabehera",
			other: "{{count}} hilabete gutxi gorabehera"
		},
		xMonths: {
			one: "1 hilabete",
			other: "{{count}} hilabete"
		},
		aboutXYears: {
			one: "1 urte gutxi gorabehera",
			other: "{{count}} urte gutxi gorabehera"
		},
		xYears: {
			one: "1 urte",
			other: "{{count}} urte"
		},
		overXYears: {
			one: "1 urte baino gehiago",
			other: "{{count}} urte baino gehiago"
		},
		almostXYears: {
			one: "ia 1 urte",
			other: "ia {{count}} urte"
		}
	};
	var formatDistance$59 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$58[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "en " + result;
		else return "duela " + result;
		return result;
	};
	var formatLong$62 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, y'ko' MMMM'ren' d'a' y'ren'",
				long: "y'ko' MMMM'ren' d'a'",
				medium: "y MMM d",
				short: "yy/MM/dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'tan' {{time}}",
				long: "{{date}} 'tan' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eu/_lib/formatRelative.js
	var formatRelativeLocale$60 = {
		lastWeek: "'joan den' eeee, LT",
		yesterday: "'atzo,' p",
		today: "'gaur,' p",
		tomorrow: "'bihar,' p",
		nextWeek: "eeee, p",
		other: "P"
	};
	var formatRelativeLocalePlural$1 = {
		lastWeek: "'joan den' eeee, p",
		yesterday: "'atzo,' p",
		today: "'gaur,' p",
		tomorrow: "'bihar,' p",
		nextWeek: "eeee, p",
		other: "P"
	};
	var formatRelative$60 = (token, date) => {
		if (date.getHours() !== 1) return formatRelativeLocalePlural$1[token];
		return formatRelativeLocale$60[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eu/_lib/localize.js
	var eraValues$59 = {
		narrow: ["k.a.", "k.o."],
		abbreviated: ["k.a.", "k.o."],
		wide: ["kristo aurretik", "kristo ondoren"]
	};
	var quarterValues$59 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1H",
			"2H",
			"3H",
			"4H"
		],
		wide: [
			"1. hiruhilekoa",
			"2. hiruhilekoa",
			"3. hiruhilekoa",
			"4. hiruhilekoa"
		]
	};
	var monthValues$59 = {
		narrow: [
			"u",
			"o",
			"m",
			"a",
			"m",
			"e",
			"u",
			"a",
			"i",
			"u",
			"a",
			"a"
		],
		abbreviated: [
			"urt",
			"ots",
			"mar",
			"api",
			"mai",
			"eka",
			"uzt",
			"abu",
			"ira",
			"urr",
			"aza",
			"abe"
		],
		wide: [
			"urtarrila",
			"otsaila",
			"martxoa",
			"apirila",
			"maiatza",
			"ekaina",
			"uztaila",
			"abuztua",
			"iraila",
			"urria",
			"azaroa",
			"abendua"
		]
	};
	var dayValues$59 = {
		narrow: [
			"i",
			"a",
			"a",
			"a",
			"o",
			"o",
			"l"
		],
		short: [
			"ig",
			"al",
			"as",
			"az",
			"og",
			"or",
			"lr"
		],
		abbreviated: [
			"iga",
			"ast",
			"ast",
			"ast",
			"ost",
			"ost",
			"lar"
		],
		wide: [
			"igandea",
			"astelehena",
			"asteartea",
			"asteazkena",
			"osteguna",
			"ostirala",
			"larunbata"
		]
	};
	var dayPeriodValues$59 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "ge",
			noon: "eg",
			morning: "goiza",
			afternoon: "arratsaldea",
			evening: "arratsaldea",
			night: "gaua"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "gauerdia",
			noon: "eguerdia",
			morning: "goiza",
			afternoon: "arratsaldea",
			evening: "arratsaldea",
			night: "gaua"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "gauerdia",
			noon: "eguerdia",
			morning: "goiza",
			afternoon: "arratsaldea",
			evening: "arratsaldea",
			night: "gaua"
		}
	};
	var formattingDayPeriodValues$46 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "ge",
			noon: "eg",
			morning: "goizean",
			afternoon: "arratsaldean",
			evening: "arratsaldean",
			night: "gauean"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "gauerdia",
			noon: "eguerdia",
			morning: "goizean",
			afternoon: "arratsaldean",
			evening: "arratsaldean",
			night: "gauean"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "gauerdia",
			noon: "eguerdia",
			morning: "goizean",
			afternoon: "arratsaldean",
			evening: "arratsaldean",
			night: "gauean"
		}
	};
	var ordinalNumber$59 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/eu.js
	/**
	* @category Locales
	* @summary Basque locale.
	* @language Basque
	* @iso-639-2 eus
	* @author Jacob Söderblom [@JacobSoderblom](https://github.com/JacobSoderblom)
	*/
	var eu = {
		code: "eu",
		formatDistance: formatDistance$59,
		formatLong: formatLong$62,
		formatRelative: formatRelative$60,
		localize: {
			ordinalNumber: ordinalNumber$59,
			era: buildLocalizeFn({
				values: eraValues$59,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$59,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$59,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$59,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$59,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$46,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(.)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(k.a.|k.o.)/i,
					abbreviated: /^(k.a.|k.o.)/i,
					wide: /^(kristo aurretik|kristo ondoren)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [/^k.a./i, /^k.o./i],
					abbreviated: [/^(k.a.)/i, /^(k.o.)/i],
					wide: [/^(kristo aurretik)/i, /^(kristo ondoren)/i]
				},
				defaultParseWidth: "wide"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]H/i,
					wide: /^[1234](.)? hiruhilekoa/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[uomaei]/i,
					abbreviated: /^(urt|ots|mar|api|mai|eka|uzt|abu|ira|urr|aza|abe)/i,
					wide: /^(urtarrila|otsaila|martxoa|apirila|maiatza|ekaina|uztaila|abuztua|iraila|urria|azaroa|abendua)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^u/i,
						/^o/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^e/i,
						/^u/i,
						/^a/i,
						/^i/i,
						/^u/i,
						/^a/i,
						/^a/i
					],
					any: [
						/^urt/i,
						/^ots/i,
						/^mar/i,
						/^api/i,
						/^mai/i,
						/^eka/i,
						/^uzt/i,
						/^abu/i,
						/^ira/i,
						/^urr/i,
						/^aza/i,
						/^abe/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[iaol]/i,
					short: /^(ig|al|as|az|og|or|lr)/i,
					abbreviated: /^(iga|ast|ast|ast|ost|ost|lar)/i,
					wide: /^(igandea|astelehena|asteartea|asteazkena|osteguna|ostirala|larunbata)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^i/i,
						/^a/i,
						/^a/i,
						/^a/i,
						/^o/i,
						/^o/i,
						/^l/i
					],
					short: [
						/^ig/i,
						/^al/i,
						/^as/i,
						/^az/i,
						/^og/i,
						/^or/i,
						/^lr/i
					],
					abbreviated: [
						/^iga/i,
						/^ast/i,
						/^ast/i,
						/^ast/i,
						/^ost/i,
						/^ost/i,
						/^lar/i
					],
					wide: [
						/^igandea/i,
						/^astelehena/i,
						/^asteartea/i,
						/^asteazkena/i,
						/^osteguna/i,
						/^ostirala/i,
						/^larunbata/i
					]
				},
				defaultParseWidth: "wide"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|ge|eg|((goiza|goizean)|arratsaldea|(gaua|gauean)))/i,
					any: /^([ap]\.?\s?m\.?|gauerdia|eguerdia|((goiza|goizean)|arratsaldea|(gaua|gauean)))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: {
					narrow: {
						am: /^a/i,
						pm: /^p/i,
						midnight: /^ge/i,
						noon: /^eg/i,
						morning: /goiz/i,
						afternoon: /arratsaldea/i,
						evening: /arratsaldea/i,
						night: /gau/i
					},
					any: {
						am: /^a/i,
						pm: /^p/i,
						midnight: /^gauerdia/i,
						noon: /^eguerdia/i,
						morning: /goiz/i,
						afternoon: /arratsaldea/i,
						evening: /arratsaldea/i,
						night: /gau/i
					}
				},
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fa-IR/_lib/formatDistance.js
	var formatDistanceLocale$57 = {
		lessThanXSeconds: {
			one: "کمتر از یک ثانیه",
			other: "کمتر از {{count}} ثانیه"
		},
		xSeconds: {
			one: "1 ثانیه",
			other: "{{count}} ثانیه"
		},
		halfAMinute: "نیم دقیقه",
		lessThanXMinutes: {
			one: "کمتر از یک دقیقه",
			other: "کمتر از {{count}} دقیقه"
		},
		xMinutes: {
			one: "1 دقیقه",
			other: "{{count}} دقیقه"
		},
		aboutXHours: {
			one: "حدود 1 ساعت",
			other: "حدود {{count}} ساعت"
		},
		xHours: {
			one: "1 ساعت",
			other: "{{count}} ساعت"
		},
		xDays: {
			one: "1 روز",
			other: "{{count}} روز"
		},
		aboutXWeeks: {
			one: "حدود 1 هفته",
			other: "حدود {{count}} هفته"
		},
		xWeeks: {
			one: "1 هفته",
			other: "{{count}} هفته"
		},
		aboutXMonths: {
			one: "حدود 1 ماه",
			other: "حدود {{count}} ماه"
		},
		xMonths: {
			one: "1 ماه",
			other: "{{count}} ماه"
		},
		aboutXYears: {
			one: "حدود 1 سال",
			other: "حدود {{count}} سال"
		},
		xYears: {
			one: "1 سال",
			other: "{{count}} سال"
		},
		overXYears: {
			one: "بیشتر از 1 سال",
			other: "بیشتر از {{count}} سال"
		},
		almostXYears: {
			one: "نزدیک 1 سال",
			other: "نزدیک {{count}} سال"
		}
	};
	var formatDistance$58 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$57[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "در " + result;
		else return result + " قبل";
		return result;
	};
	var formatLong$61 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE do MMMM y",
				long: "do MMMM y",
				medium: "d MMM y",
				short: "yyyy/MM/dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'در' {{time}}",
				long: "{{date}} 'در' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fa-IR/_lib/formatRelative.js
	var formatRelativeLocale$59 = {
		lastWeek: "eeee 'گذشته در' p",
		yesterday: "'دیروز در' p",
		today: "'امروز در' p",
		tomorrow: "'فردا در' p",
		nextWeek: "eeee 'در' p",
		other: "P"
	};
	var formatRelative$59 = (token, _date, _baseDate, _options) => formatRelativeLocale$59[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/fa-IR/_lib/localize.js
	var eraValues$58 = {
		narrow: ["ق", "ب"],
		abbreviated: ["ق.م.", "ب.م."],
		wide: ["قبل از میلاد", "بعد از میلاد"]
	};
	var quarterValues$58 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"س‌م1",
			"س‌م2",
			"س‌م3",
			"س‌م4"
		],
		wide: [
			"سه‌ماهه 1",
			"سه‌ماهه 2",
			"سه‌ماهه 3",
			"سه‌ماهه 4"
		]
	};
	var monthValues$58 = {
		narrow: [
			"ژ",
			"ف",
			"م",
			"آ",
			"م",
			"ج",
			"ج",
			"آ",
			"س",
			"ا",
			"ن",
			"د"
		],
		abbreviated: [
			"ژانـ",
			"فور",
			"مارس",
			"آپر",
			"می",
			"جون",
			"جولـ",
			"آگو",
			"سپتـ",
			"اکتـ",
			"نوامـ",
			"دسامـ"
		],
		wide: [
			"ژانویه",
			"فوریه",
			"مارس",
			"آپریل",
			"می",
			"جون",
			"جولای",
			"آگوست",
			"سپتامبر",
			"اکتبر",
			"نوامبر",
			"دسامبر"
		]
	};
	var dayValues$58 = {
		narrow: [
			"ی",
			"د",
			"س",
			"چ",
			"پ",
			"ج",
			"ش"
		],
		short: [
			"1ش",
			"2ش",
			"3ش",
			"4ش",
			"5ش",
			"ج",
			"ش"
		],
		abbreviated: [
			"یکشنبه",
			"دوشنبه",
			"سه‌شنبه",
			"چهارشنبه",
			"پنجشنبه",
			"جمعه",
			"شنبه"
		],
		wide: [
			"یکشنبه",
			"دوشنبه",
			"سه‌شنبه",
			"چهارشنبه",
			"پنجشنبه",
			"جمعه",
			"شنبه"
		]
	};
	var dayPeriodValues$58 = {
		narrow: {
			am: "ق",
			pm: "ب",
			midnight: "ن",
			noon: "ظ",
			morning: "ص",
			afternoon: "ب.ظ.",
			evening: "ع",
			night: "ش"
		},
		abbreviated: {
			am: "ق.ظ.",
			pm: "ب.ظ.",
			midnight: "نیمه‌شب",
			noon: "ظهر",
			morning: "صبح",
			afternoon: "بعدازظهر",
			evening: "عصر",
			night: "شب"
		},
		wide: {
			am: "قبل‌ازظهر",
			pm: "بعدازظهر",
			midnight: "نیمه‌شب",
			noon: "ظهر",
			morning: "صبح",
			afternoon: "بعدازظهر",
			evening: "عصر",
			night: "شب"
		}
	};
	var formattingDayPeriodValues$45 = {
		narrow: {
			am: "ق",
			pm: "ب",
			midnight: "ن",
			noon: "ظ",
			morning: "ص",
			afternoon: "ب.ظ.",
			evening: "ع",
			night: "ش"
		},
		abbreviated: {
			am: "ق.ظ.",
			pm: "ب.ظ.",
			midnight: "نیمه‌شب",
			noon: "ظهر",
			morning: "صبح",
			afternoon: "بعدازظهر",
			evening: "عصر",
			night: "شب"
		},
		wide: {
			am: "قبل‌ازظهر",
			pm: "بعدازظهر",
			midnight: "نیمه‌شب",
			noon: "ظهر",
			morning: "صبح",
			afternoon: "بعدازظهر",
			evening: "عصر",
			night: "شب"
		}
	};
	var ordinalNumber$58 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fa-IR.js
	/**
	* @category Locales
	* @summary Persian/Farsi locale (Iran).
	* @language Persian
	* @iso-639-2 ira
	* @author Morteza Ziyae [@mort3za](https://github.com/mort3za)
	*/
	var faIR = {
		code: "fa-IR",
		formatDistance: formatDistance$58,
		formatLong: formatLong$61,
		formatRelative: formatRelative$59,
		localize: {
			ordinalNumber: ordinalNumber$58,
			era: buildLocalizeFn({
				values: eraValues$58,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$58,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$58,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$58,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$58,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$45,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ق|ب)/i,
					abbreviated: /^(ق\.?\s?م\.?|ق\.?\s?د\.?\s?م\.?|م\.?\s?|د\.?\s?م\.?)/i,
					wide: /^(قبل از میلاد|قبل از دوران مشترک|میلادی|دوران مشترک|بعد از میلاد)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^قبل/i, /^بعد/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^س‌م[1234]/i,
					wide: /^سه‌ماهه [1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[جژفمآاماسند]/i,
					abbreviated: /^(جنو|ژانـ|ژانویه|فوریه|فور|مارس|آوریل|آپر|مه|می|ژوئن|جون|جول|جولـ|ژوئیه|اوت|آگو|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نوامـ|دسامبر|دسامـ|دسم)/i,
					wide: /^(ژانویه|جنوری|فبروری|فوریه|مارچ|مارس|آپریل|اپریل|ایپریل|آوریل|مه|می|ژوئن|جون|جولای|ژوئیه|آگست|اگست|آگوست|اوت|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نومبر|دسامبر|دسمبر)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^(ژ|ج)/i,
						/^ف/i,
						/^م/i,
						/^(آ|ا)/i,
						/^م/i,
						/^(ژ|ج)/i,
						/^(ج|ژ)/i,
						/^(آ|ا)/i,
						/^س/i,
						/^ا/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^ژا/i,
						/^ف/i,
						/^ما/i,
						/^آپ/i,
						/^(می|مه)/i,
						/^(ژوئن|جون)/i,
						/^(ژوئی|جول)/i,
						/^(اوت|آگ)/i,
						/^س/i,
						/^(اوک|اک)/i,
						/^ن/i,
						/^د/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[شیدسچپج]/i,
					short: /^(ش|ج|1ش|2ش|3ش|4ش|5ش)/i,
					abbreviated: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,
					wide: /^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ی/i,
						/^دو/i,
						/^س/i,
						/^چ/i,
						/^پ/i,
						/^ج/i,
						/^ش/i
					],
					any: [
						/^(ی|1ش|یکشنبه)/i,
						/^(د|2ش|دوشنبه)/i,
						/^(س|3ش|سه‌شنبه)/i,
						/^(چ|4ش|چهارشنبه)/i,
						/^(پ|5ش|پنجشنبه)/i,
						/^(ج|جمعه)/i,
						/^(ش|شنبه)/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ب|ق|ن|ظ|ص|ب.ظ.|ع|ش)/i,
					abbreviated: /^(ق.ظ.|ب.ظ.|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,
					wide: /^(قبل‌ازظهر|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^(ق|ق.ظ.|قبل‌ازظهر)/i,
					pm: /^(ب|ب.ظ.|بعدازظهر)/i,
					midnight: /^(‌نیمه‌شب|ن)/i,
					noon: /^(ظ|ظهر)/i,
					morning: /(ص|صبح)/i,
					afternoon: /(ب|ب.ظ.|بعدازظهر)/i,
					evening: /(ع|عصر)/i,
					night: /(ش|شب)/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 6,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fi/_lib/formatDistance.js
	function futureSeconds(text) {
		return text.replace(/sekuntia?/, "sekunnin");
	}
	function futureMinutes(text) {
		return text.replace(/minuuttia?/, "minuutin");
	}
	function futureHours(text) {
		return text.replace(/tuntia?/, "tunnin");
	}
	function futureDays(text) {
		return text.replace(/päivää?/, "päivän");
	}
	function futureWeeks(text) {
		return text.replace(/(viikko|viikkoa)/, "viikon");
	}
	function futureMonths(text) {
		return text.replace(/(kuukausi|kuukautta)/, "kuukauden");
	}
	function futureYears(text) {
		return text.replace(/(vuosi|vuotta)/, "vuoden");
	}
	var formatDistanceLocale$56 = {
		lessThanXSeconds: {
			one: "alle sekunti",
			other: "alle {{count}} sekuntia",
			futureTense: futureSeconds
		},
		xSeconds: {
			one: "sekunti",
			other: "{{count}} sekuntia",
			futureTense: futureSeconds
		},
		halfAMinute: {
			one: "puoli minuuttia",
			other: "puoli minuuttia",
			futureTense: (_text) => "puolen minuutin"
		},
		lessThanXMinutes: {
			one: "alle minuutti",
			other: "alle {{count}} minuuttia",
			futureTense: futureMinutes
		},
		xMinutes: {
			one: "minuutti",
			other: "{{count}} minuuttia",
			futureTense: futureMinutes
		},
		aboutXHours: {
			one: "noin tunti",
			other: "noin {{count}} tuntia",
			futureTense: futureHours
		},
		xHours: {
			one: "tunti",
			other: "{{count}} tuntia",
			futureTense: futureHours
		},
		xDays: {
			one: "päivä",
			other: "{{count}} päivää",
			futureTense: futureDays
		},
		aboutXWeeks: {
			one: "noin viikko",
			other: "noin {{count}} viikkoa",
			futureTense: futureWeeks
		},
		xWeeks: {
			one: "viikko",
			other: "{{count}} viikkoa",
			futureTense: futureWeeks
		},
		aboutXMonths: {
			one: "noin kuukausi",
			other: "noin {{count}} kuukautta",
			futureTense: futureMonths
		},
		xMonths: {
			one: "kuukausi",
			other: "{{count}} kuukautta",
			futureTense: futureMonths
		},
		aboutXYears: {
			one: "noin vuosi",
			other: "noin {{count}} vuotta",
			futureTense: futureYears
		},
		xYears: {
			one: "vuosi",
			other: "{{count}} vuotta",
			futureTense: futureYears
		},
		overXYears: {
			one: "yli vuosi",
			other: "yli {{count}} vuotta",
			futureTense: futureYears
		},
		almostXYears: {
			one: "lähes vuosi",
			other: "lähes {{count}} vuotta",
			futureTense: futureYears
		}
	};
	var formatDistance$57 = (token, count, options) => {
		const tokenValue = formatDistanceLocale$56[token];
		const result = count === 1 ? tokenValue.one : tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return tokenValue.futureTense(result) + " kuluttua";
		else return result + " sitten";
		return result;
	};
	var formatLong$60 = {
		date: buildFormatLongFn({
			formats: {
				full: "eeee d. MMMM y",
				long: "d. MMMM y",
				medium: "d. MMM y",
				short: "d.M.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH.mm.ss zzzz",
				long: "HH.mm.ss z",
				medium: "HH.mm.ss",
				short: "HH.mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'klo' {{time}}",
				long: "{{date}} 'klo' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fi/_lib/formatRelative.js
	var formatRelativeLocale$58 = {
		lastWeek: "'viime' eeee 'klo' p",
		yesterday: "'eilen klo' p",
		today: "'tänään klo' p",
		tomorrow: "'huomenna klo' p",
		nextWeek: "'ensi' eeee 'klo' p",
		other: "P"
	};
	var formatRelative$58 = (token, _date, _baseDate, _options) => formatRelativeLocale$58[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/fi/_lib/localize.js
	var eraValues$57 = {
		narrow: ["eaa.", "jaa."],
		abbreviated: ["eaa.", "jaa."],
		wide: ["ennen ajanlaskun alkua", "jälkeen ajanlaskun alun"]
	};
	var quarterValues$57 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. kvartaali",
			"2. kvartaali",
			"3. kvartaali",
			"4. kvartaali"
		]
	};
	var monthValues$57 = {
		narrow: [
			"T",
			"H",
			"M",
			"H",
			"T",
			"K",
			"H",
			"E",
			"S",
			"L",
			"M",
			"J"
		],
		abbreviated: [
			"tammi",
			"helmi",
			"maalis",
			"huhti",
			"touko",
			"kesä",
			"heinä",
			"elo",
			"syys",
			"loka",
			"marras",
			"joulu"
		],
		wide: [
			"tammikuu",
			"helmikuu",
			"maaliskuu",
			"huhtikuu",
			"toukokuu",
			"kesäkuu",
			"heinäkuu",
			"elokuu",
			"syyskuu",
			"lokakuu",
			"marraskuu",
			"joulukuu"
		]
	};
	var formattingMonthValues$11 = {
		narrow: monthValues$57.narrow,
		abbreviated: monthValues$57.abbreviated,
		wide: [
			"tammikuuta",
			"helmikuuta",
			"maaliskuuta",
			"huhtikuuta",
			"toukokuuta",
			"kesäkuuta",
			"heinäkuuta",
			"elokuuta",
			"syyskuuta",
			"lokakuuta",
			"marraskuuta",
			"joulukuuta"
		]
	};
	var dayValues$57 = {
		narrow: [
			"S",
			"M",
			"T",
			"K",
			"T",
			"P",
			"L"
		],
		short: [
			"su",
			"ma",
			"ti",
			"ke",
			"to",
			"pe",
			"la"
		],
		abbreviated: [
			"sunn.",
			"maan.",
			"tiis.",
			"kesk.",
			"torst.",
			"perj.",
			"la"
		],
		wide: [
			"sunnuntai",
			"maanantai",
			"tiistai",
			"keskiviikko",
			"torstai",
			"perjantai",
			"lauantai"
		]
	};
	var formattingDayValues$3 = {
		narrow: dayValues$57.narrow,
		short: dayValues$57.short,
		abbreviated: dayValues$57.abbreviated,
		wide: [
			"sunnuntaina",
			"maanantaina",
			"tiistaina",
			"keskiviikkona",
			"torstaina",
			"perjantaina",
			"lauantaina"
		]
	};
	var dayPeriodValues$57 = {
		narrow: {
			am: "ap",
			pm: "ip",
			midnight: "keskiyö",
			noon: "keskipäivä",
			morning: "ap",
			afternoon: "ip",
			evening: "illalla",
			night: "yöllä"
		},
		abbreviated: {
			am: "ap",
			pm: "ip",
			midnight: "keskiyö",
			noon: "keskipäivä",
			morning: "ap",
			afternoon: "ip",
			evening: "illalla",
			night: "yöllä"
		},
		wide: {
			am: "ap",
			pm: "ip",
			midnight: "keskiyöllä",
			noon: "keskipäivällä",
			morning: "aamupäivällä",
			afternoon: "iltapäivällä",
			evening: "illalla",
			night: "yöllä"
		}
	};
	var ordinalNumber$57 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fi.js
	/**
	* @category Locales
	* @summary Finnish locale.
	* @language Finnish
	* @iso-639-2 fin
	* @author Pyry-Samuli Lahti [@Pyppe](https://github.com/Pyppe)
	* @author Edo Rivai [@mikolajgrzyb](https://github.com/mikolajgrzyb)
	* @author Samu Juvonen [@sjuvonen](https://github.com/sjuvonen)
	*/
	var fi = {
		code: "fi",
		formatDistance: formatDistance$57,
		formatLong: formatLong$60,
		formatRelative: formatRelative$58,
		localize: {
			ordinalNumber: ordinalNumber$57,
			era: buildLocalizeFn({
				values: eraValues$57,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$57,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$57,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$11,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$57,
				defaultWidth: "wide",
				formattingValues: formattingDayValues$3,
				defaultFormattingWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$57,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(\.)/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(e|j)/i,
					abbreviated: /^(eaa.|jaa.)/i,
					wide: /^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^e/i, /^j/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234]\.? kvartaali/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[thmkeslj]/i,
					abbreviated: /^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,
					wide: /^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^t/i,
						/^h/i,
						/^m/i,
						/^h/i,
						/^t/i,
						/^k/i,
						/^h/i,
						/^e/i,
						/^s/i,
						/^l/i,
						/^m/i,
						/^j/i
					],
					any: [
						/^ta/i,
						/^hel/i,
						/^maa/i,
						/^hu/i,
						/^to/i,
						/^k/i,
						/^hei/i,
						/^e/i,
						/^s/i,
						/^l/i,
						/^mar/i,
						/^j/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtkpl]/i,
					short: /^(su|ma|ti|ke|to|pe|la)/i,
					abbreviated: /^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,
					wide: /^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^k/i,
						/^t/i,
						/^p/i,
						/^l/i
					],
					any: [
						/^s/i,
						/^m/i,
						/^ti/i,
						/^k/i,
						/^to/i,
						/^p/i,
						/^l/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,
					any: /^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ap/i,
					pm: /^ip/i,
					midnight: /^keskiyö/i,
					noon: /^keskipäivä/i,
					morning: /aamupäivällä/i,
					afternoon: /iltapäivällä/i,
					evening: /illalla/i,
					night: /yöllä/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr/_lib/formatDistance.js
	var formatDistanceLocale$55 = {
		lessThanXSeconds: {
			one: "moins d’une seconde",
			other: "moins de {{count}} secondes"
		},
		xSeconds: {
			one: "1 seconde",
			other: "{{count}} secondes"
		},
		halfAMinute: "30 secondes",
		lessThanXMinutes: {
			one: "moins d’une minute",
			other: "moins de {{count}} minutes"
		},
		xMinutes: {
			one: "1 minute",
			other: "{{count}} minutes"
		},
		aboutXHours: {
			one: "environ 1 heure",
			other: "environ {{count}} heures"
		},
		xHours: {
			one: "1 heure",
			other: "{{count}} heures"
		},
		xDays: {
			one: "1 jour",
			other: "{{count}} jours"
		},
		aboutXWeeks: {
			one: "environ 1 semaine",
			other: "environ {{count}} semaines"
		},
		xWeeks: {
			one: "1 semaine",
			other: "{{count}} semaines"
		},
		aboutXMonths: {
			one: "environ 1 mois",
			other: "environ {{count}} mois"
		},
		xMonths: {
			one: "1 mois",
			other: "{{count}} mois"
		},
		aboutXYears: {
			one: "environ 1 an",
			other: "environ {{count}} ans"
		},
		xYears: {
			one: "1 an",
			other: "{{count}} ans"
		},
		overXYears: {
			one: "plus d’un an",
			other: "plus de {{count}} ans"
		},
		almostXYears: {
			one: "presqu’un an",
			other: "presque {{count}} ans"
		}
	};
	var formatDistance$56 = (token, count, options) => {
		let result;
		const form = formatDistanceLocale$55[token];
		if (typeof form === "string") result = form;
		else if (count === 1) result = form.one;
		else result = form.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "dans " + result;
		else return "il y a " + result;
		return result;
	};
	var formatLong$59 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'à' {{time}}",
				long: "{{date}} 'à' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr/_lib/formatRelative.js
	var formatRelativeLocale$57 = {
		lastWeek: "eeee 'dernier à' p",
		yesterday: "'hier à' p",
		today: "'aujourd’hui à' p",
		tomorrow: "'demain à' p'",
		nextWeek: "eeee 'prochain à' p",
		other: "P"
	};
	var formatRelative$57 = (token, _date, _baseDate, _options) => formatRelativeLocale$57[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr/_lib/localize.js
	var eraValues$56 = {
		narrow: ["av. J.-C", "ap. J.-C"],
		abbreviated: ["av. J.-C", "ap. J.-C"],
		wide: ["avant Jésus-Christ", "après Jésus-Christ"]
	};
	var quarterValues$56 = {
		narrow: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		abbreviated: [
			"1er trim.",
			"2ème trim.",
			"3ème trim.",
			"4ème trim."
		],
		wide: [
			"1er trimestre",
			"2ème trimestre",
			"3ème trimestre",
			"4ème trimestre"
		]
	};
	var monthValues$56 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"janv.",
			"févr.",
			"mars",
			"avr.",
			"mai",
			"juin",
			"juil.",
			"août",
			"sept.",
			"oct.",
			"nov.",
			"déc."
		],
		wide: [
			"janvier",
			"février",
			"mars",
			"avril",
			"mai",
			"juin",
			"juillet",
			"août",
			"septembre",
			"octobre",
			"novembre",
			"décembre"
		]
	};
	var dayValues$56 = {
		narrow: [
			"D",
			"L",
			"M",
			"M",
			"J",
			"V",
			"S"
		],
		short: [
			"di",
			"lu",
			"ma",
			"me",
			"je",
			"ve",
			"sa"
		],
		abbreviated: [
			"dim.",
			"lun.",
			"mar.",
			"mer.",
			"jeu.",
			"ven.",
			"sam."
		],
		wide: [
			"dimanche",
			"lundi",
			"mardi",
			"mercredi",
			"jeudi",
			"vendredi",
			"samedi"
		]
	};
	var dayPeriodValues$56 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "minuit",
			noon: "midi",
			morning: "mat.",
			afternoon: "ap.m.",
			evening: "soir",
			night: "mat."
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "minuit",
			noon: "midi",
			morning: "matin",
			afternoon: "après-midi",
			evening: "soir",
			night: "matin"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "minuit",
			noon: "midi",
			morning: "du matin",
			afternoon: "de l’après-midi",
			evening: "du soir",
			night: "du matin"
		}
	};
	var ordinalNumber$56 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const unit = options?.unit;
		if (number === 0) return "0";
		const feminineUnits = [
			"year",
			"week",
			"hour",
			"minute",
			"second"
		];
		let suffix;
		if (number === 1) suffix = unit && feminineUnits.includes(unit) ? "ère" : "er";
		else suffix = "ème";
		return number + suffix;
	};
	var LONG_MONTHS_TOKENS = ["MMM", "MMMM"];
	var localize$56 = {
		preprocessor: (date, parts) => {
			if (date.getDate() === 1) return parts;
			if (!parts.some((part) => part.isToken && LONG_MONTHS_TOKENS.includes(part.value))) return parts;
			return parts.map((part) => part.isToken && part.value === "do" ? {
				isToken: true,
				value: "d"
			} : part);
		},
		ordinalNumber: ordinalNumber$56,
		era: buildLocalizeFn({
			values: eraValues$56,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$56,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$56,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$56,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$56,
			defaultWidth: "wide"
		})
	};
	var match$56 = {
		ordinalNumber: buildMatchPatternFn({
			matchPattern: /^(\d+)(ième|ère|ème|er|e)?/i,
			parsePattern: /\d+/i,
			valueCallback: (value) => parseInt(value)
		}),
		era: buildMatchFn({
			matchPatterns: {
				narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
				abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
				wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [/^av/i, /^ap/i] },
			defaultParseWidth: "any"
		}),
		quarter: buildMatchFn({
			matchPatterns: {
				narrow: /^T?[1234]/i,
				abbreviated: /^[1234](er|ème|e)? trim\.?/i,
				wide: /^[1234](er|ème|e)? trimestre/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [
				/1/i,
				/2/i,
				/3/i,
				/4/i
			] },
			defaultParseWidth: "any",
			valueCallback: (index) => index + 1
		}),
		month: buildMatchFn({
			matchPatterns: {
				narrow: /^[jfmasond]/i,
				abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
				wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^j/i,
					/^f/i,
					/^m/i,
					/^a/i,
					/^m/i,
					/^j/i,
					/^j/i,
					/^a/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				],
				any: [
					/^ja/i,
					/^f/i,
					/^mar/i,
					/^av/i,
					/^ma/i,
					/^juin/i,
					/^juil/i,
					/^ao/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				]
			},
			defaultParseWidth: "any"
		}),
		day: buildMatchFn({
			matchPatterns: {
				narrow: /^[lmjvsd]/i,
				short: /^(di|lu|ma|me|je|ve|sa)/i,
				abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
				wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^d/i,
					/^l/i,
					/^m/i,
					/^m/i,
					/^j/i,
					/^v/i,
					/^s/i
				],
				any: [
					/^di/i,
					/^lu/i,
					/^ma/i,
					/^me/i,
					/^je/i,
					/^ve/i,
					/^sa/i
				]
			},
			defaultParseWidth: "any"
		}),
		dayPeriod: buildMatchFn({
			matchPatterns: {
				narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
				any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
			},
			defaultMatchWidth: "any",
			parsePatterns: { any: {
				am: /^a/i,
				pm: /^p/i,
				midnight: /^min/i,
				noon: /^mid/i,
				morning: /mat/i,
				afternoon: /ap/i,
				evening: /soir/i,
				night: /nuit/i
			} },
			defaultParseWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr.js
	/**
	* @category Locales
	* @summary French locale.
	* @language French
	* @iso-639-2 fra
	* @author Jean Dupouy [@izeau](https://github.com/izeau)
	* @author François B [@fbonzon](https://github.com/fbonzon)
	*/
	var fr = {
		code: "fr",
		formatDistance: formatDistance$56,
		formatLong: formatLong$59,
		formatRelative: formatRelative$57,
		localize: localize$56,
		match: match$56,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr-CA.js
	/**
	* @category Locales
	* @summary French locale (Canada).
	* @language French
	* @iso-639-2 fra
	* @author Jean Dupouy [@izeau](https://github.com/izeau)
	* @author François B [@fbonzon](https://github.com/fbonzon)
	* @author Gabriele Petrioli [@gpetrioli](https://github.com/gpetrioli)
	*/
	var frCA = {
		code: "fr-CA",
		formatDistance: formatDistance$56,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE d MMMM y",
					long: "d MMMM y",
					medium: "d MMM y",
					short: "yy-MM-dd"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "HH:mm:ss zzzz",
					long: "HH:mm:ss z",
					medium: "HH:mm:ss",
					short: "HH:mm"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} 'à' {{time}}",
					long: "{{date}} 'à' {{time}}",
					medium: "{{date}}, {{time}}",
					short: "{{date}}, {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$57,
		localize: localize$56,
		match: match$56,
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	var formatLong$57 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'à' {{time}}",
				long: "{{date}} 'à' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr-CH/_lib/formatRelative.js
	var formatRelativeLocale$56 = {
		lastWeek: "eeee 'la semaine dernière à' p",
		yesterday: "'hier à' p",
		today: "'aujourd’hui à' p",
		tomorrow: "'demain à' p'",
		nextWeek: "eeee 'la semaine prochaine à' p",
		other: "P"
	};
	var formatRelative$56 = (token, _date, _baseDate, _options) => formatRelativeLocale$56[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/fr-CH.js
	/**
	* @category Locales
	* @summary French locale (Switzerland).
	* @language French
	* @iso-639-2 fra
	* @author Jean Dupouy [@izeau](https://github.com/izeau)
	* @author François B [@fbonzon](https://github.com/fbonzon)
	* @author Van Vuong Ngo [@vanvuongngo](https://github.com/vanvuongngo)
	* @author Alex Hoeing [@dcbn](https://github.com/dcbn)
	*/
	var frCH = {
		code: "fr-CH",
		formatDistance: formatDistance$56,
		formatLong: formatLong$57,
		formatRelative: formatRelative$56,
		localize: localize$56,
		match: match$56,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fy/_lib/formatDistance.js
	var formatDistanceLocale$54 = {
		lessThanXSeconds: {
			one: "minder as 1 sekonde",
			other: "minder as {{count}} sekonden"
		},
		xSeconds: {
			one: "1 sekonde",
			other: "{{count}} sekonden"
		},
		halfAMinute: "oardel minút",
		lessThanXMinutes: {
			one: "minder as 1 minút",
			other: "minder as {{count}} minuten"
		},
		xMinutes: {
			one: "1 minút",
			other: "{{count}} minuten"
		},
		aboutXHours: {
			one: "sawat 1 oere",
			other: "sawat {{count}} oere"
		},
		xHours: {
			one: "1 oere",
			other: "{{count}} oere"
		},
		xDays: {
			one: "1 dei",
			other: "{{count}} dagen"
		},
		aboutXWeeks: {
			one: "sawat 1 wike",
			other: "sawat {{count}} wiken"
		},
		xWeeks: {
			one: "1 wike",
			other: "{{count}} wiken"
		},
		aboutXMonths: {
			one: "sawat 1 moanne",
			other: "sawat {{count}} moannen"
		},
		xMonths: {
			one: "1 moanne",
			other: "{{count}} moannen"
		},
		aboutXYears: {
			one: "sawat 1 jier",
			other: "sawat {{count}} jier"
		},
		xYears: {
			one: "1 jier",
			other: "{{count}} jier"
		},
		overXYears: {
			one: "mear as 1 jier",
			other: "mear as {{count}}s jier"
		},
		almostXYears: {
			one: "hast 1 jier",
			other: "hast {{count}} jier"
		}
	};
	var formatDistance$55 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$54[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "oer " + result;
		else return result + " lyn";
		return result;
	};
	var formatLong$56 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd-MM-y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'om' {{time}}",
				long: "{{date}} 'om' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fy/_lib/formatRelative.js
	var formatRelativeLocale$55 = {
		lastWeek: "'ôfrûne' eeee 'om' p",
		yesterday: "'juster om' p",
		today: "'hjoed om' p",
		tomorrow: "'moarn om' p",
		nextWeek: "eeee 'om' p",
		other: "P"
	};
	var formatRelative$55 = (token, _date, _baseDate, _options) => formatRelativeLocale$55[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/fy/_lib/localize.js
	var eraValues$55 = {
		narrow: ["f.K.", "n.K."],
		abbreviated: ["f.Kr.", "n.Kr."],
		wide: ["foar Kristus", "nei Kristus"]
	};
	var quarterValues$55 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1e fearnsjier",
			"2e fearnsjier",
			"3e fearnsjier",
			"4e fearnsjier"
		]
	};
	var monthValues$55 = {
		narrow: [
			"j",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mrt.",
			"apr.",
			"mai.",
			"jun.",
			"jul.",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"des."
		],
		wide: [
			"jannewaris",
			"febrewaris",
			"maart",
			"april",
			"maaie",
			"juny",
			"july",
			"augustus",
			"septimber",
			"oktober",
			"novimber",
			"desimber"
		]
	};
	var dayValues$55 = {
		narrow: [
			"s",
			"m",
			"t",
			"w",
			"t",
			"f",
			"s"
		],
		short: [
			"si",
			"mo",
			"ti",
			"wo",
			"to",
			"fr",
			"so"
		],
		abbreviated: [
			"snein",
			"moa",
			"tii",
			"woa",
			"ton",
			"fre",
			"sneon"
		],
		wide: [
			"snein",
			"moandei",
			"tiisdei",
			"woansdei",
			"tongersdei",
			"freed",
			"sneon"
		]
	};
	var dayPeriodValues$55 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "middei",
			morning: "moarns",
			afternoon: "middeis",
			evening: "jûns",
			night: "nachts"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "middei",
			morning: "moarns",
			afternoon: "middeis",
			evening: "jûns",
			night: "nachts"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "middei",
			morning: "moarns",
			afternoon: "middeis",
			evening: "jûns",
			night: "nachts"
		}
	};
	var ordinalNumber$55 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "e";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/fy.js
	/**
	* @category Locales
	* @summary Western Frisian locale (Netherlands).
	* @language West Frisian
	* @iso-639-2 fry
	* @author Damon Asberg [@damon02](https://github.com/damon02)
	*/
	var fy = {
		code: "fy",
		formatDistance: formatDistance$55,
		formatLong: formatLong$56,
		formatRelative: formatRelative$55,
		localize: {
			ordinalNumber: ordinalNumber$55,
			era: buildLocalizeFn({
				values: eraValues$55,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$55,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$55,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$55,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$55,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)e?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^([fn]\.? ?K\.?)/,
					abbreviated: /^([fn]\. ?Kr\.?)/,
					wide: /^((foar|nei) Kristus)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^f/, /^n/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^K[1234]/i,
					wide: /^[1234]e fearnsjier/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan.|feb.|mrt.|apr.|mai.|jun.|jul.|aug.|sep.|okt.|nov.|des.)/i,
					wide: /^(jannewaris|febrewaris|maart|april|maaie|juny|july|augustus|septimber|oktober|novimber|desimber)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^jan/i,
						/^feb/i,
						/^m(r|a)/i,
						/^apr/i,
						/^mai/i,
						/^jun/i,
						/^jul/i,
						/^aug/i,
						/^sep/i,
						/^okt/i,
						/^nov/i,
						/^des/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtwf]/i,
					short: /^(si|mo|ti|wo|to|fr|so)/i,
					abbreviated: /^(snein|moa|tii|woa|ton|fre|sneon)/i,
					wide: /^(snein|moandei|tiisdei|woansdei|tongersdei|freed|sneon)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^w/i,
						/^t/i,
						/^f/i,
						/^s/i
					],
					any: [
						/^sn/i,
						/^mo/i,
						/^ti/i,
						/^wo/i,
						/^to/i,
						/^fr/i,
						/^sn/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|middernacht|middeis|moarns|middei|jûns|nachts)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^am/i,
					pm: /^pm/i,
					midnight: /^middernacht/i,
					noon: /^middei/i,
					morning: /moarns/i,
					afternoon: /^middeis/i,
					evening: /jûns/i,
					night: /nachts/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gd/_lib/formatDistance.js
	var formatDistanceLocale$53 = {
		lessThanXSeconds: {
			one: "nas lugha na diog",
			other: "nas lugha na {{count}} diogan"
		},
		xSeconds: {
			one: "1 diog",
			two: "2 dhiog",
			twenty: "20 diog",
			other: "{{count}} diogan"
		},
		halfAMinute: "leth mhionaid",
		lessThanXMinutes: {
			one: "nas lugha na mionaid",
			other: "nas lugha na {{count}} mionaidean"
		},
		xMinutes: {
			one: "1 mionaid",
			two: "2 mhionaid",
			twenty: "20 mionaid",
			other: "{{count}} mionaidean"
		},
		aboutXHours: {
			one: "mu uair de thìde",
			other: "mu {{count}} uairean de thìde"
		},
		xHours: {
			one: "1 uair de thìde",
			two: "2 uair de thìde",
			twenty: "20 uair de thìde",
			other: "{{count}} uairean de thìde"
		},
		xDays: {
			one: "1 là",
			other: "{{count}} là"
		},
		aboutXWeeks: {
			one: "mu 1 seachdain",
			other: "mu {{count}} seachdainean"
		},
		xWeeks: {
			one: "1 seachdain",
			other: "{{count}} seachdainean"
		},
		aboutXMonths: {
			one: "mu mhìos",
			other: "mu {{count}} mìosan"
		},
		xMonths: {
			one: "1 mìos",
			other: "{{count}} mìosan"
		},
		aboutXYears: {
			one: "mu bhliadhna",
			other: "mu {{count}} bliadhnaichean"
		},
		xYears: {
			one: "1 bhliadhna",
			other: "{{count}} bliadhna"
		},
		overXYears: {
			one: "còrr is bliadhna",
			other: "còrr is {{count}} bliadhnaichean"
		},
		almostXYears: {
			one: "cha mhòr bliadhna",
			other: "cha mhòr {{count}} bliadhnaichean"
		}
	};
	var formatDistance$54 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$53[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 2 && !!tokenValue.two) result = tokenValue.two;
		else if (count === 20 && !!tokenValue.twenty) result = tokenValue.twenty;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "ann an " + result;
		else return "o chionn " + result;
		return result;
	};
	var formatLong$55 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'aig' {{time}}",
				long: "{{date}} 'aig' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gd/_lib/formatRelative.js
	var formatRelativeLocale$54 = {
		lastWeek: "'mu dheireadh' eeee 'aig' p",
		yesterday: "'an-dè aig' p",
		today: "'an-diugh aig' p",
		tomorrow: "'a-màireach aig' p",
		nextWeek: "eeee 'aig' p",
		other: "P"
	};
	var formatRelative$54 = (token, _date, _baseDate, _options) => formatRelativeLocale$54[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/gd/_lib/localize.js
	var eraValues$54 = {
		narrow: ["R", "A"],
		abbreviated: ["RC", "AD"],
		wide: ["ro Chrìosta", "anno domini"]
	};
	var quarterValues$54 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"C1",
			"C2",
			"C3",
			"C4"
		],
		wide: [
			"a' chiad chairteal",
			"an dàrna cairteal",
			"an treas cairteal",
			"an ceathramh cairteal"
		]
	};
	var monthValues$54 = {
		narrow: [
			"F",
			"G",
			"M",
			"G",
			"C",
			"Ò",
			"I",
			"L",
			"S",
			"D",
			"S",
			"D"
		],
		abbreviated: [
			"Faoi",
			"Gear",
			"Màrt",
			"Gibl",
			"Cèit",
			"Ògmh",
			"Iuch",
			"Lùn",
			"Sult",
			"Dàmh",
			"Samh",
			"Dùbh"
		],
		wide: [
			"Am Faoilleach",
			"An Gearran",
			"Am Màrt",
			"An Giblean",
			"An Cèitean",
			"An t-Ògmhios",
			"An t-Iuchar",
			"An Lùnastal",
			"An t-Sultain",
			"An Dàmhair",
			"An t-Samhain",
			"An Dùbhlachd"
		]
	};
	var dayValues$54 = {
		narrow: [
			"D",
			"L",
			"M",
			"C",
			"A",
			"H",
			"S"
		],
		short: [
			"Dò",
			"Lu",
			"Mà",
			"Ci",
			"Ar",
			"Ha",
			"Sa"
		],
		abbreviated: [
			"Did",
			"Dil",
			"Dim",
			"Dic",
			"Dia",
			"Dih",
			"Dis"
		],
		wide: [
			"Didòmhnaich",
			"Diluain",
			"Dimàirt",
			"Diciadain",
			"Diardaoin",
			"Dihaoine",
			"Disathairne"
		]
	};
	var dayPeriodValues$54 = {
		narrow: {
			am: "m",
			pm: "f",
			midnight: "m.o.",
			noon: "m.l.",
			morning: "madainn",
			afternoon: "feasgar",
			evening: "feasgar",
			night: "oidhche"
		},
		abbreviated: {
			am: "M.",
			pm: "F.",
			midnight: "meadhan oidhche",
			noon: "meadhan là",
			morning: "madainn",
			afternoon: "feasgar",
			evening: "feasgar",
			night: "oidhche"
		},
		wide: {
			am: "m.",
			pm: "f.",
			midnight: "meadhan oidhche",
			noon: "meadhan là",
			morning: "madainn",
			afternoon: "feasgar",
			evening: "feasgar",
			night: "oidhche"
		}
	};
	var formattingDayPeriodValues$44 = {
		narrow: {
			am: "m",
			pm: "f",
			midnight: "m.o.",
			noon: "m.l.",
			morning: "sa mhadainn",
			afternoon: "feasgar",
			evening: "feasgar",
			night: "air an oidhche"
		},
		abbreviated: {
			am: "M.",
			pm: "F.",
			midnight: "meadhan oidhche",
			noon: "meadhan là",
			morning: "sa mhadainn",
			afternoon: "feasgar",
			evening: "feasgar",
			night: "air an oidhche"
		},
		wide: {
			am: "m.",
			pm: "f.",
			midnight: "meadhan oidhche",
			noon: "meadhan là",
			morning: "sa mhadainn",
			afternoon: "feasgar",
			evening: "feasgar",
			night: "air an oidhche"
		}
	};
	var ordinalNumber$54 = (dirtyNumber) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
			case 1: return number + "d";
			case 2: return number + "na";
		}
		if (rem100 === 12) return number + "na";
		return number + "mh";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gd.js
	/**
	* @category Locales
	* @summary Scottish Gaelic.
	* @language Scottish Gaelic
	* @iso-639-2 gla
	* @author Lee Driscoll [@leedriscoll](https://github.com/leedriscoll)
	*/
	var gd = {
		code: "gd",
		formatDistance: formatDistance$54,
		formatLong: formatLong$55,
		formatRelative: formatRelative$54,
		localize: {
			ordinalNumber: ordinalNumber$54,
			era: buildLocalizeFn({
				values: eraValues$54,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$54,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$54,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$54,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$54,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$44,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(d|na|tr|mh)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(r|a)/i,
					abbreviated: /^(r\.?\s?c\.?|r\.?\s?a\.?\s?c\.?|a\.?\s?d\.?|a\.?\s?c\.?)/i,
					wide: /^(ro Chrìosta|ron aois choitchinn|anno domini|aois choitcheann)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^b/i, /^(a|c)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^c[1234]/i,
					wide: /^[1234](cd|na|tr|mh)? cairteal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[fgmcòilsd]/i,
					abbreviated: /^(faoi|gear|màrt|gibl|cèit|ògmh|iuch|lùn|sult|dàmh|samh|dùbh)/i,
					wide: /^(am faoilleach|an gearran|am màrt|an giblean|an cèitean|an t-Ògmhios|an t-Iuchar|an lùnastal|an t-Sultain|an dàmhair|an t-Samhain|an dùbhlachd)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^f/i,
						/^g/i,
						/^m/i,
						/^g/i,
						/^c/i,
						/^ò/i,
						/^i/i,
						/^l/i,
						/^s/i,
						/^d/i,
						/^s/i,
						/^d/i
					],
					any: [
						/^fa/i,
						/^ge/i,
						/^mà/i,
						/^gi/i,
						/^c/i,
						/^ò/i,
						/^i/i,
						/^l/i,
						/^su/i,
						/^d/i,
						/^sa/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dlmcahs]/i,
					short: /^(dò|lu|mà|ci|ar|ha|sa)/i,
					abbreviated: /^(did|dil|dim|dic|dia|dih|dis)/i,
					wide: /^(didòmhnaich|diluain|dimàirt|diciadain|diardaoin|dihaoine|disathairne)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^c/i,
						/^a/i,
						/^h/i,
						/^s/i
					],
					any: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^c/i,
						/^a/i,
						/^h/i,
						/^s/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mi|n|(san|aig) (madainn|feasgar|feasgar|oidhche))/i,
					any: /^([ap]\.?\s?m\.?|meadhan oidhche|meadhan là|(san|aig) (madainn|feasgar|feasgar|oidhche))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^m/i,
					pm: /^f/i,
					midnight: /^meadhan oidhche/i,
					noon: /^meadhan là/i,
					morning: /sa mhadainn/i,
					afternoon: /feasgar/i,
					evening: /feasgar/i,
					night: /air an oidhche/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gl/_lib/formatDistance.js
	var formatDistanceLocale$52 = {
		lessThanXSeconds: {
			one: "menos dun segundo",
			other: "menos de {{count}} segundos"
		},
		xSeconds: {
			one: "1 segundo",
			other: "{{count}} segundos"
		},
		halfAMinute: "medio minuto",
		lessThanXMinutes: {
			one: "menos dun minuto",
			other: "menos de {{count}} minutos"
		},
		xMinutes: {
			one: "1 minuto",
			other: "{{count}} minutos"
		},
		aboutXHours: {
			one: "arredor dunha hora",
			other: "arredor de {{count}} horas"
		},
		xHours: {
			one: "1 hora",
			other: "{{count}} horas"
		},
		xDays: {
			one: "1 día",
			other: "{{count}} días"
		},
		aboutXWeeks: {
			one: "arredor dunha semana",
			other: "arredor de {{count}} semanas"
		},
		xWeeks: {
			one: "1 semana",
			other: "{{count}} semanas"
		},
		aboutXMonths: {
			one: "arredor de 1 mes",
			other: "arredor de {{count}} meses"
		},
		xMonths: {
			one: "1 mes",
			other: "{{count}} meses"
		},
		aboutXYears: {
			one: "arredor dun ano",
			other: "arredor de {{count}} anos"
		},
		xYears: {
			one: "1 ano",
			other: "{{count}} anos"
		},
		overXYears: {
			one: "máis dun ano",
			other: "máis de {{count}} anos"
		},
		almostXYears: {
			one: "case un ano",
			other: "case {{count}} anos"
		}
	};
	var formatDistance$53 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$52[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "en " + result;
		else return "hai " + result;
		return result;
	};
	var formatLong$54 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d 'de' MMMM y",
				long: "d 'de' MMMM y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'ás' {{time}}",
				long: "{{date}} 'ás' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gl/_lib/formatRelative.js
	var formatRelativeLocale$53 = {
		lastWeek: "'o' eeee 'pasado á' LT",
		yesterday: "'onte á' p",
		today: "'hoxe á' p",
		tomorrow: "'mañá á' p",
		nextWeek: "eeee 'á' p",
		other: "P"
	};
	var formatRelativeLocalePlural = {
		lastWeek: "'o' eeee 'pasado ás' p",
		yesterday: "'onte ás' p",
		today: "'hoxe ás' p",
		tomorrow: "'mañá ás' p",
		nextWeek: "eeee 'ás' p",
		other: "P"
	};
	var formatRelative$53 = (token, date, _baseDate, _options) => {
		if (date.getHours() !== 1) return formatRelativeLocalePlural[token];
		return formatRelativeLocale$53[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gl/_lib/localize.js
	var eraValues$53 = {
		narrow: ["AC", "DC"],
		abbreviated: ["AC", "DC"],
		wide: ["antes de cristo", "despois de cristo"]
	};
	var quarterValues$53 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"1º trimestre",
			"2º trimestre",
			"3º trimestre",
			"4º trimestre"
		]
	};
	var monthValues$53 = {
		narrow: [
			"e",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"xan",
			"feb",
			"mar",
			"abr",
			"mai",
			"xun",
			"xul",
			"ago",
			"set",
			"out",
			"nov",
			"dec"
		],
		wide: [
			"xaneiro",
			"febreiro",
			"marzo",
			"abril",
			"maio",
			"xuño",
			"xullo",
			"agosto",
			"setembro",
			"outubro",
			"novembro",
			"decembro"
		]
	};
	var dayValues$53 = {
		narrow: [
			"d",
			"l",
			"m",
			"m",
			"j",
			"v",
			"s"
		],
		short: [
			"do",
			"lu",
			"ma",
			"me",
			"xo",
			"ve",
			"sa"
		],
		abbreviated: [
			"dom",
			"lun",
			"mar",
			"mer",
			"xov",
			"ven",
			"sab"
		],
		wide: [
			"domingo",
			"luns",
			"martes",
			"mércores",
			"xoves",
			"venres",
			"sábado"
		]
	};
	var dayPeriodValues$53 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "md",
			morning: "mañá",
			afternoon: "tarde",
			evening: "tarde",
			night: "noite"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "medianoite",
			noon: "mediodía",
			morning: "mañá",
			afternoon: "tarde",
			evening: "tardiña",
			night: "noite"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "medianoite",
			noon: "mediodía",
			morning: "mañá",
			afternoon: "tarde",
			evening: "tardiña",
			night: "noite"
		}
	};
	var formattingDayPeriodValues$43 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "md",
			morning: "da mañá",
			afternoon: "da tarde",
			evening: "da tardiña",
			night: "da noite"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "medianoite",
			noon: "mediodía",
			morning: "da mañá",
			afternoon: "da tarde",
			evening: "da tardiña",
			night: "da noite"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "medianoite",
			noon: "mediodía",
			morning: "da mañá",
			afternoon: "da tarde",
			evening: "da tardiña",
			night: "da noite"
		}
	};
	var ordinalNumber$53 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "º";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gl.js
	/**
	* @category Locales
	* @summary Galician locale.
	* @language Galician
	* @iso-639-2 glg
	* @author Alberto Doval - Cocodin Technology[@cocodinTech](https://github.com/cocodinTech)
	* @author Fidel Pita [@fidelpita](https://github.com/fidelpita)
	*/
	var gl = {
		code: "gl",
		formatDistance: formatDistance$53,
		formatLong: formatLong$54,
		formatRelative: formatRelative$53,
		localize: {
			ordinalNumber: ordinalNumber$53,
			era: buildLocalizeFn({
				values: eraValues$53,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$53,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$53,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$53,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$53,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$43,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(º)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ac|dc|a|d)/i,
					abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
					wide: /^(antes de cristo|antes da era com[uú]n|despois de cristo|era com[uú]n)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					any: [/^ac/i, /^dc/i],
					wide: [/^(antes de cristo|antes da era com[uú]n)/i, /^(despois de cristo|era com[uú]n)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^T[1234]/i,
					wide: /^[1234](º)? trimestre/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[xfmasond]/i,
					abbreviated: /^(xan|feb|mar|abr|mai|xun|xul|ago|set|out|nov|dec)/i,
					wide: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^x/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^x/i,
						/^x/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^xan/i,
						/^feb/i,
						/^mar/i,
						/^abr/i,
						/^mai/i,
						/^xun/i,
						/^xul/i,
						/^ago/i,
						/^set/i,
						/^out/i,
						/^nov/i,
						/^dec/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dlmxvs]/i,
					short: /^(do|lu|ma|me|xo|ve|sa)/i,
					abbreviated: /^(dom|lun|mar|mer|xov|ven|sab)/i,
					wide: /^(domingo|luns|martes|m[eé]rcores|xoves|venres|s[áa]bado)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^m/i,
						/^x/i,
						/^v/i,
						/^s/i
					],
					any: [
						/^do/i,
						/^lu/i,
						/^ma/i,
						/^me/i,
						/^xo/i,
						/^ve/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mn|md|(da|[aá]s) (mañ[aá]|tarde|noite))/i,
					any: /^([ap]\.?\s?m\.?|medianoite|mediod[ií]a|(da|[aá]s) (mañ[aá]|tarde|noite))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mn/i,
					noon: /^md/i,
					morning: /mañ[aá]/i,
					afternoon: /tarde/i,
					evening: /tardiña/i,
					night: /noite/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gu/_lib/formatDistance.js
	var formatDistanceLocale$51 = {
		lessThanXSeconds: {
			one: "હમણાં",
			other: "​આશરે {{count}} સેકંડ"
		},
		xSeconds: {
			one: "1 સેકંડ",
			other: "{{count}} સેકંડ"
		},
		halfAMinute: "અડધી મિનિટ",
		lessThanXMinutes: {
			one: "આ મિનિટ",
			other: "​આશરે {{count}} મિનિટ"
		},
		xMinutes: {
			one: "1 મિનિટ",
			other: "{{count}} મિનિટ"
		},
		aboutXHours: {
			one: "​આશરે 1 કલાક",
			other: "​આશરે {{count}} કલાક"
		},
		xHours: {
			one: "1 કલાક",
			other: "{{count}} કલાક"
		},
		xDays: {
			one: "1 દિવસ",
			other: "{{count}} દિવસ"
		},
		aboutXWeeks: {
			one: "આશરે 1 અઠવાડિયું",
			other: "આશરે {{count}} અઠવાડિયા"
		},
		xWeeks: {
			one: "1 અઠવાડિયું",
			other: "{{count}} અઠવાડિયા"
		},
		aboutXMonths: {
			one: "આશરે 1 મહિનો",
			other: "આશરે {{count}} મહિના"
		},
		xMonths: {
			one: "1 મહિનો",
			other: "{{count}} મહિના"
		},
		aboutXYears: {
			one: "આશરે 1 વર્ષ",
			other: "આશરે {{count}} વર્ષ"
		},
		xYears: {
			one: "1 વર્ષ",
			other: "{{count}} વર્ષ"
		},
		overXYears: {
			one: "1 વર્ષથી વધુ",
			other: "{{count}} વર્ષથી વધુ"
		},
		almostXYears: {
			one: "લગભગ 1 વર્ષ",
			other: "લગભગ {{count}} વર્ષ"
		}
	};
	var formatDistance$52 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$51[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "માં";
		else return result + " પહેલાં";
		return result;
	};
	var formatLong$53 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM, y",
				long: "d MMMM, y",
				medium: "d MMM, y",
				short: "d/M/yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "hh:mm:ss a zzzz",
				long: "hh:mm:ss a z",
				medium: "hh:mm:ss a",
				short: "hh:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gu/_lib/formatRelative.js
	var formatRelativeLocale$52 = {
		lastWeek: "'પાછલા' eeee p",
		yesterday: "'ગઈકાલે' p",
		today: "'આજે' p",
		tomorrow: "'આવતીકાલે' p",
		nextWeek: "eeee p",
		other: "P"
	};
	var formatRelative$52 = (token, _date, _baseDate, _options) => formatRelativeLocale$52[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/gu/_lib/localize.js
	var eraValues$52 = {
		narrow: ["ઈસપૂ", "ઈસ"],
		abbreviated: ["ઈ.સ.પૂર્વે", "ઈ.સ."],
		wide: ["ઈસવીસન પૂર્વે", "ઈસવીસન"]
	};
	var quarterValues$52 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1લો ત્રિમાસ",
			"2જો ત્રિમાસ",
			"3જો ત્રિમાસ",
			"4થો ત્રિમાસ"
		]
	};
	var monthValues$52 = {
		narrow: [
			"જા",
			"ફે",
			"મા",
			"એ",
			"મે",
			"જૂ",
			"જુ",
			"ઓ",
			"સ",
			"ઓ",
			"ન",
			"ડિ"
		],
		abbreviated: [
			"જાન્યુ",
			"ફેબ્રુ",
			"માર્ચ",
			"એપ્રિલ",
			"મે",
			"જૂન",
			"જુલાઈ",
			"ઑગસ્ટ",
			"સપ્ટે",
			"ઓક્ટો",
			"નવે",
			"ડિસે"
		],
		wide: [
			"જાન્યુઆરી",
			"ફેબ્રુઆરી",
			"માર્ચ",
			"એપ્રિલ",
			"મે",
			"જૂન",
			"જુલાઇ",
			"ઓગસ્ટ",
			"સપ્ટેમ્બર",
			"ઓક્ટોબર",
			"નવેમ્બર",
			"ડિસેમ્બર"
		]
	};
	var dayValues$52 = {
		narrow: [
			"ર",
			"સો",
			"મં",
			"બુ",
			"ગુ",
			"શુ",
			"શ"
		],
		short: [
			"ર",
			"સો",
			"મં",
			"બુ",
			"ગુ",
			"શુ",
			"શ"
		],
		abbreviated: [
			"રવિ",
			"સોમ",
			"મંગળ",
			"બુધ",
			"ગુરુ",
			"શુક્ર",
			"શનિ"
		],
		wide: [
			"રવિવાર",
			"સોમવાર",
			"મંગળવાર",
			"બુધવાર",
			"ગુરુવાર",
			"શુક્રવાર",
			"શનિવાર"
		]
	};
	var dayPeriodValues$52 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "મ.રાત્રિ",
			noon: "બ.",
			morning: "સવારે",
			afternoon: "બપોરે",
			evening: "સાંજે",
			night: "રાત્રે"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "​મધ્યરાત્રિ",
			noon: "બપોરે",
			morning: "સવારે",
			afternoon: "બપોરે",
			evening: "સાંજે",
			night: "રાત્રે"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "​મધ્યરાત્રિ",
			noon: "બપોરે",
			morning: "સવારે",
			afternoon: "બપોરે",
			evening: "સાંજે",
			night: "રાત્રે"
		}
	};
	var formattingDayPeriodValues$42 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "મ.રાત્રિ",
			noon: "બપોરે",
			morning: "સવારે",
			afternoon: "બપોરે",
			evening: "સાંજે",
			night: "રાત્રે"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "મધ્યરાત્રિ",
			noon: "બપોરે",
			morning: "સવારે",
			afternoon: "બપોરે",
			evening: "સાંજે",
			night: "રાત્રે"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "​મધ્યરાત્રિ",
			noon: "બપોરે",
			morning: "સવારે",
			afternoon: "બપોરે",
			evening: "સાંજે",
			night: "રાત્રે"
		}
	};
	var ordinalNumber$52 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/gu.js
	/**
	* @category Locales
	* @summary Gujarati locale (India).
	* @language Gujarati
	* @iso-639-2 guj
	* @author Manaday Mavani [@ManadayM](https://github.com/manadaym)
	*/
	var gu = {
		code: "gu",
		formatDistance: formatDistance$52,
		formatLong: formatLong$53,
		formatRelative: formatRelative$52,
		localize: {
			ordinalNumber: ordinalNumber$52,
			era: buildLocalizeFn({
				values: eraValues$52,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$52,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$52,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$52,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$52,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$42,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(લ|જ|થ|ઠ્ઠ|મ)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ઈસપૂ|ઈસ)/i,
					abbreviated: /^(ઈ\.સ\.પૂર્વે|ઈ\.સ\.)/i,
					wide: /^(ઈસવીસન\sપૂર્વે|ઈસવીસન)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^ઈસપૂ/i, /^ઈસ/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](લો|જો|થો)? ત્રિમાસ/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[જાફેમાએમેજૂજુઓસઓનડિ]/i,
					abbreviated: /^(જાન્યુ|ફેબ્રુ|માર્ચ|એપ્રિલ|મે|જૂન|જુલાઈ|ઑગસ્ટ|સપ્ટે|ઓક્ટો|નવે|ડિસે)/i,
					wide: /^(જાન્યુઆરી|ફેબ્રુઆરી|માર્ચ|એપ્રિલ|મે|જૂન|જુલાઇ|ઓગસ્ટ|સપ્ટેમ્બર|ઓક્ટોબર|નવેમ્બર|ડિસેમ્બર)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^જા/i,
						/^ફે/i,
						/^મા/i,
						/^એ/i,
						/^મે/i,
						/^જૂ/i,
						/^જુ/i,
						/^ઑગ/i,
						/^સ/i,
						/^ઓક્ટો/i,
						/^ન/i,
						/^ડિ/i
					],
					any: [
						/^જા/i,
						/^ફે/i,
						/^મા/i,
						/^એ/i,
						/^મે/i,
						/^જૂ/i,
						/^જુ/i,
						/^ઑગ/i,
						/^સ/i,
						/^ઓક્ટો/i,
						/^ન/i,
						/^ડિ/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ર|સો|મં|બુ|ગુ|શુ|શ)/i,
					short: /^(ર|સો|મં|બુ|ગુ|શુ|શ)/i,
					abbreviated: /^(રવિ|સોમ|મંગળ|બુધ|ગુરુ|શુક્ર|શનિ)/i,
					wide: /^(રવિવાર|સોમવાર|મંગળવાર|બુધવાર|ગુરુવાર|શુક્રવાર|શનિવાર)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ર/i,
						/^સો/i,
						/^મં/i,
						/^બુ/i,
						/^ગુ/i,
						/^શુ/i,
						/^શ/i
					],
					any: [
						/^ર/i,
						/^સો/i,
						/^મં/i,
						/^બુ/i,
						/^ગુ/i,
						/^શુ/i,
						/^શ/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|મ\.?|સ|બ|સાં|રા)/i,
					any: /^(a|p|મ\.?|સ|બ|સાં|રા)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^મ\.?/i,
					noon: /^બ/i,
					morning: /સ/i,
					afternoon: /બ/i,
					evening: /સાં/i,
					night: /રા/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/he/_lib/formatDistance.js
	var formatDistanceLocale$50 = {
		lessThanXSeconds: {
			one: "פחות משנייה",
			two: "פחות משתי שניות",
			other: "פחות מ־{{count}} שניות"
		},
		xSeconds: {
			one: "שנייה",
			two: "שתי שניות",
			other: "{{count}} שניות"
		},
		halfAMinute: "חצי דקה",
		lessThanXMinutes: {
			one: "פחות מדקה",
			two: "פחות משתי דקות",
			other: "פחות מ־{{count}} דקות"
		},
		xMinutes: {
			one: "דקה",
			two: "שתי דקות",
			other: "{{count}} דקות"
		},
		aboutXHours: {
			one: "כשעה",
			two: "כשעתיים",
			other: "כ־{{count}} שעות"
		},
		xHours: {
			one: "שעה",
			two: "שעתיים",
			other: "{{count}} שעות"
		},
		xDays: {
			one: "יום",
			two: "יומיים",
			other: "{{count}} ימים"
		},
		aboutXWeeks: {
			one: "כשבוע",
			two: "כשבועיים",
			other: "כ־{{count}} שבועות"
		},
		xWeeks: {
			one: "שבוע",
			two: "שבועיים",
			other: "{{count}} שבועות"
		},
		aboutXMonths: {
			one: "כחודש",
			two: "כחודשיים",
			other: "כ־{{count}} חודשים"
		},
		xMonths: {
			one: "חודש",
			two: "חודשיים",
			other: "{{count}} חודשים"
		},
		aboutXYears: {
			one: "כשנה",
			two: "כשנתיים",
			other: "כ־{{count}} שנים"
		},
		xYears: {
			one: "שנה",
			two: "שנתיים",
			other: "{{count}} שנים"
		},
		overXYears: {
			one: "יותר משנה",
			two: "יותר משנתיים",
			other: "יותר מ־{{count}} שנים"
		},
		almostXYears: {
			one: "כמעט שנה",
			two: "כמעט שנתיים",
			other: "כמעט {{count}} שנים"
		}
	};
	var formatDistance$51 = (token, count, options) => {
		if (token === "xDays" && options?.addSuffix && count <= 2) {
			if (options.comparison && options.comparison > 0) return count === 1 ? "מחר" : "מחרתיים";
			return count === 1 ? "אתמול" : "שלשום";
		}
		let result;
		const tokenValue = formatDistanceLocale$50[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 2) result = tokenValue.two;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "בעוד " + result;
		else return "לפני " + result;
		return result;
	};
	var formatLong$52 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d בMMMM y",
				long: "d בMMMM y",
				medium: "d בMMM y",
				short: "d.M.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'בשעה' {{time}}",
				long: "{{date}} 'בשעה' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/he/_lib/formatRelative.js
	var formatRelativeLocale$51 = {
		lastWeek: "eeee 'שעבר בשעה' p",
		yesterday: "'אתמול בשעה' p",
		today: "'היום בשעה' p",
		tomorrow: "'מחר בשעה' p",
		nextWeek: "eeee 'בשעה' p",
		other: "P"
	};
	var formatRelative$51 = (token, _date, _baseDate, _options) => formatRelativeLocale$51[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/he/_lib/localize.js
	var eraValues$51 = {
		narrow: ["לפנה״ס", "לספירה"],
		abbreviated: ["לפנה״ס", "לספירה"],
		wide: ["לפני הספירה", "לספירה"]
	};
	var quarterValues$51 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"רבעון 1",
			"רבעון 2",
			"רבעון 3",
			"רבעון 4"
		]
	};
	var monthValues$51 = {
		narrow: [
			"1",
			"2",
			"3",
			"4",
			"5",
			"6",
			"7",
			"8",
			"9",
			"10",
			"11",
			"12"
		],
		abbreviated: [
			"ינו׳",
			"פבר׳",
			"מרץ",
			"אפר׳",
			"מאי",
			"יוני",
			"יולי",
			"אוג׳",
			"ספט׳",
			"אוק׳",
			"נוב׳",
			"דצמ׳"
		],
		wide: [
			"ינואר",
			"פברואר",
			"מרץ",
			"אפריל",
			"מאי",
			"יוני",
			"יולי",
			"אוגוסט",
			"ספטמבר",
			"אוקטובר",
			"נובמבר",
			"דצמבר"
		]
	};
	var dayValues$51 = {
		narrow: [
			"א׳",
			"ב׳",
			"ג׳",
			"ד׳",
			"ה׳",
			"ו׳",
			"ש׳"
		],
		short: [
			"א׳",
			"ב׳",
			"ג׳",
			"ד׳",
			"ה׳",
			"ו׳",
			"ש׳"
		],
		abbreviated: [
			"יום א׳",
			"יום ב׳",
			"יום ג׳",
			"יום ד׳",
			"יום ה׳",
			"יום ו׳",
			"שבת"
		],
		wide: [
			"יום ראשון",
			"יום שני",
			"יום שלישי",
			"יום רביעי",
			"יום חמישי",
			"יום שישי",
			"יום שבת"
		]
	};
	var dayPeriodValues$51 = {
		narrow: {
			am: "לפנה״צ",
			pm: "אחה״צ",
			midnight: "חצות",
			noon: "צהריים",
			morning: "בוקר",
			afternoon: "אחר הצהריים",
			evening: "ערב",
			night: "לילה"
		},
		abbreviated: {
			am: "לפנה״צ",
			pm: "אחה״צ",
			midnight: "חצות",
			noon: "צהריים",
			morning: "בוקר",
			afternoon: "אחר הצהריים",
			evening: "ערב",
			night: "לילה"
		},
		wide: {
			am: "לפנה״צ",
			pm: "אחה״צ",
			midnight: "חצות",
			noon: "צהריים",
			morning: "בוקר",
			afternoon: "אחר הצהריים",
			evening: "ערב",
			night: "לילה"
		}
	};
	var formattingDayPeriodValues$41 = {
		narrow: {
			am: "לפנה״צ",
			pm: "אחה״צ",
			midnight: "חצות",
			noon: "צהריים",
			morning: "בבוקר",
			afternoon: "בצהריים",
			evening: "בערב",
			night: "בלילה"
		},
		abbreviated: {
			am: "לפנה״צ",
			pm: "אחה״צ",
			midnight: "חצות",
			noon: "צהריים",
			morning: "בבוקר",
			afternoon: "אחר הצהריים",
			evening: "בערב",
			night: "בלילה"
		},
		wide: {
			am: "לפנה״צ",
			pm: "אחה״צ",
			midnight: "חצות",
			noon: "צהריים",
			morning: "בבוקר",
			afternoon: "אחר הצהריים",
			evening: "בערב",
			night: "בלילה"
		}
	};
	var ordinalNumber$51 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		if (number <= 0 || number > 10) return String(number);
		const unit = String(options?.unit);
		const isFemale = [
			"year",
			"hour",
			"minute",
			"second"
		].indexOf(unit) >= 0;
		const male = [
			"ראשון",
			"שני",
			"שלישי",
			"רביעי",
			"חמישי",
			"שישי",
			"שביעי",
			"שמיני",
			"תשיעי",
			"עשירי"
		];
		const female = [
			"ראשונה",
			"שנייה",
			"שלישית",
			"רביעית",
			"חמישית",
			"שישית",
			"שביעית",
			"שמינית",
			"תשיעית",
			"עשירית"
		];
		const index = number - 1;
		return isFemale ? female[index] : male[index];
	};
	var localize$51 = {
		ordinalNumber: ordinalNumber$51,
		era: buildLocalizeFn({
			values: eraValues$51,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$51,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$51,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$51,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$51,
			defaultWidth: "wide",
			formattingValues: formattingDayPeriodValues$41,
			defaultFormattingWidth: "wide"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/he/_lib/match.js
	var matchOrdinalNumberPattern$51 = /^(\d+|(ראשון|שני|שלישי|רביעי|חמישי|שישי|שביעי|שמיני|תשיעי|עשירי|ראשונה|שנייה|שלישית|רביעית|חמישית|שישית|שביעית|שמינית|תשיעית|עשירית))/i;
	var parseOrdinalNumberPattern$51 = /^(\d+|רא|שנ|של|רב|ח|שי|שב|שמ|ת|ע)/i;
	var matchEraPatterns$51 = {
		narrow: /^ל(ספירה|פנה״ס)/i,
		abbreviated: /^ל(ספירה|פנה״ס)/i,
		wide: /^ל(פני ה)?ספירה/i
	};
	var parseEraPatterns$51 = { any: [/^לפ/i, /^לס/i] };
	var matchQuarterPatterns$51 = {
		narrow: /^[1234]/i,
		abbreviated: /^q[1234]/i,
		wide: /^רבעון [1234]/i
	};
	var parseQuarterPatterns$51 = { any: [
		/1/i,
		/2/i,
		/3/i,
		/4/i
	] };
	var matchMonthPatterns$51 = {
		narrow: /^\d+/i,
		abbreviated: /^(ינו|פבר|מרץ|אפר|מאי|יוני|יולי|אוג|ספט|אוק|נוב|דצמ)׳?/i,
		wide: /^(ינואר|פברואר|מרץ|אפריל|מאי|יוני|יולי|אוגוסט|ספטמבר|אוקטובר|נובמבר|דצמבר)/i
	};
	var parseMonthPatterns$51 = {
		narrow: [
			/^1$/i,
			/^2/i,
			/^3/i,
			/^4/i,
			/^5/i,
			/^6/i,
			/^7/i,
			/^8/i,
			/^9/i,
			/^10/i,
			/^11/i,
			/^12/i
		],
		any: [
			/^ינ/i,
			/^פ/i,
			/^מר/i,
			/^אפ/i,
			/^מא/i,
			/^יונ/i,
			/^יול/i,
			/^אוג/i,
			/^ס/i,
			/^אוק/i,
			/^נ/i,
			/^ד/i
		]
	};
	var matchDayPatterns$51 = {
		narrow: /^[אבגדהוש]׳/i,
		short: /^[אבגדהוש]׳/i,
		abbreviated: /^(שבת|יום (א|ב|ג|ד|ה|ו)׳)/i,
		wide: /^יום (ראשון|שני|שלישי|רביעי|חמישי|שישי|שבת)/i
	};
	var parseDayPatterns$51 = {
		abbreviated: [
			/א׳$/i,
			/ב׳$/i,
			/ג׳$/i,
			/ד׳$/i,
			/ה׳$/i,
			/ו׳$/i,
			/^ש/i
		],
		wide: [
			/ן$/i,
			/ני$/i,
			/לישי$/i,
			/עי$/i,
			/מישי$/i,
			/שישי$/i,
			/ת$/i
		],
		any: [
			/^א/i,
			/^ב/i,
			/^ג/i,
			/^ד/i,
			/^ה/i,
			/^ו/i,
			/^ש/i
		]
	};
	var matchDayPeriodPatterns$51 = { any: /^(אחר ה|ב)?(חצות|צהריים|בוקר|ערב|לילה|אחה״צ|לפנה״צ)/i };
	var parseDayPeriodPatterns$51 = { any: {
		am: /^לפ/i,
		pm: /^אחה/i,
		midnight: /^ח/i,
		noon: /^צ/i,
		morning: /בוקר/i,
		afternoon: /בצ|אחר/i,
		evening: /ערב/i,
		night: /לילה/i
	} };
	var ordinalName = [
		"רא",
		"שנ",
		"של",
		"רב",
		"ח",
		"שי",
		"שב",
		"שמ",
		"ת",
		"ע"
	];
	//#endregion
	//#region ../../node_modules/date-fns/locale/he.js
	/**
	* @category Locales
	* @summary Hebrew locale.
	* @language Hebrew
	* @iso-639-2 heb
	* @author Nir Lahad [@nirlah](https://github.com/nirlah)
	*/
	var he = {
		code: "he",
		formatDistance: formatDistance$51,
		formatLong: formatLong$52,
		formatRelative: formatRelative$51,
		localize: localize$51,
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: matchOrdinalNumberPattern$51,
				parsePattern: parseOrdinalNumberPattern$51,
				valueCallback: (value) => {
					const number = parseInt(value, 10);
					return isNaN(number) ? ordinalName.indexOf(value) + 1 : number;
				}
			}),
			era: buildMatchFn({
				matchPatterns: matchEraPatterns$51,
				defaultMatchWidth: "wide",
				parsePatterns: parseEraPatterns$51,
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: matchQuarterPatterns$51,
				defaultMatchWidth: "wide",
				parsePatterns: parseQuarterPatterns$51,
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: matchMonthPatterns$51,
				defaultMatchWidth: "wide",
				parsePatterns: parseMonthPatterns$51,
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: matchDayPatterns$51,
				defaultMatchWidth: "wide",
				parsePatterns: parseDayPatterns$51,
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: matchDayPeriodPatterns$51,
				defaultMatchWidth: "any",
				parsePatterns: parseDayPeriodPatterns$51,
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hi/_lib/localize.js
	var numberValues = {
		locale: {
			1: "१",
			2: "२",
			3: "३",
			4: "४",
			5: "५",
			6: "६",
			7: "७",
			8: "८",
			9: "९",
			0: "०"
		},
		number: {
			"१": "1",
			"२": "2",
			"३": "3",
			"४": "4",
			"५": "5",
			"६": "6",
			"७": "7",
			"८": "8",
			"९": "9",
			"०": "0"
		}
	};
	var eraValues$50 = {
		narrow: ["ईसा-पूर्व", "ईस्वी"],
		abbreviated: ["ईसा-पूर्व", "ईस्वी"],
		wide: ["ईसा-पूर्व", "ईसवी सन"]
	};
	var quarterValues$50 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ति1",
			"ति2",
			"ति3",
			"ति4"
		],
		wide: [
			"पहली तिमाही",
			"दूसरी तिमाही",
			"तीसरी तिमाही",
			"चौथी तिमाही"
		]
	};
	var monthValues$50 = {
		narrow: [
			"ज",
			"फ़",
			"मा",
			"अ",
			"मई",
			"जू",
			"जु",
			"अग",
			"सि",
			"अक्टू",
			"न",
			"दि"
		],
		abbreviated: [
			"जन",
			"फ़र",
			"मार्च",
			"अप्रैल",
			"मई",
			"जून",
			"जुल",
			"अग",
			"सित",
			"अक्टू",
			"नव",
			"दिस"
		],
		wide: [
			"जनवरी",
			"फ़रवरी",
			"मार्च",
			"अप्रैल",
			"मई",
			"जून",
			"जुलाई",
			"अगस्त",
			"सितंबर",
			"अक्टूबर",
			"नवंबर",
			"दिसंबर"
		]
	};
	var dayValues$50 = {
		narrow: [
			"र",
			"सो",
			"मं",
			"बु",
			"गु",
			"शु",
			"श"
		],
		short: [
			"र",
			"सो",
			"मं",
			"बु",
			"गु",
			"शु",
			"श"
		],
		abbreviated: [
			"रवि",
			"सोम",
			"मंगल",
			"बुध",
			"गुरु",
			"शुक्र",
			"शनि"
		],
		wide: [
			"रविवार",
			"सोमवार",
			"मंगलवार",
			"बुधवार",
			"गुरुवार",
			"शुक्रवार",
			"शनिवार"
		]
	};
	var dayPeriodValues$50 = {
		narrow: {
			am: "पूर्वाह्न",
			pm: "अपराह्न",
			midnight: "मध्यरात्रि",
			noon: "दोपहर",
			morning: "सुबह",
			afternoon: "दोपहर",
			evening: "शाम",
			night: "रात"
		},
		abbreviated: {
			am: "पूर्वाह्न",
			pm: "अपराह्न",
			midnight: "मध्यरात्रि",
			noon: "दोपहर",
			morning: "सुबह",
			afternoon: "दोपहर",
			evening: "शाम",
			night: "रात"
		},
		wide: {
			am: "पूर्वाह्न",
			pm: "अपराह्न",
			midnight: "मध्यरात्रि",
			noon: "दोपहर",
			morning: "सुबह",
			afternoon: "दोपहर",
			evening: "शाम",
			night: "रात"
		}
	};
	var formattingDayPeriodValues$40 = {
		narrow: {
			am: "पूर्वाह्न",
			pm: "अपराह्न",
			midnight: "मध्यरात्रि",
			noon: "दोपहर",
			morning: "सुबह",
			afternoon: "दोपहर",
			evening: "शाम",
			night: "रात"
		},
		abbreviated: {
			am: "पूर्वाह्न",
			pm: "अपराह्न",
			midnight: "मध्यरात्रि",
			noon: "दोपहर",
			morning: "सुबह",
			afternoon: "दोपहर",
			evening: "शाम",
			night: "रात"
		},
		wide: {
			am: "पूर्वाह्न",
			pm: "अपराह्न",
			midnight: "मध्यरात्रि",
			noon: "दोपहर",
			morning: "सुबह",
			afternoon: "दोपहर",
			evening: "शाम",
			night: "रात"
		}
	};
	var ordinalNumber$50 = (dirtyNumber, _options) => {
		return numberToLocale(Number(dirtyNumber));
	};
	function localeToNumber(locale) {
		const enNumber = locale.toString().replace(/[१२३४५६७८९०]/g, function(match) {
			return numberValues.number[match];
		});
		return Number(enNumber);
	}
	function numberToLocale(enNumber) {
		return enNumber.toString().replace(/\d/g, function(match) {
			return numberValues.locale[match];
		});
	}
	var localize$50 = {
		ordinalNumber: ordinalNumber$50,
		era: buildLocalizeFn({
			values: eraValues$50,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$50,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$50,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$50,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$50,
			defaultWidth: "wide",
			formattingValues: formattingDayPeriodValues$40,
			defaultFormattingWidth: "wide"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hi/_lib/formatDistance.js
	var formatDistanceLocale$49 = {
		lessThanXSeconds: {
			one: "१ सेकंड से कम",
			other: "{{count}} सेकंड से कम"
		},
		xSeconds: {
			one: "१ सेकंड",
			other: "{{count}} सेकंड"
		},
		halfAMinute: "आधा मिनट",
		lessThanXMinutes: {
			one: "१ मिनट से कम",
			other: "{{count}} मिनट से कम"
		},
		xMinutes: {
			one: "१ मिनट",
			other: "{{count}} मिनट"
		},
		aboutXHours: {
			one: "लगभग १ घंटा",
			other: "लगभग {{count}} घंटे"
		},
		xHours: {
			one: "१ घंटा",
			other: "{{count}} घंटे"
		},
		xDays: {
			one: "१ दिन",
			other: "{{count}} दिन"
		},
		aboutXWeeks: {
			one: "लगभग १ सप्ताह",
			other: "लगभग {{count}} सप्ताह"
		},
		xWeeks: {
			one: "१ सप्ताह",
			other: "{{count}} सप्ताह"
		},
		aboutXMonths: {
			one: "लगभग १ महीना",
			other: "लगभग {{count}} महीने"
		},
		xMonths: {
			one: "१ महीना",
			other: "{{count}} महीने"
		},
		aboutXYears: {
			one: "लगभग १ वर्ष",
			other: "लगभग {{count}} वर्ष"
		},
		xYears: {
			one: "१ वर्ष",
			other: "{{count}} वर्ष"
		},
		overXYears: {
			one: "१ वर्ष से अधिक",
			other: "{{count}} वर्ष से अधिक"
		},
		almostXYears: {
			one: "लगभग १ वर्ष",
			other: "लगभग {{count}} वर्ष"
		}
	};
	var formatDistance$50 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$49[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", numberToLocale(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "मे ";
		else return result + " पहले";
		return result;
	};
	var formatLong$51 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM, y",
				long: "do MMMM, y",
				medium: "d MMM, y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'को' {{time}}",
				long: "{{date}} 'को' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hi/_lib/formatRelative.js
	var formatRelativeLocale$50 = {
		lastWeek: "'पिछले' eeee p",
		yesterday: "'कल' p",
		today: "'आज' p",
		tomorrow: "'कल' p",
		nextWeek: "eeee 'को' p",
		other: "P"
	};
	var formatRelative$50 = (token, _date, _baseDate, _options) => formatRelativeLocale$50[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/hi.js
	/**
	* @category Locales
	* @summary Hindi locale (India).
	* @language Hindi
	* @iso-639-2 hin
	* @author Mukesh Mandiwal [@mukeshmandiwal](https://github.com/mukeshmandiwal)
	*/
	var hi = {
		code: "hi",
		formatDistance: formatDistance$50,
		formatLong: formatLong$51,
		formatRelative: formatRelative$50,
		localize: localize$50,
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^[०१२३४५६७८९]+/i,
				parsePattern: /^[०१२३४५६७८९]+/i,
				valueCallback: localeToNumber
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ईसा-पूर्व|ईस्वी)/i,
					abbreviated: /^(ईसा\.?\s?पूर्व\.?|ईसा\.?)/i,
					wide: /^(ईसा-पूर्व|ईसवी पूर्व|ईसवी सन|ईसवी)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^b/i, /^(a|c)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ति[1234]/i,
					wide: /^[1234](पहली|दूसरी|तीसरी|चौथी)? तिमाही/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[जफ़माअप्मईजूनजुअगसिअक्तनदि]/i,
					abbreviated: /^(जन|फ़र|मार्च|अप्|मई|जून|जुल|अग|सित|अक्तू|नव|दिस)/i,
					wide: /^(जनवरी|फ़रवरी|मार्च|अप्रैल|मई|जून|जुलाई|अगस्त|सितंबर|अक्तूबर|नवंबर|दिसंबर)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ज/i,
						/^फ़/i,
						/^मा/i,
						/^अप्/i,
						/^मई/i,
						/^जू/i,
						/^जु/i,
						/^अग/i,
						/^सि/i,
						/^अक्तू/i,
						/^न/i,
						/^दि/i
					],
					any: [
						/^जन/i,
						/^फ़/i,
						/^मा/i,
						/^अप्/i,
						/^मई/i,
						/^जू/i,
						/^जु/i,
						/^अग/i,
						/^सि/i,
						/^अक्तू/i,
						/^नव/i,
						/^दिस/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[रविसोममंगलबुधगुरुशुक्रशनि]/i,
					short: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
					abbreviated: /^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,
					wide: /^(रविवार|सोमवार|मंगलवार|बुधवार|गुरुवार|शुक्रवार|शनिवार)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^रवि/i,
						/^सोम/i,
						/^मंगल/i,
						/^बुध/i,
						/^गुरु/i,
						/^शुक्र/i,
						/^शनि/i
					],
					any: [
						/^रवि/i,
						/^सोम/i,
						/^मंगल/i,
						/^बुध/i,
						/^गुरु/i,
						/^शुक्र/i,
						/^शनि/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(पू|अ|म|द.\?|सु|दो|शा|रा)/i,
					any: /^(पूर्वाह्न|अपराह्न|म|द.\?|सु|दो|शा|रा)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^पूर्वाह्न/i,
					pm: /^अपराह्न/i,
					midnight: /^मध्य/i,
					noon: /^दो/i,
					morning: /सु/i,
					afternoon: /दो/i,
					evening: /शा/i,
					night: /रा/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hr/_lib/formatDistance.js
	var formatDistanceLocale$48 = {
		lessThanXSeconds: {
			one: {
				standalone: "manje od 1 sekunde",
				withPrepositionAgo: "manje od 1 sekunde",
				withPrepositionIn: "manje od 1 sekundu"
			},
			dual: "manje od {{count}} sekunde",
			other: "manje od {{count}} sekundi"
		},
		xSeconds: {
			one: {
				standalone: "1 sekunda",
				withPrepositionAgo: "1 sekunde",
				withPrepositionIn: "1 sekundu"
			},
			dual: "{{count}} sekunde",
			other: "{{count}} sekundi"
		},
		halfAMinute: "pola minute",
		lessThanXMinutes: {
			one: {
				standalone: "manje od 1 minute",
				withPrepositionAgo: "manje od 1 minute",
				withPrepositionIn: "manje od 1 minutu"
			},
			dual: "manje od {{count}} minute",
			other: "manje od {{count}} minuta"
		},
		xMinutes: {
			one: {
				standalone: "1 minuta",
				withPrepositionAgo: "1 minute",
				withPrepositionIn: "1 minutu"
			},
			dual: "{{count}} minute",
			other: "{{count}} minuta"
		},
		aboutXHours: {
			one: {
				standalone: "oko 1 sat",
				withPrepositionAgo: "oko 1 sat",
				withPrepositionIn: "oko 1 sat"
			},
			dual: "oko {{count}} sata",
			other: "oko {{count}} sati"
		},
		xHours: {
			one: {
				standalone: "1 sat",
				withPrepositionAgo: "1 sat",
				withPrepositionIn: "1 sat"
			},
			dual: "{{count}} sata",
			other: "{{count}} sati"
		},
		xDays: {
			one: {
				standalone: "1 dan",
				withPrepositionAgo: "1 dan",
				withPrepositionIn: "1 dan"
			},
			dual: "{{count}} dana",
			other: "{{count}} dana"
		},
		aboutXWeeks: {
			one: {
				standalone: "oko 1 tjedan",
				withPrepositionAgo: "oko 1 tjedan",
				withPrepositionIn: "oko 1 tjedan"
			},
			dual: "oko {{count}} tjedna",
			other: "oko {{count}} tjedana"
		},
		xWeeks: {
			one: {
				standalone: "1 tjedan",
				withPrepositionAgo: "1 tjedan",
				withPrepositionIn: "1 tjedan"
			},
			dual: "{{count}} tjedna",
			other: "{{count}} tjedana"
		},
		aboutXMonths: {
			one: {
				standalone: "oko 1 mjesec",
				withPrepositionAgo: "oko 1 mjesec",
				withPrepositionIn: "oko 1 mjesec"
			},
			dual: "oko {{count}} mjeseca",
			other: "oko {{count}} mjeseci"
		},
		xMonths: {
			one: {
				standalone: "1 mjesec",
				withPrepositionAgo: "1 mjesec",
				withPrepositionIn: "1 mjesec"
			},
			dual: "{{count}} mjeseca",
			other: "{{count}} mjeseci"
		},
		aboutXYears: {
			one: {
				standalone: "oko 1 godinu",
				withPrepositionAgo: "oko 1 godinu",
				withPrepositionIn: "oko 1 godinu"
			},
			dual: "oko {{count}} godine",
			other: "oko {{count}} godina"
		},
		xYears: {
			one: {
				standalone: "1 godina",
				withPrepositionAgo: "1 godine",
				withPrepositionIn: "1 godinu"
			},
			dual: "{{count}} godine",
			other: "{{count}} godina"
		},
		overXYears: {
			one: {
				standalone: "preko 1 godinu",
				withPrepositionAgo: "preko 1 godinu",
				withPrepositionIn: "preko 1 godinu"
			},
			dual: "preko {{count}} godine",
			other: "preko {{count}} godina"
		},
		almostXYears: {
			one: {
				standalone: "gotovo 1 godinu",
				withPrepositionAgo: "gotovo 1 godinu",
				withPrepositionIn: "gotovo 1 godinu"
			},
			dual: "gotovo {{count}} godine",
			other: "gotovo {{count}} godina"
		}
	};
	var formatDistance$49 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$48[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) if (options?.addSuffix) if (options.comparison && options.comparison > 0) result = tokenValue.one.withPrepositionIn;
		else result = tokenValue.one.withPrepositionAgo;
		else result = tokenValue.one.standalone;
		else if (count % 10 > 1 && count % 10 < 5 && String(count).substr(-2, 1) !== "1") result = tokenValue.dual.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "za " + result;
		else return "prije " + result;
		return result;
	};
	var formatLong$50 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d. MMMM y.",
				long: "d. MMMM y.",
				medium: "d. MMM y.",
				short: "dd. MM. y."
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss (zzzz)",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'u' {{time}}",
				long: "{{date}} 'u' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hr/_lib/formatRelative.js
	var formatRelativeLocale$49 = {
		lastWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'prošlu nedjelju u' p";
				case 3: return "'prošlu srijedu u' p";
				case 6: return "'prošlu subotu u' p";
				default: return "'prošli' EEEE 'u' p";
			}
		},
		yesterday: "'jučer u' p",
		today: "'danas u' p",
		tomorrow: "'sutra u' p",
		nextWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'iduću nedjelju u' p";
				case 3: return "'iduću srijedu u' p";
				case 6: return "'iduću subotu u' p";
				default: return "'prošli' EEEE 'u' p";
			}
		},
		other: "P"
	};
	var formatRelative$49 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$49[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hr/_lib/localize.js
	var eraValues$49 = {
		narrow: ["pr.n.e.", "AD"],
		abbreviated: ["pr. Kr.", "po. Kr."],
		wide: ["Prije Krista", "Poslije Krista"]
	};
	var quarterValues$49 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4."
		],
		abbreviated: [
			"1. kv.",
			"2. kv.",
			"3. kv.",
			"4. kv."
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$49 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"sij",
			"velj",
			"ožu",
			"tra",
			"svi",
			"lip",
			"srp",
			"kol",
			"ruj",
			"lis",
			"stu",
			"pro"
		],
		wide: [
			"siječanj",
			"veljača",
			"ožujak",
			"travanj",
			"svibanj",
			"lipanj",
			"srpanj",
			"kolovoz",
			"rujan",
			"listopad",
			"studeni",
			"prosinac"
		]
	};
	var formattingMonthValues$10 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"sij",
			"velj",
			"ožu",
			"tra",
			"svi",
			"lip",
			"srp",
			"kol",
			"ruj",
			"lis",
			"stu",
			"pro"
		],
		wide: [
			"siječnja",
			"veljače",
			"ožujka",
			"travnja",
			"svibnja",
			"lipnja",
			"srpnja",
			"kolovoza",
			"rujna",
			"listopada",
			"studenog",
			"prosinca"
		]
	};
	var dayValues$49 = {
		narrow: [
			"N",
			"P",
			"U",
			"S",
			"Č",
			"P",
			"S"
		],
		short: [
			"ned",
			"pon",
			"uto",
			"sri",
			"čet",
			"pet",
			"sub"
		],
		abbreviated: [
			"ned",
			"pon",
			"uto",
			"sri",
			"čet",
			"pet",
			"sub"
		],
		wide: [
			"nedjelja",
			"ponedjeljak",
			"utorak",
			"srijeda",
			"četvrtak",
			"petak",
			"subota"
		]
	};
	var formattingDayPeriodValues$39 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutro",
			afternoon: "popodne",
			evening: "navečer",
			night: "noću"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutro",
			afternoon: "popodne",
			evening: "navečer",
			night: "noću"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutro",
			afternoon: "poslije podne",
			evening: "navečer",
			night: "noću"
		}
	};
	var dayPeriodValues$49 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutro",
			afternoon: "popodne",
			evening: "navečer",
			night: "noću"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutro",
			afternoon: "popodne",
			evening: "navečer",
			night: "noću"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutro",
			afternoon: "poslije podne",
			evening: "navečer",
			night: "noću"
		}
	};
	var ordinalNumber$49 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hr.js
	/**
	* @category Locales
	* @summary Croatian locale.
	* @language Croatian
	* @iso-639-2 hrv
	* @author Matija Marohnić [@silvenon](https://github.com/silvenon)
	* @author Manico [@manico](https://github.com/manico)
	* @author Ivan Jeržabek [@jerzabek](https://github.com/jerzabek)
	*/
	var hr = {
		code: "hr",
		formatDistance: formatDistance$49,
		formatLong: formatLong$50,
		formatRelative: formatRelative$49,
		localize: {
			ordinalNumber: ordinalNumber$49,
			era: buildLocalizeFn({
				values: eraValues$49,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$49,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$49,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$10,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$49,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$49,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$39,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(pr\.n\.e\.|AD)/i,
					abbreviated: /^(pr\.\s?Kr\.|po\.\s?Kr\.)/i,
					wide: /^(Prije Krista|prije nove ere|Poslije Krista|nova era)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^pr/i, /^(po|nova)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]\.\s?kv\.?/i,
					wide: /^[1234]\. kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(10|11|12|[123456789])\./i,
					abbreviated: /^(sij|velj|(ožu|ozu)|tra|svi|lip|srp|kol|ruj|lis|stu|pro)/i,
					wide: /^((siječanj|siječnja|sijecanj|sijecnja)|(veljača|veljače|veljaca|veljace)|(ožujak|ožujka|ozujak|ozujka)|(travanj|travnja)|(svibanj|svibnja)|(lipanj|lipnja)|(srpanj|srpnja)|(kolovoz|kolovoza)|(rujan|rujna)|(listopad|listopada)|(studeni|studenog)|(prosinac|prosinca))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/1/i,
						/2/i,
						/3/i,
						/4/i,
						/5/i,
						/6/i,
						/7/i,
						/8/i,
						/9/i,
						/10/i,
						/11/i,
						/12/i
					],
					abbreviated: [
						/^sij/i,
						/^velj/i,
						/^(ožu|ozu)/i,
						/^tra/i,
						/^svi/i,
						/^lip/i,
						/^srp/i,
						/^kol/i,
						/^ruj/i,
						/^lis/i,
						/^stu/i,
						/^pro/i
					],
					wide: [
						/^sij/i,
						/^velj/i,
						/^(ožu|ozu)/i,
						/^tra/i,
						/^svi/i,
						/^lip/i,
						/^srp/i,
						/^kol/i,
						/^ruj/i,
						/^lis/i,
						/^stu/i,
						/^pro/i
					]
				},
				defaultParseWidth: "wide"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[npusčc]/i,
					short: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
					abbreviated: /^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,
					wide: /^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^w/i,
						/^t/i,
						/^f/i,
						/^s/i
					],
					any: [
						/^su/i,
						/^m/i,
						/^tu/i,
						/^w/i,
						/^th/i,
						/^f/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|ponoc|ponoć|(po)?podne|navecer|navečer|noću|poslije podne|ujutro)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^pono/i,
					noon: /^pod/i,
					morning: /jutro/i,
					afternoon: /(poslije\s|po)+podne/i,
					evening: /(navece|naveče)/i,
					night: /(nocu|noću)/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ht/_lib/formatDistance.js
	var formatDistanceLocale$47 = {
		lessThanXSeconds: {
			one: "mwens pase yon segond",
			other: "mwens pase {{count}} segond"
		},
		xSeconds: {
			one: "1 segond",
			other: "{{count}} segond"
		},
		halfAMinute: "30 segond",
		lessThanXMinutes: {
			one: "mwens pase yon minit",
			other: "mwens pase {{count}} minit"
		},
		xMinutes: {
			one: "1 minit",
			other: "{{count}} minit"
		},
		aboutXHours: {
			one: "anviwon inè",
			other: "anviwon {{count}} è"
		},
		xHours: {
			one: "1 lè",
			other: "{{count}} lè"
		},
		xDays: {
			one: "1 jou",
			other: "{{count}} jou"
		},
		aboutXWeeks: {
			one: "anviwon 1 semèn",
			other: "anviwon {{count}} semèn"
		},
		xWeeks: {
			one: "1 semèn",
			other: "{{count}} semèn"
		},
		aboutXMonths: {
			one: "anviwon 1 mwa",
			other: "anviwon {{count}} mwa"
		},
		xMonths: {
			one: "1 mwa",
			other: "{{count}} mwa"
		},
		aboutXYears: {
			one: "anviwon 1 an",
			other: "anviwon {{count}} an"
		},
		xYears: {
			one: "1 an",
			other: "{{count}} an"
		},
		overXYears: {
			one: "plis pase 1 an",
			other: "plis pase {{count}} an"
		},
		almostXYears: {
			one: "prèske 1 an",
			other: "prèske {{count}} an"
		}
	};
	var formatDistance$48 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$47[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "nan " + result;
		else return "sa fè " + result;
		return result;
	};
	var formatLong$49 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'nan lè' {{time}}",
				long: "{{date}} 'nan lè' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ht/_lib/formatRelative.js
	var formatRelativeLocale$48 = {
		lastWeek: "eeee 'pase nan lè' p",
		yesterday: "'yè nan lè' p",
		today: "'jodi a' p",
		tomorrow: "'demen nan lè' p'",
		nextWeek: "eeee 'pwochen nan lè' p",
		other: "P"
	};
	var formatRelative$48 = (token, _date, _baseDate, _options) => formatRelativeLocale$48[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ht/_lib/localize.js
	var eraValues$48 = {
		narrow: ["av. J.-K", "ap. J.-K"],
		abbreviated: ["av. J.-K", "ap. J.-K"],
		wide: ["anvan Jezi Kris", "apre Jezi Kris"]
	};
	var quarterValues$48 = {
		narrow: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		abbreviated: [
			"1ye trim.",
			"2yèm trim.",
			"3yèm trim.",
			"4yèm trim."
		],
		wide: [
			"1ye trimès",
			"2yèm trimès",
			"3yèm trimès",
			"4yèm trimès"
		]
	};
	var monthValues$48 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"O",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"janv.",
			"fevr.",
			"mas",
			"avr.",
			"me",
			"jen",
			"jiyè",
			"out",
			"sept.",
			"okt.",
			"nov.",
			"des."
		],
		wide: [
			"janvye",
			"fevrye",
			"mas",
			"avril",
			"me",
			"jen",
			"jiyè",
			"out",
			"septanm",
			"oktòb",
			"novanm",
			"desanm"
		]
	};
	var dayValues$48 = {
		narrow: [
			"D",
			"L",
			"M",
			"M",
			"J",
			"V",
			"S"
		],
		short: [
			"di",
			"le",
			"ma",
			"mè",
			"je",
			"va",
			"sa"
		],
		abbreviated: [
			"dim.",
			"len.",
			"mad.",
			"mèk.",
			"jed.",
			"van.",
			"sam."
		],
		wide: [
			"dimanch",
			"lendi",
			"madi",
			"mèkredi",
			"jedi",
			"vandredi",
			"samdi"
		]
	};
	var dayPeriodValues$48 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "minwit",
			noon: "midi",
			morning: "mat.",
			afternoon: "ap.m.",
			evening: "swa",
			night: "mat."
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "minwit",
			noon: "midi",
			morning: "maten",
			afternoon: "aprèmidi",
			evening: "swa",
			night: "maten"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "minwit",
			noon: "midi",
			morning: "nan maten",
			afternoon: "nan aprèmidi",
			evening: "nan aswè",
			night: "nan maten"
		}
	};
	var ordinalNumber$48 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		if (number === 0) return String(number);
		return number + (number === 1 ? "ye" : "yèm");
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ht.js
	/**
	* @category Locales
	* @summary Haitian Creole locale.
	* @language Haitian Creole
	* @iso-639-2 hat
	* @author Rubens Mariuzzo [@rmariuzzo](https://github.com/rmariuzzo)
	* @author Watson Marcelain [@watsongm24](https://github.com/watsongm24)
	*/
	var ht = {
		code: "ht",
		formatDistance: formatDistance$48,
		formatLong: formatLong$49,
		formatRelative: formatRelative$48,
		localize: {
			ordinalNumber: ordinalNumber$48,
			era: buildLocalizeFn({
				values: eraValues$48,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$48,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$48,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$48,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$48,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(ye|yèm)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(av\.J\.K|ap\.J\.K|ap\.J\.-K)/i,
					abbreviated: /^(av\.J\.-K|av\.J-K|apr\.J\.-K|apr\.J-K|ap\.J-K)/i,
					wide: /^(avan Jezi Kris|apre Jezi Kris)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^av/i, /^ap/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^t[1234]/i,
					wide: /^[1234](ye|yèm)? trimès/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(janv|fevr|mas|avr|me|jen|jiyè|out|sept|okt|nov|des)\.?/i,
					wide: /^(janvye|fevrye|mas|avril|me|jen|jiyè|out|septanm|oktòb|novanm|desanm)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^o/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^ma/i,
						/^av/i,
						/^me/i,
						/^je/i,
						/^ji/i,
						/^ou/i,
						/^s/i,
						/^ok/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[lmjvsd]/i,
					short: /^(di|le|ma|me|je|va|sa)/i,
					abbreviated: /^(dim|len|mad|mèk|jed|van|sam)\.?/i,
					wide: /^(dimanch|lendi|madi|mèkredi|jedi|vandredi|samdi)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^m/i,
						/^j/i,
						/^v/i,
						/^s/i
					],
					any: [
						/^di/i,
						/^le/i,
						/^ma/i,
						/^mè/i,
						/^je/i,
						/^va/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|minwit|midi|mat\.?|ap\.?m\.?|swa)/i,
					any: /^([ap]\.?\s?m\.?|nan maten|nan aprèmidi|nan aswè)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^min/i,
					noon: /^mid/i,
					morning: /mat/i,
					afternoon: /ap/i,
					evening: /sw/i,
					night: /nwit/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hu/_lib/formatDistance.js
	var translations$1 = {
		about: "körülbelül",
		over: "több mint",
		almost: "majdnem",
		lessthan: "kevesebb mint"
	};
	var withoutSuffixes = {
		xseconds: " másodperc",
		halfaminute: "fél perc",
		xminutes: " perc",
		xhours: " óra",
		xdays: " nap",
		xweeks: " hét",
		xmonths: " hónap",
		xyears: " év"
	};
	var withSuffixes = {
		xseconds: {
			"-1": " másodperccel ezelőtt",
			1: " másodperc múlva",
			0: " másodperce"
		},
		halfaminute: {
			"-1": "fél perccel ezelőtt",
			1: "fél perc múlva",
			0: "fél perce"
		},
		xminutes: {
			"-1": " perccel ezelőtt",
			1: " perc múlva",
			0: " perce"
		},
		xhours: {
			"-1": " órával ezelőtt",
			1: " óra múlva",
			0: " órája"
		},
		xdays: {
			"-1": " nappal ezelőtt",
			1: " nap múlva",
			0: " napja"
		},
		xweeks: {
			"-1": " héttel ezelőtt",
			1: " hét múlva",
			0: " hete"
		},
		xmonths: {
			"-1": " hónappal ezelőtt",
			1: " hónap múlva",
			0: " hónapja"
		},
		xyears: {
			"-1": " évvel ezelőtt",
			1: " év múlva",
			0: " éve"
		}
	};
	var formatDistance$47 = (token, count, options) => {
		const adverb = token.match(/about|over|almost|lessthan/i);
		const unit = adverb ? token.replace(adverb[0], "") : token;
		const addSuffix = options?.addSuffix === true;
		const key = unit.toLowerCase();
		const comparison = options?.comparison || 0;
		const translated = addSuffix ? withSuffixes[key][comparison] : withoutSuffixes[key];
		let result = key === "halfaminute" ? translated : count + translated;
		if (adverb) result = translations$1[adverb[0].toLowerCase()] + " " + result;
		return result;
	};
	var formatLong$48 = {
		date: buildFormatLongFn({
			formats: {
				full: "y. MMMM d., EEEE",
				long: "y. MMMM d.",
				medium: "y. MMM d.",
				short: "y. MM. dd."
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hu/_lib/formatRelative.js
	var accusativeWeekdays$4 = [
		"vasárnap",
		"hétfőn",
		"kedden",
		"szerdán",
		"csütörtökön",
		"pénteken",
		"szombaton"
	];
	function week(isFuture) {
		return (date) => {
			const weekday = accusativeWeekdays$4[date.getDay()];
			return `${isFuture ? "" : "'múlt' "}'${weekday}' p'-kor'`;
		};
	}
	var formatRelativeLocale$47 = {
		lastWeek: week(false),
		yesterday: "'tegnap' p'-kor'",
		today: "'ma' p'-kor'",
		tomorrow: "'holnap' p'-kor'",
		nextWeek: week(true),
		other: "P"
	};
	var formatRelative$47 = (token, date) => {
		const format = formatRelativeLocale$47[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hu/_lib/localize.js
	var eraValues$47 = {
		narrow: ["ie.", "isz."],
		abbreviated: ["i. e.", "i. sz."],
		wide: ["Krisztus előtt", "időszámításunk szerint"]
	};
	var quarterValues$47 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4."
		],
		abbreviated: [
			"1. n.év",
			"2. n.év",
			"3. n.év",
			"4. n.év"
		],
		wide: [
			"1. negyedév",
			"2. negyedév",
			"3. negyedév",
			"4. negyedév"
		]
	};
	var formattingQuarterValues$3 = {
		narrow: [
			"I.",
			"II.",
			"III.",
			"IV."
		],
		abbreviated: [
			"I. n.év",
			"II. n.év",
			"III. n.év",
			"IV. n.év"
		],
		wide: [
			"I. negyedév",
			"II. negyedév",
			"III. negyedév",
			"IV. negyedév"
		]
	};
	var monthValues$47 = {
		narrow: [
			"J",
			"F",
			"M",
			"Á",
			"M",
			"J",
			"J",
			"A",
			"Sz",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"febr.",
			"márc.",
			"ápr.",
			"máj.",
			"jún.",
			"júl.",
			"aug.",
			"szept.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"január",
			"február",
			"március",
			"április",
			"május",
			"június",
			"július",
			"augusztus",
			"szeptember",
			"október",
			"november",
			"december"
		]
	};
	var dayValues$47 = {
		narrow: [
			"V",
			"H",
			"K",
			"Sz",
			"Cs",
			"P",
			"Sz"
		],
		short: [
			"V",
			"H",
			"K",
			"Sze",
			"Cs",
			"P",
			"Szo"
		],
		abbreviated: [
			"V",
			"H",
			"K",
			"Sze",
			"Cs",
			"P",
			"Szo"
		],
		wide: [
			"vasárnap",
			"hétfő",
			"kedd",
			"szerda",
			"csütörtök",
			"péntek",
			"szombat"
		]
	};
	var dayPeriodValues$47 = {
		narrow: {
			am: "de.",
			pm: "du.",
			midnight: "éjfél",
			noon: "dél",
			morning: "reggel",
			afternoon: "du.",
			evening: "este",
			night: "éjjel"
		},
		abbreviated: {
			am: "de.",
			pm: "du.",
			midnight: "éjfél",
			noon: "dél",
			morning: "reggel",
			afternoon: "du.",
			evening: "este",
			night: "éjjel"
		},
		wide: {
			am: "de.",
			pm: "du.",
			midnight: "éjfél",
			noon: "dél",
			morning: "reggel",
			afternoon: "délután",
			evening: "este",
			night: "éjjel"
		}
	};
	var ordinalNumber$47 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hu.js
	/**
	* @category Locales
	* @summary Hungarian locale.
	* @language Hungarian
	* @iso-639-2 hun
	* @author Pavlo Shpak [@pshpak](https://github.com/pshpak)
	* @author Eduardo Pardo [@eduardopsll](https://github.com/eduardopsll)
	* @author Zoltan Szepesi [@twodcube](https://github.com/twodcube)
	*/
	var hu = {
		code: "hu",
		formatDistance: formatDistance$47,
		formatLong: formatLong$48,
		formatRelative: formatRelative$47,
		localize: {
			ordinalNumber: ordinalNumber$47,
			era: buildLocalizeFn({
				values: eraValues$47,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$47,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1,
				formattingValues: formattingQuarterValues$3,
				defaultFormattingWidth: "wide"
			}),
			month: buildLocalizeFn({
				values: monthValues$47,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$47,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$47,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\.?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ie\.|isz\.)/i,
					abbreviated: /^(i\.\s?e\.?|b?\s?c\s?e|i\.\s?sz\.?)/i,
					wide: /^(Krisztus előtt|időszámításunk előtt|időszámításunk szerint|i\. sz\.)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [/ie/i, /isz/i],
					abbreviated: [/^(i\.?\s?e\.?|b\s?ce)/i, /^(i\.?\s?sz\.?|c\s?e)/i],
					any: [/előtt/i, /(szerint|i. sz.)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]\.?/i,
					abbreviated: /^[1234]?\.?\s?n\.év/i,
					wide: /^([1234]|I|II|III|IV)?\.?\s?negyedév/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1|I$/i,
					/2|II$/i,
					/3|III/i,
					/4|IV/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmaásond]|sz/i,
					abbreviated: /^(jan\.?|febr\.?|márc\.?|ápr\.?|máj\.?|jún\.?|júl\.?|aug\.?|szept\.?|okt\.?|nov\.?|dec\.?)/i,
					wide: /^(január|február|március|április|május|június|július|augusztus|szeptember|október|november|december)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a|á/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s|sz/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^már/i,
						/^áp/i,
						/^máj/i,
						/^jún/i,
						/^júl/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^([vhkpc]|sz|cs|sz)/i,
					short: /^([vhkp]|sze|cs|szo)/i,
					abbreviated: /^([vhkp]|sze|cs|szo)/i,
					wide: /^(vasárnap|hétfő|kedd|szerda|csütörtök|péntek|szombat)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^v/i,
						/^h/i,
						/^k/i,
						/^sz/i,
						/^c/i,
						/^p/i,
						/^sz/i
					],
					any: [
						/^v/i,
						/^h/i,
						/^k/i,
						/^sze/i,
						/^c/i,
						/^p/i,
						/^szo/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^((de|du)\.?|éjfél|délután|dél|reggel|este|éjjel)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^de\.?/i,
					pm: /^du\.?/i,
					midnight: /^éjf/i,
					noon: /^dé/i,
					morning: /reg/i,
					afternoon: /^délu\.?/i,
					evening: /es/i,
					night: /éjj/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hy/_lib/formatDistance.js
	var formatDistanceLocale$46 = {
		lessThanXSeconds: {
			one: "ավելի քիչ քան 1 վայրկյան",
			other: "ավելի քիչ քան {{count}} վայրկյան"
		},
		xSeconds: {
			one: "1 վայրկյան",
			other: "{{count}} վայրկյան"
		},
		halfAMinute: "կես րոպե",
		lessThanXMinutes: {
			one: "ավելի քիչ քան 1 րոպե",
			other: "ավելի քիչ քան {{count}} րոպե"
		},
		xMinutes: {
			one: "1 րոպե",
			other: "{{count}} րոպե"
		},
		aboutXHours: {
			one: "մոտ 1 ժամ",
			other: "մոտ {{count}} ժամ"
		},
		xHours: {
			one: "1 ժամ",
			other: "{{count}} ժամ"
		},
		xDays: {
			one: "1 օր",
			other: "{{count}} օր"
		},
		aboutXWeeks: {
			one: "մոտ 1 շաբաթ",
			other: "մոտ {{count}} շաբաթ"
		},
		xWeeks: {
			one: "1 շաբաթ",
			other: "{{count}} շաբաթ"
		},
		aboutXMonths: {
			one: "մոտ 1 ամիս",
			other: "մոտ {{count}} ամիս"
		},
		xMonths: {
			one: "1 ամիս",
			other: "{{count}} ամիս"
		},
		aboutXYears: {
			one: "մոտ 1 տարի",
			other: "մոտ {{count}} տարի"
		},
		xYears: {
			one: "1 տարի",
			other: "{{count}} տարի"
		},
		overXYears: {
			one: "ավելի քան 1 տարի",
			other: "ավելի քան {{count}} տարի"
		},
		almostXYears: {
			one: "համարյա 1 տարի",
			other: "համարյա {{count}} տարի"
		}
	};
	var formatDistance$46 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$46[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " հետո";
		else return result + " առաջ";
		return result;
	};
	var formatLong$47 = {
		date: buildFormatLongFn({
			formats: {
				full: "d MMMM, y, EEEE",
				long: "d MMMM, y",
				medium: "d MMM, y",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'ժ․'{{time}}",
				long: "{{date}} 'ժ․'{{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hy/_lib/formatRelative.js
	var formatRelativeLocale$46 = {
		lastWeek: "'նախորդ' eeee p'֊ին'",
		yesterday: "'երեկ' p'֊ին'",
		today: "'այսօր' p'֊ին'",
		tomorrow: "'վաղը' p'֊ին'",
		nextWeek: "'հաջորդ' eeee p'֊ին'",
		other: "P"
	};
	var formatRelative$46 = (token, _date, _baseDate, _options) => formatRelativeLocale$46[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/hy/_lib/localize.js
	var eraValues$46 = {
		narrow: ["Ք", "Մ"],
		abbreviated: ["ՔԱ", "ՄԹ"],
		wide: ["Քրիստոսից առաջ", "Մեր թվարկության"]
	};
	var quarterValues$46 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Ք1",
			"Ք2",
			"Ք3",
			"Ք4"
		],
		wide: [
			"1֊ին քառորդ",
			"2֊րդ քառորդ",
			"3֊րդ քառորդ",
			"4֊րդ քառորդ"
		]
	};
	var monthValues$46 = {
		narrow: [
			"Հ",
			"Փ",
			"Մ",
			"Ա",
			"Մ",
			"Հ",
			"Հ",
			"Օ",
			"Ս",
			"Հ",
			"Ն",
			"Դ"
		],
		abbreviated: [
			"հուն",
			"փետ",
			"մար",
			"ապր",
			"մայ",
			"հուն",
			"հուլ",
			"օգս",
			"սեպ",
			"հոկ",
			"նոյ",
			"դեկ"
		],
		wide: [
			"հունվար",
			"փետրվար",
			"մարտ",
			"ապրիլ",
			"մայիս",
			"հունիս",
			"հուլիս",
			"օգոստոս",
			"սեպտեմբեր",
			"հոկտեմբեր",
			"նոյեմբեր",
			"դեկտեմբեր"
		]
	};
	var dayValues$46 = {
		narrow: [
			"Կ",
			"Ե",
			"Ե",
			"Չ",
			"Հ",
			"Ո",
			"Շ"
		],
		short: [
			"կր",
			"եր",
			"եք",
			"չք",
			"հգ",
			"ուր",
			"շբ"
		],
		abbreviated: [
			"կիր",
			"երկ",
			"երք",
			"չոր",
			"հնգ",
			"ուրբ",
			"շաբ"
		],
		wide: [
			"կիրակի",
			"երկուշաբթի",
			"երեքշաբթի",
			"չորեքշաբթի",
			"հինգշաբթի",
			"ուրբաթ",
			"շաբաթ"
		]
	};
	var dayPeriodValues$46 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "կեսգշ",
			noon: "կեսօր",
			morning: "առավոտ",
			afternoon: "ցերեկ",
			evening: "երեկո",
			night: "գիշեր"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "կեսգիշեր",
			noon: "կեսօր",
			morning: "առավոտ",
			afternoon: "ցերեկ",
			evening: "երեկո",
			night: "գիշեր"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "կեսգիշեր",
			noon: "կեսօր",
			morning: "առավոտ",
			afternoon: "ցերեկ",
			evening: "երեկո",
			night: "գիշեր"
		}
	};
	var formattingDayPeriodValues$38 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "կեսգշ",
			noon: "կեսօր",
			morning: "առավոտը",
			afternoon: "ցերեկը",
			evening: "երեկոյան",
			night: "գիշերը"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "կեսգիշերին",
			noon: "կեսօրին",
			morning: "առավոտը",
			afternoon: "ցերեկը",
			evening: "երեկոյան",
			night: "գիշերը"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "կեսգիշերին",
			noon: "կեսօրին",
			morning: "առավոտը",
			afternoon: "ցերեկը",
			evening: "երեկոյան",
			night: "գիշերը"
		}
	};
	var ordinalNumber$46 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 < 10) {
			if (rem100 % 10 === 1) return number + "֊ին";
		}
		return number + "֊րդ";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/hy.js
	/**
	* @category Locales
	* @summary Armenian locale
	* @language Armenian
	* @iso-639-2 arm
	* @author Alex Igityan [@alexigityan](https://github.com/alexigityan)
	*/
	var hy = {
		code: "hy",
		formatDistance: formatDistance$46,
		formatLong: formatLong$47,
		formatRelative: formatRelative$46,
		localize: {
			ordinalNumber: ordinalNumber$46,
			era: buildLocalizeFn({
				values: eraValues$46,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$46,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$46,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$46,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$46,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$38,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)((-|֊)?(ին|րդ))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(Ք|Մ)/i,
					abbreviated: /^(Ք\.?\s?Ա\.?|Մ\.?\s?Թ\.?\s?Ա\.?|Մ\.?\s?Թ\.?|Ք\.?\s?Հ\.?)/i,
					wide: /^(քրիստոսից առաջ|մեր թվարկությունից առաջ|մեր թվարկության|քրիստոսից հետո)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^ք/i, /^մ/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ք[1234]/i,
					wide: /^[1234]((-|֊)?(ին|րդ)) քառորդ/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[հփմաօսնդ]/i,
					abbreviated: /^(հուն|փետ|մար|ապր|մայ|հուն|հուլ|օգս|սեպ|հոկ|նոյ|դեկ)/i,
					wide: /^(հունվար|փետրվար|մարտ|ապրիլ|մայիս|հունիս|հուլիս|օգոստոս|սեպտեմբեր|հոկտեմբեր|նոյեմբեր|դեկտեմբեր)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^հ/i,
						/^փ/i,
						/^մ/i,
						/^ա/i,
						/^մ/i,
						/^հ/i,
						/^հ/i,
						/^օ/i,
						/^ս/i,
						/^հ/i,
						/^ն/i,
						/^դ/i
					],
					any: [
						/^հու/i,
						/^փ/i,
						/^մար/i,
						/^ա/i,
						/^մայ/i,
						/^հուն/i,
						/^հուլ/i,
						/^օ/i,
						/^ս/i,
						/^հոկ/i,
						/^ն/i,
						/^դ/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[եչհոշկ]/i,
					short: /^(կր|եր|եք|չք|հգ|ուր|շբ)/i,
					abbreviated: /^(կիր|երկ|երք|չոր|հնգ|ուրբ|շաբ)/i,
					wide: /^(կիրակի|երկուշաբթի|երեքշաբթի|չորեքշաբթի|հինգշաբթի|ուրբաթ|շաբաթ)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^կ/i,
						/^ե/i,
						/^ե/i,
						/^չ/i,
						/^հ/i,
						/^(ո|Ո)/,
						/^շ/i
					],
					short: [
						/^կ/i,
						/^եր/i,
						/^եք/i,
						/^չ/i,
						/^հ/i,
						/^(ո|Ո)/,
						/^շ/i
					],
					abbreviated: [
						/^կ/i,
						/^երկ/i,
						/^երք/i,
						/^չ/i,
						/^հ/i,
						/^(ո|Ո)/,
						/^շ/i
					],
					wide: [
						/^կ/i,
						/^երկ/i,
						/^երե/i,
						/^չ/i,
						/^հ/i,
						/^(ո|Ո)/,
						/^շ/i
					]
				},
				defaultParseWidth: "wide"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^([ap]|կեսգշ|կեսօր|(առավոտը?|ցերեկը?|երեկո(յան)?|գիշերը?))/i,
					any: /^([ap]\.?\s?m\.?|կեսգիշեր(ին)?|կեսօր(ին)?|(առավոտը?|ցերեկը?|երեկո(յան)?|գիշերը?))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /կեսգիշեր/i,
					noon: /կեսօր/i,
					morning: /առավոտ/i,
					afternoon: /ցերեկ/i,
					evening: /երեկո/i,
					night: /գիշեր/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/id/_lib/formatDistance.js
	var formatDistanceLocale$45 = {
		lessThanXSeconds: {
			one: "kurang dari 1 detik",
			other: "kurang dari {{count}} detik"
		},
		xSeconds: {
			one: "1 detik",
			other: "{{count}} detik"
		},
		halfAMinute: "setengah menit",
		lessThanXMinutes: {
			one: "kurang dari 1 menit",
			other: "kurang dari {{count}} menit"
		},
		xMinutes: {
			one: "1 menit",
			other: "{{count}} menit"
		},
		aboutXHours: {
			one: "sekitar 1 jam",
			other: "sekitar {{count}} jam"
		},
		xHours: {
			one: "1 jam",
			other: "{{count}} jam"
		},
		xDays: {
			one: "1 hari",
			other: "{{count}} hari"
		},
		aboutXWeeks: {
			one: "sekitar 1 minggu",
			other: "sekitar {{count}} minggu"
		},
		xWeeks: {
			one: "1 minggu",
			other: "{{count}} minggu"
		},
		aboutXMonths: {
			one: "sekitar 1 bulan",
			other: "sekitar {{count}} bulan"
		},
		xMonths: {
			one: "1 bulan",
			other: "{{count}} bulan"
		},
		aboutXYears: {
			one: "sekitar 1 tahun",
			other: "sekitar {{count}} tahun"
		},
		xYears: {
			one: "1 tahun",
			other: "{{count}} tahun"
		},
		overXYears: {
			one: "lebih dari 1 tahun",
			other: "lebih dari {{count}} tahun"
		},
		almostXYears: {
			one: "hampir 1 tahun",
			other: "hampir {{count}} tahun"
		}
	};
	var formatDistance$45 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$45[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "dalam waktu " + result;
		else return result + " yang lalu";
		return result;
	};
	var formatLong$46 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "d/M/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH.mm.ss",
				long: "HH.mm.ss",
				medium: "HH.mm",
				short: "HH.mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'pukul' {{time}}",
				long: "{{date}} 'pukul' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/id/_lib/formatRelative.js
	var formatRelativeLocale$45 = {
		lastWeek: "eeee 'lalu pukul' p",
		yesterday: "'Kemarin pukul' p",
		today: "'Hari ini pukul' p",
		tomorrow: "'Besok pukul' p",
		nextWeek: "eeee 'pukul' p",
		other: "P"
	};
	var formatRelative$45 = (token, _date, _baseDate, _options) => formatRelativeLocale$45[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/id/_lib/localize.js
	var eraValues$45 = {
		narrow: ["SM", "M"],
		abbreviated: ["SM", "M"],
		wide: ["Sebelum Masehi", "Masehi"]
	};
	var quarterValues$45 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"Kuartal ke-1",
			"Kuartal ke-2",
			"Kuartal ke-3",
			"Kuartal ke-4"
		]
	};
	var monthValues$45 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Feb",
			"Mar",
			"Apr",
			"Mei",
			"Jun",
			"Jul",
			"Agt",
			"Sep",
			"Okt",
			"Nov",
			"Des"
		],
		wide: [
			"Januari",
			"Februari",
			"Maret",
			"April",
			"Mei",
			"Juni",
			"Juli",
			"Agustus",
			"September",
			"Oktober",
			"November",
			"Desember"
		]
	};
	var dayValues$45 = {
		narrow: [
			"M",
			"S",
			"S",
			"R",
			"K",
			"J",
			"S"
		],
		short: [
			"Min",
			"Sen",
			"Sel",
			"Rab",
			"Kam",
			"Jum",
			"Sab"
		],
		abbreviated: [
			"Min",
			"Sen",
			"Sel",
			"Rab",
			"Kam",
			"Jum",
			"Sab"
		],
		wide: [
			"Minggu",
			"Senin",
			"Selasa",
			"Rabu",
			"Kamis",
			"Jumat",
			"Sabtu"
		]
	};
	var dayPeriodValues$45 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "siang",
			evening: "sore",
			night: "malam"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "siang",
			evening: "sore",
			night: "malam"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "siang",
			evening: "sore",
			night: "malam"
		}
	};
	var formattingDayPeriodValues$37 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "siang",
			evening: "sore",
			night: "malam"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "siang",
			evening: "sore",
			night: "malam"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "siang",
			evening: "sore",
			night: "malam"
		}
	};
	var ordinalNumber$45 = (dirtyNumber, _options) => {
		return "ke-" + Number(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/id.js
	/**
	* @category Locales
	* @summary Indonesian locale.
	* @language Indonesian
	* @iso-639-2 ind
	* @author Rahmat Budiharso [@rbudiharso](https://github.com/rbudiharso)
	* @author Benget Nata [@bentinata](https://github.com/bentinata)
	* @author Budi Irawan [@deerawan](https://github.com/deerawan)
	* @author Try Ajitiono [@imballinst](https://github.com/imballinst)
	*/
	var id = {
		code: "id",
		formatDistance: formatDistance$45,
		formatLong: formatLong$46,
		formatRelative: formatRelative$45,
		localize: {
			ordinalNumber: ordinalNumber$45,
			era: buildLocalizeFn({
				values: eraValues$45,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$45,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$45,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$45,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$45,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$37,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^ke-(\d+)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(sm|m)/i,
					abbreviated: /^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,
					wide: /^(sebelum masehi|sebelum era umum|masehi|era umum)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^s/i, /^(m|e)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^K-?\s[1234]/i,
					wide: /^Kuartal ke-?\s?[1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,
					wide: /^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^ma/i,
						/^ap/i,
						/^me/i,
						/^jun/i,
						/^jul/i,
						/^ag/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[srkjm]/i,
					short: /^(min|sen|sel|rab|kam|jum|sab)/i,
					abbreviated: /^(min|sen|sel|rab|kam|jum|sab)/i,
					wide: /^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^m/i,
						/^s/i,
						/^s/i,
						/^r/i,
						/^k/i,
						/^j/i,
						/^s/i
					],
					any: [
						/^m/i,
						/^sen/i,
						/^sel/i,
						/^r/i,
						/^k/i,
						/^j/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,
					any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^pm/i,
					midnight: /^tengah m/i,
					noon: /^tengah h/i,
					morning: /pagi/i,
					afternoon: /siang/i,
					evening: /sore/i,
					night: /malam/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/is/_lib/formatDistance.js
	var formatDistanceLocale$44 = {
		lessThanXSeconds: {
			one: "minna en 1 sekúnda",
			other: "minna en {{count}} sekúndur"
		},
		xSeconds: {
			one: "1 sekúnda",
			other: "{{count}} sekúndur"
		},
		halfAMinute: "hálf mínúta",
		lessThanXMinutes: {
			one: "minna en 1 mínúta",
			other: "minna en {{count}} mínútur"
		},
		xMinutes: {
			one: "1 mínúta",
			other: "{{count}} mínútur"
		},
		aboutXHours: {
			one: "u.þ.b. 1 klukkustund",
			other: "u.þ.b. {{count}} klukkustundir"
		},
		xHours: {
			one: "1 klukkustund",
			other: "{{count}} klukkustundir"
		},
		xDays: {
			one: "1 dagur",
			other: "{{count}} dagar"
		},
		aboutXWeeks: {
			one: "um viku",
			other: "um {{count}} vikur"
		},
		xWeeks: {
			one: "1 viku",
			other: "{{count}} vikur"
		},
		aboutXMonths: {
			one: "u.þ.b. 1 mánuður",
			other: "u.þ.b. {{count}} mánuðir"
		},
		xMonths: {
			one: "1 mánuður",
			other: "{{count}} mánuðir"
		},
		aboutXYears: {
			one: "u.þ.b. 1 ár",
			other: "u.þ.b. {{count}} ár"
		},
		xYears: {
			one: "1 ár",
			other: "{{count}} ár"
		},
		overXYears: {
			one: "meira en 1 ár",
			other: "meira en {{count}} ár"
		},
		almostXYears: {
			one: "næstum 1 ár",
			other: "næstum {{count}} ár"
		}
	};
	var formatDistance$44 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$44[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "í " + result;
		else return result + " síðan";
		return result;
	};
	var formatLong$45 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y",
				long: "do MMMM y",
				medium: "do MMM y",
				short: "d.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "'kl'. HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'kl.' {{time}}",
				long: "{{date}} 'kl.' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/is/_lib/formatRelative.js
	var formatRelativeLocale$44 = {
		lastWeek: "'síðasta' dddd 'kl.' p",
		yesterday: "'í gær kl.' p",
		today: "'í dag kl.' p",
		tomorrow: "'á morgun kl.' p",
		nextWeek: "dddd 'kl.' p",
		other: "P"
	};
	var formatRelative$44 = (token, _date, _baseDate, _options) => formatRelativeLocale$44[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/is/_lib/localize.js
	var eraValues$44 = {
		narrow: ["f.Kr.", "e.Kr."],
		abbreviated: ["f.Kr.", "e.Kr."],
		wide: ["fyrir Krist", "eftir Krist"]
	};
	var quarterValues$44 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1F",
			"2F",
			"3F",
			"4F"
		],
		wide: [
			"1. fjórðungur",
			"2. fjórðungur",
			"3. fjórðungur",
			"4. fjórðungur"
		]
	};
	var monthValues$44 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"Á",
			"S",
			"Ó",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mars",
			"apríl",
			"maí",
			"júní",
			"júlí",
			"ágúst",
			"sept.",
			"okt.",
			"nóv.",
			"des."
		],
		wide: [
			"janúar",
			"febrúar",
			"mars",
			"apríl",
			"maí",
			"júní",
			"júlí",
			"ágúst",
			"september",
			"október",
			"nóvember",
			"desember"
		]
	};
	var dayValues$44 = {
		narrow: [
			"S",
			"M",
			"Þ",
			"M",
			"F",
			"F",
			"L"
		],
		short: [
			"Su",
			"Má",
			"Þr",
			"Mi",
			"Fi",
			"Fö",
			"La"
		],
		abbreviated: [
			"sun.",
			"mán.",
			"þri.",
			"mið.",
			"fim.",
			"fös.",
			"lau."
		],
		wide: [
			"sunnudagur",
			"mánudagur",
			"þriðjudagur",
			"miðvikudagur",
			"fimmtudagur",
			"föstudagur",
			"laugardagur"
		]
	};
	var dayPeriodValues$44 = {
		narrow: {
			am: "f",
			pm: "e",
			midnight: "miðnætti",
			noon: "hádegi",
			morning: "morgunn",
			afternoon: "síðdegi",
			evening: "kvöld",
			night: "nótt"
		},
		abbreviated: {
			am: "f.h.",
			pm: "e.h.",
			midnight: "miðnætti",
			noon: "hádegi",
			morning: "morgunn",
			afternoon: "síðdegi",
			evening: "kvöld",
			night: "nótt"
		},
		wide: {
			am: "fyrir hádegi",
			pm: "eftir hádegi",
			midnight: "miðnætti",
			noon: "hádegi",
			morning: "morgunn",
			afternoon: "síðdegi",
			evening: "kvöld",
			night: "nótt"
		}
	};
	var formattingDayPeriodValues$36 = {
		narrow: {
			am: "f",
			pm: "e",
			midnight: "á miðnætti",
			noon: "á hádegi",
			morning: "að morgni",
			afternoon: "síðdegis",
			evening: "um kvöld",
			night: "um nótt"
		},
		abbreviated: {
			am: "f.h.",
			pm: "e.h.",
			midnight: "á miðnætti",
			noon: "á hádegi",
			morning: "að morgni",
			afternoon: "síðdegis",
			evening: "um kvöld",
			night: "um nótt"
		},
		wide: {
			am: "fyrir hádegi",
			pm: "eftir hádegi",
			midnight: "á miðnætti",
			noon: "á hádegi",
			morning: "að morgni",
			afternoon: "síðdegis",
			evening: "um kvöld",
			night: "um nótt"
		}
	};
	var ordinalNumber$44 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/is.js
	/**
	* @category Locales
	* @summary Icelandic locale.
	* @language Icelandic
	* @iso-639-2 isl
	* @author Derek Blank [@derekblank](https://github.com/derekblank)
	* @author Arnór Ýmir [@lamayg](https://github.com/lamayg)
	*/
	var is = {
		code: "is",
		formatDistance: formatDistance$44,
		formatLong: formatLong$45,
		formatRelative: formatRelative$44,
		localize: {
			ordinalNumber: ordinalNumber$44,
			era: buildLocalizeFn({
				values: eraValues$44,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$44,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$44,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$44,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$44,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$36,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(\.)?/i,
				parsePattern: /\d+(\.)?/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(f\.Kr\.|e\.Kr\.)/i,
					abbreviated: /^(f\.Kr\.|e\.Kr\.)/i,
					wide: /^(fyrir Krist|eftir Krist)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(f\.Kr\.)/i, /^(e\.Kr\.)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]\.?/i,
					abbreviated: /^q[1234]\.?/i,
					wide: /^[1234]\.? fjórðungur/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1\.?/i,
					/2\.?/i,
					/3\.?/i,
					/4\.?/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmásónd]/i,
					abbreviated: /^(jan\.|feb\.|mars\.|apríl\.|maí|júní|júlí|águst|sep\.|oct\.|nov\.|dec\.)/i,
					wide: /^(januar|febrúar|mars|apríl|maí|júní|júlí|águst|september|október|nóvember|desember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^á/i,
						/^s/i,
						/^ó/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^maí/i,
						/^jún/i,
						/^júl/i,
						/^áu/i,
						/^s/i,
						/^ó/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtwf]/i,
					short: /^(su|má|þr|mi|fi|fö|la)/i,
					abbreviated: /^(sun|mán|þri|mið|fim|fös|lau)\.?/i,
					wide: /^(sunnudagur|mánudagur|þriðjudagur|miðvikudagur|fimmtudagur|föstudagur|laugardagur)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^þ/i,
						/^m/i,
						/^f/i,
						/^f/i,
						/^l/i
					],
					any: [
						/^su/i,
						/^má/i,
						/^þr/i,
						/^mi/i,
						/^fi/i,
						/^fö/i,
						/^la/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(f|e|síðdegis|(á|að|um) (morgni|kvöld|nótt|miðnætti))/i,
					any: /^(fyrir hádegi|eftir hádegi|[ef]\.?h\.?|síðdegis|morgunn|(á|að|um) (morgni|kvöld|nótt|miðnætti))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^f/i,
					pm: /^e/i,
					midnight: /^mi/i,
					noon: /^há/i,
					morning: /morgunn/i,
					afternoon: /síðdegi/i,
					evening: /kvöld/i,
					night: /nótt/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/it/_lib/formatDistance.js
	var formatDistanceLocale$43 = {
		lessThanXSeconds: {
			one: "meno di un secondo",
			other: "meno di {{count}} secondi"
		},
		xSeconds: {
			one: "un secondo",
			other: "{{count}} secondi"
		},
		halfAMinute: "alcuni secondi",
		lessThanXMinutes: {
			one: "meno di un minuto",
			other: "meno di {{count}} minuti"
		},
		xMinutes: {
			one: "un minuto",
			other: "{{count}} minuti"
		},
		aboutXHours: {
			one: "circa un'ora",
			other: "circa {{count}} ore"
		},
		xHours: {
			one: "un'ora",
			other: "{{count}} ore"
		},
		xDays: {
			one: "un giorno",
			other: "{{count}} giorni"
		},
		aboutXWeeks: {
			one: "circa una settimana",
			other: "circa {{count}} settimane"
		},
		xWeeks: {
			one: "una settimana",
			other: "{{count}} settimane"
		},
		aboutXMonths: {
			one: "circa un mese",
			other: "circa {{count}} mesi"
		},
		xMonths: {
			one: "un mese",
			other: "{{count}} mesi"
		},
		aboutXYears: {
			one: "circa un anno",
			other: "circa {{count}} anni"
		},
		xYears: {
			one: "un anno",
			other: "{{count}} anni"
		},
		overXYears: {
			one: "più di un anno",
			other: "più di {{count}} anni"
		},
		almostXYears: {
			one: "quasi un anno",
			other: "quasi {{count}} anni"
		}
	};
	var formatDistance$43 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$43[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "tra " + result;
		else return result + " fa";
		return result;
	};
	var formatLong$44 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/it/_lib/formatRelative.js
	var weekdays$2 = [
		"domenica",
		"lunedì",
		"martedì",
		"mercoledì",
		"giovedì",
		"venerdì",
		"sabato"
	];
	function lastWeek$5(day) {
		switch (day) {
			case 0: return "'domenica scorsa alle' p";
			default: return "'" + weekdays$2[day] + " scorso alle' p";
		}
	}
	function thisWeek$5(day) {
		return "'" + weekdays$2[day] + " alle' p";
	}
	function nextWeek$5(day) {
		switch (day) {
			case 0: return "'domenica prossima alle' p";
			default: return "'" + weekdays$2[day] + " prossimo alle' p";
		}
	}
	var formatRelativeLocale$43 = {
		lastWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$5(day);
			else return lastWeek$5(day);
		},
		yesterday: "'ieri alle' p",
		today: "'oggi alle' p",
		tomorrow: "'domani alle' p",
		nextWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$5(day);
			else return nextWeek$5(day);
		},
		other: "P"
	};
	var formatRelative$43 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$43[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/it/_lib/localize.js
	var eraValues$43 = {
		narrow: ["aC", "dC"],
		abbreviated: ["a.C.", "d.C."],
		wide: ["avanti Cristo", "dopo Cristo"]
	};
	var quarterValues$43 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"1º trimestre",
			"2º trimestre",
			"3º trimestre",
			"4º trimestre"
		]
	};
	var monthValues$43 = {
		narrow: [
			"G",
			"F",
			"M",
			"A",
			"M",
			"G",
			"L",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"gen",
			"feb",
			"mar",
			"apr",
			"mag",
			"giu",
			"lug",
			"ago",
			"set",
			"ott",
			"nov",
			"dic"
		],
		wide: [
			"gennaio",
			"febbraio",
			"marzo",
			"aprile",
			"maggio",
			"giugno",
			"luglio",
			"agosto",
			"settembre",
			"ottobre",
			"novembre",
			"dicembre"
		]
	};
	var dayValues$43 = {
		narrow: [
			"D",
			"L",
			"M",
			"M",
			"G",
			"V",
			"S"
		],
		short: [
			"dom",
			"lun",
			"mar",
			"mer",
			"gio",
			"ven",
			"sab"
		],
		abbreviated: [
			"dom",
			"lun",
			"mar",
			"mer",
			"gio",
			"ven",
			"sab"
		],
		wide: [
			"domenica",
			"lunedì",
			"martedì",
			"mercoledì",
			"giovedì",
			"venerdì",
			"sabato"
		]
	};
	var dayPeriodValues$43 = {
		narrow: {
			am: "m.",
			pm: "p.",
			midnight: "mezzanotte",
			noon: "mezzogiorno",
			morning: "mattina",
			afternoon: "pomeriggio",
			evening: "sera",
			night: "notte"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "mezzanotte",
			noon: "mezzogiorno",
			morning: "mattina",
			afternoon: "pomeriggio",
			evening: "sera",
			night: "notte"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "mezzanotte",
			noon: "mezzogiorno",
			morning: "mattina",
			afternoon: "pomeriggio",
			evening: "sera",
			night: "notte"
		}
	};
	var formattingDayPeriodValues$35 = {
		narrow: {
			am: "m.",
			pm: "p.",
			midnight: "mezzanotte",
			noon: "mezzogiorno",
			morning: "di mattina",
			afternoon: "del pomeriggio",
			evening: "di sera",
			night: "di notte"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "mezzanotte",
			noon: "mezzogiorno",
			morning: "di mattina",
			afternoon: "del pomeriggio",
			evening: "di sera",
			night: "di notte"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "mezzanotte",
			noon: "mezzogiorno",
			morning: "di mattina",
			afternoon: "del pomeriggio",
			evening: "di sera",
			night: "di notte"
		}
	};
	var ordinalNumber$43 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		return String(number);
	};
	var localize$43 = {
		ordinalNumber: ordinalNumber$43,
		era: buildLocalizeFn({
			values: eraValues$43,
			defaultWidth: "wide"
		}),
		quarter: buildLocalizeFn({
			values: quarterValues$43,
			defaultWidth: "wide",
			argumentCallback: (quarter) => quarter - 1
		}),
		month: buildLocalizeFn({
			values: monthValues$43,
			defaultWidth: "wide"
		}),
		day: buildLocalizeFn({
			values: dayValues$43,
			defaultWidth: "wide"
		}),
		dayPeriod: buildLocalizeFn({
			values: dayPeriodValues$43,
			defaultWidth: "wide",
			formattingValues: formattingDayPeriodValues$35,
			defaultFormattingWidth: "wide"
		})
	};
	var match$43 = {
		ordinalNumber: buildMatchPatternFn({
			matchPattern: /^(\d+)(º)?/i,
			parsePattern: /\d+/i,
			valueCallback: (value) => parseInt(value, 10)
		}),
		era: buildMatchFn({
			matchPatterns: {
				narrow: /^(aC|dC)/i,
				abbreviated: /^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,
				wide: /^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [/^a/i, /^(d|e)/i] },
			defaultParseWidth: "any"
		}),
		quarter: buildMatchFn({
			matchPatterns: {
				narrow: /^[1234]/i,
				abbreviated: /^t[1234]/i,
				wide: /^[1234](º)? trimestre/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: { any: [
				/1/i,
				/2/i,
				/3/i,
				/4/i
			] },
			defaultParseWidth: "any",
			valueCallback: (index) => index + 1
		}),
		month: buildMatchFn({
			matchPatterns: {
				narrow: /^[gfmalsond]/i,
				abbreviated: /^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,
				wide: /^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^g/i,
					/^f/i,
					/^m/i,
					/^a/i,
					/^m/i,
					/^g/i,
					/^l/i,
					/^a/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				],
				any: [
					/^ge/i,
					/^f/i,
					/^mar/i,
					/^ap/i,
					/^mag/i,
					/^gi/i,
					/^l/i,
					/^ag/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				]
			},
			defaultParseWidth: "any"
		}),
		day: buildMatchFn({
			matchPatterns: {
				narrow: /^[dlmgvs]/i,
				short: /^(do|lu|ma|me|gi|ve|sa)/i,
				abbreviated: /^(dom|lun|mar|mer|gio|ven|sab)/i,
				wide: /^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i
			},
			defaultMatchWidth: "wide",
			parsePatterns: {
				narrow: [
					/^d/i,
					/^l/i,
					/^m/i,
					/^m/i,
					/^g/i,
					/^v/i,
					/^s/i
				],
				any: [
					/^d/i,
					/^l/i,
					/^ma/i,
					/^me/i,
					/^g/i,
					/^v/i,
					/^s/i
				]
			},
			defaultParseWidth: "any"
		}),
		dayPeriod: buildMatchFn({
			matchPatterns: {
				narrow: /^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,
				any: /^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i
			},
			defaultMatchWidth: "any",
			parsePatterns: { any: {
				am: /^a/i,
				pm: /^p/i,
				midnight: /^mezza/i,
				noon: /^mezzo/i,
				morning: /mattina/i,
				afternoon: /pomeriggio/i,
				evening: /sera/i,
				night: /notte/i
			} },
			defaultParseWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/it.js
	/**
	* @category Locales
	* @summary Italian locale.
	* @language Italian
	* @iso-639-2 ita
	* @author Alberto Restifo [@albertorestifo](https://github.com/albertorestifo)
	* @author Giovanni Polimeni [@giofilo](https://github.com/giofilo)
	* @author Vincenzo Carrese [@vin-car](https://github.com/vin-car)
	*/
	var it = {
		code: "it",
		formatDistance: formatDistance$43,
		formatLong: formatLong$44,
		formatRelative: formatRelative$43,
		localize: localize$43,
		match: match$43,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/it-CH.js
	/**
	* @category Locales
	* @summary Italian locale (Switzerland).
	* @language Italian
	* @iso-639-2 ita
	* @author Mike Peyer [@maic66](https://github.com/maic66)
	*/
	var itCH = {
		code: "it-CH",
		formatDistance: formatDistance$43,
		formatLong: {
			date: buildFormatLongFn({
				formats: {
					full: "EEEE d MMMM y",
					long: "d MMMM y",
					medium: "d MMM y",
					short: "dd.MM.y"
				},
				defaultWidth: "full"
			}),
			time: buildFormatLongFn({
				formats: {
					full: "HH:mm:ss zzzz",
					long: "HH:mm:ss z",
					medium: "HH:mm:ss",
					short: "HH:mm"
				},
				defaultWidth: "full"
			}),
			dateTime: buildFormatLongFn({
				formats: {
					full: "{{date}} {{time}}",
					long: "{{date}} {{time}}",
					medium: "{{date}} {{time}}",
					short: "{{date}} {{time}}"
				},
				defaultWidth: "full"
			})
		},
		formatRelative: formatRelative$43,
		localize: localize$43,
		match: match$43,
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja/_lib/formatDistance.js
	var formatDistanceLocale$42 = {
		lessThanXSeconds: {
			one: "1秒未満",
			other: "{{count}}秒未満",
			oneWithSuffix: "約1秒",
			otherWithSuffix: "約{{count}}秒"
		},
		xSeconds: {
			one: "1秒",
			other: "{{count}}秒"
		},
		halfAMinute: "30秒",
		lessThanXMinutes: {
			one: "1分未満",
			other: "{{count}}分未満",
			oneWithSuffix: "約1分",
			otherWithSuffix: "約{{count}}分"
		},
		xMinutes: {
			one: "1分",
			other: "{{count}}分"
		},
		aboutXHours: {
			one: "約1時間",
			other: "約{{count}}時間"
		},
		xHours: {
			one: "1時間",
			other: "{{count}}時間"
		},
		xDays: {
			one: "1日",
			other: "{{count}}日"
		},
		aboutXWeeks: {
			one: "約1週間",
			other: "約{{count}}週間"
		},
		xWeeks: {
			one: "1週間",
			other: "{{count}}週間"
		},
		aboutXMonths: {
			one: "約1か月",
			other: "約{{count}}か月"
		},
		xMonths: {
			one: "1か月",
			other: "{{count}}か月"
		},
		aboutXYears: {
			one: "約1年",
			other: "約{{count}}年"
		},
		xYears: {
			one: "1年",
			other: "{{count}}年"
		},
		overXYears: {
			one: "1年以上",
			other: "{{count}}年以上"
		},
		almostXYears: {
			one: "1年近く",
			other: "{{count}}年近く"
		}
	};
	var formatDistance$42 = (token, count, options) => {
		options = options || {};
		let result;
		const tokenValue = formatDistanceLocale$42[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) if (options.addSuffix && tokenValue.oneWithSuffix) result = tokenValue.oneWithSuffix;
		else result = tokenValue.one;
		else if (options.addSuffix && tokenValue.otherWithSuffix) result = tokenValue.otherWithSuffix.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options.addSuffix) if (options.comparison && options.comparison > 0) return result + "後";
		else return result + "前";
		return result;
	};
	var formatLong$42 = {
		date: buildFormatLongFn({
			formats: {
				full: "y年M月d日EEEE",
				long: "y年M月d日",
				medium: "y/MM/dd",
				short: "y/MM/dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H時mm分ss秒 zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja/_lib/formatRelative.js
	var formatRelativeLocale$42 = {
		lastWeek: "先週のeeeeのp",
		yesterday: "昨日のp",
		today: "今日のp",
		tomorrow: "明日のp",
		nextWeek: "翌週のeeeeのp",
		other: "P"
	};
	var formatRelative$42 = (token, _date, _baseDate, _options) => {
		return formatRelativeLocale$42[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja/_lib/localize.js
	var eraValues$42 = {
		narrow: ["BC", "AC"],
		abbreviated: ["紀元前", "西暦"],
		wide: ["紀元前", "西暦"]
	};
	var quarterValues$42 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"第1四半期",
			"第2四半期",
			"第3四半期",
			"第4四半期"
		]
	};
	var monthValues$42 = {
		narrow: [
			"1",
			"2",
			"3",
			"4",
			"5",
			"6",
			"7",
			"8",
			"9",
			"10",
			"11",
			"12"
		],
		abbreviated: [
			"1月",
			"2月",
			"3月",
			"4月",
			"5月",
			"6月",
			"7月",
			"8月",
			"9月",
			"10月",
			"11月",
			"12月"
		],
		wide: [
			"1月",
			"2月",
			"3月",
			"4月",
			"5月",
			"6月",
			"7月",
			"8月",
			"9月",
			"10月",
			"11月",
			"12月"
		]
	};
	var dayValues$42 = {
		narrow: [
			"日",
			"月",
			"火",
			"水",
			"木",
			"金",
			"土"
		],
		short: [
			"日",
			"月",
			"火",
			"水",
			"木",
			"金",
			"土"
		],
		abbreviated: [
			"日",
			"月",
			"火",
			"水",
			"木",
			"金",
			"土"
		],
		wide: [
			"日曜日",
			"月曜日",
			"火曜日",
			"水曜日",
			"木曜日",
			"金曜日",
			"土曜日"
		]
	};
	var dayPeriodValues$42 = {
		narrow: {
			am: "午前",
			pm: "午後",
			midnight: "深夜",
			noon: "正午",
			morning: "朝",
			afternoon: "午後",
			evening: "夜",
			night: "深夜"
		},
		abbreviated: {
			am: "午前",
			pm: "午後",
			midnight: "深夜",
			noon: "正午",
			morning: "朝",
			afternoon: "午後",
			evening: "夜",
			night: "深夜"
		},
		wide: {
			am: "午前",
			pm: "午後",
			midnight: "深夜",
			noon: "正午",
			morning: "朝",
			afternoon: "午後",
			evening: "夜",
			night: "深夜"
		}
	};
	var formattingDayPeriodValues$34 = {
		narrow: {
			am: "午前",
			pm: "午後",
			midnight: "深夜",
			noon: "正午",
			morning: "朝",
			afternoon: "午後",
			evening: "夜",
			night: "深夜"
		},
		abbreviated: {
			am: "午前",
			pm: "午後",
			midnight: "深夜",
			noon: "正午",
			morning: "朝",
			afternoon: "午後",
			evening: "夜",
			night: "深夜"
		},
		wide: {
			am: "午前",
			pm: "午後",
			midnight: "深夜",
			noon: "正午",
			morning: "朝",
			afternoon: "午後",
			evening: "夜",
			night: "深夜"
		}
	};
	var ordinalNumber$42 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		switch (String(options?.unit)) {
			case "year": return `${number}年`;
			case "quarter": return `第${number}四半期`;
			case "month": return `${number}月`;
			case "week": return `第${number}週`;
			case "date": return `${number}日`;
			case "hour": return `${number}時`;
			case "minute": return `${number}分`;
			case "second": return `${number}秒`;
			default: return `${number}`;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja.js
	/**
	* @category Locales
	* @summary Japanese locale.
	* @language Japanese
	* @iso-639-2 jpn
	* @author Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu)
	* @author Yamagishi Kazutoshi [@ykzts](https://github.com/ykzts)
	* @author Luca Ban [@mesqueeb](https://github.com/mesqueeb)
	* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
	* @author Taiki IKeda [@so99ynoodles](https://github.com/so99ynoodles)
	*/
	var ja = {
		code: "ja",
		formatDistance: formatDistance$42,
		formatLong: formatLong$42,
		formatRelative: formatRelative$42,
		localize: {
			ordinalNumber: ordinalNumber$42,
			era: buildLocalizeFn({
				values: eraValues$42,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$42,
				defaultWidth: "wide",
				argumentCallback: (quarter) => Number(quarter) - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$42,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$42,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$42,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$34,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(B\.?C\.?|A\.?D\.?)/i,
					abbreviated: /^(紀元[前後]|西暦)/i,
					wide: /^(紀元[前後]|西暦)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [/^B/i, /^A/i],
					any: [/^(紀元前)/i, /^(西暦|紀元後)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^Q[1234]/i,
					wide: /^第[1234一二三四１２３４]四半期/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|一|１)/i,
					/(2|二|２)/i,
					/(3|三|３)/i,
					/(4|四|４)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^([123456789]|1[012])/,
					abbreviated: /^([123456789]|1[012])月/i,
					wide: /^([123456789]|1[012])月/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^1\D/,
					/^2/,
					/^3/,
					/^4/,
					/^5/,
					/^6/,
					/^7/,
					/^8/,
					/^9/,
					/^10/,
					/^11/,
					/^12/
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[日月火水木金土]/,
					short: /^[日月火水木金土]/,
					abbreviated: /^[日月火水木金土]/,
					wide: /^[日月火水木金土]曜日/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^日/,
					/^月/,
					/^火/,
					/^水/,
					/^木/,
					/^金/,
					/^土/
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^(A|午前)/i,
					pm: /^(P|午後)/i,
					midnight: /^深夜|真夜中/i,
					noon: /^正午/i,
					morning: /^朝/i,
					afternoon: /^午後/i,
					evening: /^夜/i,
					night: /^深夜/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja-Hira/_lib/formatDistance.js
	var formatDistanceLocale$41 = {
		lessThanXSeconds: {
			one: "1びょうみまん",
			other: "{{count}}びょうみまん",
			oneWithSuffix: "やく1びょう",
			otherWithSuffix: "やく{{count}}びょう"
		},
		xSeconds: {
			one: "1びょう",
			other: "{{count}}びょう"
		},
		halfAMinute: "30びょう",
		lessThanXMinutes: {
			one: "1ぷんみまん",
			other: "{{count}}ふんみまん",
			oneWithSuffix: "やく1ぷん",
			otherWithSuffix: "やく{{count}}ふん"
		},
		xMinutes: {
			one: "1ぷん",
			other: "{{count}}ふん"
		},
		aboutXHours: {
			one: "やく1じかん",
			other: "やく{{count}}じかん"
		},
		xHours: {
			one: "1じかん",
			other: "{{count}}じかん"
		},
		xDays: {
			one: "1にち",
			other: "{{count}}にち"
		},
		aboutXWeeks: {
			one: "やく1しゅうかん",
			other: "やく{{count}}しゅうかん"
		},
		xWeeks: {
			one: "1しゅうかん",
			other: "{{count}}しゅうかん"
		},
		aboutXMonths: {
			one: "やく1かげつ",
			other: "やく{{count}}かげつ"
		},
		xMonths: {
			one: "1かげつ",
			other: "{{count}}かげつ"
		},
		aboutXYears: {
			one: "やく1ねん",
			other: "やく{{count}}ねん"
		},
		xYears: {
			one: "1ねん",
			other: "{{count}}ねん"
		},
		overXYears: {
			one: "1ねんいじょう",
			other: "{{count}}ねんいじょう"
		},
		almostXYears: {
			one: "1ねんちかく",
			other: "{{count}}ねんちかく"
		}
	};
	var formatDistance$41 = (token, count, options) => {
		options = options || {};
		let result;
		const tokenValue = formatDistanceLocale$41[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) if (options.addSuffix && tokenValue.oneWithSuffix) result = tokenValue.oneWithSuffix;
		else result = tokenValue.one;
		else if (options.addSuffix && tokenValue.otherWithSuffix) result = tokenValue.otherWithSuffix.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options.addSuffix) if (options.comparison && options.comparison > 0) return result + "あと";
		else return result + "まえ";
		return result;
	};
	var formatLong$41 = {
		date: buildFormatLongFn({
			formats: {
				full: "yねんMがつdにちEEEE",
				long: "yねんMがつdにち",
				medium: "y/MM/dd",
				short: "y/MM/dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "Hじmmふんssびょう zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja-Hira/_lib/formatRelative.js
	var formatRelativeLocale$41 = {
		lastWeek: "せんしゅうのeeeeのp",
		yesterday: "きのうのp",
		today: "きょうのp",
		tomorrow: "あしたのp",
		nextWeek: "よくしゅうのeeeeのp",
		other: "P"
	};
	var formatRelative$41 = (token, _date, _baseDate, _options) => {
		return formatRelativeLocale$41[token];
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja-Hira/_lib/localize.js
	var eraValues$41 = {
		narrow: ["BC", "AC"],
		abbreviated: ["きげんぜん", "せいれき"],
		wide: ["きげんぜん", "せいれき"]
	};
	var quarterValues$41 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"だい1しはんき",
			"だい2しはんき",
			"だい3しはんき",
			"だい4しはんき"
		]
	};
	var monthValues$41 = {
		narrow: [
			"1",
			"2",
			"3",
			"4",
			"5",
			"6",
			"7",
			"8",
			"9",
			"10",
			"11",
			"12"
		],
		abbreviated: [
			"1がつ",
			"2がつ",
			"3がつ",
			"4がつ",
			"5がつ",
			"6がつ",
			"7がつ",
			"8がつ",
			"9がつ",
			"10がつ",
			"11がつ",
			"12がつ"
		],
		wide: [
			"1がつ",
			"2がつ",
			"3がつ",
			"4がつ",
			"5がつ",
			"6がつ",
			"7がつ",
			"8がつ",
			"9がつ",
			"10がつ",
			"11がつ",
			"12がつ"
		]
	};
	var dayValues$41 = {
		narrow: [
			"にち",
			"げつ",
			"か",
			"すい",
			"もく",
			"きん",
			"ど"
		],
		short: [
			"にち",
			"げつ",
			"か",
			"すい",
			"もく",
			"きん",
			"ど"
		],
		abbreviated: [
			"にち",
			"げつ",
			"か",
			"すい",
			"もく",
			"きん",
			"ど"
		],
		wide: [
			"にちようび",
			"げつようび",
			"かようび",
			"すいようび",
			"もくようび",
			"きんようび",
			"どようび"
		]
	};
	var dayPeriodValues$41 = {
		narrow: {
			am: "ごぜん",
			pm: "ごご",
			midnight: "しんや",
			noon: "しょうご",
			morning: "あさ",
			afternoon: "ごご",
			evening: "よる",
			night: "しんや"
		},
		abbreviated: {
			am: "ごぜん",
			pm: "ごご",
			midnight: "しんや",
			noon: "しょうご",
			morning: "あさ",
			afternoon: "ごご",
			evening: "よる",
			night: "しんや"
		},
		wide: {
			am: "ごぜん",
			pm: "ごご",
			midnight: "しんや",
			noon: "しょうご",
			morning: "あさ",
			afternoon: "ごご",
			evening: "よる",
			night: "しんや"
		}
	};
	var formattingDayPeriodValues$33 = {
		narrow: {
			am: "ごぜん",
			pm: "ごご",
			midnight: "しんや",
			noon: "しょうご",
			morning: "あさ",
			afternoon: "ごご",
			evening: "よる",
			night: "しんや"
		},
		abbreviated: {
			am: "ごぜん",
			pm: "ごご",
			midnight: "しんや",
			noon: "しょうご",
			morning: "あさ",
			afternoon: "ごご",
			evening: "よる",
			night: "しんや"
		},
		wide: {
			am: "ごぜん",
			pm: "ごご",
			midnight: "しんや",
			noon: "しょうご",
			morning: "あさ",
			afternoon: "ごご",
			evening: "よる",
			night: "しんや"
		}
	};
	var ordinalNumber$41 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		switch (String(options?.unit)) {
			case "year": return `${number}ねん`;
			case "quarter": return `だい${number}しはんき`;
			case "month": return `${number}がつ`;
			case "week": return `だい${number}しゅう`;
			case "date": return `${number}にち`;
			case "hour": return `${number}じ`;
			case "minute": return `${number}ふん`;
			case "second": return `${number}びょう`;
			default: return `${number}`;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ja-Hira.js
	/**
	* @category Locales
	* @summary Japanese (Hiragana) locale.
	* @language Japanese (Hiragana)
	* @iso-639-2 jpn
	* @author Eri Hiramatsu [@Eritutteo](https://github.com/Eritutteo)
	*/
	var jaHira = {
		code: "ja-Hira",
		formatDistance: formatDistance$41,
		formatLong: formatLong$41,
		formatRelative: formatRelative$41,
		localize: {
			ordinalNumber: ordinalNumber$41,
			era: buildLocalizeFn({
				values: eraValues$41,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$41,
				defaultWidth: "wide",
				argumentCallback: (quarter) => Number(quarter) - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$41,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$41,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$41,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$33,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^だ?い?\d+(ねん|しはんき|がつ|しゅう|にち|じ|ふん|びょう)?/i,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(B\.?C\.?|A\.?D\.?)/i,
					abbreviated: /^(きげん[前後]|せいれき)/i,
					wide: /^(きげん[前後]|せいれき)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [/^B/i, /^A/i],
					any: [/^(きげんぜん)/i, /^(せいれき|きげんご)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^Q[1234]/i,
					wide: /^だい[1234一二三四１２３４]しはんき/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|一|１)/i,
					/(2|二|２)/i,
					/(3|三|３)/i,
					/(4|四|４)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^([123456789]|1[012])/,
					abbreviated: /^([123456789]|1[012])がつ/i,
					wide: /^([123456789]|1[012])がつ/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^1\D/,
					/^2/,
					/^3/,
					/^4/,
					/^5/,
					/^6/,
					/^7/,
					/^8/,
					/^9/,
					/^10/,
					/^11/,
					/^12/
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(にち|げつ|か|すい|もく|きん|ど)/,
					short: /^(にち|げつ|か|すい|もく|きん|ど)/,
					abbreviated: /^(にち|げつ|か|すい|もく|きん|ど)/,
					wide: /^(にち|げつ|か|すい|もく|きん|ど)ようび/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^にち/,
					/^げつ/,
					/^か/,
					/^すい/,
					/^もく/,
					/^きん/,
					/^ど/
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(AM|PM|ごぜん|ごご|しょうご|しんや|まよなか|よる|あさ)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^(A|ごぜん)/i,
					pm: /^(P|ごご)/i,
					midnight: /^しんや|まよなか/i,
					noon: /^しょうご/i,
					morning: /^あさ/i,
					afternoon: /^ごご/i,
					evening: /^よる/i,
					night: /^しんや/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ka/_lib/formatDistance.js
	var formatDistanceLocale$40 = {
		lessThanXSeconds: {
			past: "{{count}} წამზე ნაკლები ხნის წინ",
			present: "{{count}} წამზე ნაკლები",
			future: "{{count}} წამზე ნაკლებში"
		},
		xSeconds: {
			past: "{{count}} წამის წინ",
			present: "{{count}} წამი",
			future: "{{count}} წამში"
		},
		halfAMinute: {
			past: "ნახევარი წუთის წინ",
			present: "ნახევარი წუთი",
			future: "ნახევარი წუთში"
		},
		lessThanXMinutes: {
			past: "{{count}} წუთზე ნაკლები ხნის წინ",
			present: "{{count}} წუთზე ნაკლები",
			future: "{{count}} წუთზე ნაკლებში"
		},
		xMinutes: {
			past: "{{count}} წუთის წინ",
			present: "{{count}} წუთი",
			future: "{{count}} წუთში"
		},
		aboutXHours: {
			past: "დაახლოებით {{count}} საათის წინ",
			present: "დაახლოებით {{count}} საათი",
			future: "დაახლოებით {{count}} საათში"
		},
		xHours: {
			past: "{{count}} საათის წინ",
			present: "{{count}} საათი",
			future: "{{count}} საათში"
		},
		xDays: {
			past: "{{count}} დღის წინ",
			present: "{{count}} დღე",
			future: "{{count}} დღეში"
		},
		aboutXWeeks: {
			past: "დაახლოებით {{count}} კვირას წინ",
			present: "დაახლოებით {{count}} კვირა",
			future: "დაახლოებით {{count}} კვირაში"
		},
		xWeeks: {
			past: "{{count}} კვირას კვირა",
			present: "{{count}} კვირა",
			future: "{{count}} კვირაში"
		},
		aboutXMonths: {
			past: "დაახლოებით {{count}} თვის წინ",
			present: "დაახლოებით {{count}} თვე",
			future: "დაახლოებით {{count}} თვეში"
		},
		xMonths: {
			past: "{{count}} თვის წინ",
			present: "{{count}} თვე",
			future: "{{count}} თვეში"
		},
		aboutXYears: {
			past: "დაახლოებით {{count}} წლის წინ",
			present: "დაახლოებით {{count}} წელი",
			future: "დაახლოებით {{count}} წელში"
		},
		xYears: {
			past: "{{count}} წლის წინ",
			present: "{{count}} წელი",
			future: "{{count}} წელში"
		},
		overXYears: {
			past: "{{count}} წელზე მეტი ხნის წინ",
			present: "{{count}} წელზე მეტი",
			future: "{{count}} წელზე მეტი ხნის შემდეგ"
		},
		almostXYears: {
			past: "თითქმის {{count}} წლის წინ",
			present: "თითქმის {{count}} წელი",
			future: "თითქმის {{count}} წელში"
		}
	};
	var formatDistance$40 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$40[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (options?.addSuffix && options.comparison && options.comparison > 0) result = tokenValue.future.replace("{{count}}", String(count));
		else if (options?.addSuffix) result = tokenValue.past.replace("{{count}}", String(count));
		else result = tokenValue.present.replace("{{count}}", String(count));
		return result;
	};
	var formatLong$40 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM, y",
				long: "do, MMMM, y",
				medium: "d, MMM, y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}'-ზე'",
				long: "{{date}} {{time}}'-ზე'",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ka/_lib/formatRelative.js
	var formatRelativeLocale$40 = {
		lastWeek: "'წინა' eeee p'-ზე'",
		yesterday: "'გუშინ' p'-ზე'",
		today: "'დღეს' p'-ზე'",
		tomorrow: "'ხვალ' p'-ზე'",
		nextWeek: "'შემდეგი' eeee p'-ზე'",
		other: "P"
	};
	var formatRelative$40 = (token, _date, _baseDate, _options) => formatRelativeLocale$40[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ka/_lib/localize.js
	var eraValues$40 = {
		narrow: ["ჩ.წ-მდე", "ჩ.წ"],
		abbreviated: ["ჩვ.წ-მდე", "ჩვ.წ"],
		wide: ["ჩვენს წელთაღრიცხვამდე", "ჩვენი წელთაღრიცხვით"]
	};
	var quarterValues$40 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-ლი კვ",
			"2-ე კვ",
			"3-ე კვ",
			"4-ე კვ"
		],
		wide: [
			"1-ლი კვარტალი",
			"2-ე კვარტალი",
			"3-ე კვარტალი",
			"4-ე კვარტალი"
		]
	};
	var monthValues$40 = {
		narrow: [
			"ია",
			"თე",
			"მა",
			"აპ",
			"მს",
			"ვნ",
			"ვლ",
			"აგ",
			"სე",
			"ოქ",
			"ნო",
			"დე"
		],
		abbreviated: [
			"იან",
			"თებ",
			"მარ",
			"აპრ",
			"მაი",
			"ივნ",
			"ივლ",
			"აგვ",
			"სექ",
			"ოქტ",
			"ნოე",
			"დეკ"
		],
		wide: [
			"იანვარი",
			"თებერვალი",
			"მარტი",
			"აპრილი",
			"მაისი",
			"ივნისი",
			"ივლისი",
			"აგვისტო",
			"სექტემბერი",
			"ოქტომბერი",
			"ნოემბერი",
			"დეკემბერი"
		]
	};
	var dayValues$40 = {
		narrow: [
			"კვ",
			"ორ",
			"სა",
			"ოთ",
			"ხუ",
			"პა",
			"შა"
		],
		short: [
			"კვი",
			"ორშ",
			"სამ",
			"ოთხ",
			"ხუთ",
			"პარ",
			"შაბ"
		],
		abbreviated: [
			"კვი",
			"ორშ",
			"სამ",
			"ოთხ",
			"ხუთ",
			"პარ",
			"შაბ"
		],
		wide: [
			"კვირა",
			"ორშაბათი",
			"სამშაბათი",
			"ოთხშაბათი",
			"ხუთშაბათი",
			"პარასკევი",
			"შაბათი"
		]
	};
	var dayPeriodValues$40 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "შუაღამე",
			noon: "შუადღე",
			morning: "დილა",
			afternoon: "საღამო",
			evening: "საღამო",
			night: "ღამე"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "შუაღამე",
			noon: "შუადღე",
			morning: "დილა",
			afternoon: "საღამო",
			evening: "საღამო",
			night: "ღამე"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "შუაღამე",
			noon: "შუადღე",
			morning: "დილა",
			afternoon: "საღამო",
			evening: "საღამო",
			night: "ღამე"
		}
	};
	var formattingDayPeriodValues$32 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "შუაღამით",
			noon: "შუადღისას",
			morning: "დილით",
			afternoon: "ნაშუადღევს",
			evening: "საღამოს",
			night: "ღამით"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "შუაღამით",
			noon: "შუადღისას",
			morning: "დილით",
			afternoon: "ნაშუადღევს",
			evening: "საღამოს",
			night: "ღამით"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "შუაღამით",
			noon: "შუადღისას",
			morning: "დილით",
			afternoon: "ნაშუადღევს",
			evening: "საღამოს",
			night: "ღამით"
		}
	};
	var ordinalNumber$40 = (dirtyNumber) => {
		const number = Number(dirtyNumber);
		if (number === 1) return number + "-ლი";
		return number + "-ე";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ka.js
	/**
	* @category Locales
	* @summary Georgian locale.
	* @language Georgian
	* @iso-639-2 geo
	* @author Lado Lomidze [@Landish](https://github.com/Landish)
	* @author Nick Shvelidze [@shvelo](https://github.com/shvelo)
	*/
	var ka = {
		code: "ka",
		formatDistance: formatDistance$40,
		formatLong: formatLong$40,
		formatRelative: formatRelative$40,
		localize: {
			ordinalNumber: ordinalNumber$40,
			era: buildLocalizeFn({
				values: eraValues$40,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$40,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$40,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$40,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$40,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$32,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-ლი|-ე)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ჩვ?\.წ)/i,
					abbreviated: /^(ჩვ?\.წ)/i,
					wide: /^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე|ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(ჩვენს წელთაღრიცხვამდე|ქრისტეშობამდე)/i, /^(ჩვენი წელთაღრიცხვით|ქრისტეშობიდან)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]-(ლი|ე)? კვ/i,
					wide: /^[1234]-(ლი|ე)? კვარტალი/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: { any: /^(ია|თე|მა|აპ|მს|ვნ|ვლ|აგ|სე|ოქ|ნო|დე)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: [
					/^ია/i,
					/^თ/i,
					/^მარ/i,
					/^აპ/i,
					/^მაი/i,
					/^ი?ვნ/i,
					/^ი?ვლ/i,
					/^აგ/i,
					/^ს/i,
					/^ო/i,
					/^ნ/i,
					/^დ/i
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(კვ|ორ|სა|ოთ|ხუ|პა|შა)/i,
					short: /^(კვი|ორშ|სამ|ოთხ|ხუთ|პარ|შაბ)/i,
					wide: /^(კვირა|ორშაბათი|სამშაბათი|ოთხშაბათი|ხუთშაბათი|პარასკევი|შაბათი)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^კვ/i,
					/^ორ/i,
					/^სა/i,
					/^ოთ/i,
					/^ხუ/i,
					/^პა/i,
					/^შა/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^([ap]\.?\s?m\.?|შუაღ|დილ)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^შუაღ/i,
					noon: /^შუადღ/i,
					morning: /^დილ/i,
					afternoon: /ნაშუადღევს/i,
					evening: /საღამო/i,
					night: /ღამ/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kk/_lib/formatDistance.js
	var formatDistanceLocale$39 = {
		lessThanXSeconds: {
			regular: {
				one: "1 секундтан аз",
				singularNominative: "{{count}} секундтан аз",
				singularGenitive: "{{count}} секундтан аз",
				pluralGenitive: "{{count}} секундтан аз"
			},
			future: {
				one: "бір секундтан кейін",
				singularNominative: "{{count}} секундтан кейін",
				singularGenitive: "{{count}} секундтан кейін",
				pluralGenitive: "{{count}} секундтан кейін"
			}
		},
		xSeconds: {
			regular: {
				singularNominative: "{{count}} секунд",
				singularGenitive: "{{count}} секунд",
				pluralGenitive: "{{count}} секунд"
			},
			past: {
				singularNominative: "{{count}} секунд бұрын",
				singularGenitive: "{{count}} секунд бұрын",
				pluralGenitive: "{{count}} секунд бұрын"
			},
			future: {
				singularNominative: "{{count}} секундтан кейін",
				singularGenitive: "{{count}} секундтан кейін",
				pluralGenitive: "{{count}} секундтан кейін"
			}
		},
		halfAMinute: (options) => {
			if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "жарты минут ішінде";
			else return "жарты минут бұрын";
			return "жарты минут";
		},
		lessThanXMinutes: {
			regular: {
				one: "1 минуттан аз",
				singularNominative: "{{count}} минуттан аз",
				singularGenitive: "{{count}} минуттан аз",
				pluralGenitive: "{{count}} минуттан аз"
			},
			future: {
				one: "минуттан кем ",
				singularNominative: "{{count}} минуттан кем",
				singularGenitive: "{{count}} минуттан кем",
				pluralGenitive: "{{count}} минуттан кем"
			}
		},
		xMinutes: {
			regular: {
				singularNominative: "{{count}} минут",
				singularGenitive: "{{count}} минут",
				pluralGenitive: "{{count}} минут"
			},
			past: {
				singularNominative: "{{count}} минут бұрын",
				singularGenitive: "{{count}} минут бұрын",
				pluralGenitive: "{{count}} минут бұрын"
			},
			future: {
				singularNominative: "{{count}} минуттан кейін",
				singularGenitive: "{{count}} минуттан кейін",
				pluralGenitive: "{{count}} минуттан кейін"
			}
		},
		aboutXHours: {
			regular: {
				singularNominative: "шамамен {{count}} сағат",
				singularGenitive: "шамамен {{count}} сағат",
				pluralGenitive: "шамамен {{count}} сағат"
			},
			future: {
				singularNominative: "шамамен {{count}} сағаттан кейін",
				singularGenitive: "шамамен {{count}} сағаттан кейін",
				pluralGenitive: "шамамен {{count}} сағаттан кейін"
			}
		},
		xHours: { regular: {
			singularNominative: "{{count}} сағат",
			singularGenitive: "{{count}} сағат",
			pluralGenitive: "{{count}} сағат"
		} },
		xDays: {
			regular: {
				singularNominative: "{{count}} күн",
				singularGenitive: "{{count}} күн",
				pluralGenitive: "{{count}} күн"
			},
			future: {
				singularNominative: "{{count}} күннен кейін",
				singularGenitive: "{{count}} күннен кейін",
				pluralGenitive: "{{count}} күннен кейін"
			}
		},
		aboutXWeeks: {
			type: "weeks",
			one: "шамамен 1 апта",
			other: "шамамен {{count}} апта"
		},
		xWeeks: {
			type: "weeks",
			one: "1 апта",
			other: "{{count}} апта"
		},
		aboutXMonths: {
			regular: {
				singularNominative: "шамамен {{count}} ай",
				singularGenitive: "шамамен {{count}} ай",
				pluralGenitive: "шамамен {{count}} ай"
			},
			future: {
				singularNominative: "шамамен {{count}} айдан кейін",
				singularGenitive: "шамамен {{count}} айдан кейін",
				pluralGenitive: "шамамен {{count}} айдан кейін"
			}
		},
		xMonths: { regular: {
			singularNominative: "{{count}} ай",
			singularGenitive: "{{count}} ай",
			pluralGenitive: "{{count}} ай"
		} },
		aboutXYears: {
			regular: {
				singularNominative: "шамамен {{count}} жыл",
				singularGenitive: "шамамен {{count}} жыл",
				pluralGenitive: "шамамен {{count}} жыл"
			},
			future: {
				singularNominative: "шамамен {{count}} жылдан кейін",
				singularGenitive: "шамамен {{count}} жылдан кейін",
				pluralGenitive: "шамамен {{count}} жылдан кейін"
			}
		},
		xYears: {
			regular: {
				singularNominative: "{{count}} жыл",
				singularGenitive: "{{count}} жыл",
				pluralGenitive: "{{count}} жыл"
			},
			future: {
				singularNominative: "{{count}} жылдан кейін",
				singularGenitive: "{{count}} жылдан кейін",
				pluralGenitive: "{{count}} жылдан кейін"
			}
		},
		overXYears: {
			regular: {
				singularNominative: "{{count}} жылдан астам",
				singularGenitive: "{{count}} жылдан астам",
				pluralGenitive: "{{count}} жылдан астам"
			},
			future: {
				singularNominative: "{{count}} жылдан астам",
				singularGenitive: "{{count}} жылдан астам",
				pluralGenitive: "{{count}} жылдан астам"
			}
		},
		almostXYears: {
			regular: {
				singularNominative: "{{count}} жылға жақын",
				singularGenitive: "{{count}} жылға жақын",
				pluralGenitive: "{{count}} жылға жақын"
			},
			future: {
				singularNominative: "{{count}} жылдан кейін",
				singularGenitive: "{{count}} жылдан кейін",
				pluralGenitive: "{{count}} жылдан кейін"
			}
		}
	};
	function declension$4(scheme, count) {
		if (scheme.one && count === 1) return scheme.one;
		const rem10 = count % 10;
		const rem100 = count % 100;
		if (rem10 === 1 && rem100 !== 11) return scheme.singularNominative.replace("{{count}}", String(count));
		else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) return scheme.singularGenitive.replace("{{count}}", String(count));
		else return scheme.pluralGenitive.replace("{{count}}", String(count));
	}
	var formatDistance$39 = (token, count, options) => {
		const tokenValue = formatDistanceLocale$39[token];
		if (typeof tokenValue === "function") return tokenValue(options);
		if (tokenValue.type === "weeks") return count === 1 ? tokenValue.one : tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) if (tokenValue.future) return declension$4(tokenValue.future, count);
		else return declension$4(tokenValue.regular, count) + " кейін";
		else if (tokenValue.past) return declension$4(tokenValue.past, count);
		else return declension$4(tokenValue.regular, count) + " бұрын";
		else return declension$4(tokenValue.regular, count);
	};
	var formatLong$39 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y 'ж.'",
				long: "do MMMM y 'ж.'",
				medium: "d MMM y 'ж.'",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}}, {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kk/_lib/formatRelative.js
	var accusativeWeekdays$3 = [
		"жексенбіде",
		"дүйсенбіде",
		"сейсенбіде",
		"сәрсенбіде",
		"бейсенбіде",
		"жұмада",
		"сенбіде"
	];
	function lastWeek$4(day) {
		return "'өткен " + accusativeWeekdays$3[day] + " сағат' p'-де'";
	}
	function thisWeek$4(day) {
		return "'" + accusativeWeekdays$3[day] + " сағат' p'-де'";
	}
	function nextWeek$4(day) {
		return "'келесі " + accusativeWeekdays$3[day] + " сағат' p'-де'";
	}
	var formatRelativeLocale$39 = {
		lastWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$4(day);
			else return lastWeek$4(day);
		},
		yesterday: "'кеше сағат' p'-де'",
		today: "'бүгін сағат' p'-де'",
		tomorrow: "'ертең сағат' p'-де'",
		nextWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$4(day);
			else return nextWeek$4(day);
		},
		other: "P"
	};
	var formatRelative$39 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$39[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kk/_lib/localize.js
	var eraValues$39 = {
		narrow: ["б.з.д.", "б.з."],
		abbreviated: ["б.з.д.", "б.з."],
		wide: ["біздің заманымызға дейін", "біздің заманымыз"]
	};
	var quarterValues$39 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-ші тоқ.",
			"2-ші тоқ.",
			"3-ші тоқ.",
			"4-ші тоқ."
		],
		wide: [
			"1-ші тоқсан",
			"2-ші тоқсан",
			"3-ші тоқсан",
			"4-ші тоқсан"
		]
	};
	var monthValues$39 = {
		narrow: [
			"Қ",
			"А",
			"Н",
			"С",
			"М",
			"М",
			"Ш",
			"Т",
			"Қ",
			"Қ",
			"Қ",
			"Ж"
		],
		abbreviated: [
			"қаң",
			"ақп",
			"нау",
			"сәу",
			"мам",
			"мау",
			"шіл",
			"там",
			"қыр",
			"қаз",
			"қар",
			"жел"
		],
		wide: [
			"қаңтар",
			"ақпан",
			"наурыз",
			"сәуір",
			"мамыр",
			"маусым",
			"шілде",
			"тамыз",
			"қыркүйек",
			"қазан",
			"қараша",
			"желтоқсан"
		]
	};
	var formattingMonthValues$9 = {
		narrow: [
			"Қ",
			"А",
			"Н",
			"С",
			"М",
			"М",
			"Ш",
			"Т",
			"Қ",
			"Қ",
			"Қ",
			"Ж"
		],
		abbreviated: [
			"қаң",
			"ақп",
			"нау",
			"сәу",
			"мам",
			"мау",
			"шіл",
			"там",
			"қыр",
			"қаз",
			"қар",
			"жел"
		],
		wide: [
			"қаңтар",
			"ақпан",
			"наурыз",
			"сәуір",
			"мамыр",
			"маусым",
			"шілде",
			"тамыз",
			"қыркүйек",
			"қазан",
			"қараша",
			"желтоқсан"
		]
	};
	var dayValues$39 = {
		narrow: [
			"Ж",
			"Д",
			"С",
			"С",
			"Б",
			"Ж",
			"С"
		],
		short: [
			"жс",
			"дс",
			"сс",
			"ср",
			"бс",
			"жм",
			"сб"
		],
		abbreviated: [
			"жс",
			"дс",
			"сс",
			"ср",
			"бс",
			"жм",
			"сб"
		],
		wide: [
			"жексенбі",
			"дүйсенбі",
			"сейсенбі",
			"сәрсенбі",
			"бейсенбі",
			"жұма",
			"сенбі"
		]
	};
	var dayPeriodValues$39 = {
		narrow: {
			am: "ТД",
			pm: "ТК",
			midnight: "түн ортасы",
			noon: "түс",
			morning: "таң",
			afternoon: "күндіз",
			evening: "кеш",
			night: "түн"
		},
		wide: {
			am: "ТД",
			pm: "ТК",
			midnight: "түн ортасы",
			noon: "түс",
			morning: "таң",
			afternoon: "күндіз",
			evening: "кеш",
			night: "түн"
		}
	};
	var formattingDayPeriodValues$31 = {
		narrow: {
			am: "ТД",
			pm: "ТК",
			midnight: "түн ортасында",
			noon: "түс",
			morning: "таң",
			afternoon: "күн",
			evening: "кеш",
			night: "түн"
		},
		wide: {
			am: "ТД",
			pm: "ТК",
			midnight: "түн ортасында",
			noon: "түсте",
			morning: "таңертең",
			afternoon: "күндіз",
			evening: "кеште",
			night: "түнде"
		}
	};
	var suffixes = {
		0: "-ші",
		1: "-ші",
		2: "-ші",
		3: "-ші",
		4: "-ші",
		5: "-ші",
		6: "-шы",
		7: "-ші",
		8: "-ші",
		9: "-шы",
		10: "-шы",
		20: "-шы",
		30: "-шы",
		40: "-шы",
		50: "-ші",
		60: "-шы",
		70: "-ші",
		80: "-ші",
		90: "-шы",
		100: "-ші"
	};
	var ordinalNumber$39 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		const mod10 = number % 10;
		const b = number >= 100 ? 100 : null;
		return number + (suffixes[number] || suffixes[mod10] || b && suffixes[b] || "");
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kk.js
	/**
	* @category Locales
	* @summary Kazakh locale.
	* @language Kazakh
	* @iso-639-2 kaz
	* @author Nikita Bayev [@drugoi](https://github.com/drugoi)
	*/
	var kk = {
		code: "kk",
		formatDistance: formatDistance$39,
		formatLong: formatLong$39,
		formatRelative: formatRelative$39,
		localize: {
			ordinalNumber: ordinalNumber$39,
			era: buildLocalizeFn({
				values: eraValues$39,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$39,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$39,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$9,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$39,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$39,
				defaultWidth: "any",
				formattingValues: formattingDayPeriodValues$31,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?(ші|шы))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((б )?з\.?\s?д\.?)/i,
					abbreviated: /^((б )?з\.?\s?д\.?)/i,
					wide: /^(біздің заманымызға дейін|біздің заманымыз|біздің заманымыздан)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^б/i, /^з/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?ші)? тоқ.?/i,
					wide: /^[1234](-?ші)? тоқсан/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(қ|а|н|с|м|мау|ш|т|қыр|қаз|қар|ж)/i,
					abbreviated: /^(қаң|ақп|нау|сәу|мам|мау|шіл|там|қыр|қаз|қар|жел)/i,
					wide: /^(қаңтар|ақпан|наурыз|сәуір|мамыр|маусым|шілде|тамыз|қыркүйек|қазан|қараша|желтоқсан)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^қ/i,
						/^а/i,
						/^н/i,
						/^с/i,
						/^м/i,
						/^м/i,
						/^ш/i,
						/^т/i,
						/^қ/i,
						/^қ/i,
						/^қ/i,
						/^ж/i
					],
					abbreviated: [
						/^қаң/i,
						/^ақп/i,
						/^нау/i,
						/^сәу/i,
						/^мам/i,
						/^мау/i,
						/^шіл/i,
						/^там/i,
						/^қыр/i,
						/^қаз/i,
						/^қар/i,
						/^жел/i
					],
					any: [
						/^қ/i,
						/^а/i,
						/^н/i,
						/^с/i,
						/^м/i,
						/^м/i,
						/^ш/i,
						/^т/i,
						/^қ/i,
						/^қ/i,
						/^қ/i,
						/^ж/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ж|д|с|с|б|ж|с)/i,
					short: /^(жс|дс|сс|ср|бс|жм|сб)/i,
					wide: /^(жексенбі|дүйсенбі|сейсенбі|сәрсенбі|бейсенбі|жұма|сенбі)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ж/i,
						/^д/i,
						/^с/i,
						/^с/i,
						/^б/i,
						/^ж/i,
						/^с/i
					],
					short: [
						/^жс/i,
						/^дс/i,
						/^сс/i,
						/^ср/i,
						/^бс/i,
						/^жм/i,
						/^сб/i
					],
					any: [
						/^ж[ек]/i,
						/^д[үй]/i,
						/^сe[й]/i,
						/^сә[р]/i,
						/^б[ей]/i,
						/^ж[ұм]/i,
						/^се[н]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i,
					wide: /^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i,
					any: /^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^ТД/i,
					pm: /^ТК/i,
					midnight: /^түн орта/i,
					noon: /^күндіз/i,
					morning: /таң/i,
					afternoon: /түс/i,
					evening: /кеш/i,
					night: /түн/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/km/_lib/formatDistance.js
	var formatDistanceLocale$38 = {
		lessThanXSeconds: "តិចជាង {{count}} វិនាទី",
		xSeconds: "{{count}} វិនាទី",
		halfAMinute: "កន្លះនាទី",
		lessThanXMinutes: "តិចជាង {{count}} នាទី",
		xMinutes: "{{count}} នាទី",
		aboutXHours: "ប្រហែល {{count}} ម៉ោង",
		xHours: "{{count}} ម៉ោង",
		xDays: "{{count}} ថ្ងៃ",
		aboutXWeeks: "ប្រហែល {{count}} សប្តាហ៍",
		xWeeks: "{{count}} សប្តាហ៍",
		aboutXMonths: "ប្រហែល {{count}} ខែ",
		xMonths: "{{count}} ខែ",
		aboutXYears: "ប្រហែល {{count}} ឆ្នាំ",
		xYears: "{{count}} ឆ្នាំ",
		overXYears: "ជាង {{count}} ឆ្នាំ",
		almostXYears: "ជិត {{count}} ឆ្នាំ"
	};
	var formatDistance$38 = (token, count, options) => {
		let result = formatDistanceLocale$38[token];
		if (typeof count === "number") result = result.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "ក្នុងរយៈពេល " + result;
		else return result + "មុន";
		return result;
	};
	var formatLong$38 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE do MMMM y",
				long: "do MMMM y",
				medium: "d MMM y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a",
				long: "h:mm:ss a",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'ម៉ោង' {{time}}",
				long: "{{date}} 'ម៉ោង' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/km/_lib/formatRelative.js
	var formatRelativeLocale$38 = {
		lastWeek: "'ថ្ងៃ'eeee'ស​ប្តា​ហ៍​មុនម៉ោង' p",
		yesterday: "'ម្សិលមិញនៅម៉ោង' p",
		today: "'ថ្ងៃនេះម៉ោង' p",
		tomorrow: "'ថ្ងៃស្អែកម៉ោង' p",
		nextWeek: "'ថ្ងៃ'eeee'ស​ប្តា​ហ៍​ក្រោយម៉ោង' p",
		other: "P"
	};
	var formatRelative$38 = (token, _date, _baseDate, _options) => formatRelativeLocale$38[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/km/_lib/localize.js
	var eraValues$38 = {
		narrow: ["ម.គស", "គស"],
		abbreviated: ["មុនគ.ស", "គ.ស"],
		wide: ["មុនគ្រិស្តសករាជ", "នៃគ្រិស្តសករាជ"]
	};
	var quarterValues$38 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"ត្រីមាសទី 1",
			"ត្រីមាសទី 2",
			"ត្រីមាសទី 3",
			"ត្រីមាសទី 4"
		]
	};
	var monthValues$38 = {
		narrow: [
			"ម.ក",
			"ក.ម",
			"មិ",
			"ម.ស",
			"ឧ.ស",
			"ម.ថ",
			"ក.ដ",
			"សី",
			"កញ",
			"តុ",
			"វិ",
			"ធ"
		],
		abbreviated: [
			"មករា",
			"កុម្ភៈ",
			"មីនា",
			"មេសា",
			"ឧសភា",
			"មិថុនា",
			"កក្កដា",
			"សីហា",
			"កញ្ញា",
			"តុលា",
			"វិច្ឆិកា",
			"ធ្នូ"
		],
		wide: [
			"មករា",
			"កុម្ភៈ",
			"មីនា",
			"មេសា",
			"ឧសភា",
			"មិថុនា",
			"កក្កដា",
			"សីហា",
			"កញ្ញា",
			"តុលា",
			"វិច្ឆិកា",
			"ធ្នូ"
		]
	};
	var dayValues$38 = {
		narrow: [
			"អា",
			"ច",
			"អ",
			"ព",
			"ព្រ",
			"សុ",
			"ស"
		],
		short: [
			"អា",
			"ច",
			"អ",
			"ព",
			"ព្រ",
			"សុ",
			"ស"
		],
		abbreviated: [
			"អា",
			"ច",
			"អ",
			"ព",
			"ព្រ",
			"សុ",
			"ស"
		],
		wide: [
			"អាទិត្យ",
			"ចន្ទ",
			"អង្គារ",
			"ពុធ",
			"ព្រហស្បតិ៍",
			"សុក្រ",
			"សៅរ៍"
		]
	};
	var dayPeriodValues$38 = {
		narrow: {
			am: "ព្រឹក",
			pm: "ល្ងាច",
			midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
			noon: "ពេលថ្ងៃត្រង់",
			morning: "ពេលព្រឹក",
			afternoon: "ពេលរសៀល",
			evening: "ពេលល្ងាច",
			night: "ពេលយប់"
		},
		abbreviated: {
			am: "ព្រឹក",
			pm: "ល្ងាច",
			midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
			noon: "ពេលថ្ងៃត្រង់",
			morning: "ពេលព្រឹក",
			afternoon: "ពេលរសៀល",
			evening: "ពេលល្ងាច",
			night: "ពេលយប់"
		},
		wide: {
			am: "ព្រឹក",
			pm: "ល្ងាច",
			midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
			noon: "ពេលថ្ងៃត្រង់",
			morning: "ពេលព្រឹក",
			afternoon: "ពេលរសៀល",
			evening: "ពេលល្ងាច",
			night: "ពេលយប់"
		}
	};
	var formattingDayPeriodValues$30 = {
		narrow: {
			am: "ព្រឹក",
			pm: "ល្ងាច",
			midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
			noon: "ពេលថ្ងៃត្រង់",
			morning: "ពេលព្រឹក",
			afternoon: "ពេលរសៀល",
			evening: "ពេលល្ងាច",
			night: "ពេលយប់"
		},
		abbreviated: {
			am: "ព្រឹក",
			pm: "ល្ងាច",
			midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
			noon: "ពេលថ្ងៃត្រង់",
			morning: "ពេលព្រឹក",
			afternoon: "ពេលរសៀល",
			evening: "ពេលល្ងាច",
			night: "ពេលយប់"
		},
		wide: {
			am: "ព្រឹក",
			pm: "ល្ងាច",
			midnight: "​ពេលកណ្ដាលអធ្រាត្រ",
			noon: "ពេលថ្ងៃត្រង់",
			morning: "ពេលព្រឹក",
			afternoon: "ពេលរសៀល",
			evening: "ពេលល្ងាច",
			night: "ពេលយប់"
		}
	};
	var ordinalNumber$38 = (dirtyNumber, _) => {
		return Number(dirtyNumber).toString();
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/km.js
	/**
	* @category Locales
	* @summary Khmer locale (Cambodian).
	* @language Khmer
	* @iso-639-2 khm
	* @author Seanghay Yath [@seanghay](https://github.com/seanghay)
	*/
	var km = {
		code: "km",
		formatDistance: formatDistance$38,
		formatLong: formatLong$38,
		formatRelative: formatRelative$38,
		localize: {
			ordinalNumber: ordinalNumber$38,
			era: buildLocalizeFn({
				values: eraValues$38,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$38,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$38,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$38,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$38,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$30,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ម\.)?គស/i,
					abbreviated: /^(មុន)?គ\.ស/i,
					wide: /^(មុន|នៃ)គ្រិស្តសករាជ/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(ម|មុន)គ\.?ស/i, /^(នៃ)?គ\.?ស/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^(ត្រីមាស)(ទី)?\s?[1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(ម\.ក|ក\.ម|មិ|ម\.ស|ឧ\.ស|ម\.ថ|ក\.ដ|សី|កញ|តុ|វិ|ធ)/i,
					abbreviated: /^(មករា|កុម្ភៈ|មីនា|មេសា|ឧសភា|មិថុនា|កក្កដា|សីហា|កញ្ញា|តុលា|វិច្ឆិកា|ធ្នូ)/i,
					wide: /^(មករា|កុម្ភៈ|មីនា|មេសា|ឧសភា|មិថុនា|កក្កដា|សីហា|កញ្ញា|តុលា|វិច្ឆិកា|ធ្នូ)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ម\.ក/i,
						/^ក\.ម/i,
						/^មិ/i,
						/^ម\.ស/i,
						/^ឧ\.ស/i,
						/^ម\.ថ/i,
						/^ក\.ដ/i,
						/^សី/i,
						/^កញ/i,
						/^តុ/i,
						/^វិ/i,
						/^ធ/i
					],
					any: [
						/^មក/i,
						/^កុ/i,
						/^មីន/i,
						/^មេ/i,
						/^ឧស/i,
						/^មិថ/i,
						/^កក/i,
						/^សី/i,
						/^កញ/i,
						/^តុ/i,
						/^វិច/i,
						/^ធ/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(អា|ច|អ|ព|ព្រ|សុ|ស)/i,
					short: /^(អា|ច|អ|ព|ព្រ|សុ|ស)/i,
					abbreviated: /^(អា|ច|អ|ព|ព្រ|សុ|ស)/i,
					wide: /^(អាទិត្យ|ចន្ទ|អង្គារ|ពុធ|ព្រហស្បតិ៍|សុក្រ|សៅរ៍)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^អា/i,
						/^ច/i,
						/^អ/i,
						/^ព/i,
						/^ព្រ/i,
						/^សុ/i,
						/^ស/i
					],
					any: [
						/^អា/i,
						/^ច/i,
						/^អ/i,
						/^ព/i,
						/^ព្រ/i,
						/^សុ/i,
						/^សៅ/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ព្រឹក|ល្ងាច|ពេលព្រឹក|ពេលថ្ងៃត្រង់|ពេលល្ងាច|ពេលរសៀល|ពេលយប់|ពេលកណ្ដាលអធ្រាត្រ)/i,
					any: /^(ព្រឹក|ល្ងាច|ពេលព្រឹក|ពេលថ្ងៃត្រង់|ពេលល្ងាច|ពេលរសៀល|ពេលយប់|ពេលកណ្ដាលអធ្រាត្រ)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ព្រឹក/i,
					pm: /^ល្ងាច/i,
					midnight: /^ពេលកណ្ដាលអធ្រាត្រ/i,
					noon: /^ពេលថ្ងៃត្រង់/i,
					morning: /ពេលព្រឹក/i,
					afternoon: /ពេលរសៀល/i,
					evening: /ពេលល្ងាច/i,
					night: /ពេលយប់/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kn/_lib/formatDistance.js
	var formatDistanceLocale$37 = {
		lessThanXSeconds: {
			one: {
				default: "1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",
				future: "1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",
				past: "1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ"
			},
			other: {
				default: "{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",
				future: "{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",
				past: "{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ"
			}
		},
		xSeconds: {
			one: {
				default: "1 ಸೆಕೆಂಡ್",
				future: "1 ಸೆಕೆಂಡ್‌ನಲ್ಲಿ",
				past: "1 ಸೆಕೆಂಡ್ ಹಿಂದೆ"
			},
			other: {
				default: "{{count}} ಸೆಕೆಂಡುಗಳು",
				future: "{{count}} ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ",
				past: "{{count}} ಸೆಕೆಂಡ್ ಹಿಂದೆ"
			}
		},
		halfAMinute: { other: {
			default: "ಅರ್ಧ ನಿಮಿಷ",
			future: "ಅರ್ಧ ನಿಮಿಷದಲ್ಲಿ",
			past: "ಅರ್ಧ ನಿಮಿಷದ ಹಿಂದೆ"
		} },
		lessThanXMinutes: {
			one: {
				default: "1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",
				future: "1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",
				past: "1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ"
			},
			other: {
				default: "{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",
				future: "{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",
				past: "{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ"
			}
		},
		xMinutes: {
			one: {
				default: "1 ನಿಮಿಷ",
				future: "1 ನಿಮಿಷದಲ್ಲಿ",
				past: "1 ನಿಮಿಷದ ಹಿಂದೆ"
			},
			other: {
				default: "{{count}} ನಿಮಿಷಗಳು",
				future: "{{count}} ನಿಮಿಷಗಳಲ್ಲಿ",
				past: "{{count}} ನಿಮಿಷಗಳ ಹಿಂದೆ"
			}
		},
		aboutXHours: {
			one: {
				default: "ಸುಮಾರು 1 ಗಂಟೆ",
				future: "ಸುಮಾರು 1 ಗಂಟೆಯಲ್ಲಿ",
				past: "ಸುಮಾರು 1 ಗಂಟೆ ಹಿಂದೆ"
			},
			other: {
				default: "ಸುಮಾರು {{count}} ಗಂಟೆಗಳು",
				future: "ಸುಮಾರು {{count}} ಗಂಟೆಗಳಲ್ಲಿ",
				past: "ಸುಮಾರು {{count}} ಗಂಟೆಗಳ ಹಿಂದೆ"
			}
		},
		xHours: {
			one: {
				default: "1 ಗಂಟೆ",
				future: "1 ಗಂಟೆಯಲ್ಲಿ",
				past: "1 ಗಂಟೆ ಹಿಂದೆ"
			},
			other: {
				default: "{{count}} ಗಂಟೆಗಳು",
				future: "{{count}} ಗಂಟೆಗಳಲ್ಲಿ",
				past: "{{count}} ಗಂಟೆಗಳ ಹಿಂದೆ"
			}
		},
		xDays: {
			one: {
				default: "1 ದಿನ",
				future: "1 ದಿನದಲ್ಲಿ",
				past: "1 ದಿನದ ಹಿಂದೆ"
			},
			other: {
				default: "{{count}} ದಿನಗಳು",
				future: "{{count}} ದಿನಗಳಲ್ಲಿ",
				past: "{{count}} ದಿನಗಳ ಹಿಂದೆ"
			}
		},
		aboutXMonths: {
			one: {
				default: "ಸುಮಾರು 1 ತಿಂಗಳು",
				future: "ಸುಮಾರು 1 ತಿಂಗಳಲ್ಲಿ",
				past: "ಸುಮಾರು 1 ತಿಂಗಳ ಹಿಂದೆ"
			},
			other: {
				default: "ಸುಮಾರು {{count}} ತಿಂಗಳು",
				future: "ಸುಮಾರು {{count}} ತಿಂಗಳುಗಳಲ್ಲಿ",
				past: "ಸುಮಾರು {{count}} ತಿಂಗಳುಗಳ ಹಿಂದೆ"
			}
		},
		xMonths: {
			one: {
				default: "1 ತಿಂಗಳು",
				future: "1 ತಿಂಗಳಲ್ಲಿ",
				past: "1 ತಿಂಗಳ ಹಿಂದೆ"
			},
			other: {
				default: "{{count}} ತಿಂಗಳು",
				future: "{{count}} ತಿಂಗಳುಗಳಲ್ಲಿ",
				past: "{{count}} ತಿಂಗಳುಗಳ ಹಿಂದೆ"
			}
		},
		aboutXYears: {
			one: {
				default: "ಸುಮಾರು 1 ವರ್ಷ",
				future: "ಸುಮಾರು 1 ವರ್ಷದಲ್ಲಿ",
				past: "ಸುಮಾರು 1 ವರ್ಷದ ಹಿಂದೆ"
			},
			other: {
				default: "ಸುಮಾರು {{count}} ವರ್ಷಗಳು",
				future: "ಸುಮಾರು {{count}} ವರ್ಷಗಳಲ್ಲಿ",
				past: "ಸುಮಾರು {{count}} ವರ್ಷಗಳ ಹಿಂದೆ"
			}
		},
		xYears: {
			one: {
				default: "1 ವರ್ಷ",
				future: "1 ವರ್ಷದಲ್ಲಿ",
				past: "1 ವರ್ಷದ ಹಿಂದೆ"
			},
			other: {
				default: "{{count}} ವರ್ಷಗಳು",
				future: "{{count}} ವರ್ಷಗಳಲ್ಲಿ",
				past: "{{count}} ವರ್ಷಗಳ ಹಿಂದೆ"
			}
		},
		overXYears: {
			one: {
				default: "1 ವರ್ಷದ ಮೇಲೆ",
				future: "1 ವರ್ಷದ ಮೇಲೆ",
				past: "1 ವರ್ಷದ ಮೇಲೆ"
			},
			other: {
				default: "{{count}} ವರ್ಷಗಳ ಮೇಲೆ",
				future: "{{count}} ವರ್ಷಗಳ ಮೇಲೆ",
				past: "{{count}} ವರ್ಷಗಳ ಮೇಲೆ"
			}
		},
		almostXYears: {
			one: {
				default: "ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ",
				future: "ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ",
				past: "ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ"
			},
			other: {
				default: "ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ",
				future: "ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ",
				past: "ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ"
			}
		}
	};
	function getResultByTense(parentToken, options) {
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return parentToken.future;
		else return parentToken.past;
		return parentToken.default;
	}
	var formatDistance$37 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$37[token];
		if (tokenValue.one && count === 1) result = getResultByTense(tokenValue.one, options);
		else result = getResultByTense(tokenValue.other, options);
		return result.replace("{{count}}", String(count));
	};
	var formatLong$37 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM d, y",
				long: "MMMM d, y",
				medium: "MMM d, y",
				short: "d/M/yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "hh:mm:ss a zzzz",
				long: "hh:mm:ss a z",
				medium: "hh:mm:ss a",
				short: "hh:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kn/_lib/formatRelative.js
	var formatRelativeLocale$37 = {
		lastWeek: "'ಕಳೆದ' eeee p 'ಕ್ಕೆ'",
		yesterday: "'ನಿನ್ನೆ' p 'ಕ್ಕೆ'",
		today: "'ಇಂದು' p 'ಕ್ಕೆ'",
		tomorrow: "'ನಾಳೆ' p 'ಕ್ಕೆ'",
		nextWeek: "eeee p 'ಕ್ಕೆ'",
		other: "P"
	};
	var formatRelative$37 = (token, _date, _baseDate, _options) => formatRelativeLocale$37[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/kn/_lib/localize.js
	var eraValues$37 = {
		narrow: ["ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"],
		abbreviated: ["ಕ್ರಿ.ಪೂ", "ಕ್ರಿ.ಶ"],
		wide: ["ಕ್ರಿಸ್ತ ಪೂರ್ವ", "ಕ್ರಿಸ್ತ ಶಕ"]
	};
	var quarterValues$37 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"ತ್ರೈ 1",
			"ತ್ರೈ 2",
			"ತ್ರೈ 3",
			"ತ್ರೈ 4"
		],
		wide: [
			"1ನೇ ತ್ರೈಮಾಸಿಕ",
			"2ನೇ ತ್ರೈಮಾಸಿಕ",
			"3ನೇ ತ್ರೈಮಾಸಿಕ",
			"4ನೇ ತ್ರೈಮಾಸಿಕ"
		]
	};
	var monthValues$37 = {
		narrow: [
			"ಜ",
			"ಫೆ",
			"ಮಾ",
			"ಏ",
			"ಮೇ",
			"ಜೂ",
			"ಜು",
			"ಆ",
			"ಸೆ",
			"ಅ",
			"ನ",
			"ಡಿ"
		],
		abbreviated: [
			"ಜನ",
			"ಫೆಬ್ರ",
			"ಮಾರ್ಚ್",
			"ಏಪ್ರಿ",
			"ಮೇ",
			"ಜೂನ್",
			"ಜುಲೈ",
			"ಆಗ",
			"ಸೆಪ್ಟೆಂ",
			"ಅಕ್ಟೋ",
			"ನವೆಂ",
			"ಡಿಸೆಂ"
		],
		wide: [
			"ಜನವರಿ",
			"ಫೆಬ್ರವರಿ",
			"ಮಾರ್ಚ್",
			"ಏಪ್ರಿಲ್",
			"ಮೇ",
			"ಜೂನ್",
			"ಜುಲೈ",
			"ಆಗಸ್ಟ್",
			"ಸೆಪ್ಟೆಂಬರ್",
			"ಅಕ್ಟೋಬರ್",
			"ನವೆಂಬರ್",
			"ಡಿಸೆಂಬರ್"
		]
	};
	var dayValues$37 = {
		narrow: [
			"ಭಾ",
			"ಸೋ",
			"ಮಂ",
			"ಬು",
			"ಗು",
			"ಶು",
			"ಶ"
		],
		short: [
			"ಭಾನು",
			"ಸೋಮ",
			"ಮಂಗಳ",
			"ಬುಧ",
			"ಗುರು",
			"ಶುಕ್ರ",
			"ಶನಿ"
		],
		abbreviated: [
			"ಭಾನು",
			"ಸೋಮ",
			"ಮಂಗಳ",
			"ಬುಧ",
			"ಗುರು",
			"ಶುಕ್ರ",
			"ಶನಿ"
		],
		wide: [
			"ಭಾನುವಾರ",
			"ಸೋಮವಾರ",
			"ಮಂಗಳವಾರ",
			"ಬುಧವಾರ",
			"ಗುರುವಾರ",
			"ಶುಕ್ರವಾರ",
			"ಶನಿವಾರ"
		]
	};
	var dayPeriodValues$37 = {
		narrow: {
			am: "ಪೂರ್ವಾಹ್ನ",
			pm: "ಅಪರಾಹ್ನ",
			midnight: "ಮಧ್ಯರಾತ್ರಿ",
			noon: "ಮಧ್ಯಾಹ್ನ",
			morning: "ಬೆಳಗ್ಗೆ",
			afternoon: "ಮಧ್ಯಾಹ್ನ",
			evening: "ಸಂಜೆ",
			night: "ರಾತ್ರಿ"
		},
		abbreviated: {
			am: "ಪೂರ್ವಾಹ್ನ",
			pm: "ಅಪರಾಹ್ನ",
			midnight: "ಮಧ್ಯರಾತ್ರಿ",
			noon: "ಮಧ್ಯಾನ್ಹ",
			morning: "ಬೆಳಗ್ಗೆ",
			afternoon: "ಮಧ್ಯಾನ್ಹ",
			evening: "ಸಂಜೆ",
			night: "ರಾತ್ರಿ"
		},
		wide: {
			am: "ಪೂರ್ವಾಹ್ನ",
			pm: "ಅಪರಾಹ್ನ",
			midnight: "ಮಧ್ಯರಾತ್ರಿ",
			noon: "ಮಧ್ಯಾನ್ಹ",
			morning: "ಬೆಳಗ್ಗೆ",
			afternoon: "ಮಧ್ಯಾನ್ಹ",
			evening: "ಸಂಜೆ",
			night: "ರಾತ್ರಿ"
		}
	};
	var formattingDayPeriodValues$29 = {
		narrow: {
			am: "ಪೂ",
			pm: "ಅ",
			midnight: "ಮಧ್ಯರಾತ್ರಿ",
			noon: "ಮಧ್ಯಾನ್ಹ",
			morning: "ಬೆಳಗ್ಗೆ",
			afternoon: "ಮಧ್ಯಾನ್ಹ",
			evening: "ಸಂಜೆ",
			night: "ರಾತ್ರಿ"
		},
		abbreviated: {
			am: "ಪೂರ್ವಾಹ್ನ",
			pm: "ಅಪರಾಹ್ನ",
			midnight: "ಮಧ್ಯ ರಾತ್ರಿ",
			noon: "ಮಧ್ಯಾನ್ಹ",
			morning: "ಬೆಳಗ್ಗೆ",
			afternoon: "ಮಧ್ಯಾನ್ಹ",
			evening: "ಸಂಜೆ",
			night: "ರಾತ್ರಿ"
		},
		wide: {
			am: "ಪೂರ್ವಾಹ್ನ",
			pm: "ಅಪರಾಹ್ನ",
			midnight: "ಮಧ್ಯ ರಾತ್ರಿ",
			noon: "ಮಧ್ಯಾನ್ಹ",
			morning: "ಬೆಳಗ್ಗೆ",
			afternoon: "ಮಧ್ಯಾನ್ಹ",
			evening: "ಸಂಜೆ",
			night: "ರಾತ್ರಿ"
		}
	};
	var ordinalNumber$37 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "ನೇ";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/kn.js
	/**
	* @category Locales
	* @summary Kannada locale (India).
	* @language Kannada
	* @iso-639-2 kan
	* @author Manjunatha Gouli [@developergouli](https://github.com/developergouli)
	*/
	var kn = {
		code: "kn",
		formatDistance: formatDistance$37,
		formatLong: formatLong$37,
		formatRelative: formatRelative$37,
		localize: {
			ordinalNumber: ordinalNumber$37,
			era: buildLocalizeFn({
				values: eraValues$37,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$37,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$37,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$37,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$37,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$29,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(ನೇ|ನೆ)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ಕ್ರಿ.ಪೂ|ಕ್ರಿ.ಶ)/i,
					abbreviated: /^(ಕ್ರಿ\.?\s?ಪೂ\.?|ಕ್ರಿ\.?\s?ಶ\.?|ಪ್ರ\.?\s?ಶ\.?)/i,
					wide: /^(ಕ್ರಿಸ್ತ ಪೂರ್ವ|ಕ್ರಿಸ್ತ ಶಕ|ಪ್ರಸಕ್ತ ಶಕ)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^ಪೂ/i, /^(ಶ|ಪ್ರ)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^ತ್ರೈ[1234]|ತ್ರೈ [1234]| [1234]ತ್ರೈ/i,
					wide: /^[1234](ನೇ)? ತ್ರೈಮಾಸಿಕ/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(ಜೂ|ಜು|ಜ|ಫೆ|ಮಾ|ಏ|ಮೇ|ಆ|ಸೆ|ಅ|ನ|ಡಿ)/i,
					abbreviated: /^(ಜನ|ಫೆಬ್ರ|ಮಾರ್ಚ್|ಏಪ್ರಿ|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗ|ಸೆಪ್ಟೆಂ|ಅಕ್ಟೋ|ನವೆಂ|ಡಿಸೆಂ)/i,
					wide: /^(ಜನವರಿ|ಫೆಬ್ರವರಿ|ಮಾರ್ಚ್|ಏಪ್ರಿಲ್|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗಸ್ಟ್|ಸೆಪ್ಟೆಂಬರ್|ಅಕ್ಟೋಬರ್|ನವೆಂಬರ್|ಡಿಸೆಂಬರ್)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ಜ$/i,
						/^ಫೆ/i,
						/^ಮಾ/i,
						/^ಏ/i,
						/^ಮೇ/i,
						/^ಜೂ/i,
						/^ಜು$/i,
						/^ಆ/i,
						/^ಸೆ/i,
						/^ಅ/i,
						/^ನ/i,
						/^ಡಿ/i
					],
					any: [
						/^ಜನ/i,
						/^ಫೆ/i,
						/^ಮಾ/i,
						/^ಏ/i,
						/^ಮೇ/i,
						/^ಜೂನ್/i,
						/^ಜುಲೈ/i,
						/^ಆ/i,
						/^ಸೆ/i,
						/^ಅ/i,
						/^ನ/i,
						/^ಡಿ/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ಭಾ|ಸೋ|ಮ|ಬು|ಗು|ಶು|ಶ)/i,
					short: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
					abbreviated: /^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,
					wide: /^(ಭಾನುವಾರ|ಸೋಮವಾರ|ಮಂಗಳವಾರ|ಬುಧವಾರ|ಗುರುವಾರ|ಶುಕ್ರವಾರ|ಶನಿವಾರ)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ಭಾ/i,
						/^ಸೋ/i,
						/^ಮ/i,
						/^ಬು/i,
						/^ಗು/i,
						/^ಶು/i,
						/^ಶ/i
					],
					any: [
						/^ಭಾ/i,
						/^ಸೋ/i,
						/^ಮ/i,
						/^ಬು/i,
						/^ಗು/i,
						/^ಶು/i,
						/^ಶ/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ಪೂ|ಅ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,
					any: /^(ಪೂರ್ವಾಹ್ನ|ಅಪರಾಹ್ನ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ಪೂ/i,
					pm: /^ಅ/i,
					midnight: /ಮಧ್ಯರಾತ್ರಿ/i,
					noon: /ಮಧ್ಯಾನ್ಹ/i,
					morning: /ಬೆಳಗ್ಗೆ/i,
					afternoon: /ಮಧ್ಯಾನ್ಹ/i,
					evening: /ಸಂಜೆ/i,
					night: /ರಾತ್ರಿ/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ko/_lib/formatDistance.js
	var formatDistanceLocale$36 = {
		lessThanXSeconds: {
			one: "1초 미만",
			other: "{{count}}초 미만"
		},
		xSeconds: {
			one: "1초",
			other: "{{count}}초"
		},
		halfAMinute: "30초",
		lessThanXMinutes: {
			one: "1분 미만",
			other: "{{count}}분 미만"
		},
		xMinutes: {
			one: "1분",
			other: "{{count}}분"
		},
		aboutXHours: {
			one: "약 1시간",
			other: "약 {{count}}시간"
		},
		xHours: {
			one: "1시간",
			other: "{{count}}시간"
		},
		xDays: {
			one: "1일",
			other: "{{count}}일"
		},
		aboutXWeeks: {
			one: "약 1주",
			other: "약 {{count}}주"
		},
		xWeeks: {
			one: "1주",
			other: "{{count}}주"
		},
		aboutXMonths: {
			one: "약 1개월",
			other: "약 {{count}}개월"
		},
		xMonths: {
			one: "1개월",
			other: "{{count}}개월"
		},
		aboutXYears: {
			one: "약 1년",
			other: "약 {{count}}년"
		},
		xYears: {
			one: "1년",
			other: "{{count}}년"
		},
		overXYears: {
			one: "1년 이상",
			other: "{{count}}년 이상"
		},
		almostXYears: {
			one: "거의 1년",
			other: "거의 {{count}}년"
		}
	};
	var formatDistance$36 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$36[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " 후";
		else return result + " 전";
		return result;
	};
	var formatLong$36 = {
		date: buildFormatLongFn({
			formats: {
				full: "y년 M월 d일 EEEE",
				long: "y년 M월 d일",
				medium: "y.MM.dd",
				short: "y.MM.dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "a H시 mm분 ss초 zzzz",
				long: "a H:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ko/_lib/formatRelative.js
	var formatRelativeLocale$36 = {
		lastWeek: "'지난' eeee p",
		yesterday: "'어제' p",
		today: "'오늘' p",
		tomorrow: "'내일' p",
		nextWeek: "'다음' eeee p",
		other: "P"
	};
	var formatRelative$36 = (token, _date, _baseDate, _options) => formatRelativeLocale$36[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ko/_lib/localize.js
	var eraValues$36 = {
		narrow: ["BC", "AD"],
		abbreviated: ["BC", "AD"],
		wide: ["기원전", "서기"]
	};
	var quarterValues$36 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1분기",
			"2분기",
			"3분기",
			"4분기"
		]
	};
	var monthValues$36 = {
		narrow: [
			"1",
			"2",
			"3",
			"4",
			"5",
			"6",
			"7",
			"8",
			"9",
			"10",
			"11",
			"12"
		],
		abbreviated: [
			"1월",
			"2월",
			"3월",
			"4월",
			"5월",
			"6월",
			"7월",
			"8월",
			"9월",
			"10월",
			"11월",
			"12월"
		],
		wide: [
			"1월",
			"2월",
			"3월",
			"4월",
			"5월",
			"6월",
			"7월",
			"8월",
			"9월",
			"10월",
			"11월",
			"12월"
		]
	};
	var dayValues$36 = {
		narrow: [
			"일",
			"월",
			"화",
			"수",
			"목",
			"금",
			"토"
		],
		short: [
			"일",
			"월",
			"화",
			"수",
			"목",
			"금",
			"토"
		],
		abbreviated: [
			"일",
			"월",
			"화",
			"수",
			"목",
			"금",
			"토"
		],
		wide: [
			"일요일",
			"월요일",
			"화요일",
			"수요일",
			"목요일",
			"금요일",
			"토요일"
		]
	};
	var dayPeriodValues$36 = {
		narrow: {
			am: "오전",
			pm: "오후",
			midnight: "자정",
			noon: "정오",
			morning: "아침",
			afternoon: "오후",
			evening: "저녁",
			night: "밤"
		},
		abbreviated: {
			am: "오전",
			pm: "오후",
			midnight: "자정",
			noon: "정오",
			morning: "아침",
			afternoon: "오후",
			evening: "저녁",
			night: "밤"
		},
		wide: {
			am: "오전",
			pm: "오후",
			midnight: "자정",
			noon: "정오",
			morning: "아침",
			afternoon: "오후",
			evening: "저녁",
			night: "밤"
		}
	};
	var formattingDayPeriodValues$28 = {
		narrow: {
			am: "오전",
			pm: "오후",
			midnight: "자정",
			noon: "정오",
			morning: "아침",
			afternoon: "오후",
			evening: "저녁",
			night: "밤"
		},
		abbreviated: {
			am: "오전",
			pm: "오후",
			midnight: "자정",
			noon: "정오",
			morning: "아침",
			afternoon: "오후",
			evening: "저녁",
			night: "밤"
		},
		wide: {
			am: "오전",
			pm: "오후",
			midnight: "자정",
			noon: "정오",
			morning: "아침",
			afternoon: "오후",
			evening: "저녁",
			night: "밤"
		}
	};
	var ordinalNumber$36 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		switch (String(options?.unit)) {
			case "minute":
			case "second": return String(number);
			case "date": return number + "일";
			default: return number + "번째";
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ko.js
	/**
	* @category Locales
	* @summary Korean locale.
	* @language Korean
	* @iso-639-2 kor
	* @author Hong Chulju [@angdev](https://github.com/angdev)
	* @author Lee Seoyoen [@iamssen](https://github.com/iamssen)
	* @author Taiki IKeda [@so99ynoodles](https://github.com/so99ynoodles)
	*/
	var ko = {
		code: "ko",
		formatDistance: formatDistance$36,
		formatLong: formatLong$36,
		formatRelative: formatRelative$36,
		localize: {
			ordinalNumber: ordinalNumber$36,
			era: buildLocalizeFn({
				values: eraValues$36,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$36,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$36,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$36,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$36,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$28,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(일|번째)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
					abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
					wide: /^(기원전|서기)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(bc|기원전)/i, /^(ad|서기)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234]사?분기/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(1[012]|[123456789])/,
					abbreviated: /^(1[012]|[123456789])월/i,
					wide: /^(1[012]|[123456789])월/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^1월?$/,
					/^2/,
					/^3/,
					/^4/,
					/^5/,
					/^6/,
					/^7/,
					/^8/,
					/^9/,
					/^10/,
					/^11/,
					/^12/
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[일월화수목금토]/,
					short: /^[일월화수목금토]/,
					abbreviated: /^[일월화수목금토]/,
					wide: /^[일월화수목금토]요일/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^일/,
					/^월/,
					/^화/,
					/^수/,
					/^목/,
					/^금/,
					/^토/
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^(am|오전)/i,
					pm: /^(pm|오후)/i,
					midnight: /^자정/i,
					noon: /^정오/i,
					morning: /^아침/i,
					afternoon: /^오후/i,
					evening: /^저녁/i,
					night: /^밤/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lb/_lib/formatDistance.js
	var formatDistanceLocale$35 = {
		lessThanXSeconds: {
			standalone: {
				one: "manner wéi eng Sekonn",
				other: "manner wéi {{count}} Sekonnen"
			},
			withPreposition: {
				one: "manner wéi enger Sekonn",
				other: "manner wéi {{count}} Sekonnen"
			}
		},
		xSeconds: {
			standalone: {
				one: "eng Sekonn",
				other: "{{count}} Sekonnen"
			},
			withPreposition: {
				one: "enger Sekonn",
				other: "{{count}} Sekonnen"
			}
		},
		halfAMinute: {
			standalone: "eng hallef Minutt",
			withPreposition: "enger hallwer Minutt"
		},
		lessThanXMinutes: {
			standalone: {
				one: "manner wéi eng Minutt",
				other: "manner wéi {{count}} Minutten"
			},
			withPreposition: {
				one: "manner wéi enger Minutt",
				other: "manner wéi {{count}} Minutten"
			}
		},
		xMinutes: {
			standalone: {
				one: "eng Minutt",
				other: "{{count}} Minutten"
			},
			withPreposition: {
				one: "enger Minutt",
				other: "{{count}} Minutten"
			}
		},
		aboutXHours: {
			standalone: {
				one: "ongeféier eng Stonn",
				other: "ongeféier {{count}} Stonnen"
			},
			withPreposition: {
				one: "ongeféier enger Stonn",
				other: "ongeféier {{count}} Stonnen"
			}
		},
		xHours: {
			standalone: {
				one: "eng Stonn",
				other: "{{count}} Stonnen"
			},
			withPreposition: {
				one: "enger Stonn",
				other: "{{count}} Stonnen"
			}
		},
		xDays: {
			standalone: {
				one: "een Dag",
				other: "{{count}} Deeg"
			},
			withPreposition: {
				one: "engem Dag",
				other: "{{count}} Deeg"
			}
		},
		aboutXWeeks: {
			standalone: {
				one: "ongeféier eng Woch",
				other: "ongeféier {{count}} Wochen"
			},
			withPreposition: {
				one: "ongeféier enger Woche",
				other: "ongeféier {{count}} Wochen"
			}
		},
		xWeeks: {
			standalone: {
				one: "eng Woch",
				other: "{{count}} Wochen"
			},
			withPreposition: {
				one: "enger Woch",
				other: "{{count}} Wochen"
			}
		},
		aboutXMonths: {
			standalone: {
				one: "ongeféier ee Mount",
				other: "ongeféier {{count}} Méint"
			},
			withPreposition: {
				one: "ongeféier engem Mount",
				other: "ongeféier {{count}} Méint"
			}
		},
		xMonths: {
			standalone: {
				one: "ee Mount",
				other: "{{count}} Méint"
			},
			withPreposition: {
				one: "engem Mount",
				other: "{{count}} Méint"
			}
		},
		aboutXYears: {
			standalone: {
				one: "ongeféier ee Joer",
				other: "ongeféier {{count}} Joer"
			},
			withPreposition: {
				one: "ongeféier engem Joer",
				other: "ongeféier {{count}} Joer"
			}
		},
		xYears: {
			standalone: {
				one: "ee Joer",
				other: "{{count}} Joer"
			},
			withPreposition: {
				one: "engem Joer",
				other: "{{count}} Joer"
			}
		},
		overXYears: {
			standalone: {
				one: "méi wéi ee Joer",
				other: "méi wéi {{count}} Joer"
			},
			withPreposition: {
				one: "méi wéi engem Joer",
				other: "méi wéi {{count}} Joer"
			}
		},
		almostXYears: {
			standalone: {
				one: "bal ee Joer",
				other: "bal {{count}} Joer"
			},
			withPreposition: {
				one: "bal engem Joer",
				other: "bal {{count}} Joer"
			}
		}
	};
	var EXCEPTION_CONSONANTS = [
		"d",
		"h",
		"n",
		"t",
		"z"
	];
	var VOWELS = [
		"a,",
		"e",
		"i",
		"o",
		"u"
	];
	var DIGITS_SPOKEN_N_NEEDED = [
		0,
		1,
		2,
		3,
		8,
		9
	];
	var FIRST_TWO_DIGITS_SPOKEN_NO_N_NEEDED = [
		40,
		50,
		60,
		70
	];
	function isFinalNNeeded(nextWords) {
		const firstLetter = nextWords.charAt(0).toLowerCase();
		if (VOWELS.indexOf(firstLetter) != -1 || EXCEPTION_CONSONANTS.indexOf(firstLetter) != -1) return true;
		const firstWord = nextWords.split(" ")[0];
		const number = parseInt(firstWord);
		if (!isNaN(number) && DIGITS_SPOKEN_N_NEEDED.indexOf(number % 10) != -1 && FIRST_TWO_DIGITS_SPOKEN_NO_N_NEEDED.indexOf(parseInt(firstWord.substring(0, 2))) == -1) return true;
		return false;
	}
	var formatDistance$35 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$35[token];
		const usageGroup = options?.addSuffix ? tokenValue.withPreposition : tokenValue.standalone;
		if (typeof usageGroup === "string") result = usageGroup;
		else if (count === 1) result = usageGroup.one;
		else result = usageGroup.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "a" + (isFinalNNeeded(result) ? "n" : "") + " " + result;
		else return "viru" + (isFinalNNeeded(result) ? "n" : "") + " " + result;
		return result;
	};
	var formatLong$35 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y",
				long: "do MMMM y",
				medium: "do MMM y",
				short: "dd.MM.yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'um' {{time}}",
				long: "{{date}} 'um' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lb/_lib/formatRelative.js
	var formatRelativeLocale$35 = {
		lastWeek: (date) => {
			const day = date.getDay();
			let result = "'läschte";
			if (day === 2 || day === 4) result += "n";
			result += "' eeee 'um' p";
			return result;
		},
		yesterday: "'gëschter um' p",
		today: "'haut um' p",
		tomorrow: "'moien um' p",
		nextWeek: "eeee 'um' p",
		other: "P"
	};
	var formatRelative$35 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$35[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lb/_lib/localize.js
	var eraValues$35 = {
		narrow: ["v.Chr.", "n.Chr."],
		abbreviated: ["v.Chr.", "n.Chr."],
		wide: ["viru Christus", "no Christus"]
	};
	var quarterValues$35 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. Quartal",
			"2. Quartal",
			"3. Quartal",
			"4. Quartal"
		]
	};
	var monthValues$35 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Feb",
			"Mäe",
			"Abr",
			"Mee",
			"Jun",
			"Jul",
			"Aug",
			"Sep",
			"Okt",
			"Nov",
			"Dez"
		],
		wide: [
			"Januar",
			"Februar",
			"Mäerz",
			"Abrëll",
			"Mee",
			"Juni",
			"Juli",
			"August",
			"September",
			"Oktober",
			"November",
			"Dezember"
		]
	};
	var dayValues$35 = {
		narrow: [
			"S",
			"M",
			"D",
			"M",
			"D",
			"F",
			"S"
		],
		short: [
			"So",
			"Mé",
			"Dë",
			"Më",
			"Do",
			"Fr",
			"Sa"
		],
		abbreviated: [
			"So.",
			"Mé.",
			"Dë.",
			"Më.",
			"Do.",
			"Fr.",
			"Sa."
		],
		wide: [
			"Sonndeg",
			"Méindeg",
			"Dënschdeg",
			"Mëttwoch",
			"Donneschdeg",
			"Freideg",
			"Samschdeg"
		]
	};
	var dayPeriodValues$35 = {
		narrow: {
			am: "mo.",
			pm: "nomë.",
			midnight: "Mëtternuecht",
			noon: "Mëtteg",
			morning: "Moien",
			afternoon: "Nomëtteg",
			evening: "Owend",
			night: "Nuecht"
		},
		abbreviated: {
			am: "moies",
			pm: "nomëttes",
			midnight: "Mëtternuecht",
			noon: "Mëtteg",
			morning: "Moien",
			afternoon: "Nomëtteg",
			evening: "Owend",
			night: "Nuecht"
		},
		wide: {
			am: "moies",
			pm: "nomëttes",
			midnight: "Mëtternuecht",
			noon: "Mëtteg",
			morning: "Moien",
			afternoon: "Nomëtteg",
			evening: "Owend",
			night: "Nuecht"
		}
	};
	var formattingDayPeriodValues$27 = {
		narrow: {
			am: "mo.",
			pm: "nom.",
			midnight: "Mëtternuecht",
			noon: "mëttes",
			morning: "moies",
			afternoon: "nomëttes",
			evening: "owes",
			night: "nuets"
		},
		abbreviated: {
			am: "moies",
			pm: "nomëttes",
			midnight: "Mëtternuecht",
			noon: "mëttes",
			morning: "moies",
			afternoon: "nomëttes",
			evening: "owes",
			night: "nuets"
		},
		wide: {
			am: "moies",
			pm: "nomëttes",
			midnight: "Mëtternuecht",
			noon: "mëttes",
			morning: "moies",
			afternoon: "nomëttes",
			evening: "owes",
			night: "nuets"
		}
	};
	var ordinalNumber$35 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lb.js
	/**
	* @category Locales
	* @summary Luxembourgish locale.
	* @language Luxembourgish
	* @iso-639-2 ltz
	* @author Daniel Waxweiler [@dwaxweiler](https://github.com/dwaxweiler)
	*/
	var lb = {
		code: "lb",
		formatDistance: formatDistance$35,
		formatLong: formatLong$35,
		formatRelative: formatRelative$35,
		localize: {
			ordinalNumber: ordinalNumber$35,
			era: buildLocalizeFn({
				values: eraValues$35,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$35,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$35,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$35,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$35,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$27,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(\.)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
					abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
					wide: /^(viru Christus|virun eiser Zäitrechnung|no Christus|eiser Zäitrechnung)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^v/i, /^n/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](\.)? Quartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mäe|abr|mee|jun|jul|aug|sep|okt|nov|dez)/i,
					wide: /^(januar|februar|mäerz|abrëll|mee|juni|juli|august|september|oktober|november|dezember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mä/i,
						/^ab/i,
						/^me/i,
						/^jun/i,
						/^jul/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smdf]/i,
					short: /^(so|mé|dë|më|do|fr|sa)/i,
					abbreviated: /^(son?|méi?|dën?|mët?|don?|fre?|sam?)\.?/i,
					wide: /^(sonndeg|méindeg|dënschdeg|mëttwoch|donneschdeg|freideg|samschdeg)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^so/i,
					/^mé/i,
					/^dë/i,
					/^më/i,
					/^do/i,
					/^f/i,
					/^sa/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(mo\.?|nomë\.?|Mëtternuecht|mëttes|moies|nomëttes|owes|nuets)/i,
					abbreviated: /^(moi\.?|nomët\.?|Mëtternuecht|mëttes|moies|nomëttes|owes|nuets)/i,
					wide: /^(moies|nomëttes|Mëtternuecht|mëttes|moies|nomëttes|owes|nuets)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^m/i,
					pm: /^n/i,
					midnight: /^Mëtter/i,
					noon: /^mëttes/i,
					morning: /moies/i,
					afternoon: /nomëttes/i,
					evening: /owes/i,
					night: /nuets/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lt/_lib/formatDistance.js
	var translations = {
		xseconds_other: "sekundė_sekundžių_sekundes",
		xminutes_one: "minutė_minutės_minutę",
		xminutes_other: "minutės_minučių_minutes",
		xhours_one: "valanda_valandos_valandą",
		xhours_other: "valandos_valandų_valandas",
		xdays_one: "diena_dienos_dieną",
		xdays_other: "dienos_dienų_dienas",
		xweeks_one: "savaitė_savaitės_savaitę",
		xweeks_other: "savaitės_savaičių_savaites",
		xmonths_one: "mėnuo_mėnesio_mėnesį",
		xmonths_other: "mėnesiai_mėnesių_mėnesius",
		xyears_one: "metai_metų_metus",
		xyears_other: "metai_metų_metus",
		about: "apie",
		over: "daugiau nei",
		almost: "beveik",
		lessthan: "mažiau nei"
	};
	var translateSeconds = (_number, addSuffix, _key, isFuture) => {
		if (!addSuffix) return "kelios sekundės";
		else return isFuture ? "kelių sekundžių" : "kelias sekundes";
	};
	var translateSingular = (_number, addSuffix, key, isFuture) => {
		return !addSuffix ? forms(key)[0] : isFuture ? forms(key)[1] : forms(key)[2];
	};
	var translate = (number, addSuffix, key, isFuture) => {
		const result = number + " ";
		if (number === 1) return result + translateSingular(number, addSuffix, key, isFuture);
		else if (!addSuffix) return result + (special(number) ? forms(key)[1] : forms(key)[0]);
		else if (isFuture) return result + forms(key)[1];
		else return result + (special(number) ? forms(key)[1] : forms(key)[2]);
	};
	function special(number) {
		return number % 10 === 0 || number > 10 && number < 20;
	}
	function forms(key) {
		return translations[key].split("_");
	}
	var formatDistanceLocale$34 = {
		lessThanXSeconds: {
			one: translateSeconds,
			other: translate
		},
		xSeconds: {
			one: translateSeconds,
			other: translate
		},
		halfAMinute: "pusė minutės",
		lessThanXMinutes: {
			one: translateSingular,
			other: translate
		},
		xMinutes: {
			one: translateSingular,
			other: translate
		},
		aboutXHours: {
			one: translateSingular,
			other: translate
		},
		xHours: {
			one: translateSingular,
			other: translate
		},
		xDays: {
			one: translateSingular,
			other: translate
		},
		aboutXWeeks: {
			one: translateSingular,
			other: translate
		},
		xWeeks: {
			one: translateSingular,
			other: translate
		},
		aboutXMonths: {
			one: translateSingular,
			other: translate
		},
		xMonths: {
			one: translateSingular,
			other: translate
		},
		aboutXYears: {
			one: translateSingular,
			other: translate
		},
		xYears: {
			one: translateSingular,
			other: translate
		},
		overXYears: {
			one: translateSingular,
			other: translate
		},
		almostXYears: {
			one: translateSingular,
			other: translate
		}
	};
	var formatDistance$34 = (token, count, options) => {
		const adverb = token.match(/about|over|almost|lessthan/i);
		const unit = adverb ? token.replace(adverb[0], "") : token;
		const isFuture = options?.comparison !== void 0 && options.comparison > 0;
		let result;
		const tokenValue = formatDistanceLocale$34[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one(count, options?.addSuffix === true, unit.toLowerCase() + "_one", isFuture);
		else result = tokenValue.other(count, options?.addSuffix === true, unit.toLowerCase() + "_other", isFuture);
		if (adverb) result = translations[adverb[0].toLowerCase()] + " " + result;
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "po " + result;
		else return "prieš " + result;
		return result;
	};
	var formatLong$34 = {
		date: buildFormatLongFn({
			formats: {
				full: "y 'm'. MMMM d 'd'., EEEE",
				long: "y 'm'. MMMM d 'd'.",
				medium: "y-MM-dd",
				short: "y-MM-dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lt/_lib/formatRelative.js
	var formatRelativeLocale$34 = {
		lastWeek: "'Praėjusį' eeee p",
		yesterday: "'Vakar' p",
		today: "'Šiandien' p",
		tomorrow: "'Rytoj' p",
		nextWeek: "eeee p",
		other: "P"
	};
	var formatRelative$34 = (token, _date, _baseDate, _options) => formatRelativeLocale$34[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/lt/_lib/localize.js
	var eraValues$34 = {
		narrow: ["pr. Kr.", "po Kr."],
		abbreviated: ["pr. Kr.", "po Kr."],
		wide: ["prieš Kristų", "po Kristaus"]
	};
	var quarterValues$34 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"I ketv.",
			"II ketv.",
			"III ketv.",
			"IV ketv."
		],
		wide: [
			"I ketvirtis",
			"II ketvirtis",
			"III ketvirtis",
			"IV ketvirtis"
		]
	};
	var formattingQuarterValues$2 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"I k.",
			"II k.",
			"III k.",
			"IV k."
		],
		wide: [
			"I ketvirtis",
			"II ketvirtis",
			"III ketvirtis",
			"IV ketvirtis"
		]
	};
	var monthValues$34 = {
		narrow: [
			"S",
			"V",
			"K",
			"B",
			"G",
			"B",
			"L",
			"R",
			"R",
			"S",
			"L",
			"G"
		],
		abbreviated: [
			"saus.",
			"vas.",
			"kov.",
			"bal.",
			"geg.",
			"birž.",
			"liep.",
			"rugp.",
			"rugs.",
			"spal.",
			"lapkr.",
			"gruod."
		],
		wide: [
			"sausis",
			"vasaris",
			"kovas",
			"balandis",
			"gegužė",
			"birželis",
			"liepa",
			"rugpjūtis",
			"rugsėjis",
			"spalis",
			"lapkritis",
			"gruodis"
		]
	};
	var formattingMonthValues$8 = {
		narrow: [
			"S",
			"V",
			"K",
			"B",
			"G",
			"B",
			"L",
			"R",
			"R",
			"S",
			"L",
			"G"
		],
		abbreviated: [
			"saus.",
			"vas.",
			"kov.",
			"bal.",
			"geg.",
			"birž.",
			"liep.",
			"rugp.",
			"rugs.",
			"spal.",
			"lapkr.",
			"gruod."
		],
		wide: [
			"sausio",
			"vasario",
			"kovo",
			"balandžio",
			"gegužės",
			"birželio",
			"liepos",
			"rugpjūčio",
			"rugsėjo",
			"spalio",
			"lapkričio",
			"gruodžio"
		]
	};
	var dayValues$34 = {
		narrow: [
			"S",
			"P",
			"A",
			"T",
			"K",
			"P",
			"Š"
		],
		short: [
			"Sk",
			"Pr",
			"An",
			"Tr",
			"Kt",
			"Pn",
			"Št"
		],
		abbreviated: [
			"sk",
			"pr",
			"an",
			"tr",
			"kt",
			"pn",
			"št"
		],
		wide: [
			"sekmadienis",
			"pirmadienis",
			"antradienis",
			"trečiadienis",
			"ketvirtadienis",
			"penktadienis",
			"šeštadienis"
		]
	};
	var formattingDayValues$2 = {
		narrow: [
			"S",
			"P",
			"A",
			"T",
			"K",
			"P",
			"Š"
		],
		short: [
			"Sk",
			"Pr",
			"An",
			"Tr",
			"Kt",
			"Pn",
			"Št"
		],
		abbreviated: [
			"sk",
			"pr",
			"an",
			"tr",
			"kt",
			"pn",
			"št"
		],
		wide: [
			"sekmadienį",
			"pirmadienį",
			"antradienį",
			"trečiadienį",
			"ketvirtadienį",
			"penktadienį",
			"šeštadienį"
		]
	};
	var dayPeriodValues$34 = {
		narrow: {
			am: "pr. p.",
			pm: "pop.",
			midnight: "vidurnaktis",
			noon: "vidurdienis",
			morning: "rytas",
			afternoon: "diena",
			evening: "vakaras",
			night: "naktis"
		},
		abbreviated: {
			am: "priešpiet",
			pm: "popiet",
			midnight: "vidurnaktis",
			noon: "vidurdienis",
			morning: "rytas",
			afternoon: "diena",
			evening: "vakaras",
			night: "naktis"
		},
		wide: {
			am: "priešpiet",
			pm: "popiet",
			midnight: "vidurnaktis",
			noon: "vidurdienis",
			morning: "rytas",
			afternoon: "diena",
			evening: "vakaras",
			night: "naktis"
		}
	};
	var formattingDayPeriodValues$26 = {
		narrow: {
			am: "pr. p.",
			pm: "pop.",
			midnight: "vidurnaktis",
			noon: "perpiet",
			morning: "rytas",
			afternoon: "popietė",
			evening: "vakaras",
			night: "naktis"
		},
		abbreviated: {
			am: "priešpiet",
			pm: "popiet",
			midnight: "vidurnaktis",
			noon: "perpiet",
			morning: "rytas",
			afternoon: "popietė",
			evening: "vakaras",
			night: "naktis"
		},
		wide: {
			am: "priešpiet",
			pm: "popiet",
			midnight: "vidurnaktis",
			noon: "perpiet",
			morning: "rytas",
			afternoon: "popietė",
			evening: "vakaras",
			night: "naktis"
		}
	};
	var ordinalNumber$34 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "-oji";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lt.js
	/**
	* @category Locales
	* @summary Lithuanian locale.
	* @language Lithuanian
	* @iso-639-2 lit
	* @author Pavlo Shpak [@pshpak](https://github.com/pshpak)
	* @author Eduardo Pardo [@eduardopsll](https://github.com/eduardopsll)
	*/
	var lt = {
		code: "lt",
		formatDistance: formatDistance$34,
		formatLong: formatLong$34,
		formatRelative: formatRelative$34,
		localize: {
			ordinalNumber: ordinalNumber$34,
			era: buildLocalizeFn({
				values: eraValues$34,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$34,
				defaultWidth: "wide",
				formattingValues: formattingQuarterValues$2,
				defaultFormattingWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$34,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$8,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$34,
				defaultWidth: "wide",
				formattingValues: formattingDayValues$2,
				defaultFormattingWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$34,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$26,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-oji)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^p(r|o)\.?\s?(kr\.?|me)/i,
					abbreviated: /^(pr\.\s?(kr\.|m\.\s?e\.)|po\s?kr\.|mūsų eroje)/i,
					wide: /^(prieš Kristų|prieš mūsų erą|po Kristaus|mūsų eroje)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					wide: [/prieš/i, /(po|mūsų)/i],
					any: [/^pr/i, /^(po|m)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^([1234])/i,
					abbreviated: /^(I|II|III|IV)\s?ketv?\.?/i,
					wide: /^(I|II|III|IV)\s?ketvirtis/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/1/i,
						/2/i,
						/3/i,
						/4/i
					],
					any: [
						/I$/i,
						/II$/i,
						/III/i,
						/IV/i
					]
				},
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[svkbglr]/i,
					abbreviated: /^(saus\.|vas\.|kov\.|bal\.|geg\.|birž\.|liep\.|rugp\.|rugs\.|spal\.|lapkr\.|gruod\.)/i,
					wide: /^(sausi(s|o)|vasari(s|o)|kov(a|o)s|balandž?i(s|o)|gegužės?|birželi(s|o)|liep(a|os)|rugpjū(t|č)i(s|o)|rugsėj(is|o)|spali(s|o)|lapkri(t|č)i(s|o)|gruodž?i(s|o))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^v/i,
						/^k/i,
						/^b/i,
						/^g/i,
						/^b/i,
						/^l/i,
						/^r/i,
						/^r/i,
						/^s/i,
						/^l/i,
						/^g/i
					],
					any: [
						/^saus/i,
						/^vas/i,
						/^kov/i,
						/^bal/i,
						/^geg/i,
						/^birž/i,
						/^liep/i,
						/^rugp/i,
						/^rugs/i,
						/^spal/i,
						/^lapkr/i,
						/^gruod/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[spatkš]/i,
					short: /^(sk|pr|an|tr|kt|pn|št)/i,
					abbreviated: /^(sk|pr|an|tr|kt|pn|št)/i,
					wide: /^(sekmadien(is|į)|pirmadien(is|į)|antradien(is|į)|trečiadien(is|į)|ketvirtadien(is|į)|penktadien(is|į)|šeštadien(is|į))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^p/i,
						/^a/i,
						/^t/i,
						/^k/i,
						/^p/i,
						/^š/i
					],
					wide: [
						/^se/i,
						/^pi/i,
						/^an/i,
						/^tr/i,
						/^ke/i,
						/^pe/i,
						/^še/i
					],
					any: [
						/^sk/i,
						/^pr/i,
						/^an/i,
						/^tr/i,
						/^kt/i,
						/^pn/i,
						/^št/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(pr.\s?p.|pop.|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i,
					any: /^(priešpiet|popiet$|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: {
					narrow: {
						am: /^pr/i,
						pm: /^pop./i,
						midnight: /^vidurnaktis/i,
						noon: /^(vidurdienis|perp)/i,
						morning: /rytas/i,
						afternoon: /(die|popietė)/i,
						evening: /vakaras/i,
						night: /naktis/i
					},
					any: {
						am: /^pr/i,
						pm: /^popiet$/i,
						midnight: /^vidurnaktis/i,
						noon: /^(vidurdienis|perp)/i,
						morning: /rytas/i,
						afternoon: /(die|popietė)/i,
						evening: /vakaras/i,
						night: /naktis/i
					}
				},
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lv/_lib/formatDistance.js
	function buildLocalizeTokenFn$2(schema) {
		return (count, options) => {
			if (count === 1) if (options?.addSuffix) return schema.one[0].replace("{{time}}", schema.one[2]);
			else return schema.one[0].replace("{{time}}", schema.one[1]);
			else {
				const rem = count % 10 === 1 && count % 100 !== 11;
				if (options?.addSuffix) return schema.other[0].replace("{{time}}", rem ? schema.other[3] : schema.other[4]).replace("{{count}}", String(count));
				else return schema.other[0].replace("{{time}}", rem ? schema.other[1] : schema.other[2]).replace("{{count}}", String(count));
			}
		};
	}
	var formatDistanceLocale$33 = {
		lessThanXSeconds: buildLocalizeTokenFn$2({
			one: [
				"mazāk par {{time}}",
				"sekundi",
				"sekundi"
			],
			other: [
				"mazāk nekā {{count}} {{time}}",
				"sekunde",
				"sekundes",
				"sekundes",
				"sekundēm"
			]
		}),
		xSeconds: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"sekunde",
				"sekundes"
			],
			other: [
				"{{count}} {{time}}",
				"sekunde",
				"sekundes",
				"sekundes",
				"sekundēm"
			]
		}),
		halfAMinute: (_count, options) => {
			if (options?.addSuffix) return "pusminūtes";
			else return "pusminūte";
		},
		lessThanXMinutes: buildLocalizeTokenFn$2({
			one: [
				"mazāk par {{time}}",
				"minūti",
				"minūti"
			],
			other: [
				"mazāk nekā {{count}} {{time}}",
				"minūte",
				"minūtes",
				"minūtes",
				"minūtēm"
			]
		}),
		xMinutes: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"minūte",
				"minūtes"
			],
			other: [
				"{{count}} {{time}}",
				"minūte",
				"minūtes",
				"minūtes",
				"minūtēm"
			]
		}),
		aboutXHours: buildLocalizeTokenFn$2({
			one: [
				"apmēram 1 {{time}}",
				"stunda",
				"stundas"
			],
			other: [
				"apmēram {{count}} {{time}}",
				"stunda",
				"stundas",
				"stundas",
				"stundām"
			]
		}),
		xHours: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"stunda",
				"stundas"
			],
			other: [
				"{{count}} {{time}}",
				"stunda",
				"stundas",
				"stundas",
				"stundām"
			]
		}),
		xDays: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"diena",
				"dienas"
			],
			other: [
				"{{count}} {{time}}",
				"diena",
				"dienas",
				"dienas",
				"dienām"
			]
		}),
		aboutXWeeks: buildLocalizeTokenFn$2({
			one: [
				"apmēram 1 {{time}}",
				"nedēļa",
				"nedēļas"
			],
			other: [
				"apmēram {{count}} {{time}}",
				"nedēļa",
				"nedēļu",
				"nedēļas",
				"nedēļām"
			]
		}),
		xWeeks: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"nedēļa",
				"nedēļas"
			],
			other: [
				"{{count}} {{time}}",
				"nedēļa",
				"nedēļu",
				"nedēļas",
				"nedēļām"
			]
		}),
		aboutXMonths: buildLocalizeTokenFn$2({
			one: [
				"apmēram 1 {{time}}",
				"mēnesis",
				"mēneša"
			],
			other: [
				"apmēram {{count}} {{time}}",
				"mēnesis",
				"mēneši",
				"mēneša",
				"mēnešiem"
			]
		}),
		xMonths: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"mēnesis",
				"mēneša"
			],
			other: [
				"{{count}} {{time}}",
				"mēnesis",
				"mēneši",
				"mēneša",
				"mēnešiem"
			]
		}),
		aboutXYears: buildLocalizeTokenFn$2({
			one: [
				"apmēram 1 {{time}}",
				"gads",
				"gada"
			],
			other: [
				"apmēram {{count}} {{time}}",
				"gads",
				"gadi",
				"gada",
				"gadiem"
			]
		}),
		xYears: buildLocalizeTokenFn$2({
			one: [
				"1 {{time}}",
				"gads",
				"gada"
			],
			other: [
				"{{count}} {{time}}",
				"gads",
				"gadi",
				"gada",
				"gadiem"
			]
		}),
		overXYears: buildLocalizeTokenFn$2({
			one: [
				"ilgāk par 1 {{time}}",
				"gadu",
				"gadu"
			],
			other: [
				"vairāk nekā {{count}} {{time}}",
				"gads",
				"gadi",
				"gada",
				"gadiem"
			]
		}),
		almostXYears: buildLocalizeTokenFn$2({
			one: [
				"gandrīz 1 {{time}}",
				"gads",
				"gada"
			],
			other: [
				"vairāk nekā {{count}} {{time}}",
				"gads",
				"gadi",
				"gada",
				"gadiem"
			]
		})
	};
	var formatDistance$33 = (token, count, options) => {
		const result = formatDistanceLocale$33[token](count, options);
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "pēc " + result;
		else return "pirms " + result;
		return result;
	};
	var formatLong$33 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, y. 'gada' d. MMMM",
				long: "y. 'gada' d. MMMM",
				medium: "dd.MM.y.",
				short: "dd.MM.y."
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'plkst.' {{time}}",
				long: "{{date}} 'plkst.' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lv/_lib/formatRelative.js
	var weekdays$1 = [
		"svētdienā",
		"pirmdienā",
		"otrdienā",
		"trešdienā",
		"ceturtdienā",
		"piektdienā",
		"sestdienā"
	];
	var formatRelativeLocale$33 = {
		lastWeek: (date, baseDate, options) => {
			if (isSameWeek(date, baseDate, options)) return "eeee 'plkst.' p";
			return "'Pagājušā " + weekdays$1[date.getDay()] + " plkst.' p";
		},
		yesterday: "'Vakar plkst.' p",
		today: "'Šodien plkst.' p",
		tomorrow: "'Rīt plkst.' p",
		nextWeek: (date, baseDate, options) => {
			if (isSameWeek(date, baseDate, options)) return "eeee 'plkst.' p";
			return "'Nākamajā " + weekdays$1[date.getDay()] + " plkst.' p";
		},
		other: "P"
	};
	var formatRelative$33 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$33[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lv/_lib/localize.js
	var eraValues$33 = {
		narrow: ["p.m.ē", "m.ē"],
		abbreviated: ["p. m. ē.", "m. ē."],
		wide: ["pirms mūsu ēras", "mūsu ērā"]
	};
	var quarterValues$33 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1. cet.",
			"2. cet.",
			"3. cet.",
			"4. cet."
		],
		wide: [
			"pirmais ceturksnis",
			"otrais ceturksnis",
			"trešais ceturksnis",
			"ceturtais ceturksnis"
		]
	};
	var formattingQuarterValues$1 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1. cet.",
			"2. cet.",
			"3. cet.",
			"4. cet."
		],
		wide: [
			"pirmajā ceturksnī",
			"otrajā ceturksnī",
			"trešajā ceturksnī",
			"ceturtajā ceturksnī"
		]
	};
	var monthValues$33 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"janv.",
			"febr.",
			"marts",
			"apr.",
			"maijs",
			"jūn.",
			"jūl.",
			"aug.",
			"sept.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"janvāris",
			"februāris",
			"marts",
			"aprīlis",
			"maijs",
			"jūnijs",
			"jūlijs",
			"augusts",
			"septembris",
			"oktobris",
			"novembris",
			"decembris"
		]
	};
	var formattingMonthValues$7 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"janv.",
			"febr.",
			"martā",
			"apr.",
			"maijs",
			"jūn.",
			"jūl.",
			"aug.",
			"sept.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"janvārī",
			"februārī",
			"martā",
			"aprīlī",
			"maijā",
			"jūnijā",
			"jūlijā",
			"augustā",
			"septembrī",
			"oktobrī",
			"novembrī",
			"decembrī"
		]
	};
	var dayValues$33 = {
		narrow: [
			"S",
			"P",
			"O",
			"T",
			"C",
			"P",
			"S"
		],
		short: [
			"Sv",
			"P",
			"O",
			"T",
			"C",
			"Pk",
			"S"
		],
		abbreviated: [
			"svētd.",
			"pirmd.",
			"otrd.",
			"trešd.",
			"ceturtd.",
			"piektd.",
			"sestd."
		],
		wide: [
			"svētdiena",
			"pirmdiena",
			"otrdiena",
			"trešdiena",
			"ceturtdiena",
			"piektdiena",
			"sestdiena"
		]
	};
	var formattingDayValues$1 = {
		narrow: [
			"S",
			"P",
			"O",
			"T",
			"C",
			"P",
			"S"
		],
		short: [
			"Sv",
			"P",
			"O",
			"T",
			"C",
			"Pk",
			"S"
		],
		abbreviated: [
			"svētd.",
			"pirmd.",
			"otrd.",
			"trešd.",
			"ceturtd.",
			"piektd.",
			"sestd."
		],
		wide: [
			"svētdienā",
			"pirmdienā",
			"otrdienā",
			"trešdienā",
			"ceturtdienā",
			"piektdienā",
			"sestdienā"
		]
	};
	var dayPeriodValues$33 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "pusn.",
			noon: "pusd.",
			morning: "rīts",
			afternoon: "diena",
			evening: "vakars",
			night: "nakts"
		},
		abbreviated: {
			am: "am",
			pm: "pm",
			midnight: "pusn.",
			noon: "pusd.",
			morning: "rīts",
			afternoon: "pēcpusd.",
			evening: "vakars",
			night: "nakts"
		},
		wide: {
			am: "am",
			pm: "pm",
			midnight: "pusnakts",
			noon: "pusdienlaiks",
			morning: "rīts",
			afternoon: "pēcpusdiena",
			evening: "vakars",
			night: "nakts"
		}
	};
	var formattingDayPeriodValues$25 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "pusn.",
			noon: "pusd.",
			morning: "rītā",
			afternoon: "dienā",
			evening: "vakarā",
			night: "naktī"
		},
		abbreviated: {
			am: "am",
			pm: "pm",
			midnight: "pusn.",
			noon: "pusd.",
			morning: "rītā",
			afternoon: "pēcpusd.",
			evening: "vakarā",
			night: "naktī"
		},
		wide: {
			am: "am",
			pm: "pm",
			midnight: "pusnaktī",
			noon: "pusdienlaikā",
			morning: "rītā",
			afternoon: "pēcpusdienā",
			evening: "vakarā",
			night: "naktī"
		}
	};
	var ordinalNumber$33 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/lv.js
	/**
	* @category Locales
	* @summary Latvian locale (Latvia).
	* @language Latvian
	* @iso-639-2 lav
	* @author Rūdolfs Puķītis [@prudolfs](https://github.com/prudolfs)
	*/
	var lv = {
		code: "lv",
		formatDistance: formatDistance$33,
		formatLong: formatLong$33,
		formatRelative: formatRelative$33,
		localize: {
			ordinalNumber: ordinalNumber$33,
			era: buildLocalizeFn({
				values: eraValues$33,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$33,
				defaultWidth: "wide",
				formattingValues: formattingQuarterValues$1,
				defaultFormattingWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$33,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$7,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$33,
				defaultWidth: "wide",
				formattingValues: formattingDayValues$1,
				defaultFormattingWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$33,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$25,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(p\.m\.ē|m\.ē)/i,
					abbreviated: /^(p\. m\. ē\.|m\. ē\.)/i,
					wide: /^(pirms mūsu ēras|mūsu ērā)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^p/i, /^m/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](\. cet\.)/i,
					wide: /^(pirma(is|jā)|otra(is|jā)|treša(is|jā)|ceturta(is|jā)) ceturksn(is|ī)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^1/i,
						/^2/i,
						/^3/i,
						/^4/i
					],
					abbreviated: [
						/^1/i,
						/^2/i,
						/^3/i,
						/^4/i
					],
					wide: [
						/^p/i,
						/^o/i,
						/^t/i,
						/^c/i
					]
				},
				defaultParseWidth: "wide",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(janv\.|febr\.|marts|apr\.|maijs|jūn\.|jūl\.|aug\.|sept\.|okt\.|nov\.|dec\.)/i,
					wide: /^(janvār(is|ī)|februār(is|ī)|mart[sā]|aprīl(is|ī)|maij[sā]|jūnij[sā]|jūlij[sā]|august[sā]|septembr(is|ī)|oktobr(is|ī)|novembr(is|ī)|decembr(is|ī))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^mai/i,
						/^jūn/i,
						/^jūl/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[spotc]/i,
					short: /^(sv|pi|o|t|c|pk|s)/i,
					abbreviated: /^(svētd\.|pirmd\.|otrd.\|trešd\.|ceturtd\.|piektd\.|sestd\.)/i,
					wide: /^(svētdien(a|ā)|pirmdien(a|ā)|otrdien(a|ā)|trešdien(a|ā)|ceturtdien(a|ā)|piektdien(a|ā)|sestdien(a|ā))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^p/i,
						/^o/i,
						/^t/i,
						/^c/i,
						/^p/i,
						/^s/i
					],
					any: [
						/^sv/i,
						/^pi/i,
						/^o/i,
						/^t/i,
						/^c/i,
						/^p/i,
						/^se/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(am|pm|pusn\.|pusd\.|rīt(s|ā)|dien(a|ā)|vakar(s|ā)|nakt(s|ī))/,
					abbreviated: /^(am|pm|pusn\.|pusd\.|rīt(s|ā)|pēcpusd\.|vakar(s|ā)|nakt(s|ī))/,
					wide: /^(am|pm|pusnakt(s|ī)|pusdienlaik(s|ā)|rīt(s|ā)|pēcpusdien(a|ā)|vakar(s|ā)|nakt(s|ī))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^am/i,
					pm: /^pm/i,
					midnight: /^pusn/i,
					noon: /^pusd/i,
					morning: /^r/i,
					afternoon: /^(d|pēc)/i,
					evening: /^v/i,
					night: /^n/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mk/_lib/formatDistance.js
	var formatDistanceLocale$32 = {
		lessThanXSeconds: {
			one: "помалку од секунда",
			other: "помалку од {{count}} секунди"
		},
		xSeconds: {
			one: "1 секунда",
			other: "{{count}} секунди"
		},
		halfAMinute: "половина минута",
		lessThanXMinutes: {
			one: "помалку од минута",
			other: "помалку од {{count}} минути"
		},
		xMinutes: {
			one: "1 минута",
			other: "{{count}} минути"
		},
		aboutXHours: {
			one: "околу 1 час",
			other: "околу {{count}} часа"
		},
		xHours: {
			one: "1 час",
			other: "{{count}} часа"
		},
		xDays: {
			one: "1 ден",
			other: "{{count}} дена"
		},
		aboutXWeeks: {
			one: "околу 1 недела",
			other: "околу {{count}} месеци"
		},
		xWeeks: {
			one: "1 недела",
			other: "{{count}} недели"
		},
		aboutXMonths: {
			one: "околу 1 месец",
			other: "околу {{count}} недели"
		},
		xMonths: {
			one: "1 месец",
			other: "{{count}} месеци"
		},
		aboutXYears: {
			one: "околу 1 година",
			other: "околу {{count}} години"
		},
		xYears: {
			one: "1 година",
			other: "{{count}} години"
		},
		overXYears: {
			one: "повеќе од 1 година",
			other: "повеќе од {{count}} години"
		},
		almostXYears: {
			one: "безмалку 1 година",
			other: "безмалку {{count}} години"
		}
	};
	var formatDistance$32 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$32[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "за " + result;
		else return "пред " + result;
		return result;
	};
	var formatLong$32 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, dd MMMM yyyy",
				long: "dd MMMM yyyy",
				medium: "dd MMM yyyy",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}} {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mk/_lib/formatRelative.js
	var weekdays = [
		"недела",
		"понеделник",
		"вторник",
		"среда",
		"четврток",
		"петок",
		"сабота"
	];
	function lastWeek$3(day) {
		const weekday = weekdays[day];
		switch (day) {
			case 0:
			case 3:
			case 6: return "'минатата " + weekday + " во' p";
			case 1:
			case 2:
			case 4:
			case 5: return "'минатиот " + weekday + " во' p";
		}
	}
	function thisWeek$3(day) {
		const weekday = weekdays[day];
		switch (day) {
			case 0:
			case 3:
			case 6: return "'ова " + weekday + " вo' p";
			case 1:
			case 2:
			case 4:
			case 5: return "'овој " + weekday + " вo' p";
		}
	}
	function nextWeek$3(day) {
		const weekday = weekdays[day];
		switch (day) {
			case 0:
			case 3:
			case 6: return "'следната " + weekday + " вo' p";
			case 1:
			case 2:
			case 4:
			case 5: return "'следниот " + weekday + " вo' p";
		}
	}
	var formatRelativeLocale$32 = {
		lastWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$3(day);
			else return lastWeek$3(day);
		},
		yesterday: "'вчера во' p",
		today: "'денес во' p",
		tomorrow: "'утре во' p",
		nextWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$3(day);
			else return nextWeek$3(day);
		},
		other: "P"
	};
	var formatRelative$32 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$32[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mk/_lib/localize.js
	var eraValues$32 = {
		narrow: ["пр.н.е.", "н.е."],
		abbreviated: ["пред н. е.", "н. е."],
		wide: ["пред нашата ера", "нашата ера"]
	};
	var quarterValues$32 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-ви кв.",
			"2-ри кв.",
			"3-ти кв.",
			"4-ти кв."
		],
		wide: [
			"1-ви квартал",
			"2-ри квартал",
			"3-ти квартал",
			"4-ти квартал"
		]
	};
	var monthValues$32 = {
		abbreviated: [
			"јан",
			"фев",
			"мар",
			"апр",
			"мај",
			"јун",
			"јул",
			"авг",
			"септ",
			"окт",
			"ноем",
			"дек"
		],
		wide: [
			"јануари",
			"февруари",
			"март",
			"април",
			"мај",
			"јуни",
			"јули",
			"август",
			"септември",
			"октомври",
			"ноември",
			"декември"
		]
	};
	var dayValues$32 = {
		narrow: [
			"Н",
			"П",
			"В",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"не",
			"по",
			"вт",
			"ср",
			"че",
			"пе",
			"са"
		],
		abbreviated: [
			"нед",
			"пон",
			"вто",
			"сре",
			"чет",
			"пет",
			"саб"
		],
		wide: [
			"недела",
			"понеделник",
			"вторник",
			"среда",
			"четврток",
			"петок",
			"сабота"
		]
	};
	var dayPeriodValues$32 = { wide: {
		am: "претпладне",
		pm: "попладне",
		midnight: "полноќ",
		noon: "напладне",
		morning: "наутро",
		afternoon: "попладне",
		evening: "навечер",
		night: "ноќе"
	} };
	var ordinalNumber$32 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
			case 1: return number + "-ви";
			case 2: return number + "-ри";
			case 7:
			case 8: return number + "-ми";
		}
		return number + "-ти";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mk.js
	/**
	* @category Locales
	* @summary Macedonian locale.
	* @language Macedonian
	* @iso-639-2 mkd
	* @author Petar Vlahu [@vlahupetar](https://github.com/vlahupetar)
	* @author Altrim Beqiri [@altrim](https://github.com/altrim)
	*/
	var mk = {
		code: "mk",
		formatDistance: formatDistance$32,
		formatLong: formatLong$32,
		formatRelative: formatRelative$32,
		localize: {
			ordinalNumber: ordinalNumber$32,
			era: buildLocalizeFn({
				values: eraValues$32,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$32,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$32,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$32,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$32,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?[врмт][и])?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((пр)?н\.?\s?е\.?)/i,
					abbreviated: /^((пр)?н\.?\s?е\.?)/i,
					wide: /^(пред нашата ера|нашата ера)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^п/i, /^н/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?[врт]?и?)? кв.?/i,
					wide: /^[1234](-?[врт]?и?)? квартал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					abbreviated: /^(јан|фев|мар|апр|мај|јун|јул|авг|сеп|окт|ноем|дек)/i,
					wide: /^(јануари|февруари|март|април|мај|јуни|јули|август|септември|октомври|ноември|декември)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^ја/i,
					/^Ф/i,
					/^мар/i,
					/^ап/i,
					/^мај/i,
					/^јун/i,
					/^јул/i,
					/^ав/i,
					/^се/i,
					/^окт/i,
					/^но/i,
					/^де/i
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[нпвсч]/i,
					short: /^(не|по|вт|ср|че|пе|са)/i,
					abbreviated: /^(нед|пон|вто|сре|чет|пет|саб)/i,
					wide: /^(недела|понеделник|вторник|среда|четврток|петок|сабота)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^н/i,
						/^п/i,
						/^в/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i
					],
					any: [
						/^н[ед]/i,
						/^п[он]/i,
						/^вт/i,
						/^ср/i,
						/^ч[ет]/i,
						/^п[ет]/i,
						/^с[аб]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(претп|попл|полноќ|утро|пладне|вечер|ноќ)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /претпладне/i,
					pm: /попладне/i,
					midnight: /полноќ/i,
					noon: /напладне/i,
					morning: /наутро/i,
					afternoon: /попладне/i,
					evening: /навечер/i,
					night: /ноќе/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mn/_lib/formatDistance.js
	var formatDistanceLocale$31 = {
		lessThanXSeconds: {
			one: "секунд хүрэхгүй",
			other: "{{count}} секунд хүрэхгүй"
		},
		xSeconds: {
			one: "1 секунд",
			other: "{{count}} секунд"
		},
		halfAMinute: "хагас минут",
		lessThanXMinutes: {
			one: "минут хүрэхгүй",
			other: "{{count}} минут хүрэхгүй"
		},
		xMinutes: {
			one: "1 минут",
			other: "{{count}} минут"
		},
		aboutXHours: {
			one: "ойролцоогоор 1 цаг",
			other: "ойролцоогоор {{count}} цаг"
		},
		xHours: {
			one: "1 цаг",
			other: "{{count}} цаг"
		},
		xDays: {
			one: "1 өдөр",
			other: "{{count}} өдөр"
		},
		aboutXWeeks: {
			one: "ойролцоогоор 1 долоо хоног",
			other: "ойролцоогоор {{count}} долоо хоног"
		},
		xWeeks: {
			one: "1 долоо хоног",
			other: "{{count}} долоо хоног"
		},
		aboutXMonths: {
			one: "ойролцоогоор 1 сар",
			other: "ойролцоогоор {{count}} сар"
		},
		xMonths: {
			one: "1 сар",
			other: "{{count}} сар"
		},
		aboutXYears: {
			one: "ойролцоогоор 1 жил",
			other: "ойролцоогоор {{count}} жил"
		},
		xYears: {
			one: "1 жил",
			other: "{{count}} жил"
		},
		overXYears: {
			one: "1 жил гаран",
			other: "{{count}} жил гаран"
		},
		almostXYears: {
			one: "бараг 1 жил",
			other: "бараг {{count}} жил"
		}
	};
	var formatDistance$31 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$31[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) {
			/**
			* Append genitive case
			*/
			const words = result.split(" ");
			const lastword = words.pop();
			result = words.join(" ");
			switch (lastword) {
				case "секунд":
					result += " секундийн";
					break;
				case "минут":
					result += " минутын";
					break;
				case "цаг":
					result += " цагийн";
					break;
				case "өдөр":
					result += " өдрийн";
					break;
				case "сар":
					result += " сарын";
					break;
				case "жил":
					result += " жилийн";
					break;
				case "хоног":
					result += " хоногийн";
					break;
				case "гаран":
					result += " гараны";
					break;
				case "хүрэхгүй":
					result += " хүрэхгүй хугацааны";
					break;
				default: result += lastword + "-н";
			}
			if (options.comparison && options.comparison > 0) return result + " дараа";
			else return result + " өмнө";
		}
		return result;
	};
	var formatLong$31 = {
		date: buildFormatLongFn({
			formats: {
				full: "y 'оны' MMMM'ын' d, EEEE 'гараг'",
				long: "y 'оны' MMMM'ын' d",
				medium: "y 'оны' MMM'ын' d",
				short: "y.MM.dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mn/_lib/formatRelative.js
	var formatRelativeLocale$31 = {
		lastWeek: "'өнгөрсөн' eeee 'гарагийн' p 'цагт'",
		yesterday: "'өчигдөр' p 'цагт'",
		today: "'өнөөдөр' p 'цагт'",
		tomorrow: "'маргааш' p 'цагт'",
		nextWeek: "'ирэх' eeee 'гарагийн' p 'цагт'",
		other: "P"
	};
	var formatRelative$31 = (token, _date, _baseDate, _options) => formatRelativeLocale$31[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/mn/_lib/localize.js
	var eraValues$31 = {
		narrow: ["НТӨ", "НТ"],
		abbreviated: ["НТӨ", "НТ"],
		wide: ["нийтийн тооллын өмнөх", "нийтийн тооллын"]
	};
	var quarterValues$31 = {
		narrow: [
			"I",
			"II",
			"III",
			"IV"
		],
		abbreviated: [
			"I улирал",
			"II улирал",
			"III улирал",
			"IV улирал"
		],
		wide: [
			"1-р улирал",
			"2-р улирал",
			"3-р улирал",
			"4-р улирал"
		]
	};
	var monthValues$31 = {
		narrow: [
			"I",
			"II",
			"III",
			"IV",
			"V",
			"VI",
			"VII",
			"VIII",
			"IX",
			"X",
			"XI",
			"XII"
		],
		abbreviated: [
			"1-р сар",
			"2-р сар",
			"3-р сар",
			"4-р сар",
			"5-р сар",
			"6-р сар",
			"7-р сар",
			"8-р сар",
			"9-р сар",
			"10-р сар",
			"11-р сар",
			"12-р сар"
		],
		wide: [
			"Нэгдүгээр сар",
			"Хоёрдугаар сар",
			"Гуравдугаар сар",
			"Дөрөвдүгээр сар",
			"Тавдугаар сар",
			"Зургаадугаар сар",
			"Долоодугаар сар",
			"Наймдугаар сар",
			"Есдүгээр сар",
			"Аравдугаар сар",
			"Арваннэгдүгээр сар",
			"Арван хоёрдугаар сар"
		]
	};
	var formattingMonthValues$6 = {
		narrow: [
			"I",
			"II",
			"III",
			"IV",
			"V",
			"VI",
			"VII",
			"VIII",
			"IX",
			"X",
			"XI",
			"XII"
		],
		abbreviated: [
			"1-р сар",
			"2-р сар",
			"3-р сар",
			"4-р сар",
			"5-р сар",
			"6-р сар",
			"7-р сар",
			"8-р сар",
			"9-р сар",
			"10-р сар",
			"11-р сар",
			"12-р сар"
		],
		wide: [
			"нэгдүгээр сар",
			"хоёрдугаар сар",
			"гуравдугаар сар",
			"дөрөвдүгээр сар",
			"тавдугаар сар",
			"зургаадугаар сар",
			"долоодугаар сар",
			"наймдугаар сар",
			"есдүгээр сар",
			"аравдугаар сар",
			"арваннэгдүгээр сар",
			"арван хоёрдугаар сар"
		]
	};
	var dayValues$31 = {
		narrow: [
			"Н",
			"Д",
			"М",
			"Л",
			"П",
			"Б",
			"Б"
		],
		short: [
			"Ня",
			"Да",
			"Мя",
			"Лх",
			"Пү",
			"Ба",
			"Бя"
		],
		abbreviated: [
			"Ням",
			"Дав",
			"Мяг",
			"Лха",
			"Пүр",
			"Баа",
			"Бям"
		],
		wide: [
			"Ням",
			"Даваа",
			"Мягмар",
			"Лхагва",
			"Пүрэв",
			"Баасан",
			"Бямба"
		]
	};
	var formattingDayValues = {
		narrow: [
			"Н",
			"Д",
			"М",
			"Л",
			"П",
			"Б",
			"Б"
		],
		short: [
			"Ня",
			"Да",
			"Мя",
			"Лх",
			"Пү",
			"Ба",
			"Бя"
		],
		abbreviated: [
			"Ням",
			"Дав",
			"Мяг",
			"Лха",
			"Пүр",
			"Баа",
			"Бям"
		],
		wide: [
			"ням",
			"даваа",
			"мягмар",
			"лхагва",
			"пүрэв",
			"баасан",
			"бямба"
		]
	};
	var dayPeriodValues$31 = {
		narrow: {
			am: "ү.ө.",
			pm: "ү.х.",
			midnight: "шөнө дунд",
			noon: "үд дунд",
			morning: "өглөө",
			afternoon: "өдөр",
			evening: "орой",
			night: "шөнө"
		},
		abbreviated: {
			am: "ү.ө.",
			pm: "ү.х.",
			midnight: "шөнө дунд",
			noon: "үд дунд",
			morning: "өглөө",
			afternoon: "өдөр",
			evening: "орой",
			night: "шөнө"
		},
		wide: {
			am: "ү.ө.",
			pm: "ү.х.",
			midnight: "шөнө дунд",
			noon: "үд дунд",
			morning: "өглөө",
			afternoon: "өдөр",
			evening: "орой",
			night: "шөнө"
		}
	};
	var ordinalNumber$31 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mn.js
	/**
	* @category Locales
	* @summary Mongolian locale.
	* @language Mongolian
	* @iso-639-2 mon
	* @author Bilguun Ochirbat [@bilguun0203](https://github.com/bilguun0203)
	*/
	var mn = {
		code: "mn",
		formatDistance: formatDistance$31,
		formatLong: formatLong$31,
		formatRelative: formatRelative$31,
		localize: {
			ordinalNumber: ordinalNumber$31,
			era: buildLocalizeFn({
				values: eraValues$31,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$31,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$31,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$6,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$31,
				defaultWidth: "wide",
				formattingValues: formattingDayValues,
				defaultFormattingWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$31,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /\d+/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(нтө|нт)/i,
					abbreviated: /^(нтө|нт)/i,
					wide: /^(нийтийн тооллын өмнө|нийтийн тооллын)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(нтө|нийтийн тооллын өмнө)/i, /^(нт|нийтийн тооллын)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^(iv|iii|ii|i)/i,
					abbreviated: /^(iv|iii|ii|i) улирал/i,
					wide: /^[1-4]-р улирал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^(i(\s|$)|1)/i,
					/^(ii(\s|$)|2)/i,
					/^(iii(\s|$)|3)/i,
					/^(iv(\s|$)|4)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(xii|xi|x|ix|viii|vii|vi|v|iv|iii|ii|i)/i,
					abbreviated: /^(1-р сар|2-р сар|3-р сар|4-р сар|5-р сар|6-р сар|7-р сар|8-р сар|9-р сар|10-р сар|11-р сар|12-р сар)/i,
					wide: /^(нэгдүгээр сар|хоёрдугаар сар|гуравдугаар сар|дөрөвдүгээр сар|тавдугаар сар|зургаадугаар сар|долоодугаар сар|наймдугаар сар|есдүгээр сар|аравдугаар сар|арван нэгдүгээр сар|арван хоёрдугаар сар)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^i$/i,
						/^ii$/i,
						/^iii$/i,
						/^iv$/i,
						/^v$/i,
						/^vi$/i,
						/^vii$/i,
						/^viii$/i,
						/^ix$/i,
						/^x$/i,
						/^xi$/i,
						/^xii$/i
					],
					any: [
						/^(1|нэгдүгээр)/i,
						/^(2|хоёрдугаар)/i,
						/^(3|гуравдугаар)/i,
						/^(4|дөрөвдүгээр)/i,
						/^(5|тавдугаар)/i,
						/^(6|зургаадугаар)/i,
						/^(7|долоодугаар)/i,
						/^(8|наймдугаар)/i,
						/^(9|есдүгээр)/i,
						/^(10|аравдугаар)/i,
						/^(11|арван нэгдүгээр)/i,
						/^(12|арван хоёрдугаар)/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[ндмлпбб]/i,
					short: /^(ня|да|мя|лх|пү|ба|бя)/i,
					abbreviated: /^(ням|дав|мяг|лха|пүр|баа|бям)/i,
					wide: /^(ням|даваа|мягмар|лхагва|пүрэв|баасан|бямба)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^н/i,
						/^д/i,
						/^м/i,
						/^л/i,
						/^п/i,
						/^б/i,
						/^б/i
					],
					any: [
						/^ня/i,
						/^да/i,
						/^мя/i,
						/^лх/i,
						/^пү/i,
						/^ба/i,
						/^бя/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i,
					any: /^(ү\.ө\.|ү\.х\.|шөнө дунд|үд дунд|өглөө|өдөр|орой|шөнө)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ү\.ө\./i,
					pm: /^ү\.х\./i,
					midnight: /^шөнө дунд/i,
					noon: /^үд дунд/i,
					morning: /өглөө/i,
					afternoon: /өдөр/i,
					evening: /орой/i,
					night: /шөнө/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ms/_lib/formatDistance.js
	var formatDistanceLocale$30 = {
		lessThanXSeconds: {
			one: "kurang dari 1 saat",
			other: "kurang dari {{count}} saat"
		},
		xSeconds: {
			one: "1 saat",
			other: "{{count}} saat"
		},
		halfAMinute: "setengah minit",
		lessThanXMinutes: {
			one: "kurang dari 1 minit",
			other: "kurang dari {{count}} minit"
		},
		xMinutes: {
			one: "1 minit",
			other: "{{count}} minit"
		},
		aboutXHours: {
			one: "sekitar 1 jam",
			other: "sekitar {{count}} jam"
		},
		xHours: {
			one: "1 jam",
			other: "{{count}} jam"
		},
		xDays: {
			one: "1 hari",
			other: "{{count}} hari"
		},
		aboutXWeeks: {
			one: "sekitar 1 minggu",
			other: "sekitar {{count}} minggu"
		},
		xWeeks: {
			one: "1 minggu",
			other: "{{count}} minggu"
		},
		aboutXMonths: {
			one: "sekitar 1 bulan",
			other: "sekitar {{count}} bulan"
		},
		xMonths: {
			one: "1 bulan",
			other: "{{count}} bulan"
		},
		aboutXYears: {
			one: "sekitar 1 tahun",
			other: "sekitar {{count}} tahun"
		},
		xYears: {
			one: "1 tahun",
			other: "{{count}} tahun"
		},
		overXYears: {
			one: "lebih dari 1 tahun",
			other: "lebih dari {{count}} tahun"
		},
		almostXYears: {
			one: "hampir 1 tahun",
			other: "hampir {{count}} tahun"
		}
	};
	var formatDistance$30 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$30[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "dalam masa " + result;
		else return result + " yang lalu";
		return result;
	};
	var formatLong$30 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "d/M/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH.mm.ss",
				long: "HH.mm.ss",
				medium: "HH.mm",
				short: "HH.mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'pukul' {{time}}",
				long: "{{date}} 'pukul' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ms/_lib/formatRelative.js
	var formatRelativeLocale$30 = {
		lastWeek: "eeee 'lepas pada jam' p",
		yesterday: "'Semalam pada jam' p",
		today: "'Hari ini pada jam' p",
		tomorrow: "'Esok pada jam' p",
		nextWeek: "eeee 'pada jam' p",
		other: "P"
	};
	var formatRelative$30 = (token, _date, _baseDate, _options) => formatRelativeLocale$30[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ms/_lib/localize.js
	var eraValues$30 = {
		narrow: ["SM", "M"],
		abbreviated: ["SM", "M"],
		wide: ["Sebelum Masihi", "Masihi"]
	};
	var quarterValues$30 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"S1",
			"S2",
			"S3",
			"S4"
		],
		wide: [
			"Suku pertama",
			"Suku kedua",
			"Suku ketiga",
			"Suku keempat"
		]
	};
	var monthValues$30 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"O",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Feb",
			"Mac",
			"Apr",
			"Mei",
			"Jun",
			"Jul",
			"Ogo",
			"Sep",
			"Okt",
			"Nov",
			"Dis"
		],
		wide: [
			"Januari",
			"Februari",
			"Mac",
			"April",
			"Mei",
			"Jun",
			"Julai",
			"Ogos",
			"September",
			"Oktober",
			"November",
			"Disember"
		]
	};
	var dayValues$30 = {
		narrow: [
			"A",
			"I",
			"S",
			"R",
			"K",
			"J",
			"S"
		],
		short: [
			"Ahd",
			"Isn",
			"Sel",
			"Rab",
			"Kha",
			"Jum",
			"Sab"
		],
		abbreviated: [
			"Ahd",
			"Isn",
			"Sel",
			"Rab",
			"Kha",
			"Jum",
			"Sab"
		],
		wide: [
			"Ahad",
			"Isnin",
			"Selasa",
			"Rabu",
			"Khamis",
			"Jumaat",
			"Sabtu"
		]
	};
	var dayPeriodValues$30 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "tgh malam",
			noon: "tgh hari",
			morning: "pagi",
			afternoon: "tengah hari",
			evening: "petang",
			night: "malam"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "tengah hari",
			evening: "petang",
			night: "malam"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "tengah hari",
			evening: "petang",
			night: "malam"
		}
	};
	var formattingDayPeriodValues$24 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "tengah hari",
			evening: "petang",
			night: "malam"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "tengah hari",
			evening: "petang",
			night: "malam"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "tengah malam",
			noon: "tengah hari",
			morning: "pagi",
			afternoon: "tengah hari",
			evening: "petang",
			night: "malam"
		}
	};
	var ordinalNumber$30 = (dirtyNumber, _options) => {
		return "ke-" + Number(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ms.js
	/**
	* @category Locales
	* @summary Malay locale.
	* @language Malay
	* @iso-639-2 msa
	* @author Ruban Selvarajah [@Zyten](https://github.com/Zyten)
	*/
	var ms = {
		code: "ms",
		formatDistance: formatDistance$30,
		formatLong: formatLong$30,
		formatRelative: formatRelative$30,
		localize: {
			ordinalNumber: ordinalNumber$30,
			era: buildLocalizeFn({
				values: eraValues$30,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$30,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$30,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$30,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$30,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$24,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^ke-(\d+)?/i,
				parsePattern: /petama|\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(sm|m)/i,
					abbreviated: /^(s\.?\s?m\.?|m\.?)/i,
					wide: /^(sebelum masihi|masihi)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^s/i, /^(m)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^S[1234]/i,
					wide: /Suku (pertama|kedua|ketiga|keempat)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/pertama|1/i,
					/kedua|2/i,
					/ketiga|3/i,
					/keempat|4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mac|apr|mei|jun|jul|ogo|sep|okt|nov|dis)/i,
					wide: /^(januari|februari|mac|april|mei|jun|julai|ogos|september|oktober|november|disember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^o/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^ma/i,
						/^ap/i,
						/^me/i,
						/^jun/i,
						/^jul/i,
						/^og/i,
						/^s/i,
						/^ok/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[aisrkj]/i,
					short: /^(ahd|isn|sel|rab|kha|jum|sab)/i,
					abbreviated: /^(ahd|isn|sel|rab|kha|jum|sab)/i,
					wide: /^(ahad|isnin|selasa|rabu|khamis|jumaat|sabtu)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^a/i,
						/^i/i,
						/^s/i,
						/^r/i,
						/^k/i,
						/^j/i,
						/^s/i
					],
					any: [
						/^a/i,
						/^i/i,
						/^se/i,
						/^r/i,
						/^k/i,
						/^j/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(am|pm|tengah malam|tengah hari|pagi|petang|malam)/i,
					any: /^([ap]\.?\s?m\.?|tengah malam|tengah hari|pagi|petang|malam)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^pm/i,
					midnight: /^tengah m/i,
					noon: /^tengah h/i,
					morning: /pa/i,
					afternoon: /tengah h/i,
					evening: /pe/i,
					night: /m/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mt/_lib/formatDistance.js
	var formatDistanceLocale$29 = {
		lessThanXSeconds: {
			one: "inqas minn sekonda",
			other: "inqas minn {{count}} sekondi"
		},
		xSeconds: {
			one: "sekonda",
			other: "{{count}} sekondi"
		},
		halfAMinute: "nofs minuta",
		lessThanXMinutes: {
			one: "inqas minn minuta",
			other: "inqas minn {{count}} minuti"
		},
		xMinutes: {
			one: "minuta",
			other: "{{count}} minuti"
		},
		aboutXHours: {
			one: "madwar siegħa",
			other: "madwar {{count}} siegħat"
		},
		xHours: {
			one: "siegħa",
			other: "{{count}} siegħat"
		},
		xDays: {
			one: "ġurnata",
			other: "{{count}} ġranet"
		},
		aboutXWeeks: {
			one: "madwar ġimgħa",
			other: "madwar {{count}} ġimgħat"
		},
		xWeeks: {
			one: "ġimgħa",
			other: "{{count}} ġimgħat"
		},
		aboutXMonths: {
			one: "madwar xahar",
			other: "madwar {{count}} xhur"
		},
		xMonths: {
			one: "xahar",
			other: "{{count}} xhur"
		},
		aboutXYears: {
			one: "madwar sena",
			two: "madwar sentejn",
			other: "madwar {{count}} snin"
		},
		xYears: {
			one: "sena",
			two: "sentejn",
			other: "{{count}} snin"
		},
		overXYears: {
			one: "aktar minn sena",
			two: "aktar minn sentejn",
			other: "aktar minn {{count}} snin"
		},
		almostXYears: {
			one: "kważi sena",
			two: "kważi sentejn",
			other: "kważi {{count}} snin"
		}
	};
	var formatDistance$29 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$29[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else if (count === 2 && tokenValue.two) result = tokenValue.two;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "f'" + result;
		else return result + " ilu";
		return result;
	};
	var formatLong$29 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mt/_lib/formatRelative.js
	var formatRelativeLocale$29 = {
		lastWeek: "eeee 'li għadda' 'fil-'p",
		yesterday: "'Il-bieraħ fil-'p",
		today: "'Illum fil-'p",
		tomorrow: "'Għada fil-'p",
		nextWeek: "eeee 'fil-'p",
		other: "P"
	};
	var formatRelative$29 = (token, _date, _baseDate, _options) => formatRelativeLocale$29[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/mt/_lib/localize.js
	var eraValues$29 = {
		narrow: ["Q", "W"],
		abbreviated: ["QK", "WK"],
		wide: ["qabel Kristu", "wara Kristu"]
	};
	var quarterValues$29 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1. kwart",
			"2. kwart",
			"3. kwart",
			"4. kwart"
		]
	};
	var monthValues$29 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"Ġ",
			"L",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Fra",
			"Mar",
			"Apr",
			"Mej",
			"Ġun",
			"Lul",
			"Aww",
			"Set",
			"Ott",
			"Nov",
			"Diċ"
		],
		wide: [
			"Jannar",
			"Frar",
			"Marzu",
			"April",
			"Mejju",
			"Ġunju",
			"Lulju",
			"Awwissu",
			"Settembru",
			"Ottubru",
			"Novembru",
			"Diċembru"
		]
	};
	var dayValues$29 = {
		narrow: [
			"Ħ",
			"T",
			"T",
			"E",
			"Ħ",
			"Ġ",
			"S"
		],
		short: [
			"Ħa",
			"Tn",
			"Tl",
			"Er",
			"Ħa",
			"Ġi",
			"Si"
		],
		abbreviated: [
			"Ħad",
			"Tne",
			"Tli",
			"Erb",
			"Ħam",
			"Ġim",
			"Sib"
		],
		wide: [
			"Il-Ħadd",
			"It-Tnejn",
			"It-Tlieta",
			"L-Erbgħa",
			"Il-Ħamis",
			"Il-Ġimgħa",
			"Is-Sibt"
		]
	};
	var dayPeriodValues$29 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "nofsillejl",
			noon: "nofsinhar",
			morning: "għodwa",
			afternoon: "wara nofsinhar",
			evening: "filgħaxija",
			night: "lejl"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "nofsillejl",
			noon: "nofsinhar",
			morning: "għodwa",
			afternoon: "wara nofsinhar",
			evening: "filgħaxija",
			night: "lejl"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "nofsillejl",
			noon: "nofsinhar",
			morning: "għodwa",
			afternoon: "wara nofsinhar",
			evening: "filgħaxija",
			night: "lejl"
		}
	};
	var formattingDayPeriodValues$23 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "f'nofsillejl",
			noon: "f'nofsinhar",
			morning: "filgħodu",
			afternoon: "wara nofsinhar",
			evening: "filgħaxija",
			night: "billejl"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "f'nofsillejl",
			noon: "f'nofsinhar",
			morning: "filgħodu",
			afternoon: "wara nofsinhar",
			evening: "filgħaxija",
			night: "billejl"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "f'nofsillejl",
			noon: "f'nofsinhar",
			morning: "filgħodu",
			afternoon: "wara nofsinhar",
			evening: "filgħaxija",
			night: "billejl"
		}
	};
	var ordinalNumber$29 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "º";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/mt.js
	/**
	* @category Locales
	* @summary Maltese locale.
	* @language Maltese
	* @iso-639-2 mlt
	* @author Andras Matzon [@amatzon](@link https://github.com/amatzon)
	* @author Bryan Borg [@bryanMt](@link https://github.com/bryanMt)
	*/
	var mt = {
		code: "mt",
		formatDistance: formatDistance$29,
		formatLong: formatLong$29,
		formatRelative: formatRelative$29,
		localize: {
			ordinalNumber: ordinalNumber$29,
			era: buildLocalizeFn({
				values: eraValues$29,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$29,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$29,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$29,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$29,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$23,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(º)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(q|w)/i,
					abbreviated: /^(q\.?\s?k\.?|b\.?\s?c\.?\s?e\.?|w\.?\s?k\.?)/i,
					wide: /^(qabel kristu|before common era|wara kristu|common era)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(q|b)/i, /^(w|c)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^k[1234]/i,
					wide: /^[1234](\.)? kwart/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmaglsond]/i,
					abbreviated: /^(jan|fra|mar|apr|mej|ġun|lul|aww|set|ott|nov|diċ)/i,
					wide: /^(jannar|frar|marzu|april|mejju|ġunju|lulju|awwissu|settembru|ottubru|novembru|diċembru)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^ġ/i,
						/^l/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^mej/i,
						/^ġ/i,
						/^l/i,
						/^aw/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[ħteġs]/i,
					short: /^(ħa|tn|tl|er|ħa|ġi|si)/i,
					abbreviated: /^(ħad|tne|tli|erb|ħam|ġim|sib)/i,
					wide: /^(il-ħadd|it-tnejn|it-tlieta|l-erbgħa|il-ħamis|il-ġimgħa|is-sibt)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ħ/i,
						/^t/i,
						/^t/i,
						/^e/i,
						/^ħ/i,
						/^ġ/i,
						/^s/i
					],
					any: [
						/^(il-)?ħad/i,
						/^(it-)?tn/i,
						/^(it-)?tl/i,
						/^(l-)?er/i,
						/^(il-)?ham/i,
						/^(il-)?ġi/i,
						/^(is-)?si/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|f'nofsillejl|f'nofsinhar|(ta') (għodwa|wara nofsinhar|filgħaxija|lejl))/i,
					any: /^([ap]\.?\s?m\.?|f'nofsillejl|f'nofsinhar|(ta') (għodwa|wara nofsinhar|filgħaxija|lejl))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^f'nofsillejl/i,
					noon: /^f'nofsinhar/i,
					morning: /għodwa/i,
					afternoon: /wara(\s.*)nofsinhar/i,
					evening: /filgħaxija/i,
					night: /lejl/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nb/_lib/formatDistance.js
	var formatDistanceLocale$28 = {
		lessThanXSeconds: {
			one: "mindre enn ett sekund",
			other: "mindre enn {{count}} sekunder"
		},
		xSeconds: {
			one: "ett sekund",
			other: "{{count}} sekunder"
		},
		halfAMinute: "et halvt minutt",
		lessThanXMinutes: {
			one: "mindre enn ett minutt",
			other: "mindre enn {{count}} minutter"
		},
		xMinutes: {
			one: "ett minutt",
			other: "{{count}} minutter"
		},
		aboutXHours: {
			one: "omtrent en time",
			other: "omtrent {{count}} timer"
		},
		xHours: {
			one: "en time",
			other: "{{count}} timer"
		},
		xDays: {
			one: "en dag",
			other: "{{count}} dager"
		},
		aboutXWeeks: {
			one: "omtrent en uke",
			other: "omtrent {{count}} uker"
		},
		xWeeks: {
			one: "en uke",
			other: "{{count}} uker"
		},
		aboutXMonths: {
			one: "omtrent en måned",
			other: "omtrent {{count}} måneder"
		},
		xMonths: {
			one: "en måned",
			other: "{{count}} måneder"
		},
		aboutXYears: {
			one: "omtrent ett år",
			other: "omtrent {{count}} år"
		},
		xYears: {
			one: "ett år",
			other: "{{count}} år"
		},
		overXYears: {
			one: "over ett år",
			other: "over {{count}} år"
		},
		almostXYears: {
			one: "nesten ett år",
			other: "nesten {{count}} år"
		}
	};
	var formatDistance$28 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$28[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "om " + result;
		else return result + " siden";
		return result;
	};
	var formatLong$28 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d. MMMM y",
				long: "d. MMMM y",
				medium: "d. MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "'kl'. HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'kl.' {{time}}",
				long: "{{date}} 'kl.' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nb/_lib/formatRelative.js
	var formatRelativeLocale$28 = {
		lastWeek: "'forrige' eeee 'kl.' p",
		yesterday: "'i går kl.' p",
		today: "'i dag kl.' p",
		tomorrow: "'i morgen kl.' p",
		nextWeek: "EEEE 'kl.' p",
		other: "P"
	};
	var formatRelative$28 = (token, _date, _baseDate, _options) => formatRelativeLocale$28[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/nb/_lib/localize.js
	var eraValues$28 = {
		narrow: ["f.Kr.", "e.Kr."],
		abbreviated: ["f.Kr.", "e.Kr."],
		wide: ["før Kristus", "etter Kristus"]
	};
	var quarterValues$28 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$28 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mars",
			"apr.",
			"mai",
			"juni",
			"juli",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"des."
		],
		wide: [
			"januar",
			"februar",
			"mars",
			"april",
			"mai",
			"juni",
			"juli",
			"august",
			"september",
			"oktober",
			"november",
			"desember"
		]
	};
	var dayValues$28 = {
		narrow: [
			"S",
			"M",
			"T",
			"O",
			"T",
			"F",
			"L"
		],
		short: [
			"sø",
			"ma",
			"ti",
			"on",
			"to",
			"fr",
			"lø"
		],
		abbreviated: [
			"søn",
			"man",
			"tir",
			"ons",
			"tor",
			"fre",
			"lør"
		],
		wide: [
			"søndag",
			"mandag",
			"tirsdag",
			"onsdag",
			"torsdag",
			"fredag",
			"lørdag"
		]
	};
	var dayPeriodValues$28 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morg.",
			afternoon: "på etterm.",
			evening: "på kvelden",
			night: "på natten"
		},
		abbreviated: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morg.",
			afternoon: "på etterm.",
			evening: "på kvelden",
			night: "på natten"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morgenen",
			afternoon: "på ettermiddagen",
			evening: "på kvelden",
			night: "på natten"
		}
	};
	var ordinalNumber$28 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nb.js
	/**
	* @category Locales
	* @summary Norwegian Bokmål locale.
	* @language Norwegian Bokmål
	* @iso-639-2 nob
	* @author Hans-Kristian Koren [@Hanse](https://github.com/Hanse)
	* @author Mikolaj Grzyb [@mikolajgrzyb](https://github.com/mikolajgrzyb)
	* @author Dag Stuan [@dagstuan](https://github.com/dagstuan)
	*/
	var nb = {
		code: "nb",
		formatDistance: formatDistance$28,
		formatLong: formatLong$28,
		formatRelative: formatRelative$28,
		localize: {
			ordinalNumber: ordinalNumber$28,
			era: buildLocalizeFn({
				values: eraValues$28,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$28,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$28,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$28,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$28,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\.?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
					abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
					wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^f/i, /^e/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](\.)? kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
					wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^mai/i,
						/^jun/i,
						/^jul/i,
						/^aug/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtofl]/i,
					short: /^(sø|ma|ti|on|to|fr|lø)/i,
					abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
					wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^s/i,
					/^m/i,
					/^ti/i,
					/^o/i,
					/^to/i,
					/^f/i,
					/^l/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,
					any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a(\.?\s?m\.?)?$/i,
					pm: /^p(\.?\s?m\.?)?$/i,
					midnight: /^midn/i,
					noon: /^midd/i,
					morning: /morgen/i,
					afternoon: /ettermiddag/i,
					evening: /kveld/i,
					night: /natt/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl/_lib/formatDistance.js
	var formatDistanceLocale$27 = {
		lessThanXSeconds: {
			one: "minder dan een seconde",
			other: "minder dan {{count}} seconden"
		},
		xSeconds: {
			one: "1 seconde",
			other: "{{count}} seconden"
		},
		halfAMinute: "een halve minuut",
		lessThanXMinutes: {
			one: "minder dan een minuut",
			other: "minder dan {{count}} minuten"
		},
		xMinutes: {
			one: "een minuut",
			other: "{{count}} minuten"
		},
		aboutXHours: {
			one: "ongeveer 1 uur",
			other: "ongeveer {{count}} uur"
		},
		xHours: {
			one: "1 uur",
			other: "{{count}} uur"
		},
		xDays: {
			one: "1 dag",
			other: "{{count}} dagen"
		},
		aboutXWeeks: {
			one: "ongeveer 1 week",
			other: "ongeveer {{count}} weken"
		},
		xWeeks: {
			one: "1 week",
			other: "{{count}} weken"
		},
		aboutXMonths: {
			one: "ongeveer 1 maand",
			other: "ongeveer {{count}} maanden"
		},
		xMonths: {
			one: "1 maand",
			other: "{{count}} maanden"
		},
		aboutXYears: {
			one: "ongeveer 1 jaar",
			other: "ongeveer {{count}} jaar"
		},
		xYears: {
			one: "1 jaar",
			other: "{{count}} jaar"
		},
		overXYears: {
			one: "meer dan 1 jaar",
			other: "meer dan {{count}} jaar"
		},
		almostXYears: {
			one: "bijna 1 jaar",
			other: "bijna {{count}} jaar"
		}
	};
	var formatDistance$27 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$27[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "over " + result;
		else return result + " geleden";
		return result;
	};
	var formatLong$27 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd-MM-y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'om' {{time}}",
				long: "{{date}} 'om' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl/_lib/formatRelative.js
	var formatRelativeLocale$27 = {
		lastWeek: "'afgelopen' eeee 'om' p",
		yesterday: "'gisteren om' p",
		today: "'vandaag om' p",
		tomorrow: "'morgen om' p",
		nextWeek: "eeee 'om' p",
		other: "P"
	};
	var formatRelative$27 = (token, _date, _baseDate, _options) => formatRelativeLocale$27[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl/_lib/localize.js
	var eraValues$27 = {
		narrow: ["v.C.", "n.C."],
		abbreviated: ["v.Chr.", "n.Chr."],
		wide: ["voor Christus", "na Christus"]
	};
	var quarterValues$27 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1e kwartaal",
			"2e kwartaal",
			"3e kwartaal",
			"4e kwartaal"
		]
	};
	var monthValues$27 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mrt.",
			"apr.",
			"mei",
			"jun.",
			"jul.",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"januari",
			"februari",
			"maart",
			"april",
			"mei",
			"juni",
			"juli",
			"augustus",
			"september",
			"oktober",
			"november",
			"december"
		]
	};
	var dayValues$27 = {
		narrow: [
			"Z",
			"M",
			"D",
			"W",
			"D",
			"V",
			"Z"
		],
		short: [
			"zo",
			"ma",
			"di",
			"wo",
			"do",
			"vr",
			"za"
		],
		abbreviated: [
			"zon",
			"maa",
			"din",
			"woe",
			"don",
			"vri",
			"zat"
		],
		wide: [
			"zondag",
			"maandag",
			"dinsdag",
			"woensdag",
			"donderdag",
			"vrijdag",
			"zaterdag"
		]
	};
	var dayPeriodValues$27 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "het middaguur",
			morning: "'s ochtends",
			afternoon: "'s middags",
			evening: "'s avonds",
			night: "'s nachts"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "het middaguur",
			morning: "'s ochtends",
			afternoon: "'s middags",
			evening: "'s avonds",
			night: "'s nachts"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "het middaguur",
			morning: "'s ochtends",
			afternoon: "'s middags",
			evening: "'s avonds",
			night: "'s nachts"
		}
	};
	var ordinalNumber$27 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "e";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl.js
	/**
	* @category Locales
	* @summary Dutch locale.
	* @language Dutch
	* @iso-639-2 nld
	* @author Jorik Tangelder [@jtangelder](https://github.com/jtangelder)
	* @author Ruben Stolk [@rubenstolk](https://github.com/rubenstolk)
	* @author Lode Vanhove [@bitcrumb](https://github.com/bitcrumb)
	* @author Edo Rivai [@edorivai](https://github.com/edorivai)
	* @author Niels Keurentjes [@curry684](https://github.com/curry684)
	* @author Stefan Vermaas [@stefanvermaas](https://github.com/stefanvermaas)
	*/
	var nl$2 = {
		code: "nl",
		formatDistance: formatDistance$27,
		formatLong: formatLong$27,
		formatRelative: formatRelative$27,
		localize: {
			ordinalNumber: ordinalNumber$27,
			era: buildLocalizeFn({
				values: eraValues$27,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$27,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$27,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$27,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$27,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)e?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^([vn]\.? ?C\.?)/,
					abbreviated: /^([vn]\. ?Chr\.?)/,
					wide: /^((voor|na) Christus)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^v/, /^n/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^K[1234]/i,
					wide: /^[1234]e kwartaal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
					wide: /^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^jan/i,
						/^feb/i,
						/^m(r|a)/i,
						/^apr/i,
						/^mei/i,
						/^jun/i,
						/^jul/i,
						/^aug/i,
						/^sep/i,
						/^okt/i,
						/^nov/i,
						/^dec/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[zmdwv]/i,
					short: /^(zo|ma|di|wo|do|vr|za)/i,
					abbreviated: /^(zon|maa|din|woe|don|vri|zat)/i,
					wide: /^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^z/i,
						/^m/i,
						/^d/i,
						/^w/i,
						/^d/i,
						/^v/i,
						/^z/i
					],
					any: [
						/^zo/i,
						/^ma/i,
						/^di/i,
						/^wo/i,
						/^do/i,
						/^vr/i,
						/^za/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^am/i,
					pm: /^pm/i,
					midnight: /^middernacht/i,
					noon: /^het middaguur/i,
					morning: /ochtend/i,
					afternoon: /middag/i,
					evening: /avond/i,
					night: /nacht/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl-BE/_lib/formatDistance.js
	var formatDistanceLocale$26 = {
		lessThanXSeconds: {
			one: "minder dan een seconde",
			other: "minder dan {{count}} seconden"
		},
		xSeconds: {
			one: "1 seconde",
			other: "{{count}} seconden"
		},
		halfAMinute: "een halve minuut",
		lessThanXMinutes: {
			one: "minder dan een minuut",
			other: "minder dan {{count}} minuten"
		},
		xMinutes: {
			one: "een minuut",
			other: "{{count}} minuten"
		},
		aboutXHours: {
			one: "ongeveer 1 uur",
			other: "ongeveer {{count}} uur"
		},
		xHours: {
			one: "1 uur",
			other: "{{count}} uur"
		},
		xDays: {
			one: "1 dag",
			other: "{{count}} dagen"
		},
		aboutXWeeks: {
			one: "ongeveer 1 week",
			other: "ongeveer {{count}} weken"
		},
		xWeeks: {
			one: "1 week",
			other: "{{count}} weken"
		},
		aboutXMonths: {
			one: "ongeveer 1 maand",
			other: "ongeveer {{count}} maanden"
		},
		xMonths: {
			one: "1 maand",
			other: "{{count}} maanden"
		},
		aboutXYears: {
			one: "ongeveer 1 jaar",
			other: "ongeveer {{count}} jaar"
		},
		xYears: {
			one: "1 jaar",
			other: "{{count}} jaar"
		},
		overXYears: {
			one: "meer dan 1 jaar",
			other: "meer dan {{count}} jaar"
		},
		almostXYears: {
			one: "bijna 1 jaar",
			other: "bijna {{count}} jaar"
		}
	};
	var formatDistance$26 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$26[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "over " + result;
		else return result + " geleden";
		return result;
	};
	var formatLong$26 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'om' {{time}}",
				long: "{{date}} 'om' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl-BE/_lib/formatRelative.js
	var formatRelativeLocale$26 = {
		lastWeek: "'vorige' eeee 'om' p",
		yesterday: "'gisteren om' p",
		today: "'vandaag om' p",
		tomorrow: "'morgen om' p",
		nextWeek: "eeee 'om' p",
		other: "P"
	};
	var formatRelative$26 = (token, _date, _baseDate, _options) => formatRelativeLocale$26[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl-BE/_lib/localize.js
	var eraValues$26 = {
		narrow: ["v.C.", "n.C."],
		abbreviated: ["v.Chr.", "n.Chr."],
		wide: ["voor Christus", "na Christus"]
	};
	var quarterValues$26 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"K1",
			"K2",
			"K3",
			"K4"
		],
		wide: [
			"1e kwartaal",
			"2e kwartaal",
			"3e kwartaal",
			"4e kwartaal"
		]
	};
	var monthValues$26 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mrt.",
			"apr.",
			"mei",
			"jun.",
			"jul.",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"januari",
			"februari",
			"maart",
			"april",
			"mei",
			"juni",
			"juli",
			"augustus",
			"september",
			"oktober",
			"november",
			"december"
		]
	};
	var dayValues$26 = {
		narrow: [
			"Z",
			"M",
			"D",
			"W",
			"D",
			"V",
			"Z"
		],
		short: [
			"zo",
			"ma",
			"di",
			"wo",
			"do",
			"vr",
			"za"
		],
		abbreviated: [
			"zon",
			"maa",
			"din",
			"woe",
			"don",
			"vri",
			"zat"
		],
		wide: [
			"zondag",
			"maandag",
			"dinsdag",
			"woensdag",
			"donderdag",
			"vrijdag",
			"zaterdag"
		]
	};
	var dayPeriodValues$26 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "het middag",
			morning: "'s ochtends",
			afternoon: "'s namiddags",
			evening: "'s avonds",
			night: "'s nachts"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "het middag",
			morning: "'s ochtends",
			afternoon: "'s namiddags",
			evening: "'s avonds",
			night: "'s nachts"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "middernacht",
			noon: "het middag",
			morning: "'s ochtends",
			afternoon: "'s namiddags",
			evening: "'s avonds",
			night: "'s nachts"
		}
	};
	var ordinalNumber$26 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "e";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nl-BE.js
	/**
	* @category Locales
	* @summary Dutch locale.
	* @language Dutch
	* @iso-639-2 nld
	* @author Jorik Tangelder [@jtangelder](https://github.com/jtangelder)
	* @author Ruben Stolk [@rubenstolk](https://github.com/rubenstolk)
	* @author Lode Vanhove [@bitcrumb](https://github.com/bitcrumb)
	* @author Alex Hoeing [@dcbn](https://github.com/dcbn)
	*/
	var nlBE = {
		code: "nl-BE",
		formatDistance: formatDistance$26,
		formatLong: formatLong$26,
		formatRelative: formatRelative$26,
		localize: {
			ordinalNumber: ordinalNumber$26,
			era: buildLocalizeFn({
				values: eraValues$26,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$26,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$26,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$26,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$26,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)e?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^([vn]\.? ?C\.?)/,
					abbreviated: /^([vn]\. ?Chr\.?)/,
					wide: /^((voor|na) Christus)/
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^v/, /^n/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^K[1234]/i,
					wide: /^[1234]e kwartaal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,
					wide: /^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^jan/i,
						/^feb/i,
						/^m(r|a)/i,
						/^apr/i,
						/^mei/i,
						/^jun/i,
						/^jul/i,
						/^aug/i,
						/^sep/i,
						/^okt/i,
						/^nov/i,
						/^dec/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[zmdwv]/i,
					short: /^(zo|ma|di|wo|do|vr|za)/i,
					abbreviated: /^(zon|maa|din|woe|don|vri|zat)/i,
					wide: /^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^z/i,
						/^m/i,
						/^d/i,
						/^w/i,
						/^d/i,
						/^v/i,
						/^z/i
					],
					any: [
						/^zo/i,
						/^ma/i,
						/^di/i,
						/^wo/i,
						/^do/i,
						/^vr/i,
						/^za/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^am/i,
					pm: /^pm/i,
					midnight: /^middernacht/i,
					noon: /^het middaguur/i,
					morning: /ochtend/i,
					afternoon: /middag/i,
					evening: /avond/i,
					night: /nacht/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nn/_lib/formatDistance.js
	var formatDistanceLocale$25 = {
		lessThanXSeconds: {
			one: "mindre enn eitt sekund",
			other: "mindre enn {{count}} sekund"
		},
		xSeconds: {
			one: "eitt sekund",
			other: "{{count}} sekund"
		},
		halfAMinute: "eit halvt minutt",
		lessThanXMinutes: {
			one: "mindre enn eitt minutt",
			other: "mindre enn {{count}} minutt"
		},
		xMinutes: {
			one: "eitt minutt",
			other: "{{count}} minutt"
		},
		aboutXHours: {
			one: "omtrent ein time",
			other: "omtrent {{count}} timar"
		},
		xHours: {
			one: "ein time",
			other: "{{count}} timar"
		},
		xDays: {
			one: "ein dag",
			other: "{{count}} dagar"
		},
		aboutXWeeks: {
			one: "omtrent ei veke",
			other: "omtrent {{count}} veker"
		},
		xWeeks: {
			one: "ei veke",
			other: "{{count}} veker"
		},
		aboutXMonths: {
			one: "omtrent ein månad",
			other: "omtrent {{count}} månader"
		},
		xMonths: {
			one: "ein månad",
			other: "{{count}} månader"
		},
		aboutXYears: {
			one: "omtrent eitt år",
			other: "omtrent {{count}} år"
		},
		xYears: {
			one: "eitt år",
			other: "{{count}} år"
		},
		overXYears: {
			one: "over eitt år",
			other: "over {{count}} år"
		},
		almostXYears: {
			one: "nesten eitt år",
			other: "nesten {{count}} år"
		}
	};
	var wordMapping$1 = [
		"null",
		"ein",
		"to",
		"tre",
		"fire",
		"fem",
		"seks",
		"sju",
		"åtte",
		"ni",
		"ti",
		"elleve",
		"tolv"
	];
	var formatDistance$25 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$25[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count < 13 ? wordMapping$1[count] : String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "om " + result;
		else return result + " sidan";
		return result;
	};
	var formatLong$25 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d. MMMM y",
				long: "d. MMMM y",
				medium: "d. MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "'kl'. HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'kl.' {{time}}",
				long: "{{date}} 'kl.' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nn/_lib/formatRelative.js
	var formatRelativeLocale$25 = {
		lastWeek: "'førre' eeee 'kl.' p",
		yesterday: "'i går kl.' p",
		today: "'i dag kl.' p",
		tomorrow: "'i morgon kl.' p",
		nextWeek: "EEEE 'kl.' p",
		other: "P"
	};
	var formatRelative$25 = (token, _date, _baseDate, _options) => formatRelativeLocale$25[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/nn/_lib/localize.js
	var eraValues$25 = {
		narrow: ["f.Kr.", "e.Kr."],
		abbreviated: ["f.Kr.", "e.Kr."],
		wide: ["før Kristus", "etter Kristus"]
	};
	var quarterValues$25 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$25 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mars",
			"apr.",
			"mai",
			"juni",
			"juli",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"des."
		],
		wide: [
			"januar",
			"februar",
			"mars",
			"april",
			"mai",
			"juni",
			"juli",
			"august",
			"september",
			"oktober",
			"november",
			"desember"
		]
	};
	var dayValues$25 = {
		narrow: [
			"S",
			"M",
			"T",
			"O",
			"T",
			"F",
			"L"
		],
		short: [
			"su",
			"må",
			"ty",
			"on",
			"to",
			"fr",
			"lau"
		],
		abbreviated: [
			"sun",
			"mån",
			"tys",
			"ons",
			"tor",
			"fre",
			"laur"
		],
		wide: [
			"sundag",
			"måndag",
			"tysdag",
			"onsdag",
			"torsdag",
			"fredag",
			"laurdag"
		]
	};
	var dayPeriodValues$25 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morg.",
			afternoon: "på etterm.",
			evening: "på kvelden",
			night: "på natta"
		},
		abbreviated: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morg.",
			afternoon: "på etterm.",
			evening: "på kvelden",
			night: "på natta"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morgonen",
			afternoon: "på ettermiddagen",
			evening: "på kvelden",
			night: "på natta"
		}
	};
	var ordinalNumber$25 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/nn.js
	/**
	* @category Locales
	* @summary Norwegian Nynorsk locale.
	* @language Norwegian Nynorsk
	* @iso-639-2 nno
	* @author Mats Byrkjeland [@draperunner](https://github.com/draperunner)
	*/
	var nn = {
		code: "nn",
		formatDistance: formatDistance$25,
		formatLong: formatLong$25,
		formatRelative: formatRelative$25,
		localize: {
			ordinalNumber: ordinalNumber$25,
			era: buildLocalizeFn({
				values: eraValues$25,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$25,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$25,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$25,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$25,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\.?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
					abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
					wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^f/i, /^e/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](\.)? kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
					wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^mai/i,
						/^jun/i,
						/^jul/i,
						/^aug/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtofl]/i,
					short: /^(su|må|ty|on|to|fr|la)/i,
					abbreviated: /^(sun|mån|tys|ons|tor|fre|laur)/i,
					wide: /^(sundag|måndag|tysdag|onsdag|torsdag|fredag|laurdag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^s/i,
					/^m/i,
					/^ty/i,
					/^o/i,
					/^to/i,
					/^f/i,
					/^l/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta)|[ap])/i,
					any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a(\.?\s?m\.?)?$/i,
					pm: /^p(\.?\s?m\.?)?$/i,
					midnight: /^midn/i,
					noon: /^midd/i,
					morning: /morgon/i,
					afternoon: /ettermiddag/i,
					evening: /kveld/i,
					night: /natt/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/oc/_lib/formatDistance.js
	var formatDistanceLocale$24 = {
		lessThanXSeconds: {
			one: "mens d’una segonda",
			other: "mens de {{count}} segondas"
		},
		xSeconds: {
			one: "1 segonda",
			other: "{{count}} segondas"
		},
		halfAMinute: "30 segondas",
		lessThanXMinutes: {
			one: "mens d’una minuta",
			other: "mens de {{count}} minutas"
		},
		xMinutes: {
			one: "1 minuta",
			other: "{{count}} minutas"
		},
		aboutXHours: {
			one: "environ 1 ora",
			other: "environ {{count}} oras"
		},
		xHours: {
			one: "1 ora",
			other: "{{count}} oras"
		},
		xDays: {
			one: "1 jorn",
			other: "{{count}} jorns"
		},
		aboutXWeeks: {
			one: "environ 1 setmana",
			other: "environ {{count}} setmanas"
		},
		xWeeks: {
			one: "1 setmana",
			other: "{{count}} setmanas"
		},
		aboutXMonths: {
			one: "environ 1 mes",
			other: "environ {{count}} meses"
		},
		xMonths: {
			one: "1 mes",
			other: "{{count}} meses"
		},
		aboutXYears: {
			one: "environ 1 an",
			other: "environ {{count}} ans"
		},
		xYears: {
			one: "1 an",
			other: "{{count}} ans"
		},
		overXYears: {
			one: "mai d’un an",
			other: "mai de {{count}} ans"
		},
		almostXYears: {
			one: "gaireben un an",
			other: "gaireben {{count}} ans"
		}
	};
	var formatDistance$24 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$24[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "d’aquí " + result;
		else return "fa " + result;
		return result;
	};
	var formatLong$24 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d 'de' MMMM y",
				long: "d 'de' MMMM y",
				medium: "d MMM y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'a' {{time}}",
				long: "{{date}} 'a' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/oc/_lib/formatRelative.js
	var formatRelativeLocale$24 = {
		lastWeek: "eeee 'passat a' p",
		yesterday: "'ièr a' p",
		today: "'uèi a' p",
		tomorrow: "'deman a' p",
		nextWeek: "eeee 'a' p",
		other: "P"
	};
	var formatRelative$24 = (token, _date, _baseDate, _options) => formatRelativeLocale$24[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/oc/_lib/localize.js
	var eraValues$24 = {
		narrow: ["ab. J.C.", "apr. J.C."],
		abbreviated: ["ab. J.C.", "apr. J.C."],
		wide: ["abans Jèsus-Crist", "après Jèsus-Crist"]
	};
	var quarterValues$24 = {
		narrow: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		abbreviated: [
			"1èr trim.",
			"2nd trim.",
			"3en trim.",
			"4en trim."
		],
		wide: [
			"1èr trimèstre",
			"2nd trimèstre",
			"3en trimèstre",
			"4en trimèstre"
		]
	};
	var monthValues$24 = {
		narrow: [
			"GN",
			"FB",
			"MÇ",
			"AB",
			"MA",
			"JN",
			"JL",
			"AG",
			"ST",
			"OC",
			"NV",
			"DC"
		],
		abbreviated: [
			"gen.",
			"febr.",
			"març",
			"abr.",
			"mai",
			"junh",
			"jul.",
			"ag.",
			"set.",
			"oct.",
			"nov.",
			"dec."
		],
		wide: [
			"genièr",
			"febrièr",
			"març",
			"abril",
			"mai",
			"junh",
			"julhet",
			"agost",
			"setembre",
			"octòbre",
			"novembre",
			"decembre"
		]
	};
	var dayValues$24 = {
		narrow: [
			"dg.",
			"dl.",
			"dm.",
			"dc.",
			"dj.",
			"dv.",
			"ds."
		],
		short: [
			"dg.",
			"dl.",
			"dm.",
			"dc.",
			"dj.",
			"dv.",
			"ds."
		],
		abbreviated: [
			"dg.",
			"dl.",
			"dm.",
			"dc.",
			"dj.",
			"dv.",
			"ds."
		],
		wide: [
			"dimenge",
			"diluns",
			"dimars",
			"dimècres",
			"dijòus",
			"divendres",
			"dissabte"
		]
	};
	var dayPeriodValues$24 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "mièjanuèch",
			noon: "miègjorn",
			morning: "matin",
			afternoon: "aprèp-miègjorn",
			evening: "vèspre",
			night: "nuèch"
		},
		abbreviated: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "mièjanuèch",
			noon: "miègjorn",
			morning: "matin",
			afternoon: "aprèp-miègjorn",
			evening: "vèspre",
			night: "nuèch"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "mièjanuèch",
			noon: "miègjorn",
			morning: "matin",
			afternoon: "aprèp-miègjorn",
			evening: "vèspre",
			night: "nuèch"
		}
	};
	var formattingDayPeriodValues$22 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "mièjanuèch",
			noon: "miègjorn",
			morning: "del matin",
			afternoon: "de l’aprèp-miègjorn",
			evening: "del ser",
			night: "de la nuèch"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "mièjanuèch",
			noon: "miègjorn",
			morning: "del matin",
			afternoon: "de l’aprèp-miègjorn",
			evening: "del ser",
			night: "de la nuèch"
		},
		wide: {
			am: "ante meridiem",
			pm: "post meridiem",
			midnight: "mièjanuèch",
			noon: "miègjorn",
			morning: "del matin",
			afternoon: "de l’aprèp-miègjorn",
			evening: "del ser",
			night: "de la nuèch"
		}
	};
	var ordinalNumber$24 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const unit = options?.unit;
		let ordinal;
		switch (number) {
			case 1:
				ordinal = "èr";
				break;
			case 2:
				ordinal = "nd";
				break;
			default: ordinal = "en";
		}
		if (unit === "year" || unit === "week" || unit === "hour" || unit === "minute" || unit === "second") ordinal += "a";
		return number + ordinal;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/oc.js
	/**
	* @category Locales
	* @summary Occitan locale.
	* @language Occitan
	* @iso-639-2 oci
	* @author Quentin PAGÈS
	*/
	var oc = {
		code: "oc",
		formatDistance: formatDistance$24,
		formatLong: formatLong$24,
		formatRelative: formatRelative$24,
		localize: {
			ordinalNumber: ordinalNumber$24,
			era: buildLocalizeFn({
				values: eraValues$24,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$24,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$24,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$24,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$24,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$22,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(èr|nd|en)?[a]?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ab\.J\.C|apr\.J\.C|apr\.J\.-C)/i,
					abbreviated: /^(ab\.J\.-C|ab\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
					wide: /^(abans Jèsus-Crist|après Jèsus-Crist)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^ab/i, /^ap/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^T[1234]/i,
					abbreviated: /^[1234](èr|nd|en)? trim\.?/i,
					wide: /^[1234](èr|nd|en)? trimèstre/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(GN|FB|MÇ|AB|MA|JN|JL|AG|ST|OC|NV|DC)/i,
					abbreviated: /^(gen|febr|març|abr|mai|junh|jul|ag|set|oct|nov|dec)\.?/i,
					wide: /^(genièr|febrièr|març|abril|mai|junh|julhet|agost|setembre|octòbre|novembre|decembre)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^g/i,
					/^f/i,
					/^ma[r?]|MÇ/i,
					/^ab/i,
					/^ma[i?]/i,
					/^ju[n?]|JN/i,
					/^ju[l?]|JL/i,
					/^ag/i,
					/^s/i,
					/^o/i,
					/^n/i,
					/^d/i
				] },
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^d[glmcjvs]\.?/i,
					short: /^d[glmcjvs]\.?/i,
					abbreviated: /^d[glmcjvs]\.?/i,
					wide: /^(dimenge|diluns|dimars|dimècres|dijòus|divendres|dissabte)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^dg/i,
						/^dl/i,
						/^dm/i,
						/^dc/i,
						/^dj/i,
						/^dv/i,
						/^ds/i
					],
					short: [
						/^dg/i,
						/^dl/i,
						/^dm/i,
						/^dc/i,
						/^dj/i,
						/^dv/i,
						/^ds/i
					],
					abbreviated: [
						/^dg/i,
						/^dl/i,
						/^dm/i,
						/^dc/i,
						/^dj/i,
						/^dv/i,
						/^ds/i
					],
					any: [
						/^dg|dime/i,
						/^dl|dil/i,
						/^dm|dima/i,
						/^dc|dimè/i,
						/^dj|dij/i,
						/^dv|div/i,
						/^ds|dis/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /(^(a\.?m|p\.?m))|(ante meridiem|post meridiem)|((del |de la |de l’)(matin|aprèp-miègjorn|vèspre|ser|nuèch))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /(^a)|ante meridiem/i,
					pm: /(^p)|post meridiem/i,
					midnight: /^mièj/i,
					noon: /^mièg/i,
					morning: /matin/i,
					afternoon: /aprèp-miègjorn/i,
					evening: /vèspre|ser/i,
					night: /nuèch/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pl/_lib/formatDistance.js
	var formatDistanceLocale$23 = {
		lessThanXSeconds: {
			one: {
				regular: "mniej niż sekunda",
				past: "mniej niż sekundę",
				future: "mniej niż sekundę"
			},
			twoFour: "mniej niż {{count}} sekundy",
			other: "mniej niż {{count}} sekund"
		},
		xSeconds: {
			one: {
				regular: "sekunda",
				past: "sekundę",
				future: "sekundę"
			},
			twoFour: "{{count}} sekundy",
			other: "{{count}} sekund"
		},
		halfAMinute: {
			one: "pół minuty",
			twoFour: "pół minuty",
			other: "pół minuty"
		},
		lessThanXMinutes: {
			one: {
				regular: "mniej niż minuta",
				past: "mniej niż minutę",
				future: "mniej niż minutę"
			},
			twoFour: "mniej niż {{count}} minuty",
			other: "mniej niż {{count}} minut"
		},
		xMinutes: {
			one: {
				regular: "minuta",
				past: "minutę",
				future: "minutę"
			},
			twoFour: "{{count}} minuty",
			other: "{{count}} minut"
		},
		aboutXHours: {
			one: {
				regular: "około godziny",
				past: "około godziny",
				future: "około godzinę"
			},
			twoFour: "około {{count}} godziny",
			other: "około {{count}} godzin"
		},
		xHours: {
			one: {
				regular: "godzina",
				past: "godzinę",
				future: "godzinę"
			},
			twoFour: "{{count}} godziny",
			other: "{{count}} godzin"
		},
		xDays: {
			one: {
				regular: "dzień",
				past: "dzień",
				future: "1 dzień"
			},
			twoFour: "{{count}} dni",
			other: "{{count}} dni"
		},
		aboutXWeeks: {
			one: "około tygodnia",
			twoFour: "około {{count}} tygodni",
			other: "około {{count}} tygodni"
		},
		xWeeks: {
			one: "tydzień",
			twoFour: "{{count}} tygodnie",
			other: "{{count}} tygodni"
		},
		aboutXMonths: {
			one: "około miesiąc",
			twoFour: "około {{count}} miesiące",
			other: "około {{count}} miesięcy"
		},
		xMonths: {
			one: "miesiąc",
			twoFour: "{{count}} miesiące",
			other: "{{count}} miesięcy"
		},
		aboutXYears: {
			one: "około rok",
			twoFour: "około {{count}} lata",
			other: "około {{count}} lat"
		},
		xYears: {
			one: "rok",
			twoFour: "{{count}} lata",
			other: "{{count}} lat"
		},
		overXYears: {
			one: "ponad rok",
			twoFour: "ponad {{count}} lata",
			other: "ponad {{count}} lat"
		},
		almostXYears: {
			one: "prawie rok",
			twoFour: "prawie {{count}} lata",
			other: "prawie {{count}} lat"
		}
	};
	function declensionGroup$1(scheme, count) {
		if (count === 1) return scheme.one;
		const rem100 = count % 100;
		if (rem100 <= 20 && rem100 > 10) return scheme.other;
		const rem10 = rem100 % 10;
		if (rem10 >= 2 && rem10 <= 4) return scheme.twoFour;
		return scheme.other;
	}
	function declension$3(scheme, count, time) {
		const group = declensionGroup$1(scheme, count);
		return (typeof group === "string" ? group : group[time]).replace("{{count}}", String(count));
	}
	var formatDistance$23 = (token, count, options) => {
		const scheme = formatDistanceLocale$23[token];
		if (!options?.addSuffix) return declension$3(scheme, count, "regular");
		if (options.comparison && options.comparison > 0) return "za " + declension$3(scheme, count, "future");
		else return declension$3(scheme, count, "past") + " temu";
	};
	var formatLong$23 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y",
				long: "do MMMM y",
				medium: "do MMM y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pl/_lib/formatRelative.js
	var adjectivesLastWeek = {
		masculine: "ostatni",
		feminine: "ostatnia"
	};
	var adjectivesThisWeek = {
		masculine: "ten",
		feminine: "ta"
	};
	var adjectivesNextWeek = {
		masculine: "następny",
		feminine: "następna"
	};
	var dayGrammaticalGender = {
		0: "feminine",
		1: "masculine",
		2: "masculine",
		3: "feminine",
		4: "masculine",
		5: "masculine",
		6: "feminine"
	};
	function dayAndTimeWithAdjective(token, date, baseDate, options) {
		let adjectives;
		if (isSameWeek(date, baseDate, options)) adjectives = adjectivesThisWeek;
		else if (token === "lastWeek") adjectives = adjectivesLastWeek;
		else if (token === "nextWeek") adjectives = adjectivesNextWeek;
		else throw new Error(`Cannot determine adjectives for token ${token}`);
		const grammaticalGender = dayGrammaticalGender[date.getDay()];
		return `'${adjectives[grammaticalGender]}' eeee 'o' p`;
	}
	var formatRelativeLocale$23 = {
		lastWeek: dayAndTimeWithAdjective,
		yesterday: "'wczoraj o' p",
		today: "'dzisiaj o' p",
		tomorrow: "'jutro o' p",
		nextWeek: dayAndTimeWithAdjective,
		other: "P"
	};
	var formatRelative$23 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$23[token];
		if (typeof format === "function") return format(token, date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pl/_lib/localize.js
	var eraValues$23 = {
		narrow: ["p.n.e.", "n.e."],
		abbreviated: ["p.n.e.", "n.e."],
		wide: ["przed naszą erą", "naszej ery"]
	};
	var quarterValues$23 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"I kw.",
			"II kw.",
			"III kw.",
			"IV kw."
		],
		wide: [
			"I kwartał",
			"II kwartał",
			"III kwartał",
			"IV kwartał"
		]
	};
	var monthValues$23 = {
		narrow: [
			"S",
			"L",
			"M",
			"K",
			"M",
			"C",
			"L",
			"S",
			"W",
			"P",
			"L",
			"G"
		],
		abbreviated: [
			"sty",
			"lut",
			"mar",
			"kwi",
			"maj",
			"cze",
			"lip",
			"sie",
			"wrz",
			"paź",
			"lis",
			"gru"
		],
		wide: [
			"styczeń",
			"luty",
			"marzec",
			"kwiecień",
			"maj",
			"czerwiec",
			"lipiec",
			"sierpień",
			"wrzesień",
			"październik",
			"listopad",
			"grudzień"
		]
	};
	var monthFormattingValues = {
		narrow: [
			"s",
			"l",
			"m",
			"k",
			"m",
			"c",
			"l",
			"s",
			"w",
			"p",
			"l",
			"g"
		],
		abbreviated: [
			"sty",
			"lut",
			"mar",
			"kwi",
			"maj",
			"cze",
			"lip",
			"sie",
			"wrz",
			"paź",
			"lis",
			"gru"
		],
		wide: [
			"stycznia",
			"lutego",
			"marca",
			"kwietnia",
			"maja",
			"czerwca",
			"lipca",
			"sierpnia",
			"września",
			"października",
			"listopada",
			"grudnia"
		]
	};
	var dayValues$23 = {
		narrow: [
			"N",
			"P",
			"W",
			"Ś",
			"C",
			"P",
			"S"
		],
		short: [
			"nie",
			"pon",
			"wto",
			"śro",
			"czw",
			"pią",
			"sob"
		],
		abbreviated: [
			"niedz.",
			"pon.",
			"wt.",
			"śr.",
			"czw.",
			"pt.",
			"sob."
		],
		wide: [
			"niedziela",
			"poniedziałek",
			"wtorek",
			"środa",
			"czwartek",
			"piątek",
			"sobota"
		]
	};
	var dayFormattingValues = {
		narrow: [
			"n",
			"p",
			"w",
			"ś",
			"c",
			"p",
			"s"
		],
		short: [
			"nie",
			"pon",
			"wto",
			"śro",
			"czw",
			"pią",
			"sob"
		],
		abbreviated: [
			"niedz.",
			"pon.",
			"wt.",
			"śr.",
			"czw.",
			"pt.",
			"sob."
		],
		wide: [
			"niedziela",
			"poniedziałek",
			"wtorek",
			"środa",
			"czwartek",
			"piątek",
			"sobota"
		]
	};
	var dayPeriodValues$23 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "półn.",
			noon: "poł",
			morning: "rano",
			afternoon: "popoł.",
			evening: "wiecz.",
			night: "noc"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "północ",
			noon: "południe",
			morning: "rano",
			afternoon: "popołudnie",
			evening: "wieczór",
			night: "noc"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "północ",
			noon: "południe",
			morning: "rano",
			afternoon: "popołudnie",
			evening: "wieczór",
			night: "noc"
		}
	};
	var dayPeriodFormattingValues = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "o półn.",
			noon: "w poł.",
			morning: "rano",
			afternoon: "po poł.",
			evening: "wiecz.",
			night: "w nocy"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "o północy",
			noon: "w południe",
			morning: "rano",
			afternoon: "po południu",
			evening: "wieczorem",
			night: "w nocy"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "o północy",
			noon: "w południe",
			morning: "rano",
			afternoon: "po południu",
			evening: "wieczorem",
			night: "w nocy"
		}
	};
	var ordinalNumber$23 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pl.js
	/**
	* @category Locales
	* @summary Polish locale.
	* @language Polish
	* @iso-639-2 pol
	* @author Mateusz Derks [@ertrzyiks](https://github.com/ertrzyiks)
	* @author Just RAG [@justrag](https://github.com/justrag)
	* @author Mikolaj Grzyb [@mikolajgrzyb](https://github.com/mikolajgrzyb)
	* @author Mateusz Tokarski [@mutisz](https://github.com/mutisz)
	*/
	var pl = {
		code: "pl",
		formatDistance: formatDistance$23,
		formatLong: formatLong$23,
		formatRelative: formatRelative$23,
		localize: {
			ordinalNumber: ordinalNumber$23,
			era: buildLocalizeFn({
				values: eraValues$23,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$23,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$23,
				defaultWidth: "wide",
				formattingValues: monthFormattingValues,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$23,
				defaultWidth: "wide",
				formattingValues: dayFormattingValues,
				defaultFormattingWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$23,
				defaultWidth: "wide",
				formattingValues: dayPeriodFormattingValues,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,
					abbreviated: /^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,
					wide: /^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^p/i, /^n/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^(I|II|III|IV)\s*kw\.?/i,
					wide: /^(I|II|III|IV)\s*kwarta(ł|l)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/1/i,
						/2/i,
						/3/i,
						/4/i
					],
					any: [
						/^I kw/i,
						/^II kw/i,
						/^III kw/i,
						/^IV kw/i
					]
				},
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[slmkcwpg]/i,
					abbreviated: /^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,
					wide: /^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^l/i,
						/^m/i,
						/^k/i,
						/^m/i,
						/^c/i,
						/^l/i,
						/^s/i,
						/^w/i,
						/^p/i,
						/^l/i,
						/^g/i
					],
					any: [
						/^st/i,
						/^lu/i,
						/^mar/i,
						/^k/i,
						/^maj/i,
						/^c/i,
						/^lip/i,
						/^si/i,
						/^w/i,
						/^p/i,
						/^lis/i,
						/^g/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[npwścs]/i,
					short: /^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,
					abbreviated: /^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,
					wide: /^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^n/i,
						/^p/i,
						/^w/i,
						/^ś/i,
						/^c/i,
						/^p/i,
						/^s/i
					],
					abbreviated: [
						/^n/i,
						/^po/i,
						/^w/i,
						/^(ś|s)r/i,
						/^c/i,
						/^pt/i,
						/^so/i
					],
					any: [
						/^n/i,
						/^po/i,
						/^w/i,
						/^(ś|s)r/i,
						/^c/i,
						/^pi/i,
						/^so/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,
					any: /^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: {
					narrow: {
						am: /^a$/i,
						pm: /^p$/i,
						midnight: /pó(ł|l)n/i,
						noon: /po(ł|l)/i,
						morning: /rano/i,
						afternoon: /po\s*po(ł|l)/i,
						evening: /wiecz/i,
						night: /noc/i
					},
					any: {
						am: /^am/i,
						pm: /^pm/i,
						midnight: /pó(ł|l)n/i,
						noon: /po(ł|l)/i,
						morning: /rano/i,
						afternoon: /po\s*po(ł|l)/i,
						evening: /wiecz/i,
						night: /noc/i
					}
				},
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt/_lib/formatDistance.js
	var formatDistanceLocale$22 = {
		lessThanXSeconds: {
			one: "menos de um segundo",
			other: "menos de {{count}} segundos"
		},
		xSeconds: {
			one: "1 segundo",
			other: "{{count}} segundos"
		},
		halfAMinute: "meio minuto",
		lessThanXMinutes: {
			one: "menos de um minuto",
			other: "menos de {{count}} minutos"
		},
		xMinutes: {
			one: "1 minuto",
			other: "{{count}} minutos"
		},
		aboutXHours: {
			one: "aproximadamente 1 hora",
			other: "aproximadamente {{count}} horas"
		},
		xHours: {
			one: "1 hora",
			other: "{{count}} horas"
		},
		xDays: {
			one: "1 dia",
			other: "{{count}} dias"
		},
		aboutXWeeks: {
			one: "aproximadamente 1 semana",
			other: "aproximadamente {{count}} semanas"
		},
		xWeeks: {
			one: "1 semana",
			other: "{{count}} semanas"
		},
		aboutXMonths: {
			one: "aproximadamente 1 mês",
			other: "aproximadamente {{count}} meses"
		},
		xMonths: {
			one: "1 mês",
			other: "{{count}} meses"
		},
		aboutXYears: {
			one: "aproximadamente 1 ano",
			other: "aproximadamente {{count}} anos"
		},
		xYears: {
			one: "1 ano",
			other: "{{count}} anos"
		},
		overXYears: {
			one: "mais de 1 ano",
			other: "mais de {{count}} anos"
		},
		almostXYears: {
			one: "quase 1 ano",
			other: "quase {{count}} anos"
		}
	};
	var formatDistance$22 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$22[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "daqui a " + result;
		else return "há " + result;
		return result;
	};
	var formatLong$22 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d 'de' MMMM 'de' y",
				long: "d 'de' MMMM 'de' y",
				medium: "d 'de' MMM 'de' y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'às' {{time}}",
				long: "{{date}} 'às' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt/_lib/formatRelative.js
	var formatRelativeLocale$22 = {
		lastWeek: (date) => {
			const weekday = date.getDay();
			return "'" + (weekday === 0 || weekday === 6 ? "último" : "última") + "' eeee 'às' p";
		},
		yesterday: "'ontem às' p",
		today: "'hoje às' p",
		tomorrow: "'amanhã às' p",
		nextWeek: "eeee 'às' p",
		other: "P"
	};
	var formatRelative$22 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$22[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt/_lib/localize.js
	var eraValues$22 = {
		narrow: ["aC", "dC"],
		abbreviated: ["a.C.", "d.C."],
		wide: ["antes de Cristo", "depois de Cristo"]
	};
	var quarterValues$22 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"1º trimestre",
			"2º trimestre",
			"3º trimestre",
			"4º trimestre"
		]
	};
	var monthValues$22 = {
		narrow: [
			"j",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"jan",
			"fev",
			"mar",
			"abr",
			"mai",
			"jun",
			"jul",
			"ago",
			"set",
			"out",
			"nov",
			"dez"
		],
		wide: [
			"janeiro",
			"fevereiro",
			"março",
			"abril",
			"maio",
			"junho",
			"julho",
			"agosto",
			"setembro",
			"outubro",
			"novembro",
			"dezembro"
		]
	};
	var dayValues$22 = {
		narrow: [
			"d",
			"s",
			"t",
			"q",
			"q",
			"s",
			"s"
		],
		short: [
			"dom",
			"seg",
			"ter",
			"qua",
			"qui",
			"sex",
			"sáb"
		],
		abbreviated: [
			"dom",
			"seg",
			"ter",
			"qua",
			"qui",
			"sex",
			"sáb"
		],
		wide: [
			"domingo",
			"segunda-feira",
			"terça-feira",
			"quarta-feira",
			"quinta-feira",
			"sexta-feira",
			"sábado"
		]
	};
	var dayPeriodValues$22 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "manhã",
			afternoon: "tarde",
			evening: "noite",
			night: "madrugada"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "manhã",
			afternoon: "tarde",
			evening: "noite",
			night: "madrugada"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "manhã",
			afternoon: "tarde",
			evening: "noite",
			night: "madrugada"
		}
	};
	var formattingDayPeriodValues$21 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "da manhã",
			afternoon: "da tarde",
			evening: "da noite",
			night: "da madrugada"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "da manhã",
			afternoon: "da tarde",
			evening: "da noite",
			night: "da madrugada"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "da manhã",
			afternoon: "da tarde",
			evening: "da noite",
			night: "da madrugada"
		}
	};
	var ordinalNumber$22 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "º";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt.js
	/**
	* @category Locales
	* @summary Portuguese locale.
	* @language Portuguese
	* @iso-639-2 por
	* @author Dário Freire [@dfreire](https://github.com/dfreire)
	* @author Adrián de la Rosa [@adrm](https://github.com/adrm)
	*/
	var pt = {
		code: "pt",
		formatDistance: formatDistance$22,
		formatLong: formatLong$22,
		formatRelative: formatRelative$22,
		localize: {
			ordinalNumber: ordinalNumber$22,
			era: buildLocalizeFn({
				values: eraValues$22,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$22,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$22,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$22,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$22,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$21,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(º|ª)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ac|dc|a|d)/i,
					abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
					wide: /^(antes de cristo|antes da era comum|depois de cristo|era comum)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					any: [/^ac/i, /^dc/i],
					wide: [/^(antes de cristo|antes da era comum)/i, /^(depois de cristo|era comum)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^T[1234]/i,
					wide: /^[1234](º|ª)? trimestre/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
					wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ab/i,
						/^mai/i,
						/^jun/i,
						/^jul/i,
						/^ag/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dstq]/i,
					short: /^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,
					abbreviated: /^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,
					wide: /^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^s/i,
						/^t/i,
						/^q/i,
						/^q/i,
						/^s/i,
						/^s/i
					],
					any: [
						/^d/i,
						/^seg/i,
						/^t/i,
						/^qua/i,
						/^qui/i,
						/^sex/i,
						/^s[áa]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,
					any: /^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^meia/i,
					noon: /^meio/i,
					morning: /manh[ãa]/i,
					afternoon: /tarde/i,
					evening: /noite/i,
					night: /madrugada/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt-BR/_lib/formatDistance.js
	var formatDistanceLocale$21 = {
		lessThanXSeconds: {
			one: "menos de um segundo",
			other: "menos de {{count}} segundos"
		},
		xSeconds: {
			one: "1 segundo",
			other: "{{count}} segundos"
		},
		halfAMinute: "meio minuto",
		lessThanXMinutes: {
			one: "menos de um minuto",
			other: "menos de {{count}} minutos"
		},
		xMinutes: {
			one: "1 minuto",
			other: "{{count}} minutos"
		},
		aboutXHours: {
			one: "cerca de 1 hora",
			other: "cerca de {{count}} horas"
		},
		xHours: {
			one: "1 hora",
			other: "{{count}} horas"
		},
		xDays: {
			one: "1 dia",
			other: "{{count}} dias"
		},
		aboutXWeeks: {
			one: "cerca de 1 semana",
			other: "cerca de {{count}} semanas"
		},
		xWeeks: {
			one: "1 semana",
			other: "{{count}} semanas"
		},
		aboutXMonths: {
			one: "cerca de 1 mês",
			other: "cerca de {{count}} meses"
		},
		xMonths: {
			one: "1 mês",
			other: "{{count}} meses"
		},
		aboutXYears: {
			one: "cerca de 1 ano",
			other: "cerca de {{count}} anos"
		},
		xYears: {
			one: "1 ano",
			other: "{{count}} anos"
		},
		overXYears: {
			one: "mais de 1 ano",
			other: "mais de {{count}} anos"
		},
		almostXYears: {
			one: "quase 1 ano",
			other: "quase {{count}} anos"
		}
	};
	var formatDistance$21 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$21[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "em " + result;
		else return "há " + result;
		return result;
	};
	var formatLong$21 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d 'de' MMMM 'de' y",
				long: "d 'de' MMMM 'de' y",
				medium: "d MMM y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'às' {{time}}",
				long: "{{date}} 'às' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt-BR/_lib/formatRelative.js
	var formatRelativeLocale$21 = {
		lastWeek: (date) => {
			const weekday = date.getDay();
			return "'" + (weekday === 0 || weekday === 6 ? "último" : "última") + "' eeee 'às' p";
		},
		yesterday: "'ontem às' p",
		today: "'hoje às' p",
		tomorrow: "'amanhã às' p",
		nextWeek: "eeee 'às' p",
		other: "P"
	};
	var formatRelative$21 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$21[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt-BR/_lib/localize.js
	var eraValues$21 = {
		narrow: ["AC", "DC"],
		abbreviated: ["AC", "DC"],
		wide: ["antes de cristo", "depois de cristo"]
	};
	var quarterValues$21 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"1º trimestre",
			"2º trimestre",
			"3º trimestre",
			"4º trimestre"
		]
	};
	var monthValues$21 = {
		narrow: [
			"j",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"jan",
			"fev",
			"mar",
			"abr",
			"mai",
			"jun",
			"jul",
			"ago",
			"set",
			"out",
			"nov",
			"dez"
		],
		wide: [
			"janeiro",
			"fevereiro",
			"março",
			"abril",
			"maio",
			"junho",
			"julho",
			"agosto",
			"setembro",
			"outubro",
			"novembro",
			"dezembro"
		]
	};
	var dayValues$21 = {
		narrow: [
			"D",
			"S",
			"T",
			"Q",
			"Q",
			"S",
			"S"
		],
		short: [
			"dom",
			"seg",
			"ter",
			"qua",
			"qui",
			"sex",
			"sab"
		],
		abbreviated: [
			"domingo",
			"segunda",
			"terça",
			"quarta",
			"quinta",
			"sexta",
			"sábado"
		],
		wide: [
			"domingo",
			"segunda-feira",
			"terça-feira",
			"quarta-feira",
			"quinta-feira",
			"sexta-feira",
			"sábado"
		]
	};
	var dayPeriodValues$21 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "md",
			morning: "manhã",
			afternoon: "tarde",
			evening: "tarde",
			night: "noite"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "manhã",
			afternoon: "tarde",
			evening: "tarde",
			night: "noite"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "manhã",
			afternoon: "tarde",
			evening: "tarde",
			night: "noite"
		}
	};
	var formattingDayPeriodValues$20 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "md",
			morning: "da manhã",
			afternoon: "da tarde",
			evening: "da tarde",
			night: "da noite"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "da manhã",
			afternoon: "da tarde",
			evening: "da tarde",
			night: "da noite"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "meia-noite",
			noon: "meio-dia",
			morning: "da manhã",
			afternoon: "da tarde",
			evening: "da tarde",
			night: "da noite"
		}
	};
	var ordinalNumber$21 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		if (options?.unit === "week") return number + "ª";
		return number + "º";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/pt-BR.js
	/**
	* @category Locales
	* @summary Portuguese locale (Brazil).
	* @language Portuguese
	* @iso-639-2 por
	* @author Lucas Duailibe [@duailibe](https://github.com/duailibe)
	* @author Yago Carballo [@yagocarballo](https://github.com/YagoCarballo)
	*/
	var ptBR = {
		code: "pt-BR",
		formatDistance: formatDistance$21,
		formatLong: formatLong$21,
		formatRelative: formatRelative$21,
		localize: {
			ordinalNumber: ordinalNumber$21,
			era: buildLocalizeFn({
				values: eraValues$21,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$21,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$21,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$21,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$21,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$20,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)[ºªo]?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ac|dc|a|d)/i,
					abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
					wide: /^(antes de cristo|depois de cristo)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					any: [/^ac/i, /^dc/i],
					wide: [/^antes de cristo/i, /^depois de cristo/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^T[1234]/i,
					wide: /^[1234](º)? trimestre/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmajsond]/i,
					abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
					wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^fev/i,
						/^mar/i,
						/^abr/i,
						/^mai/i,
						/^jun/i,
						/^jul/i,
						/^ago/i,
						/^set/i,
						/^out/i,
						/^nov/i,
						/^dez/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(dom|[23456]ª?|s[aá]b)/i,
					short: /^(dom|[23456]ª?|s[aá]b)/i,
					abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
					wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					short: [
						/^d/i,
						/^2/i,
						/^3/i,
						/^4/i,
						/^5/i,
						/^6/i,
						/^s[aá]/i
					],
					narrow: [
						/^d/i,
						/^2/i,
						/^3/i,
						/^4/i,
						/^5/i,
						/^6/i,
						/^s[aá]/i
					],
					any: [
						/^d/i,
						/^seg/i,
						/^t/i,
						/^qua/i,
						/^qui/i,
						/^sex/i,
						/^s[aá]b/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
					any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mn|^meia[-\s]noite/i,
					noon: /^md|^meio[-\s]dia/i,
					morning: /manhã/i,
					afternoon: /tarde/i,
					evening: /tarde/i,
					night: /noite/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ro/_lib/formatDistance.js
	var formatDistanceLocale$20 = {
		lessThanXSeconds: {
			one: "mai puțin de o secundă",
			other: "mai puțin de {{count}} secunde"
		},
		xSeconds: {
			one: "1 secundă",
			other: "{{count}} secunde"
		},
		halfAMinute: "jumătate de minut",
		lessThanXMinutes: {
			one: "mai puțin de un minut",
			other: "mai puțin de {{count}} minute"
		},
		xMinutes: {
			one: "1 minut",
			other: "{{count}} minute"
		},
		aboutXHours: {
			one: "circa 1 oră",
			other: "circa {{count}} ore"
		},
		xHours: {
			one: "1 oră",
			other: "{{count}} ore"
		},
		xDays: {
			one: "1 zi",
			other: "{{count}} zile"
		},
		aboutXWeeks: {
			one: "circa o săptămână",
			other: "circa {{count}} săptămâni"
		},
		xWeeks: {
			one: "1 săptămână",
			other: "{{count}} săptămâni"
		},
		aboutXMonths: {
			one: "circa 1 lună",
			other: "circa {{count}} luni"
		},
		xMonths: {
			one: "1 lună",
			other: "{{count}} luni"
		},
		aboutXYears: {
			one: "circa 1 an",
			other: "circa {{count}} ani"
		},
		xYears: {
			one: "1 an",
			other: "{{count}} ani"
		},
		overXYears: {
			one: "peste 1 an",
			other: "peste {{count}} ani"
		},
		almostXYears: {
			one: "aproape 1 an",
			other: "aproape {{count}} ani"
		}
	};
	var formatDistance$20 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$20[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "în " + result;
		else return result + " în urmă";
		return result;
	};
	var formatLong$20 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM yyyy",
				long: "d MMMM yyyy",
				medium: "d MMM yyyy",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'la' {{time}}",
				long: "{{date}} 'la' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ro/_lib/formatRelative.js
	var formatRelativeLocale$20 = {
		lastWeek: "eeee 'trecută la' p",
		yesterday: "'ieri la' p",
		today: "'astăzi la' p",
		tomorrow: "'mâine la' p",
		nextWeek: "eeee 'viitoare la' p",
		other: "P"
	};
	var formatRelative$20 = (token, _date, _baseDate, _options) => formatRelativeLocale$20[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ro/_lib/localize.js
	var eraValues$20 = {
		narrow: ["Î", "D"],
		abbreviated: ["Î.d.C.", "D.C."],
		wide: ["Înainte de Cristos", "După Cristos"]
	};
	var quarterValues$20 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"T1",
			"T2",
			"T3",
			"T4"
		],
		wide: [
			"primul trimestru",
			"al doilea trimestru",
			"al treilea trimestru",
			"al patrulea trimestru"
		]
	};
	var monthValues$20 = {
		narrow: [
			"I",
			"F",
			"M",
			"A",
			"M",
			"I",
			"I",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"ian",
			"feb",
			"mar",
			"apr",
			"mai",
			"iun",
			"iul",
			"aug",
			"sep",
			"oct",
			"noi",
			"dec"
		],
		wide: [
			"ianuarie",
			"februarie",
			"martie",
			"aprilie",
			"mai",
			"iunie",
			"iulie",
			"august",
			"septembrie",
			"octombrie",
			"noiembrie",
			"decembrie"
		]
	};
	var dayValues$20 = {
		narrow: [
			"d",
			"l",
			"m",
			"m",
			"j",
			"v",
			"s"
		],
		short: [
			"du",
			"lu",
			"ma",
			"mi",
			"jo",
			"vi",
			"sâ"
		],
		abbreviated: [
			"dum",
			"lun",
			"mar",
			"mie",
			"joi",
			"vin",
			"sâm"
		],
		wide: [
			"duminică",
			"luni",
			"marți",
			"miercuri",
			"joi",
			"vineri",
			"sâmbătă"
		]
	};
	var dayPeriodValues$20 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "ami",
			morning: "dim",
			afternoon: "da",
			evening: "s",
			night: "n"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "miezul nopții",
			noon: "amiază",
			morning: "dimineață",
			afternoon: "după-amiază",
			evening: "seară",
			night: "noapte"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "miezul nopții",
			noon: "amiază",
			morning: "dimineață",
			afternoon: "după-amiază",
			evening: "seară",
			night: "noapte"
		}
	};
	var formattingDayPeriodValues$19 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "mn",
			noon: "amiază",
			morning: "dimineață",
			afternoon: "după-amiază",
			evening: "seară",
			night: "noapte"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "miezul nopții",
			noon: "amiază",
			morning: "dimineață",
			afternoon: "după-amiază",
			evening: "seară",
			night: "noapte"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "miezul nopții",
			noon: "amiază",
			morning: "dimineață",
			afternoon: "după-amiază",
			evening: "seară",
			night: "noapte"
		}
	};
	var ordinalNumber$20 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ro.js
	/**
	* @category Locales
	* @summary Romanian locale.
	* @language Romanian
	* @iso-639-2 ron
	* @author Sergiu Munteanu [@jsergiu](https://github.com/jsergiu)
	* @author Adrian Ocneanu [@aocneanu](https://github.com/aocneanu)
	* @author Mihai Ocneanu [@gandesc](https://github.com/gandesc)
	*/
	var ro = {
		code: "ro",
		formatDistance: formatDistance$20,
		formatLong: formatLong$20,
		formatRelative: formatRelative$20,
		localize: {
			ordinalNumber: ordinalNumber$20,
			era: buildLocalizeFn({
				values: eraValues$20,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$20,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$20,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$20,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$20,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$19,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(Î|D)/i,
					abbreviated: /^(Î\.?\s?d\.?\s?C\.?|Î\.?\s?e\.?\s?n\.?|D\.?\s?C\.?|e\.?\s?n\.?)/i,
					wide: /^(Înainte de Cristos|Înaintea erei noastre|După Cristos|Era noastră)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					any: [/^ÎC/i, /^DC/i],
					wide: [/^(Înainte de Cristos|Înaintea erei noastre)/i, /^(După Cristos|Era noastră)/i]
				},
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^T[1234]/i,
					wide: /^trimestrul [1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[ifmaasond]/i,
					abbreviated: /^(ian|feb|mar|apr|mai|iun|iul|aug|sep|oct|noi|dec)/i,
					wide: /^(ianuarie|februarie|martie|aprilie|mai|iunie|iulie|august|septembrie|octombrie|noiembrie|decembrie)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^i/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^i/i,
						/^i/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ia/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^mai/i,
						/^iun/i,
						/^iul/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dlmjvs]/i,
					short: /^(d|l|ma|mi|j|v|s)/i,
					abbreviated: /^(dum|lun|mar|mie|jo|vi|sâ)/i,
					wide: /^(duminica|luni|marţi|miercuri|joi|vineri|sâmbătă)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^l/i,
						/^m/i,
						/^m/i,
						/^j/i,
						/^v/i,
						/^s/i
					],
					any: [
						/^d/i,
						/^l/i,
						/^ma/i,
						/^mi/i,
						/^j/i,
						/^v/i,
						/^s/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|mn|a|(dimineaţa|după-amiaza|seara|noaptea))/i,
					any: /^([ap]\.?\s?m\.?|miezul nopții|amiaza|(dimineaţa|după-amiaza|seara|noaptea))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^mn/i,
					noon: /amiaza/i,
					morning: /dimineaţa/i,
					afternoon: /după-amiaza/i,
					evening: /seara/i,
					night: /noaptea/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ru/_lib/formatDistance.js
	function declension$2(scheme, count) {
		if (scheme.one !== void 0 && count === 1) return scheme.one;
		const rem10 = count % 10;
		const rem100 = count % 100;
		if (rem10 === 1 && rem100 !== 11) return scheme.singularNominative.replace("{{count}}", String(count));
		else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) return scheme.singularGenitive.replace("{{count}}", String(count));
		else return scheme.pluralGenitive.replace("{{count}}", String(count));
	}
	function buildLocalizeTokenFn$1(scheme) {
		return (count, options) => {
			if (options?.addSuffix) if (options.comparison && options.comparison > 0) if (scheme.future) return declension$2(scheme.future, count);
			else return "через " + declension$2(scheme.regular, count);
			else if (scheme.past) return declension$2(scheme.past, count);
			else return declension$2(scheme.regular, count) + " назад";
			else return declension$2(scheme.regular, count);
		};
	}
	var formatDistanceLocale$19 = {
		lessThanXSeconds: buildLocalizeTokenFn$1({
			regular: {
				one: "меньше секунды",
				singularNominative: "меньше {{count}} секунды",
				singularGenitive: "меньше {{count}} секунд",
				pluralGenitive: "меньше {{count}} секунд"
			},
			future: {
				one: "меньше, чем через секунду",
				singularNominative: "меньше, чем через {{count}} секунду",
				singularGenitive: "меньше, чем через {{count}} секунды",
				pluralGenitive: "меньше, чем через {{count}} секунд"
			}
		}),
		xSeconds: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "{{count}} секунда",
				singularGenitive: "{{count}} секунды",
				pluralGenitive: "{{count}} секунд"
			},
			past: {
				singularNominative: "{{count}} секунду назад",
				singularGenitive: "{{count}} секунды назад",
				pluralGenitive: "{{count}} секунд назад"
			},
			future: {
				singularNominative: "через {{count}} секунду",
				singularGenitive: "через {{count}} секунды",
				pluralGenitive: "через {{count}} секунд"
			}
		}),
		halfAMinute: (_count, options) => {
			if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "через полминуты";
			else return "полминуты назад";
			return "полминуты";
		},
		lessThanXMinutes: buildLocalizeTokenFn$1({
			regular: {
				one: "меньше минуты",
				singularNominative: "меньше {{count}} минуты",
				singularGenitive: "меньше {{count}} минут",
				pluralGenitive: "меньше {{count}} минут"
			},
			future: {
				one: "меньше, чем через минуту",
				singularNominative: "меньше, чем через {{count}} минуту",
				singularGenitive: "меньше, чем через {{count}} минуты",
				pluralGenitive: "меньше, чем через {{count}} минут"
			}
		}),
		xMinutes: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "{{count}} минута",
				singularGenitive: "{{count}} минуты",
				pluralGenitive: "{{count}} минут"
			},
			past: {
				singularNominative: "{{count}} минуту назад",
				singularGenitive: "{{count}} минуты назад",
				pluralGenitive: "{{count}} минут назад"
			},
			future: {
				singularNominative: "через {{count}} минуту",
				singularGenitive: "через {{count}} минуты",
				pluralGenitive: "через {{count}} минут"
			}
		}),
		aboutXHours: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "около {{count}} часа",
				singularGenitive: "около {{count}} часов",
				pluralGenitive: "около {{count}} часов"
			},
			future: {
				singularNominative: "приблизительно через {{count}} час",
				singularGenitive: "приблизительно через {{count}} часа",
				pluralGenitive: "приблизительно через {{count}} часов"
			}
		}),
		xHours: buildLocalizeTokenFn$1({ regular: {
			singularNominative: "{{count}} час",
			singularGenitive: "{{count}} часа",
			pluralGenitive: "{{count}} часов"
		} }),
		xDays: buildLocalizeTokenFn$1({ regular: {
			singularNominative: "{{count}} день",
			singularGenitive: "{{count}} дня",
			pluralGenitive: "{{count}} дней"
		} }),
		aboutXWeeks: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "около {{count}} недели",
				singularGenitive: "около {{count}} недель",
				pluralGenitive: "около {{count}} недель"
			},
			future: {
				singularNominative: "приблизительно через {{count}} неделю",
				singularGenitive: "приблизительно через {{count}} недели",
				pluralGenitive: "приблизительно через {{count}} недель"
			}
		}),
		xWeeks: buildLocalizeTokenFn$1({ regular: {
			singularNominative: "{{count}} неделя",
			singularGenitive: "{{count}} недели",
			pluralGenitive: "{{count}} недель"
		} }),
		aboutXMonths: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "около {{count}} месяца",
				singularGenitive: "около {{count}} месяцев",
				pluralGenitive: "около {{count}} месяцев"
			},
			future: {
				singularNominative: "приблизительно через {{count}} месяц",
				singularGenitive: "приблизительно через {{count}} месяца",
				pluralGenitive: "приблизительно через {{count}} месяцев"
			}
		}),
		xMonths: buildLocalizeTokenFn$1({ regular: {
			singularNominative: "{{count}} месяц",
			singularGenitive: "{{count}} месяца",
			pluralGenitive: "{{count}} месяцев"
		} }),
		aboutXYears: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "около {{count}} года",
				singularGenitive: "около {{count}} лет",
				pluralGenitive: "около {{count}} лет"
			},
			future: {
				singularNominative: "приблизительно через {{count}} год",
				singularGenitive: "приблизительно через {{count}} года",
				pluralGenitive: "приблизительно через {{count}} лет"
			}
		}),
		xYears: buildLocalizeTokenFn$1({ regular: {
			singularNominative: "{{count}} год",
			singularGenitive: "{{count}} года",
			pluralGenitive: "{{count}} лет"
		} }),
		overXYears: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "больше {{count}} года",
				singularGenitive: "больше {{count}} лет",
				pluralGenitive: "больше {{count}} лет"
			},
			future: {
				singularNominative: "больше, чем через {{count}} год",
				singularGenitive: "больше, чем через {{count}} года",
				pluralGenitive: "больше, чем через {{count}} лет"
			}
		}),
		almostXYears: buildLocalizeTokenFn$1({
			regular: {
				singularNominative: "почти {{count}} год",
				singularGenitive: "почти {{count}} года",
				pluralGenitive: "почти {{count}} лет"
			},
			future: {
				singularNominative: "почти через {{count}} год",
				singularGenitive: "почти через {{count}} года",
				pluralGenitive: "почти через {{count}} лет"
			}
		})
	};
	var formatDistance$19 = (token, count, options) => {
		return formatDistanceLocale$19[token](count, options);
	};
	var formatLong$19 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM y 'г.'",
				long: "d MMMM y 'г.'",
				medium: "d MMM y 'г.'",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}}, {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ru/_lib/formatRelative.js
	var accusativeWeekdays$2 = [
		"воскресенье",
		"понедельник",
		"вторник",
		"среду",
		"четверг",
		"пятницу",
		"субботу"
	];
	function lastWeek$2(day) {
		const weekday = accusativeWeekdays$2[day];
		switch (day) {
			case 0: return "'в прошлое " + weekday + " в' p";
			case 1:
			case 2:
			case 4: return "'в прошлый " + weekday + " в' p";
			case 3:
			case 5:
			case 6: return "'в прошлую " + weekday + " в' p";
		}
	}
	function thisWeek$2(day) {
		const weekday = accusativeWeekdays$2[day];
		if (day === 2) return "'во " + weekday + " в' p";
		else return "'в " + weekday + " в' p";
	}
	function nextWeek$2(day) {
		const weekday = accusativeWeekdays$2[day];
		switch (day) {
			case 0: return "'в следующее " + weekday + " в' p";
			case 1:
			case 2:
			case 4: return "'в следующий " + weekday + " в' p";
			case 3:
			case 5:
			case 6: return "'в следующую " + weekday + " в' p";
		}
	}
	var formatRelativeLocale$19 = {
		lastWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$2(day);
			else return lastWeek$2(day);
		},
		yesterday: "'вчера в' p",
		today: "'сегодня в' p",
		tomorrow: "'завтра в' p",
		nextWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$2(day);
			else return nextWeek$2(day);
		},
		other: "P"
	};
	var formatRelative$19 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$19[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ru/_lib/localize.js
	var eraValues$19 = {
		narrow: ["до н.э.", "н.э."],
		abbreviated: ["до н. э.", "н. э."],
		wide: ["до нашей эры", "нашей эры"]
	};
	var quarterValues$19 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-й кв.",
			"2-й кв.",
			"3-й кв.",
			"4-й кв."
		],
		wide: [
			"1-й квартал",
			"2-й квартал",
			"3-й квартал",
			"4-й квартал"
		]
	};
	var monthValues$19 = {
		narrow: [
			"Я",
			"Ф",
			"М",
			"А",
			"М",
			"И",
			"И",
			"А",
			"С",
			"О",
			"Н",
			"Д"
		],
		abbreviated: [
			"янв.",
			"фев.",
			"март",
			"апр.",
			"май",
			"июнь",
			"июль",
			"авг.",
			"сент.",
			"окт.",
			"нояб.",
			"дек."
		],
		wide: [
			"январь",
			"февраль",
			"март",
			"апрель",
			"май",
			"июнь",
			"июль",
			"август",
			"сентябрь",
			"октябрь",
			"ноябрь",
			"декабрь"
		]
	};
	var formattingMonthValues$5 = {
		narrow: [
			"Я",
			"Ф",
			"М",
			"А",
			"М",
			"И",
			"И",
			"А",
			"С",
			"О",
			"Н",
			"Д"
		],
		abbreviated: [
			"янв.",
			"фев.",
			"мар.",
			"апр.",
			"мая",
			"июн.",
			"июл.",
			"авг.",
			"сент.",
			"окт.",
			"нояб.",
			"дек."
		],
		wide: [
			"января",
			"февраля",
			"марта",
			"апреля",
			"мая",
			"июня",
			"июля",
			"августа",
			"сентября",
			"октября",
			"ноября",
			"декабря"
		]
	};
	var dayValues$19 = {
		narrow: [
			"В",
			"П",
			"В",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"вс",
			"пн",
			"вт",
			"ср",
			"чт",
			"пт",
			"сб"
		],
		abbreviated: [
			"вск",
			"пнд",
			"втр",
			"срд",
			"чтв",
			"птн",
			"суб"
		],
		wide: [
			"воскресенье",
			"понедельник",
			"вторник",
			"среда",
			"четверг",
			"пятница",
			"суббота"
		]
	};
	var dayPeriodValues$19 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "полн.",
			noon: "полд.",
			morning: "утро",
			afternoon: "день",
			evening: "веч.",
			night: "ночь"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "полн.",
			noon: "полд.",
			morning: "утро",
			afternoon: "день",
			evening: "веч.",
			night: "ночь"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "полночь",
			noon: "полдень",
			morning: "утро",
			afternoon: "день",
			evening: "вечер",
			night: "ночь"
		}
	};
	var formattingDayPeriodValues$18 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "полн.",
			noon: "полд.",
			morning: "утра",
			afternoon: "дня",
			evening: "веч.",
			night: "ночи"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "полн.",
			noon: "полд.",
			morning: "утра",
			afternoon: "дня",
			evening: "веч.",
			night: "ночи"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "полночь",
			noon: "полдень",
			morning: "утра",
			afternoon: "дня",
			evening: "вечера",
			night: "ночи"
		}
	};
	var ordinalNumber$19 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const unit = options?.unit;
		let suffix;
		if (unit === "date") suffix = "-е";
		else if (unit === "week" || unit === "minute" || unit === "second") suffix = "-я";
		else suffix = "-й";
		return number + suffix;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ru.js
	/**
	* @category Locales
	* @summary Russian locale.
	* @language Russian
	* @iso-639-2 rus
	* @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
	* @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
	*/
	var ru = {
		code: "ru",
		formatDistance: formatDistance$19,
		formatLong: formatLong$19,
		formatRelative: formatRelative$19,
		localize: {
			ordinalNumber: ordinalNumber$19,
			era: buildLocalizeFn({
				values: eraValues$19,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$19,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$19,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$5,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$19,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$19,
				defaultWidth: "any",
				formattingValues: formattingDayPeriodValues$18,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((до )?н\.?\s?э\.?)/i,
					abbreviated: /^((до )?н\.?\s?э\.?)/i,
					wide: /^(до нашей эры|нашей эры|наша эра)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^д/i, /^н/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?[ыои]?й?)? кв.?/i,
					wide: /^[1234](-?[ыои]?й?)? квартал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[яфмаисонд]/i,
					abbreviated: /^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,
					wide: /^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^я/i,
						/^ф/i,
						/^м/i,
						/^а/i,
						/^м/i,
						/^и/i,
						/^и/i,
						/^а/i,
						/^с/i,
						/^о/i,
						/^н/i,
						/^я/i
					],
					any: [
						/^я/i,
						/^ф/i,
						/^мар/i,
						/^ап/i,
						/^ма[йя]/i,
						/^июн/i,
						/^июл/i,
						/^ав/i,
						/^с/i,
						/^о/i,
						/^н/i,
						/^д/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[впсч]/i,
					short: /^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,
					abbreviated: /^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,
					wide: /^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^в/i,
						/^п/i,
						/^в/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i
					],
					any: [
						/^в[ос]/i,
						/^п[он]/i,
						/^в/i,
						/^ср/i,
						/^ч/i,
						/^п[ят]/i,
						/^с[уб]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
					abbreviated: /^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,
					wide: /^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^дп/i,
					pm: /^пп/i,
					midnight: /^полн/i,
					noon: /^полд/i,
					morning: /^у/i,
					afternoon: /^д[ен]/i,
					evening: /^в/i,
					night: /^н/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/se/_lib/formatDistance.js
	var formatDistanceLocale$18 = {
		lessThanXSeconds: {
			one: "unnit go ovtta sekundda",
			other: "unnit go {{count}} sekundda"
		},
		xSeconds: {
			one: "sekundda",
			other: "{{count}} sekundda"
		},
		halfAMinute: "bealle minuhta",
		lessThanXMinutes: {
			one: "unnit go bealle minuhta",
			other: "unnit go {{count}} minuhta"
		},
		xMinutes: {
			one: "minuhta",
			other: "{{count}} minuhta"
		},
		aboutXHours: {
			one: "sullii ovtta diimmu",
			other: "sullii {{count}} diimmu"
		},
		xHours: {
			one: "diimmu",
			other: "{{count}} diimmu"
		},
		xDays: {
			one: "beaivvi",
			other: "{{count}} beaivvi"
		},
		aboutXWeeks: {
			one: "sullii ovtta vahku",
			other: "sullii {{count}} vahku"
		},
		xWeeks: {
			one: "vahku",
			other: "{{count}} vahku"
		},
		aboutXMonths: {
			one: "sullii ovtta mánu",
			other: "sullii {{count}} mánu"
		},
		xMonths: {
			one: "mánu",
			other: "{{count}} mánu"
		},
		aboutXYears: {
			one: "sullii ovtta jagi",
			other: "sullii {{count}} jagi"
		},
		xYears: {
			one: "jagi",
			other: "{{count}} jagi"
		},
		overXYears: {
			one: "guhkit go jagi",
			other: "guhkit go {{count}} jagi"
		},
		almostXYears: {
			one: "measta jagi",
			other: "measta {{count}} jagi"
		}
	};
	var formatDistance$18 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$18[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "geahčen " + result;
		else return result + " áigi";
		return result;
	};
	var formatLong$18 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE MMMM d. 'b.' y",
				long: "MMMM d. 'b.' y",
				medium: "MMM d. 'b.' y",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "'dii.' HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'dii.' {{time}}",
				long: "{{date}} 'dii.' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/se/_lib/formatRelative.js
	var formatRelativeLocale$18 = {
		lastWeek: "'ovddit' eeee 'dii.' p",
		yesterday: "'ikte dii.' p",
		today: "'odne dii.' p",
		tomorrow: "'ihtin dii.' p",
		nextWeek: "EEEE 'dii.' p",
		other: "P"
	};
	var formatRelative$18 = (token, _date, _baseDate, _options) => formatRelativeLocale$18[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/se/_lib/localize.js
	var eraValues$18 = {
		narrow: ["o.Kr.", "m.Kr."],
		abbreviated: ["o.Kr.", "m.Kr."],
		wide: ["ovdal Kristusa", "maŋŋel Kristusa"]
	};
	var quarterValues$18 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. kvartála",
			"2. kvartála",
			"3. kvartála",
			"4. kvartála"
		]
	};
	var monthValues$18 = {
		narrow: [
			"O",
			"G",
			"N",
			"C",
			"M",
			"G",
			"S",
			"B",
			"Č",
			"G",
			"S",
			"J"
		],
		abbreviated: [
			"ođđa",
			"guov",
			"njuk",
			"cuo",
			"mies",
			"geas",
			"suoi",
			"borg",
			"čakč",
			"golg",
			"skáb",
			"juov"
		],
		wide: [
			"ođđajagemánnu",
			"guovvamánnu",
			"njukčamánnu",
			"cuoŋománnu",
			"miessemánnu",
			"geassemánnu",
			"suoidnemánnu",
			"borgemánnu",
			"čakčamánnu",
			"golggotmánnu",
			"skábmamánnu",
			"juovlamánnu"
		]
	};
	var dayValues$18 = {
		narrow: [
			"S",
			"V",
			"M",
			"G",
			"D",
			"B",
			"L"
		],
		short: [
			"sotn",
			"vuos",
			"maŋ",
			"gask",
			"duor",
			"bear",
			"láv"
		],
		abbreviated: [
			"sotn",
			"vuos",
			"maŋ",
			"gask",
			"duor",
			"bear",
			"láv"
		],
		wide: [
			"sotnabeaivi",
			"vuossárga",
			"maŋŋebárga",
			"gaskavahkku",
			"duorastat",
			"bearjadat",
			"lávvardat"
		]
	};
	var dayPeriodValues$18 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "gaskaidja",
			noon: "gaskabeaivi",
			morning: "iđđes",
			afternoon: "maŋŋel gaska.",
			evening: "eahkes",
			night: "ihkku"
		},
		abbreviated: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "gaskaidja",
			noon: "gaskabeaivvi",
			morning: "iđđes",
			afternoon: "maŋŋel gaskabea.",
			evening: "eahkes",
			night: "ihkku"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "gaskaidja",
			noon: "gaskabeavvi",
			morning: "iđđes",
			afternoon: "maŋŋel gaskabeaivvi",
			evening: "eahkes",
			night: "ihkku"
		}
	};
	var ordinalNumber$18 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/se.js
	/**
	* @category Locales
	* @summary Northern Sámi locale.
	* @language Northern Sámi
	* @iso-639-2 sme
	* @author Audun Rundberg [@audunru](https://github.com/audunru)
	*/
	var se = {
		code: "se",
		formatDistance: formatDistance$18,
		formatLong: formatLong$18,
		formatRelative: formatRelative$18,
		localize: {
			ordinalNumber: ordinalNumber$18,
			era: buildLocalizeFn({
				values: eraValues$18,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$18,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$18,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$18,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$18,
				defaultWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\.?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(o\.? ?Kr\.?|m\.? ?Kr\.?)/i,
					abbreviated: /^(o\.? ?Kr\.?|m\.? ?Kr\.?)/i,
					wide: /^(ovdal Kristusa|ovdal min áiggi|maŋŋel Kristusa|min áigi)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^o/i, /^m/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](\.)? kvartála/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[ogncmsbčj]/i,
					abbreviated: /^(ođđa|guov|njuk|cuo|mies|geas|suoi|borg|čakč|golg|skáb|juov)\.?/i,
					wide: /^(ođđajagemánnu|guovvamánnu|njukčamánnu|cuoŋománnu|miessemánnu|geassemánnu|suoidnemánnu|borgemánnu|čakčamánnu|golggotmánnu|skábmamánnu|juovlamánnu)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^o/i,
						/^g/i,
						/^n/i,
						/^c/i,
						/^m/i,
						/^g/i,
						/^s/i,
						/^b/i,
						/^č/i,
						/^g/i,
						/^s/i,
						/^j/i
					],
					any: [
						/^o/i,
						/^gu/i,
						/^n/i,
						/^c/i,
						/^m/i,
						/^ge/i,
						/^su/i,
						/^b/i,
						/^č/i,
						/^go/i,
						/^sk/i,
						/^j/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[svmgdbl]/i,
					short: /^(sotn|vuos|maŋ|gask|duor|bear|láv)/i,
					abbreviated: /^(sotn|vuos|maŋ|gask|duor|bear|láv)/i,
					wide: /^(sotnabeaivi|vuossárga|maŋŋebárga|gaskavahkku|duorastat|bearjadat|lávvardat)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^s/i,
					/^v/i,
					/^m/i,
					/^g/i,
					/^d/i,
					/^b/i,
					/^l/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(gaskaidja|gaskabeaivvi|(på) (iđđes|maŋŋel gaskabeaivvi|eahkes|ihkku)|[ap])/i,
					any: /^([ap]\.?\s?m\.?|gaskaidja|gaskabeaivvi|(på) (iđđes|maŋŋel gaskabeaivvi|eahkes|ihkku))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a(\.?\s?m\.?)?$/i,
					pm: /^p(\.?\s?m\.?)?$/i,
					midnight: /^gaskai/i,
					noon: /^gaskab/i,
					morning: /iđđes/i,
					afternoon: /maŋŋel gaskabeaivvi/i,
					evening: /eahkes/i,
					night: /ihkku/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sk/_lib/formatDistance.js
	function declensionGroup(scheme, count) {
		if (count === 1 && scheme.one) return scheme.one;
		if (count >= 2 && count <= 4 && scheme.twoFour) return scheme.twoFour;
		return scheme.other;
	}
	function declension$1(scheme, count, time) {
		return declensionGroup(scheme, count)[time].replace("{{count}}", String(count));
	}
	function extractPreposition(token) {
		return [
			"lessThan",
			"about",
			"over",
			"almost"
		].filter(function(preposition) {
			return !!token.match(new RegExp("^" + preposition));
		})[0];
	}
	function prefixPreposition(preposition) {
		let translation = "";
		if (preposition === "almost") translation = "takmer";
		if (preposition === "about") translation = "približne";
		return translation.length > 0 ? translation + " " : "";
	}
	function suffixPreposition(preposition) {
		let translation = "";
		if (preposition === "lessThan") translation = "menej než";
		if (preposition === "over") translation = "viac než";
		return translation.length > 0 ? translation + " " : "";
	}
	function lowercaseFirstLetter(string) {
		return string.charAt(0).toLowerCase() + string.slice(1);
	}
	var formatDistanceLocale$17 = {
		xSeconds: {
			one: {
				present: "sekunda",
				past: "sekundou",
				future: "sekundu"
			},
			twoFour: {
				present: "{{count}} sekundy",
				past: "{{count}} sekundami",
				future: "{{count}} sekundy"
			},
			other: {
				present: "{{count}} sekúnd",
				past: "{{count}} sekundami",
				future: "{{count}} sekúnd"
			}
		},
		halfAMinute: { other: {
			present: "pol minúty",
			past: "pol minútou",
			future: "pol minúty"
		} },
		xMinutes: {
			one: {
				present: "minúta",
				past: "minútou",
				future: "minútu"
			},
			twoFour: {
				present: "{{count}} minúty",
				past: "{{count}} minútami",
				future: "{{count}} minúty"
			},
			other: {
				present: "{{count}} minút",
				past: "{{count}} minútami",
				future: "{{count}} minút"
			}
		},
		xHours: {
			one: {
				present: "hodina",
				past: "hodinou",
				future: "hodinu"
			},
			twoFour: {
				present: "{{count}} hodiny",
				past: "{{count}} hodinami",
				future: "{{count}} hodiny"
			},
			other: {
				present: "{{count}} hodín",
				past: "{{count}} hodinami",
				future: "{{count}} hodín"
			}
		},
		xDays: {
			one: {
				present: "deň",
				past: "dňom",
				future: "deň"
			},
			twoFour: {
				present: "{{count}} dni",
				past: "{{count}} dňami",
				future: "{{count}} dni"
			},
			other: {
				present: "{{count}} dní",
				past: "{{count}} dňami",
				future: "{{count}} dní"
			}
		},
		xWeeks: {
			one: {
				present: "týždeň",
				past: "týždňom",
				future: "týždeň"
			},
			twoFour: {
				present: "{{count}} týždne",
				past: "{{count}} týždňami",
				future: "{{count}} týždne"
			},
			other: {
				present: "{{count}} týždňov",
				past: "{{count}} týždňami",
				future: "{{count}} týždňov"
			}
		},
		xMonths: {
			one: {
				present: "mesiac",
				past: "mesiacom",
				future: "mesiac"
			},
			twoFour: {
				present: "{{count}} mesiace",
				past: "{{count}} mesiacmi",
				future: "{{count}} mesiace"
			},
			other: {
				present: "{{count}} mesiacov",
				past: "{{count}} mesiacmi",
				future: "{{count}} mesiacov"
			}
		},
		xYears: {
			one: {
				present: "rok",
				past: "rokom",
				future: "rok"
			},
			twoFour: {
				present: "{{count}} roky",
				past: "{{count}} rokmi",
				future: "{{count}} roky"
			},
			other: {
				present: "{{count}} rokov",
				past: "{{count}} rokmi",
				future: "{{count}} rokov"
			}
		}
	};
	var formatDistance$17 = (token, count, options) => {
		const preposition = extractPreposition(token) || "";
		const scheme = formatDistanceLocale$17[lowercaseFirstLetter(token.substring(preposition.length))];
		if (!options?.addSuffix) return prefixPreposition(preposition) + suffixPreposition(preposition) + declension$1(scheme, count, "present");
		if (options.comparison && options.comparison > 0) return prefixPreposition(preposition) + "o " + suffixPreposition(preposition) + declension$1(scheme, count, "future");
		else return prefixPreposition(preposition) + "pred " + suffixPreposition(preposition) + declension$1(scheme, count, "past");
	};
	var formatLong$17 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d. MMMM y",
				long: "d. MMMM y",
				medium: "d. M. y",
				short: "d. M. y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}}, {{time}}",
				long: "{{date}}, {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sk/_lib/formatRelative.js
	var accusativeWeekdays$1 = [
		"nedeľu",
		"pondelok",
		"utorok",
		"stredu",
		"štvrtok",
		"piatok",
		"sobotu"
	];
	function lastWeek$1(day) {
		const weekday = accusativeWeekdays$1[day];
		switch (day) {
			case 0:
			case 3:
			case 6: return "'minulú " + weekday + " o' p";
			default: return "'minulý' eeee 'o' p";
		}
	}
	function thisWeek$1(day) {
		const weekday = accusativeWeekdays$1[day];
		if (day === 4) return "'vo' eeee 'o' p";
		else return "'v " + weekday + " o' p";
	}
	function nextWeek$1(day) {
		const weekday = accusativeWeekdays$1[day];
		switch (day) {
			case 0:
			case 4:
			case 6: return "'budúcu " + weekday + " o' p";
			default: return "'budúci' eeee 'o' p";
		}
	}
	var formatRelativeLocale$17 = {
		lastWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$1(day);
			else return lastWeek$1(day);
		},
		yesterday: "'včera o' p",
		today: "'dnes o' p",
		tomorrow: "'zajtra o' p",
		nextWeek: (date, baseDate, options) => {
			const day = date.getDay();
			if (isSameWeek(date, baseDate, options)) return thisWeek$1(day);
			else return nextWeek$1(day);
		},
		other: "P"
	};
	var formatRelative$17 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$17[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sk/_lib/localize.js
	var eraValues$17 = {
		narrow: ["pred Kr.", "po Kr."],
		abbreviated: ["pred Kr.", "po Kr."],
		wide: ["pred Kristom", "po Kristovi"]
	};
	var quarterValues$17 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1. štvrťrok",
			"2. štvrťrok",
			"3. štvrťrok",
			"4. štvrťrok"
		]
	};
	var monthValues$17 = {
		narrow: [
			"j",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"máj",
			"jún",
			"júl",
			"aug",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"január",
			"február",
			"marec",
			"apríl",
			"máj",
			"jún",
			"júl",
			"august",
			"september",
			"október",
			"november",
			"december"
		]
	};
	var formattingMonthValues$4 = {
		narrow: [
			"j",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"máj",
			"jún",
			"júl",
			"aug",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"januára",
			"februára",
			"marca",
			"apríla",
			"mája",
			"júna",
			"júla",
			"augusta",
			"septembra",
			"októbra",
			"novembra",
			"decembra"
		]
	};
	var dayValues$17 = {
		narrow: [
			"n",
			"p",
			"u",
			"s",
			"š",
			"p",
			"s"
		],
		short: [
			"ne",
			"po",
			"ut",
			"st",
			"št",
			"pi",
			"so"
		],
		abbreviated: [
			"ne",
			"po",
			"ut",
			"st",
			"št",
			"pi",
			"so"
		],
		wide: [
			"nedeľa",
			"pondelok",
			"utorok",
			"streda",
			"štvrtok",
			"piatok",
			"sobota"
		]
	};
	var dayPeriodValues$17 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "poln.",
			noon: "pol.",
			morning: "ráno",
			afternoon: "pop.",
			evening: "več.",
			night: "noc"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "poln.",
			noon: "pol.",
			morning: "ráno",
			afternoon: "popol.",
			evening: "večer",
			night: "noc"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "polnoc",
			noon: "poludnie",
			morning: "ráno",
			afternoon: "popoludnie",
			evening: "večer",
			night: "noc"
		}
	};
	var formattingDayPeriodValues$17 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "o poln.",
			noon: "nap.",
			morning: "ráno",
			afternoon: "pop.",
			evening: "več.",
			night: "v n."
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "o poln.",
			noon: "napol.",
			morning: "ráno",
			afternoon: "popol.",
			evening: "večer",
			night: "v noci"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "o polnoci",
			noon: "napoludnie",
			morning: "ráno",
			afternoon: "popoludní",
			evening: "večer",
			night: "v noci"
		}
	};
	var ordinalNumber$17 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sk.js
	/**
	* @category Locales
	* @summary Slovak locale.
	* @language Slovak
	* @iso-639-2 slk
	* @author Marek Suscak [@mareksuscak](https://github.com/mareksuscak)
	*/
	var sk = {
		code: "sk",
		formatDistance: formatDistance$17,
		formatLong: formatLong$17,
		formatRelative: formatRelative$17,
		localize: {
			ordinalNumber: ordinalNumber$17,
			era: buildLocalizeFn({
				values: eraValues$17,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$17,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$17,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$4,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$17,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$17,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$17,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\.?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(pred Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,
					abbreviated: /^(pred Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,
					wide: /^(pred Kristom|pred na[šs][íi]m letopo[čc]tom|po Kristovi|n[áa][šs]ho letopo[čc]tu)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^pr/i, /^(po|n)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234]\. [šs]tvr[ťt]rok/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mar|apr|m[áa]j|j[úu]n|j[úu]l|aug|sep|okt|nov|dec)/i,
					wide: /^(janu[áa]ra?|febru[áa]ra?|(marec|marca)|apr[íi]la?|m[áa]ja?|j[úu]na?|j[úu]la?|augusta?|(september|septembra)|(okt[óo]ber|okt[óo]bra)|(november|novembra)|(december|decembra))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^m[áa]j/i,
						/^j[úu]n/i,
						/^j[úu]l/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[npusšp]/i,
					short: /^(ne|po|ut|st|št|pi|so)/i,
					abbreviated: /^(ne|po|ut|st|št|pi|so)/i,
					wide: /^(nede[ľl]a|pondelok|utorok|streda|[šs]tvrtok|piatok|sobota])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^n/i,
						/^p/i,
						/^u/i,
						/^s/i,
						/^š/i,
						/^p/i,
						/^s/i
					],
					any: [
						/^n/i,
						/^po/i,
						/^u/i,
						/^st/i,
						/^(št|stv)/i,
						/^pi/i,
						/^so/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(am|pm|(o )?poln\.?|(nap\.?|pol\.?)|r[áa]no|pop\.?|ve[čc]\.?|(v n\.?|noc))/i,
					abbreviated: /^(am|pm|(o )?poln\.?|(napol\.?|pol\.?)|r[áa]no|pop\.?|ve[čc]er|(v )?noci?)/i,
					any: /^(am|pm|(o )?polnoci?|(na)?poludnie|r[áa]no|popoludn(ie|í|i)|ve[čc]er|(v )?noci?)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^am/i,
					pm: /^pm/i,
					midnight: /poln/i,
					noon: /^(nap|(na)?pol(\.|u))/i,
					morning: /^r[áa]no/i,
					afternoon: /^pop/i,
					evening: /^ve[čc]/i,
					night: /^(noc|v n\.)/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sl/_lib/formatDistance.js
	function isPluralType$1(val) {
		return val.one !== void 0;
	}
	var formatDistanceLocale$16 = {
		lessThanXSeconds: {
			present: {
				one: "manj kot {{count}} sekunda",
				two: "manj kot {{count}} sekundi",
				few: "manj kot {{count}} sekunde",
				other: "manj kot {{count}} sekund"
			},
			past: {
				one: "manj kot {{count}} sekundo",
				two: "manj kot {{count}} sekundama",
				few: "manj kot {{count}} sekundami",
				other: "manj kot {{count}} sekundami"
			},
			future: {
				one: "manj kot {{count}} sekundo",
				two: "manj kot {{count}} sekundi",
				few: "manj kot {{count}} sekunde",
				other: "manj kot {{count}} sekund"
			}
		},
		xSeconds: {
			present: {
				one: "{{count}} sekunda",
				two: "{{count}} sekundi",
				few: "{{count}} sekunde",
				other: "{{count}} sekund"
			},
			past: {
				one: "{{count}} sekundo",
				two: "{{count}} sekundama",
				few: "{{count}} sekundami",
				other: "{{count}} sekundami"
			},
			future: {
				one: "{{count}} sekundo",
				two: "{{count}} sekundi",
				few: "{{count}} sekunde",
				other: "{{count}} sekund"
			}
		},
		halfAMinute: "pol minute",
		lessThanXMinutes: {
			present: {
				one: "manj kot {{count}} minuta",
				two: "manj kot {{count}} minuti",
				few: "manj kot {{count}} minute",
				other: "manj kot {{count}} minut"
			},
			past: {
				one: "manj kot {{count}} minuto",
				two: "manj kot {{count}} minutama",
				few: "manj kot {{count}} minutami",
				other: "manj kot {{count}} minutami"
			},
			future: {
				one: "manj kot {{count}} minuto",
				two: "manj kot {{count}} minuti",
				few: "manj kot {{count}} minute",
				other: "manj kot {{count}} minut"
			}
		},
		xMinutes: {
			present: {
				one: "{{count}} minuta",
				two: "{{count}} minuti",
				few: "{{count}} minute",
				other: "{{count}} minut"
			},
			past: {
				one: "{{count}} minuto",
				two: "{{count}} minutama",
				few: "{{count}} minutami",
				other: "{{count}} minutami"
			},
			future: {
				one: "{{count}} minuto",
				two: "{{count}} minuti",
				few: "{{count}} minute",
				other: "{{count}} minut"
			}
		},
		aboutXHours: {
			present: {
				one: "približno {{count}} ura",
				two: "približno {{count}} uri",
				few: "približno {{count}} ure",
				other: "približno {{count}} ur"
			},
			past: {
				one: "približno {{count}} uro",
				two: "približno {{count}} urama",
				few: "približno {{count}} urami",
				other: "približno {{count}} urami"
			},
			future: {
				one: "približno {{count}} uro",
				two: "približno {{count}} uri",
				few: "približno {{count}} ure",
				other: "približno {{count}} ur"
			}
		},
		xHours: {
			present: {
				one: "{{count}} ura",
				two: "{{count}} uri",
				few: "{{count}} ure",
				other: "{{count}} ur"
			},
			past: {
				one: "{{count}} uro",
				two: "{{count}} urama",
				few: "{{count}} urami",
				other: "{{count}} urami"
			},
			future: {
				one: "{{count}} uro",
				two: "{{count}} uri",
				few: "{{count}} ure",
				other: "{{count}} ur"
			}
		},
		xDays: {
			present: {
				one: "{{count}} dan",
				two: "{{count}} dni",
				few: "{{count}} dni",
				other: "{{count}} dni"
			},
			past: {
				one: "{{count}} dnem",
				two: "{{count}} dnevoma",
				few: "{{count}} dnevi",
				other: "{{count}} dnevi"
			},
			future: {
				one: "{{count}} dan",
				two: "{{count}} dni",
				few: "{{count}} dni",
				other: "{{count}} dni"
			}
		},
		aboutXWeeks: {
			one: "približno {{count}} teden",
			two: "približno {{count}} tedna",
			few: "približno {{count}} tedne",
			other: "približno {{count}} tednov"
		},
		xWeeks: {
			one: "{{count}} teden",
			two: "{{count}} tedna",
			few: "{{count}} tedne",
			other: "{{count}} tednov"
		},
		aboutXMonths: {
			present: {
				one: "približno {{count}} mesec",
				two: "približno {{count}} meseca",
				few: "približno {{count}} mesece",
				other: "približno {{count}} mesecev"
			},
			past: {
				one: "približno {{count}} mesecem",
				two: "približno {{count}} mesecema",
				few: "približno {{count}} meseci",
				other: "približno {{count}} meseci"
			},
			future: {
				one: "približno {{count}} mesec",
				two: "približno {{count}} meseca",
				few: "približno {{count}} mesece",
				other: "približno {{count}} mesecev"
			}
		},
		xMonths: {
			present: {
				one: "{{count}} mesec",
				two: "{{count}} meseca",
				few: "{{count}} meseci",
				other: "{{count}} mesecev"
			},
			past: {
				one: "{{count}} mesecem",
				two: "{{count}} mesecema",
				few: "{{count}} meseci",
				other: "{{count}} meseci"
			},
			future: {
				one: "{{count}} mesec",
				two: "{{count}} meseca",
				few: "{{count}} mesece",
				other: "{{count}} mesecev"
			}
		},
		aboutXYears: {
			present: {
				one: "približno {{count}} leto",
				two: "približno {{count}} leti",
				few: "približno {{count}} leta",
				other: "približno {{count}} let"
			},
			past: {
				one: "približno {{count}} letom",
				two: "približno {{count}} letoma",
				few: "približno {{count}} leti",
				other: "približno {{count}} leti"
			},
			future: {
				one: "približno {{count}} leto",
				two: "približno {{count}} leti",
				few: "približno {{count}} leta",
				other: "približno {{count}} let"
			}
		},
		xYears: {
			present: {
				one: "{{count}} leto",
				two: "{{count}} leti",
				few: "{{count}} leta",
				other: "{{count}} let"
			},
			past: {
				one: "{{count}} letom",
				two: "{{count}} letoma",
				few: "{{count}} leti",
				other: "{{count}} leti"
			},
			future: {
				one: "{{count}} leto",
				two: "{{count}} leti",
				few: "{{count}} leta",
				other: "{{count}} let"
			}
		},
		overXYears: {
			present: {
				one: "več kot {{count}} leto",
				two: "več kot {{count}} leti",
				few: "več kot {{count}} leta",
				other: "več kot {{count}} let"
			},
			past: {
				one: "več kot {{count}} letom",
				two: "več kot {{count}} letoma",
				few: "več kot {{count}} leti",
				other: "več kot {{count}} leti"
			},
			future: {
				one: "več kot {{count}} leto",
				two: "več kot {{count}} leti",
				few: "več kot {{count}} leta",
				other: "več kot {{count}} let"
			}
		},
		almostXYears: {
			present: {
				one: "skoraj {{count}} leto",
				two: "skoraj {{count}} leti",
				few: "skoraj {{count}} leta",
				other: "skoraj {{count}} let"
			},
			past: {
				one: "skoraj {{count}} letom",
				two: "skoraj {{count}} letoma",
				few: "skoraj {{count}} leti",
				other: "skoraj {{count}} leti"
			},
			future: {
				one: "skoraj {{count}} leto",
				two: "skoraj {{count}} leti",
				few: "skoraj {{count}} leta",
				other: "skoraj {{count}} let"
			}
		}
	};
	function getFormFromCount(count) {
		switch (count % 100) {
			case 1: return "one";
			case 2: return "two";
			case 3:
			case 4: return "few";
			default: return "other";
		}
	}
	var formatDistance$16 = (token, count, options) => {
		let result = "";
		let tense = "present";
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) {
			tense = "future";
			result = "čez ";
		} else {
			tense = "past";
			result = "pred ";
		}
		const tokenValue = formatDistanceLocale$16[token];
		if (typeof tokenValue === "string") result += tokenValue;
		else {
			const form = getFormFromCount(count);
			if (isPluralType$1(tokenValue)) result += tokenValue[form].replace("{{count}}", String(count));
			else result += tokenValue[tense][form].replace("{{count}}", String(count));
		}
		return result;
	};
	var formatLong$16 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, dd. MMMM y",
				long: "dd. MMMM y",
				medium: "d. MMM y",
				short: "d. MM. yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sl/_lib/formatRelative.js
	var formatRelativeLocale$16 = {
		lastWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'prejšnjo nedeljo ob' p";
				case 3: return "'prejšnjo sredo ob' p";
				case 6: return "'prejšnjo soboto ob' p";
				default: return "'prejšnji' EEEE 'ob' p";
			}
		},
		yesterday: "'včeraj ob' p",
		today: "'danes ob' p",
		tomorrow: "'jutri ob' p",
		nextWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'naslednjo nedeljo ob' p";
				case 3: return "'naslednjo sredo ob' p";
				case 6: return "'naslednjo soboto ob' p";
				default: return "'naslednji' EEEE 'ob' p";
			}
		},
		other: "P"
	};
	var formatRelative$16 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$16[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sl/_lib/localize.js
	var eraValues$16 = {
		narrow: ["pr. n. št.", "po n. št."],
		abbreviated: ["pr. n. št.", "po n. št."],
		wide: ["pred našim štetjem", "po našem štetju"]
	};
	var quarterValues$16 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1. čet.",
			"2. čet.",
			"3. čet.",
			"4. čet."
		],
		wide: [
			"1. četrtletje",
			"2. četrtletje",
			"3. četrtletje",
			"4. četrtletje"
		]
	};
	var monthValues$16 = {
		narrow: [
			"j",
			"f",
			"m",
			"a",
			"m",
			"j",
			"j",
			"a",
			"s",
			"o",
			"n",
			"d"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mar.",
			"apr.",
			"maj",
			"jun.",
			"jul.",
			"avg.",
			"sep.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"januar",
			"februar",
			"marec",
			"april",
			"maj",
			"junij",
			"julij",
			"avgust",
			"september",
			"oktober",
			"november",
			"december"
		]
	};
	var dayValues$16 = {
		narrow: [
			"n",
			"p",
			"t",
			"s",
			"č",
			"p",
			"s"
		],
		short: [
			"ned.",
			"pon.",
			"tor.",
			"sre.",
			"čet.",
			"pet.",
			"sob."
		],
		abbreviated: [
			"ned.",
			"pon.",
			"tor.",
			"sre.",
			"čet.",
			"pet.",
			"sob."
		],
		wide: [
			"nedelja",
			"ponedeljek",
			"torek",
			"sreda",
			"četrtek",
			"petek",
			"sobota"
		]
	};
	var dayPeriodValues$16 = {
		narrow: {
			am: "d",
			pm: "p",
			midnight: "24.00",
			noon: "12.00",
			morning: "j",
			afternoon: "p",
			evening: "v",
			night: "n"
		},
		abbreviated: {
			am: "dop.",
			pm: "pop.",
			midnight: "poln.",
			noon: "pold.",
			morning: "jut.",
			afternoon: "pop.",
			evening: "več.",
			night: "noč"
		},
		wide: {
			am: "dop.",
			pm: "pop.",
			midnight: "polnoč",
			noon: "poldne",
			morning: "jutro",
			afternoon: "popoldne",
			evening: "večer",
			night: "noč"
		}
	};
	var formattingDayPeriodValues$16 = {
		narrow: {
			am: "d",
			pm: "p",
			midnight: "24.00",
			noon: "12.00",
			morning: "zj",
			afternoon: "p",
			evening: "zv",
			night: "po"
		},
		abbreviated: {
			am: "dop.",
			pm: "pop.",
			midnight: "opoln.",
			noon: "opold.",
			morning: "zjut.",
			afternoon: "pop.",
			evening: "zveč.",
			night: "ponoči"
		},
		wide: {
			am: "dop.",
			pm: "pop.",
			midnight: "opolnoči",
			noon: "opoldne",
			morning: "zjutraj",
			afternoon: "popoldan",
			evening: "zvečer",
			night: "ponoči"
		}
	};
	var ordinalNumber$16 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sl.js
	/**
	* @category Locales
	* @summary Slovenian locale.
	* @language Slovenian
	* @iso-639-2 slv
	* @author Adam Stradovnik [@Neoglyph](https://github.com/Neoglyph)
	* @author Mato Žgajner [@mzgajner](https://github.com/mzgajner)
	*/
	var sl = {
		code: "sl",
		formatDistance: formatDistance$16,
		formatLong: formatLong$16,
		formatRelative: formatRelative$16,
		localize: {
			ordinalNumber: ordinalNumber$16,
			era: buildLocalizeFn({
				values: eraValues$16,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$16,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$16,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$16,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$16,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$16,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					abbreviated: /^(pr\. n\. št\.|po n\. št\.)/i,
					wide: /^(pred Kristusom|pred na[sš]im [sš]tetjem|po Kristusu|po na[sš]em [sš]tetju|na[sš]ega [sš]tetja)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^pr/i, /^(po|na[sš]em)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]\.\s?[čc]et\.?/i,
					wide: /^[1234]\. [čc]etrtletje/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan\.|feb\.|mar\.|apr\.|maj|jun\.|jul\.|avg\.|sep\.|okt\.|nov\.|dec\.)/i,
					wide: /^(januar|februar|marec|april|maj|junij|julij|avgust|september|oktober|november|december)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					abbreviated: [
						/^ja/i,
						/^fe/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^av/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					wide: [
						/^ja/i,
						/^fe/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^av/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "wide"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[nptsčc]/i,
					short: /^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,
					abbreviated: /^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,
					wide: /^(nedelja|ponedeljek|torek|sreda|[cč]etrtek|petek|sobota)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^n/i,
						/^p/i,
						/^t/i,
						/^s/i,
						/^[cč]/i,
						/^p/i,
						/^s/i
					],
					any: [
						/^n/i,
						/^po/i,
						/^t/i,
						/^sr/i,
						/^[cč]/i,
						/^pe/i,
						/^so/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(d|po?|z?v|n|z?j|24\.00|12\.00)/i,
					any: /^(dop\.|pop\.|o?poln(\.|o[cč]i?)|o?pold(\.|ne)|z?ve[cč](\.|er)|(po)?no[cč]i?|popold(ne|an)|jut(\.|ro)|zjut(\.|raj))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: {
					narrow: {
						am: /^d/i,
						pm: /^p/i,
						midnight: /^24/i,
						noon: /^12/i,
						morning: /^(z?j)/i,
						afternoon: /^p/i,
						evening: /^(z?v)/i,
						night: /^(n|po)/i
					},
					any: {
						am: /^dop\./i,
						pm: /^pop\./i,
						midnight: /^o?poln/i,
						noon: /^o?pold/i,
						morning: /j/i,
						afternoon: /^pop\./i,
						evening: /^z?ve/i,
						night: /(po)?no/i
					}
				},
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sq/_lib/formatDistance.js
	var formatDistanceLocale$15 = {
		lessThanXSeconds: {
			one: "më pak se një sekondë",
			other: "më pak se {{count}} sekonda"
		},
		xSeconds: {
			one: "1 sekondë",
			other: "{{count}} sekonda"
		},
		halfAMinute: "gjysëm minuti",
		lessThanXMinutes: {
			one: "më pak se një minute",
			other: "më pak se {{count}} minuta"
		},
		xMinutes: {
			one: "1 minutë",
			other: "{{count}} minuta"
		},
		aboutXHours: {
			one: "rreth 1 orë",
			other: "rreth {{count}} orë"
		},
		xHours: {
			one: "1 orë",
			other: "{{count}} orë"
		},
		xDays: {
			one: "1 ditë",
			other: "{{count}} ditë"
		},
		aboutXWeeks: {
			one: "rreth 1 javë",
			other: "rreth {{count}} javë"
		},
		xWeeks: {
			one: "1 javë",
			other: "{{count}} javë"
		},
		aboutXMonths: {
			one: "rreth 1 muaj",
			other: "rreth {{count}} muaj"
		},
		xMonths: {
			one: "1 muaj",
			other: "{{count}} muaj"
		},
		aboutXYears: {
			one: "rreth 1 vit",
			other: "rreth {{count}} vite"
		},
		xYears: {
			one: "1 vit",
			other: "{{count}} vite"
		},
		overXYears: {
			one: "mbi 1 vit",
			other: "mbi {{count}} vite"
		},
		almostXYears: {
			one: "pothuajse 1 vit",
			other: "pothuajse {{count}} vite"
		}
	};
	var formatDistance$15 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$15[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "në " + result;
		else return result + " më parë";
		return result;
	};
	var formatLong$15 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'në' {{time}}",
				long: "{{date}} 'në' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sq/_lib/formatRelative.js
	var formatRelativeLocale$15 = {
		lastWeek: "'të' eeee 'e shkuar në' p",
		yesterday: "'dje në' p",
		today: "'sot në' p",
		tomorrow: "'nesër në' p",
		nextWeek: "eeee 'at' p",
		other: "P"
	};
	var formatRelative$15 = (token, _date, _baseDate, _options) => formatRelativeLocale$15[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/sq/_lib/localize.js
	var eraValues$15 = {
		narrow: ["P", "M"],
		abbreviated: ["PK", "MK"],
		wide: ["Para Krishtit", "Mbas Krishtit"]
	};
	var quarterValues$15 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"4-mujori I",
			"4-mujori II",
			"4-mujori III",
			"4-mujori IV"
		]
	};
	var monthValues$15 = {
		narrow: [
			"J",
			"S",
			"M",
			"P",
			"M",
			"Q",
			"K",
			"G",
			"S",
			"T",
			"N",
			"D"
		],
		abbreviated: [
			"Jan",
			"Shk",
			"Mar",
			"Pri",
			"Maj",
			"Qer",
			"Kor",
			"Gus",
			"Sht",
			"Tet",
			"Nën",
			"Dhj"
		],
		wide: [
			"Janar",
			"Shkurt",
			"Mars",
			"Prill",
			"Maj",
			"Qershor",
			"Korrik",
			"Gusht",
			"Shtator",
			"Tetor",
			"Nëntor",
			"Dhjetor"
		]
	};
	var dayValues$15 = {
		narrow: [
			"D",
			"H",
			"M",
			"M",
			"E",
			"P",
			"S"
		],
		short: [
			"Di",
			"Hë",
			"Ma",
			"Më",
			"En",
			"Pr",
			"Sh"
		],
		abbreviated: [
			"Die",
			"Hën",
			"Mar",
			"Mër",
			"Enj",
			"Pre",
			"Sht"
		],
		wide: [
			"Dielë",
			"Hënë",
			"Martë",
			"Mërkurë",
			"Enjte",
			"Premte",
			"Shtunë"
		]
	};
	var dayPeriodValues$15 = {
		narrow: {
			am: "p",
			pm: "m",
			midnight: "m",
			noon: "d",
			morning: "mëngjes",
			afternoon: "dite",
			evening: "mbrëmje",
			night: "natë"
		},
		abbreviated: {
			am: "PD",
			pm: "MD",
			midnight: "mesnëtë",
			noon: "drek",
			morning: "mëngjes",
			afternoon: "mbasdite",
			evening: "mbrëmje",
			night: "natë"
		},
		wide: {
			am: "p.d.",
			pm: "m.d.",
			midnight: "mesnëtë",
			noon: "drek",
			morning: "mëngjes",
			afternoon: "mbasdite",
			evening: "mbrëmje",
			night: "natë"
		}
	};
	var formattingDayPeriodValues$15 = {
		narrow: {
			am: "p",
			pm: "m",
			midnight: "m",
			noon: "d",
			morning: "në mëngjes",
			afternoon: "në mbasdite",
			evening: "në mbrëmje",
			night: "në mesnatë"
		},
		abbreviated: {
			am: "PD",
			pm: "MD",
			midnight: "mesnatë",
			noon: "drek",
			morning: "në mëngjes",
			afternoon: "në mbasdite",
			evening: "në mbrëmje",
			night: "në mesnatë"
		},
		wide: {
			am: "p.d.",
			pm: "m.d.",
			midnight: "mesnatë",
			noon: "drek",
			morning: "në mëngjes",
			afternoon: "në mbasdite",
			evening: "në mbrëmje",
			night: "në mesnatë"
		}
	};
	var ordinalNumber$15 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		if (options?.unit === "hour") return String(number);
		if (number === 1) return number + "-rë";
		if (number === 4) return number + "t";
		return number + "-të";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sq.js
	/**
	* @category Locales
	* @summary Albanian locale.
	* @language Shqip
	* @iso-639-2 sqi
	* @author Ardit Dine [@arditdine](https://github.com/arditdine)
	*/
	var sq = {
		code: "sq",
		formatDistance: formatDistance$15,
		formatLong: formatLong$15,
		formatRelative: formatRelative$15,
		localize: {
			ordinalNumber: ordinalNumber$15,
			era: buildLocalizeFn({
				values: eraValues$15,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$15,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$15,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$15,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$15,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$15,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-rë|-të|t|)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(p|m)/i,
					abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
					wide: /^(para krishtit|mbas krishtit)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^b/i, /^(p|m)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234]-mujori (i{1,3}|iv)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jsmpqkftnd]/i,
					abbreviated: /^(jan|shk|mar|pri|maj|qer|kor|gus|sht|tet|nën|dhj)/i,
					wide: /^(janar|shkurt|mars|prill|maj|qershor|korrik|gusht|shtator|tetor|nëntor|dhjetor)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^s/i,
						/^m/i,
						/^p/i,
						/^m/i,
						/^q/i,
						/^k/i,
						/^g/i,
						/^s/i,
						/^t/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^shk/i,
						/^mar/i,
						/^pri/i,
						/^maj/i,
						/^qer/i,
						/^kor/i,
						/^gu/i,
						/^sht/i,
						/^tet/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[dhmeps]/i,
					short: /^(di|hë|ma|më|en|pr|sh)/i,
					abbreviated: /^(die|hën|mar|mër|enj|pre|sht)/i,
					wide: /^(dielë|hënë|martë|mërkurë|enjte|premte|shtunë)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^d/i,
						/^h/i,
						/^m/i,
						/^m/i,
						/^e/i,
						/^p/i,
						/^s/i
					],
					any: [
						/^d/i,
						/^h/i,
						/^ma/i,
						/^më/i,
						/^e/i,
						/^p/i,
						/^s/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(p|m|me|në (mëngjes|mbasdite|mbrëmje|mesnatë))/i,
					any: /^([pm]\.?\s?d\.?|drek|në (mëngjes|mbasdite|mbrëmje|mesnatë))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^p/i,
					pm: /^m/i,
					midnight: /^me/i,
					noon: /^dr/i,
					morning: /mëngjes/i,
					afternoon: /mbasdite/i,
					evening: /mbrëmje/i,
					night: /natë/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr/_lib/formatDistance.js
	var formatDistanceLocale$14 = {
		lessThanXSeconds: {
			one: {
				standalone: "мање од 1 секунде",
				withPrepositionAgo: "мање од 1 секунде",
				withPrepositionIn: "мање од 1 секунду"
			},
			dual: "мање од {{count}} секунде",
			other: "мање од {{count}} секунди"
		},
		xSeconds: {
			one: {
				standalone: "1 секунда",
				withPrepositionAgo: "1 секунде",
				withPrepositionIn: "1 секунду"
			},
			dual: "{{count}} секунде",
			other: "{{count}} секунди"
		},
		halfAMinute: "пола минуте",
		lessThanXMinutes: {
			one: {
				standalone: "мање од 1 минуте",
				withPrepositionAgo: "мање од 1 минуте",
				withPrepositionIn: "мање од 1 минуту"
			},
			dual: "мање од {{count}} минуте",
			other: "мање од {{count}} минута"
		},
		xMinutes: {
			one: {
				standalone: "1 минута",
				withPrepositionAgo: "1 минуте",
				withPrepositionIn: "1 минуту"
			},
			dual: "{{count}} минуте",
			other: "{{count}} минута"
		},
		aboutXHours: {
			one: {
				standalone: "око 1 сат",
				withPrepositionAgo: "око 1 сат",
				withPrepositionIn: "око 1 сат"
			},
			dual: "око {{count}} сата",
			other: "око {{count}} сати"
		},
		xHours: {
			one: {
				standalone: "1 сат",
				withPrepositionAgo: "1 сат",
				withPrepositionIn: "1 сат"
			},
			dual: "{{count}} сата",
			other: "{{count}} сати"
		},
		xDays: {
			one: {
				standalone: "1 дан",
				withPrepositionAgo: "1 дан",
				withPrepositionIn: "1 дан"
			},
			dual: "{{count}} дана",
			other: "{{count}} дана"
		},
		aboutXWeeks: {
			one: {
				standalone: "око 1 недељу",
				withPrepositionAgo: "око 1 недељу",
				withPrepositionIn: "око 1 недељу"
			},
			dual: "око {{count}} недеље",
			other: "око {{count}} недеље"
		},
		xWeeks: {
			one: {
				standalone: "1 недељу",
				withPrepositionAgo: "1 недељу",
				withPrepositionIn: "1 недељу"
			},
			dual: "{{count}} недеље",
			other: "{{count}} недеље"
		},
		aboutXMonths: {
			one: {
				standalone: "око 1 месец",
				withPrepositionAgo: "око 1 месец",
				withPrepositionIn: "око 1 месец"
			},
			dual: "око {{count}} месеца",
			other: "око {{count}} месеци"
		},
		xMonths: {
			one: {
				standalone: "1 месец",
				withPrepositionAgo: "1 месец",
				withPrepositionIn: "1 месец"
			},
			dual: "{{count}} месеца",
			other: "{{count}} месеци"
		},
		aboutXYears: {
			one: {
				standalone: "око 1 годину",
				withPrepositionAgo: "око 1 годину",
				withPrepositionIn: "око 1 годину"
			},
			dual: "око {{count}} године",
			other: "око {{count}} година"
		},
		xYears: {
			one: {
				standalone: "1 година",
				withPrepositionAgo: "1 године",
				withPrepositionIn: "1 годину"
			},
			dual: "{{count}} године",
			other: "{{count}} година"
		},
		overXYears: {
			one: {
				standalone: "преко 1 годину",
				withPrepositionAgo: "преко 1 годину",
				withPrepositionIn: "преко 1 годину"
			},
			dual: "преко {{count}} године",
			other: "преко {{count}} година"
		},
		almostXYears: {
			one: {
				standalone: "готово 1 годину",
				withPrepositionAgo: "готово 1 годину",
				withPrepositionIn: "готово 1 годину"
			},
			dual: "готово {{count}} године",
			other: "готово {{count}} година"
		}
	};
	var formatDistance$14 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$14[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) if (options?.addSuffix) if (options.comparison && options.comparison > 0) result = tokenValue.one.withPrepositionIn;
		else result = tokenValue.one.withPrepositionAgo;
		else result = tokenValue.one.standalone;
		else if (count % 10 > 1 && count % 10 < 5 && String(count).substr(-2, 1) !== "1") result = tokenValue.dual.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "за " + result;
		else return "пре " + result;
		return result;
	};
	var formatLong$14 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d. MMMM yyyy.",
				long: "d. MMMM yyyy.",
				medium: "d. MMM yy.",
				short: "dd. MM. yy."
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss (zzzz)",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'у' {{time}}",
				long: "{{date}} 'у' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr/_lib/formatRelative.js
	var formatRelativeLocale$14 = {
		lastWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'прошле недеље у' p";
				case 3: return "'прошле среде у' p";
				case 6: return "'прошле суботе у' p";
				default: return "'прошли' EEEE 'у' p";
			}
		},
		yesterday: "'јуче у' p",
		today: "'данас у' p",
		tomorrow: "'сутра у' p",
		nextWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'следеће недеље у' p";
				case 3: return "'следећу среду у' p";
				case 6: return "'следећу суботу у' p";
				default: return "'следећи' EEEE 'у' p";
			}
		},
		other: "P"
	};
	var formatRelative$14 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$14[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr/_lib/localize.js
	var eraValues$14 = {
		narrow: ["пр.н.е.", "АД"],
		abbreviated: ["пр. Хр.", "по. Хр."],
		wide: ["Пре Христа", "После Христа"]
	};
	var quarterValues$14 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4."
		],
		abbreviated: [
			"1. кв.",
			"2. кв.",
			"3. кв.",
			"4. кв."
		],
		wide: [
			"1. квартал",
			"2. квартал",
			"3. квартал",
			"4. квартал"
		]
	};
	var monthValues$14 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"јан",
			"феб",
			"мар",
			"апр",
			"мај",
			"јун",
			"јул",
			"авг",
			"сеп",
			"окт",
			"нов",
			"дец"
		],
		wide: [
			"јануар",
			"фебруар",
			"март",
			"април",
			"мај",
			"јун",
			"јул",
			"август",
			"септембар",
			"октобар",
			"новембар",
			"децембар"
		]
	};
	var formattingMonthValues$3 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"јан",
			"феб",
			"мар",
			"апр",
			"мај",
			"јун",
			"јул",
			"авг",
			"сеп",
			"окт",
			"нов",
			"дец"
		],
		wide: [
			"јануар",
			"фебруар",
			"март",
			"април",
			"мај",
			"јун",
			"јул",
			"август",
			"септембар",
			"октобар",
			"новембар",
			"децембар"
		]
	};
	var dayValues$14 = {
		narrow: [
			"Н",
			"П",
			"У",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"нед",
			"пон",
			"уто",
			"сре",
			"чет",
			"пет",
			"суб"
		],
		abbreviated: [
			"нед",
			"пон",
			"уто",
			"сре",
			"чет",
			"пет",
			"суб"
		],
		wide: [
			"недеља",
			"понедељак",
			"уторак",
			"среда",
			"четвртак",
			"петак",
			"субота"
		]
	};
	var formattingDayPeriodValues$14 = {
		narrow: {
			am: "АМ",
			pm: "ПМ",
			midnight: "поноћ",
			noon: "подне",
			morning: "ујутру",
			afternoon: "поподне",
			evening: "увече",
			night: "ноћу"
		},
		abbreviated: {
			am: "АМ",
			pm: "ПМ",
			midnight: "поноћ",
			noon: "подне",
			morning: "ујутру",
			afternoon: "поподне",
			evening: "увече",
			night: "ноћу"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "поноћ",
			noon: "подне",
			morning: "ујутру",
			afternoon: "после подне",
			evening: "увече",
			night: "ноћу"
		}
	};
	var dayPeriodValues$14 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "поноћ",
			noon: "подне",
			morning: "ујутру",
			afternoon: "поподне",
			evening: "увече",
			night: "ноћу"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "поноћ",
			noon: "подне",
			morning: "ујутру",
			afternoon: "поподне",
			evening: "увече",
			night: "ноћу"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "поноћ",
			noon: "подне",
			morning: "ујутру",
			afternoon: "после подне",
			evening: "увече",
			night: "ноћу"
		}
	};
	var ordinalNumber$14 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr.js
	/**
	* @category Locales
	* @summary Serbian cyrillic locale.
	* @language Serbian
	* @iso-639-2 srp
	* @author Igor Radivojević [@rogyvoje](https://github.com/rogyvoje)
	*/
	var sr = {
		code: "sr",
		formatDistance: formatDistance$14,
		formatLong: formatLong$14,
		formatRelative: formatRelative$14,
		localize: {
			ordinalNumber: ordinalNumber$14,
			era: buildLocalizeFn({
				values: eraValues$14,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$14,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$14,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$3,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$14,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$14,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$14,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(пр\.н\.е\.|АД)/i,
					abbreviated: /^(пр\.\s?Хр\.|по\.\s?Хр\.)/i,
					wide: /^(Пре Христа|пре нове ере|После Христа|нова ера)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^пр/i, /^(по|нова)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]\.\s?кв\.?/i,
					wide: /^[1234]\. квартал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(10|11|12|[123456789])\./i,
					abbreviated: /^(јан|феб|мар|апр|мај|јун|јул|авг|сеп|окт|нов|дец)/i,
					wide: /^((јануар|јануара)|(фебруар|фебруара)|(март|марта)|(април|априла)|(мја|маја)|(јун|јуна)|(јул|јула)|(август|августа)|(септембар|септембра)|(октобар|октобра)|(новембар|новембра)|(децембар|децембра))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^1/i,
						/^2/i,
						/^3/i,
						/^4/i,
						/^5/i,
						/^6/i,
						/^7/i,
						/^8/i,
						/^9/i,
						/^10/i,
						/^11/i,
						/^12/i
					],
					any: [
						/^ја/i,
						/^ф/i,
						/^мар/i,
						/^ап/i,
						/^мај/i,
						/^јун/i,
						/^јул/i,
						/^авг/i,
						/^с/i,
						/^о/i,
						/^н/i,
						/^д/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[пусчн]/i,
					short: /^(нед|пон|уто|сре|чет|пет|суб)/i,
					abbreviated: /^(нед|пон|уто|сре|чет|пет|суб)/i,
					wide: /^(недеља|понедељак|уторак|среда|четвртак|петак|субота)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^п/i,
						/^у/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i,
						/^н/i
					],
					any: [
						/^нед/i,
						/^пон/i,
						/^уто/i,
						/^сре/i,
						/^чет/i,
						/^пет/i,
						/^суб/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(ам|пм|поноћ|(по)?подне|увече|ноћу|после подне|ујутру)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^поно/i,
					noon: /^под/i,
					morning: /ујутру/i,
					afternoon: /(после\s|по)+подне/i,
					evening: /(увече)/i,
					night: /(ноћу)/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr-Latn/_lib/formatDistance.js
	var formatDistanceLocale$13 = {
		lessThanXSeconds: {
			one: {
				standalone: "manje od 1 sekunde",
				withPrepositionAgo: "manje od 1 sekunde",
				withPrepositionIn: "manje od 1 sekundu"
			},
			dual: "manje od {{count}} sekunde",
			other: "manje od {{count}} sekundi"
		},
		xSeconds: {
			one: {
				standalone: "1 sekunda",
				withPrepositionAgo: "1 sekunde",
				withPrepositionIn: "1 sekundu"
			},
			dual: "{{count}} sekunde",
			other: "{{count}} sekundi"
		},
		halfAMinute: "pola minute",
		lessThanXMinutes: {
			one: {
				standalone: "manje od 1 minute",
				withPrepositionAgo: "manje od 1 minute",
				withPrepositionIn: "manje od 1 minutu"
			},
			dual: "manje od {{count}} minute",
			other: "manje od {{count}} minuta"
		},
		xMinutes: {
			one: {
				standalone: "1 minuta",
				withPrepositionAgo: "1 minute",
				withPrepositionIn: "1 minutu"
			},
			dual: "{{count}} minute",
			other: "{{count}} minuta"
		},
		aboutXHours: {
			one: {
				standalone: "oko 1 sat",
				withPrepositionAgo: "oko 1 sat",
				withPrepositionIn: "oko 1 sat"
			},
			dual: "oko {{count}} sata",
			other: "oko {{count}} sati"
		},
		xHours: {
			one: {
				standalone: "1 sat",
				withPrepositionAgo: "1 sat",
				withPrepositionIn: "1 sat"
			},
			dual: "{{count}} sata",
			other: "{{count}} sati"
		},
		xDays: {
			one: {
				standalone: "1 dan",
				withPrepositionAgo: "1 dan",
				withPrepositionIn: "1 dan"
			},
			dual: "{{count}} dana",
			other: "{{count}} dana"
		},
		aboutXWeeks: {
			one: {
				standalone: "oko 1 nedelju",
				withPrepositionAgo: "oko 1 nedelju",
				withPrepositionIn: "oko 1 nedelju"
			},
			dual: "oko {{count}} nedelje",
			other: "oko {{count}} nedelje"
		},
		xWeeks: {
			one: {
				standalone: "1 nedelju",
				withPrepositionAgo: "1 nedelju",
				withPrepositionIn: "1 nedelju"
			},
			dual: "{{count}} nedelje",
			other: "{{count}} nedelje"
		},
		aboutXMonths: {
			one: {
				standalone: "oko 1 mesec",
				withPrepositionAgo: "oko 1 mesec",
				withPrepositionIn: "oko 1 mesec"
			},
			dual: "oko {{count}} meseca",
			other: "oko {{count}} meseci"
		},
		xMonths: {
			one: {
				standalone: "1 mesec",
				withPrepositionAgo: "1 mesec",
				withPrepositionIn: "1 mesec"
			},
			dual: "{{count}} meseca",
			other: "{{count}} meseci"
		},
		aboutXYears: {
			one: {
				standalone: "oko 1 godinu",
				withPrepositionAgo: "oko 1 godinu",
				withPrepositionIn: "oko 1 godinu"
			},
			dual: "oko {{count}} godine",
			other: "oko {{count}} godina"
		},
		xYears: {
			one: {
				standalone: "1 godina",
				withPrepositionAgo: "1 godine",
				withPrepositionIn: "1 godinu"
			},
			dual: "{{count}} godine",
			other: "{{count}} godina"
		},
		overXYears: {
			one: {
				standalone: "preko 1 godinu",
				withPrepositionAgo: "preko 1 godinu",
				withPrepositionIn: "preko 1 godinu"
			},
			dual: "preko {{count}} godine",
			other: "preko {{count}} godina"
		},
		almostXYears: {
			one: {
				standalone: "gotovo 1 godinu",
				withPrepositionAgo: "gotovo 1 godinu",
				withPrepositionIn: "gotovo 1 godinu"
			},
			dual: "gotovo {{count}} godine",
			other: "gotovo {{count}} godina"
		}
	};
	var formatDistance$13 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$13[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) if (options?.addSuffix) if (options.comparison && options.comparison > 0) result = tokenValue.one.withPrepositionIn;
		else result = tokenValue.one.withPrepositionAgo;
		else result = tokenValue.one.standalone;
		else if (count % 10 > 1 && count % 10 < 5 && String(count).substr(-2, 1) !== "1") result = tokenValue.dual.replace("{{count}}", String(count));
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "za " + result;
		else return "pre " + result;
		return result;
	};
	var formatLong$13 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d. MMMM yyyy.",
				long: "d. MMMM yyyy.",
				medium: "d. MMM yy.",
				short: "dd. MM. yy."
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss (zzzz)",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'u' {{time}}",
				long: "{{date}} 'u' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr-Latn/_lib/formatRelative.js
	var formatRelativeLocale$13 = {
		lastWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'prošle nedelje u' p";
				case 3: return "'prošle srede u' p";
				case 6: return "'prošle subote u' p";
				default: return "'prošli' EEEE 'u' p";
			}
		},
		yesterday: "'juče u' p",
		today: "'danas u' p",
		tomorrow: "'sutra u' p",
		nextWeek: (date) => {
			switch (date.getDay()) {
				case 0: return "'sledeće nedelje u' p";
				case 3: return "'sledeću sredu u' p";
				case 6: return "'sledeću subotu u' p";
				default: return "'sledeći' EEEE 'u' p";
			}
		},
		other: "P"
	};
	var formatRelative$13 = (token, date, _baseDate, _options) => {
		const format = formatRelativeLocale$13[token];
		if (typeof format === "function") return format(date);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr-Latn/_lib/localize.js
	var eraValues$13 = {
		narrow: ["pr.n.e.", "AD"],
		abbreviated: ["pr. Hr.", "po. Hr."],
		wide: ["Pre Hrista", "Posle Hrista"]
	};
	var quarterValues$13 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4."
		],
		abbreviated: [
			"1. kv.",
			"2. kv.",
			"3. kv.",
			"4. kv."
		],
		wide: [
			"1. kvartal",
			"2. kvartal",
			"3. kvartal",
			"4. kvartal"
		]
	};
	var monthValues$13 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"maj",
			"jun",
			"jul",
			"avg",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"januar",
			"februar",
			"mart",
			"april",
			"maj",
			"jun",
			"jul",
			"avgust",
			"septembar",
			"oktobar",
			"novembar",
			"decembar"
		]
	};
	var formattingMonthValues$2 = {
		narrow: [
			"1.",
			"2.",
			"3.",
			"4.",
			"5.",
			"6.",
			"7.",
			"8.",
			"9.",
			"10.",
			"11.",
			"12."
		],
		abbreviated: [
			"jan",
			"feb",
			"mar",
			"apr",
			"maj",
			"jun",
			"jul",
			"avg",
			"sep",
			"okt",
			"nov",
			"dec"
		],
		wide: [
			"januar",
			"februar",
			"mart",
			"april",
			"maj",
			"jun",
			"jul",
			"avgust",
			"septembar",
			"oktobar",
			"novembar",
			"decembar"
		]
	};
	var dayValues$13 = {
		narrow: [
			"N",
			"P",
			"U",
			"S",
			"Č",
			"P",
			"S"
		],
		short: [
			"ned",
			"pon",
			"uto",
			"sre",
			"čet",
			"pet",
			"sub"
		],
		abbreviated: [
			"ned",
			"pon",
			"uto",
			"sre",
			"čet",
			"pet",
			"sub"
		],
		wide: [
			"nedelja",
			"ponedeljak",
			"utorak",
			"sreda",
			"četvrtak",
			"petak",
			"subota"
		]
	};
	var formattingDayPeriodValues$13 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "posle podne",
			evening: "uveče",
			night: "noću"
		}
	};
	var dayPeriodValues$13 = {
		narrow: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "popodne",
			evening: "uveče",
			night: "noću"
		},
		wide: {
			am: "AM",
			pm: "PM",
			midnight: "ponoć",
			noon: "podne",
			morning: "ujutru",
			afternoon: "posle podne",
			evening: "uveče",
			night: "noću"
		}
	};
	var ordinalNumber$13 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sr-Latn.js
	/**
	* @category Locales
	* @summary Serbian latin locale.
	* @language Serbian
	* @iso-639-2 srp
	* @author Igor Radivojević [@rogyvoje](https://github.com/rogyvoje)
	*/
	var srLatn = {
		code: "sr-Latn",
		formatDistance: formatDistance$13,
		formatLong: formatLong$13,
		formatRelative: formatRelative$13,
		localize: {
			ordinalNumber: ordinalNumber$13,
			era: buildLocalizeFn({
				values: eraValues$13,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$13,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$13,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$2,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$13,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$13,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$13,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)\./i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(pr\.n\.e\.|AD)/i,
					abbreviated: /^(pr\.\s?Hr\.|po\.\s?Hr\.)/i,
					wide: /^(Pre Hrista|pre nove ere|Posle Hrista|nova era)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^pr/i, /^(po|nova)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]\.\s?kv\.?/i,
					wide: /^[1234]\. kvartal/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(10|11|12|[123456789])\./i,
					abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|avg|sep|okt|nov|dec)/i,
					wide: /^((januar|januara)|(februar|februara)|(mart|marta)|(april|aprila)|(maj|maja)|(jun|juna)|(jul|jula)|(avgust|avgusta)|(septembar|septembra)|(oktobar|oktobra)|(novembar|novembra)|(decembar|decembra))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^1/i,
						/^2/i,
						/^3/i,
						/^4/i,
						/^5/i,
						/^6/i,
						/^7/i,
						/^8/i,
						/^9/i,
						/^10/i,
						/^11/i,
						/^12/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^avg/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[npusčc]/i,
					short: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
					abbreviated: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
					wide: /^(nedelja|ponedeljak|utorak|sreda|(četvrtak|cetvrtak)|petak|subota)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^s/i,
						/^m/i,
						/^t/i,
						/^w/i,
						/^t/i,
						/^f/i,
						/^s/i
					],
					any: [
						/^su/i,
						/^m/i,
						/^tu/i,
						/^w/i,
						/^th/i,
						/^f/i,
						/^sa/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(am|pm|ponoc|ponoć|(po)?podne|uvece|uveče|noću|posle podne|ujutru)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^pono/i,
					noon: /^pod/i,
					morning: /jutro/i,
					afternoon: /(posle\s|po)+podne/i,
					evening: /(uvece|uveče)/i,
					night: /(nocu|noću)/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sv/_lib/formatDistance.js
	var formatDistanceLocale$12 = {
		lessThanXSeconds: {
			one: "mindre än en sekund",
			other: "mindre än {{count}} sekunder"
		},
		xSeconds: {
			one: "en sekund",
			other: "{{count}} sekunder"
		},
		halfAMinute: "en halv minut",
		lessThanXMinutes: {
			one: "mindre än en minut",
			other: "mindre än {{count}} minuter"
		},
		xMinutes: {
			one: "en minut",
			other: "{{count}} minuter"
		},
		aboutXHours: {
			one: "ungefär en timme",
			other: "ungefär {{count}} timmar"
		},
		xHours: {
			one: "en timme",
			other: "{{count}} timmar"
		},
		xDays: {
			one: "en dag",
			other: "{{count}} dagar"
		},
		aboutXWeeks: {
			one: "ungefär en vecka",
			other: "ungefär {{count}} veckor"
		},
		xWeeks: {
			one: "en vecka",
			other: "{{count}} veckor"
		},
		aboutXMonths: {
			one: "ungefär en månad",
			other: "ungefär {{count}} månader"
		},
		xMonths: {
			one: "en månad",
			other: "{{count}} månader"
		},
		aboutXYears: {
			one: "ungefär ett år",
			other: "ungefär {{count}} år"
		},
		xYears: {
			one: "ett år",
			other: "{{count}} år"
		},
		overXYears: {
			one: "över ett år",
			other: "över {{count}} år"
		},
		almostXYears: {
			one: "nästan ett år",
			other: "nästan {{count}} år"
		}
	};
	var wordMapping = [
		"noll",
		"en",
		"två",
		"tre",
		"fyra",
		"fem",
		"sex",
		"sju",
		"åtta",
		"nio",
		"tio",
		"elva",
		"tolv"
	];
	var formatDistance$12 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$12[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count < 13 ? wordMapping[count] : String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "om " + result;
		else return result + " sedan";
		return result;
	};
	var formatLong$12 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE d MMMM y",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "y-MM-dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "'kl'. HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'kl.' {{time}}",
				long: "{{date}} 'kl.' {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sv/_lib/formatRelative.js
	var formatRelativeLocale$12 = {
		lastWeek: "'i' EEEE's kl.' p",
		yesterday: "'igår kl.' p",
		today: "'idag kl.' p",
		tomorrow: "'imorgon kl.' p",
		nextWeek: "EEEE 'kl.' p",
		other: "P"
	};
	var formatRelative$12 = (token, _date, _baseDate, _options) => formatRelativeLocale$12[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/sv/_lib/localize.js
	var eraValues$12 = {
		narrow: ["f.Kr.", "e.Kr."],
		abbreviated: ["f.Kr.", "e.Kr."],
		wide: ["före Kristus", "efter Kristus"]
	};
	var quarterValues$12 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"1:a kvartalet",
			"2:a kvartalet",
			"3:e kvartalet",
			"4:e kvartalet"
		]
	};
	var monthValues$12 = {
		narrow: [
			"J",
			"F",
			"M",
			"A",
			"M",
			"J",
			"J",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"jan.",
			"feb.",
			"mars",
			"apr.",
			"maj",
			"juni",
			"juli",
			"aug.",
			"sep.",
			"okt.",
			"nov.",
			"dec."
		],
		wide: [
			"januari",
			"februari",
			"mars",
			"april",
			"maj",
			"juni",
			"juli",
			"augusti",
			"september",
			"oktober",
			"november",
			"december"
		]
	};
	var dayValues$12 = {
		narrow: [
			"S",
			"M",
			"T",
			"O",
			"T",
			"F",
			"L"
		],
		short: [
			"sö",
			"må",
			"ti",
			"on",
			"to",
			"fr",
			"lö"
		],
		abbreviated: [
			"sön",
			"mån",
			"tis",
			"ons",
			"tors",
			"fre",
			"lör"
		],
		wide: [
			"söndag",
			"måndag",
			"tisdag",
			"onsdag",
			"torsdag",
			"fredag",
			"lördag"
		]
	};
	var dayPeriodValues$12 = {
		narrow: {
			am: "fm",
			pm: "em",
			midnight: "midnatt",
			noon: "middag",
			morning: "morg.",
			afternoon: "efterm.",
			evening: "kväll",
			night: "natt"
		},
		abbreviated: {
			am: "f.m.",
			pm: "e.m.",
			midnight: "midnatt",
			noon: "middag",
			morning: "morgon",
			afternoon: "efterm.",
			evening: "kväll",
			night: "natt"
		},
		wide: {
			am: "förmiddag",
			pm: "eftermiddag",
			midnight: "midnatt",
			noon: "middag",
			morning: "morgon",
			afternoon: "eftermiddag",
			evening: "kväll",
			night: "natt"
		}
	};
	var formattingDayPeriodValues$12 = {
		narrow: {
			am: "fm",
			pm: "em",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morg.",
			afternoon: "på efterm.",
			evening: "på kvällen",
			night: "på natten"
		},
		abbreviated: {
			am: "fm",
			pm: "em",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morg.",
			afternoon: "på efterm.",
			evening: "på kvällen",
			night: "på natten"
		},
		wide: {
			am: "fm",
			pm: "em",
			midnight: "midnatt",
			noon: "middag",
			morning: "på morgonen",
			afternoon: "på eftermiddagen",
			evening: "på kvällen",
			night: "på natten"
		}
	};
	var ordinalNumber$12 = (dirtyNumber, _options) => {
		const number = Number(dirtyNumber);
		const rem100 = number % 100;
		if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
			case 1:
			case 2: return number + ":a";
		}
		return number + ":e";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/sv.js
	/**
	* @category Locales
	* @summary Swedish locale.
	* @language Swedish
	* @iso-639-2 swe
	* @author Johannes Ulén [@ejulen](https://github.com/ejulen)
	* @author Alexander Nanberg [@alexandernanberg](https://github.com/alexandernanberg)
	* @author Henrik Andersson [@limelights](https://github.com/limelights)
	*/
	var sv = {
		code: "sv",
		formatDistance: formatDistance$12,
		formatLong: formatLong$12,
		formatRelative: formatRelative$12,
		localize: {
			ordinalNumber: ordinalNumber$12,
			era: buildLocalizeFn({
				values: eraValues$12,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$12,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$12,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$12,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$12,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$12,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(:a|:e)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,
					abbreviated: /^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,
					wide: /^(före Kristus|före vår tid|efter Kristus|vår tid)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^f/i, /^[ev]/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](:a|:e)? kvartalet/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[jfmasond]/i,
					abbreviated: /^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,
					wide: /^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^j/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^j/i,
						/^j/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ja/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^maj/i,
						/^jun/i,
						/^jul/i,
						/^au/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[smtofl]/i,
					short: /^(sö|må|ti|on|to|fr|lö)/i,
					abbreviated: /^(sön|mån|tis|ons|tors|fre|lör)/i,
					wide: /^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/^s/i,
					/^m/i,
					/^ti/i,
					/^o/i,
					/^to/i,
					/^f/i,
					/^l/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^f/i,
					pm: /^e/i,
					midnight: /^midn/i,
					noon: /^midd/i,
					morning: /morgon/i,
					afternoon: /eftermiddag/i,
					evening: /kväll/i,
					night: /natt/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ta/_lib/formatDistance.js
	function isPluralType(val) {
		return val.one !== void 0;
	}
	var formatDistanceLocale$11 = {
		lessThanXSeconds: {
			one: {
				default: "ஒரு வினாடிக்கு குறைவாக",
				in: "ஒரு வினாடிக்குள்",
				ago: "ஒரு வினாடிக்கு முன்பு"
			},
			other: {
				default: "{{count}} வினாடிகளுக்கு குறைவாக",
				in: "{{count}} வினாடிகளுக்குள்",
				ago: "{{count}} வினாடிகளுக்கு முன்பு"
			}
		},
		xSeconds: {
			one: {
				default: "1 வினாடி",
				in: "1 வினாடியில்",
				ago: "1 வினாடி முன்பு"
			},
			other: {
				default: "{{count}} விநாடிகள்",
				in: "{{count}} வினாடிகளில்",
				ago: "{{count}} விநாடிகளுக்கு முன்பு"
			}
		},
		halfAMinute: {
			default: "அரை நிமிடம்",
			in: "அரை நிமிடத்தில்",
			ago: "அரை நிமிடம் முன்பு"
		},
		lessThanXMinutes: {
			one: {
				default: "ஒரு நிமிடத்திற்கும் குறைவாக",
				in: "ஒரு நிமிடத்திற்குள்",
				ago: "ஒரு நிமிடத்திற்கு முன்பு"
			},
			other: {
				default: "{{count}} நிமிடங்களுக்கும் குறைவாக",
				in: "{{count}} நிமிடங்களுக்குள்",
				ago: "{{count}} நிமிடங்களுக்கு முன்பு"
			}
		},
		xMinutes: {
			one: {
				default: "1 நிமிடம்",
				in: "1 நிமிடத்தில்",
				ago: "1 நிமிடம் முன்பு"
			},
			other: {
				default: "{{count}} நிமிடங்கள்",
				in: "{{count}} நிமிடங்களில்",
				ago: "{{count}} நிமிடங்களுக்கு முன்பு"
			}
		},
		aboutXHours: {
			one: {
				default: "சுமார் 1 மணி நேரம்",
				in: "சுமார் 1 மணி நேரத்தில்",
				ago: "சுமார் 1 மணி நேரத்திற்கு முன்பு"
			},
			other: {
				default: "சுமார் {{count}} மணி நேரம்",
				in: "சுமார் {{count}} மணி நேரத்திற்கு முன்பு",
				ago: "சுமார் {{count}} மணி நேரத்தில்"
			}
		},
		xHours: {
			one: {
				default: "1 மணி நேரம்",
				in: "1 மணி நேரத்தில்",
				ago: "1 மணி நேரத்திற்கு முன்பு"
			},
			other: {
				default: "{{count}} மணி நேரம்",
				in: "{{count}} மணி நேரத்தில்",
				ago: "{{count}} மணி நேரத்திற்கு முன்பு"
			}
		},
		xDays: {
			one: {
				default: "1 நாள்",
				in: "1 நாளில்",
				ago: "1 நாள் முன்பு"
			},
			other: {
				default: "{{count}} நாட்கள்",
				in: "{{count}} நாட்களில்",
				ago: "{{count}} நாட்களுக்கு முன்பு"
			}
		},
		aboutXWeeks: {
			one: {
				default: "சுமார் 1 வாரம்",
				in: "சுமார் 1 வாரத்தில்",
				ago: "சுமார் 1 வாரம் முன்பு"
			},
			other: {
				default: "சுமார் {{count}} வாரங்கள்",
				in: "சுமார் {{count}} வாரங்களில்",
				ago: "சுமார் {{count}} வாரங்களுக்கு முன்பு"
			}
		},
		xWeeks: {
			one: {
				default: "1 வாரம்",
				in: "1 வாரத்தில்",
				ago: "1 வாரம் முன்பு"
			},
			other: {
				default: "{{count}} வாரங்கள்",
				in: "{{count}} வாரங்களில்",
				ago: "{{count}} வாரங்களுக்கு முன்பு"
			}
		},
		aboutXMonths: {
			one: {
				default: "சுமார் 1 மாதம்",
				in: "சுமார் 1 மாதத்தில்",
				ago: "சுமார் 1 மாதத்திற்கு முன்பு"
			},
			other: {
				default: "சுமார் {{count}} மாதங்கள்",
				in: "சுமார் {{count}} மாதங்களில்",
				ago: "சுமார் {{count}} மாதங்களுக்கு முன்பு"
			}
		},
		xMonths: {
			one: {
				default: "1 மாதம்",
				in: "1 மாதத்தில்",
				ago: "1 மாதம் முன்பு"
			},
			other: {
				default: "{{count}} மாதங்கள்",
				in: "{{count}} மாதங்களில்",
				ago: "{{count}} மாதங்களுக்கு முன்பு"
			}
		},
		aboutXYears: {
			one: {
				default: "சுமார் 1 வருடம்",
				in: "சுமார் 1 ஆண்டில்",
				ago: "சுமார் 1 வருடம் முன்பு"
			},
			other: {
				default: "சுமார் {{count}} ஆண்டுகள்",
				in: "சுமார் {{count}} ஆண்டுகளில்",
				ago: "சுமார் {{count}} ஆண்டுகளுக்கு முன்பு"
			}
		},
		xYears: {
			one: {
				default: "1 வருடம்",
				in: "1 ஆண்டில்",
				ago: "1 வருடம் முன்பு"
			},
			other: {
				default: "{{count}} ஆண்டுகள்",
				in: "{{count}} ஆண்டுகளில்",
				ago: "{{count}} ஆண்டுகளுக்கு முன்பு"
			}
		},
		overXYears: {
			one: {
				default: "1 வருடத்திற்கு மேல்",
				in: "1 வருடத்திற்கும் மேலாக",
				ago: "1 வருடம் முன்பு"
			},
			other: {
				default: "{{count}} ஆண்டுகளுக்கும் மேலாக",
				in: "{{count}} ஆண்டுகளில்",
				ago: "{{count}} ஆண்டுகளுக்கு முன்பு"
			}
		},
		almostXYears: {
			one: {
				default: "கிட்டத்தட்ட 1 வருடம்",
				in: "கிட்டத்தட்ட 1 ஆண்டில்",
				ago: "கிட்டத்தட்ட 1 வருடம் முன்பு"
			},
			other: {
				default: "கிட்டத்தட்ட {{count}} ஆண்டுகள்",
				in: "கிட்டத்தட்ட {{count}} ஆண்டுகளில்",
				ago: "கிட்டத்தட்ட {{count}} ஆண்டுகளுக்கு முன்பு"
			}
		}
	};
	var formatDistance$11 = (token, count, options) => {
		const tense = options?.addSuffix ? options.comparison && options.comparison > 0 ? "in" : "ago" : "default";
		const tokenValue = formatDistanceLocale$11[token];
		if (!isPluralType(tokenValue)) return tokenValue[tense];
		if (count === 1) return tokenValue.one[tense];
		else return tokenValue.other[tense].replace("{{count}}", String(count));
	};
	var formatLong$11 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, d MMMM, y",
				long: "d MMMM, y",
				medium: "d MMM, y",
				short: "d/M/yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "a h:mm:ss zzzz",
				long: "a h:mm:ss z",
				medium: "a h:mm:ss",
				short: "a h:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ta/_lib/formatRelative.js
	var formatRelativeLocale$11 = {
		lastWeek: "'கடந்த' eeee p 'மணிக்கு'",
		yesterday: "'நேற்று ' p 'மணிக்கு'",
		today: "'இன்று ' p 'மணிக்கு'",
		tomorrow: "'நாளை ' p 'மணிக்கு'",
		nextWeek: "eeee p 'மணிக்கு'",
		other: "P"
	};
	var formatRelative$11 = (token, _date, _baseDate, _options) => formatRelativeLocale$11[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ta/_lib/localize.js
	var eraValues$11 = {
		narrow: ["கி.மு.", "கி.பி."],
		abbreviated: ["கி.மு.", "கி.பி."],
		wide: ["கிறிஸ்துவுக்கு முன்", "அன்னோ டோமினி"]
	};
	var quarterValues$11 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"காலா.1",
			"காலா.2",
			"காலா.3",
			"காலா.4"
		],
		wide: [
			"ஒன்றாம் காலாண்டு",
			"இரண்டாம் காலாண்டு",
			"மூன்றாம் காலாண்டு",
			"நான்காம் காலாண்டு"
		]
	};
	var monthValues$11 = {
		narrow: [
			"ஜ",
			"பி",
			"மா",
			"ஏ",
			"மே",
			"ஜூ",
			"ஜூ",
			"ஆ",
			"செ",
			"அ",
			"ந",
			"டி"
		],
		abbreviated: [
			"ஜன.",
			"பிப்.",
			"மார்.",
			"ஏப்.",
			"மே",
			"ஜூன்",
			"ஜூலை",
			"ஆக.",
			"செப்.",
			"அக்.",
			"நவ.",
			"டிச."
		],
		wide: [
			"ஜனவரி",
			"பிப்ரவரி",
			"மார்ச்",
			"ஏப்ரல்",
			"மே",
			"ஜூன்",
			"ஜூலை",
			"ஆகஸ்ட்",
			"செப்டம்பர்",
			"அக்டோபர்",
			"நவம்பர்",
			"டிசம்பர்"
		]
	};
	var dayValues$11 = {
		narrow: [
			"ஞா",
			"தி",
			"செ",
			"பு",
			"வி",
			"வெ",
			"ச"
		],
		short: [
			"ஞா",
			"தி",
			"செ",
			"பு",
			"வி",
			"வெ",
			"ச"
		],
		abbreviated: [
			"ஞாயி.",
			"திங்.",
			"செவ்.",
			"புத.",
			"வியா.",
			"வெள்.",
			"சனி"
		],
		wide: [
			"ஞாயிறு",
			"திங்கள்",
			"செவ்வாய்",
			"புதன்",
			"வியாழன்",
			"வெள்ளி",
			"சனி"
		]
	};
	var dayPeriodValues$11 = {
		narrow: {
			am: "மு.ப",
			pm: "பி.ப",
			midnight: "நள்.",
			noon: "நண்.",
			morning: "கா.",
			afternoon: "மதி.",
			evening: "மா.",
			night: "இர."
		},
		abbreviated: {
			am: "முற்பகல்",
			pm: "பிற்பகல்",
			midnight: "நள்ளிரவு",
			noon: "நண்பகல்",
			morning: "காலை",
			afternoon: "மதியம்",
			evening: "மாலை",
			night: "இரவு"
		},
		wide: {
			am: "முற்பகல்",
			pm: "பிற்பகல்",
			midnight: "நள்ளிரவு",
			noon: "நண்பகல்",
			morning: "காலை",
			afternoon: "மதியம்",
			evening: "மாலை",
			night: "இரவு"
		}
	};
	var formattingDayPeriodValues$11 = {
		narrow: {
			am: "மு.ப",
			pm: "பி.ப",
			midnight: "நள்.",
			noon: "நண்.",
			morning: "கா.",
			afternoon: "மதி.",
			evening: "மா.",
			night: "இர."
		},
		abbreviated: {
			am: "முற்பகல்",
			pm: "பிற்பகல்",
			midnight: "நள்ளிரவு",
			noon: "நண்பகல்",
			morning: "காலை",
			afternoon: "மதியம்",
			evening: "மாலை",
			night: "இரவு"
		},
		wide: {
			am: "முற்பகல்",
			pm: "பிற்பகல்",
			midnight: "நள்ளிரவு",
			noon: "நண்பகல்",
			morning: "காலை",
			afternoon: "மதியம்",
			evening: "மாலை",
			night: "இரவு"
		}
	};
	var ordinalNumber$11 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ta.js
	/**
	* @category Locales
	* @summary Tamil locale (India).
	* @language Tamil
	* @iso-639-2 tam
	* @author Sibiraj [@sibiraj-s](https://github.com/sibiraj-s)
	*/
	var ta = {
		code: "ta",
		formatDistance: formatDistance$11,
		formatLong: formatLong$11,
		formatRelative: formatRelative$11,
		localize: {
			ordinalNumber: ordinalNumber$11,
			era: buildLocalizeFn({
				values: eraValues$11,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$11,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$11,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$11,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$11,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$11,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(வது)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(கி.மு.|கி.பி.)/i,
					abbreviated: /^(கி\.?\s?மு\.?|கி\.?\s?பி\.?)/,
					wide: /^(கிறிஸ்துவுக்கு\sமுன்|அன்னோ\sடோமினி)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/கி\.?\s?மு\.?/, /கி\.?\s?பி\.?/] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^காலா.[1234]/i,
					wide: /^(ஒன்றாம்|இரண்டாம்|மூன்றாம்|நான்காம்) காலாண்டு/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/1/i,
						/2/i,
						/3/i,
						/4/i
					],
					any: [
						/(1|காலா.1|ஒன்றாம்)/i,
						/(2|காலா.2|இரண்டாம்)/i,
						/(3|காலா.3|மூன்றாம்)/i,
						/(4|காலா.4|நான்காம்)/i
					]
				},
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(ஜ|பி|மா|ஏ|மே|ஜூ|ஆ|செ|அ|ந|டி)$/i,
					abbreviated: /^(ஜன.|பிப்.|மார்.|ஏப்.|மே|ஜூன்|ஜூலை|ஆக.|செப்.|அக்.|நவ.|டிச.)/i,
					wide: /^(ஜனவரி|பிப்ரவரி|மார்ச்|ஏப்ரல்|மே|ஜூன்|ஜூலை|ஆகஸ்ட்|செப்டம்பர்|அக்டோபர்|நவம்பர்|டிசம்பர்)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ஜ$/i,
						/^பி/i,
						/^மா/i,
						/^ஏ/i,
						/^மே/i,
						/^ஜூ/i,
						/^ஜூ/i,
						/^ஆ/i,
						/^செ/i,
						/^அ/i,
						/^ந/i,
						/^டி/i
					],
					any: [
						/^ஜன/i,
						/^பி/i,
						/^மா/i,
						/^ஏ/i,
						/^மே/i,
						/^ஜூன்/i,
						/^ஜூலை/i,
						/^ஆ/i,
						/^செ/i,
						/^அ/i,
						/^ந/i,
						/^டி/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
					short: /^(ஞா|தி|செ|பு|வி|வெ|ச)/i,
					abbreviated: /^(ஞாயி.|திங்.|செவ்.|புத.|வியா.|வெள்.|சனி)/i,
					wide: /^(ஞாயிறு|திங்கள்|செவ்வாய்|புதன்|வியாழன்|வெள்ளி|சனி)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ஞா/i,
						/^தி/i,
						/^செ/i,
						/^பு/i,
						/^வி/i,
						/^வெ/i,
						/^ச/i
					],
					any: [
						/^ஞா/i,
						/^தி/i,
						/^செ/i,
						/^பு/i,
						/^வி/i,
						/^வெ/i,
						/^ச/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(மு.ப|பி.ப|நள்|நண்|காலை|மதியம்|மாலை|இரவு)/i,
					any: /^(மு.ப|பி.ப|முற்பகல்|பிற்பகல்|நள்ளிரவு|நண்பகல்|காலை|மதியம்|மாலை|இரவு)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^மு/i,
					pm: /^பி/i,
					midnight: /^நள்/i,
					noon: /^நண்/i,
					morning: /காலை/i,
					afternoon: /மதியம்/i,
					evening: /மாலை/i,
					night: /இரவு/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/te/_lib/formatDistance.js
	var formatDistanceLocale$10 = {
		lessThanXSeconds: {
			standalone: {
				one: "సెకను కన్నా తక్కువ",
				other: "{{count}} సెకన్ల కన్నా తక్కువ"
			},
			withPreposition: {
				one: "సెకను",
				other: "{{count}} సెకన్ల"
			}
		},
		xSeconds: {
			standalone: {
				one: "ఒక సెకను",
				other: "{{count}} సెకన్ల"
			},
			withPreposition: {
				one: "ఒక సెకను",
				other: "{{count}} సెకన్ల"
			}
		},
		halfAMinute: {
			standalone: "అర నిమిషం",
			withPreposition: "అర నిమిషం"
		},
		lessThanXMinutes: {
			standalone: {
				one: "ఒక నిమిషం కన్నా తక్కువ",
				other: "{{count}} నిమిషాల కన్నా తక్కువ"
			},
			withPreposition: {
				one: "ఒక నిమిషం",
				other: "{{count}} నిమిషాల"
			}
		},
		xMinutes: {
			standalone: {
				one: "ఒక నిమిషం",
				other: "{{count}} నిమిషాలు"
			},
			withPreposition: {
				one: "ఒక నిమిషం",
				other: "{{count}} నిమిషాల"
			}
		},
		aboutXHours: {
			standalone: {
				one: "సుమారు ఒక గంట",
				other: "సుమారు {{count}} గంటలు"
			},
			withPreposition: {
				one: "సుమారు ఒక గంట",
				other: "సుమారు {{count}} గంటల"
			}
		},
		xHours: {
			standalone: {
				one: "ఒక గంట",
				other: "{{count}} గంటలు"
			},
			withPreposition: {
				one: "ఒక గంట",
				other: "{{count}} గంటల"
			}
		},
		xDays: {
			standalone: {
				one: "ఒక రోజు",
				other: "{{count}} రోజులు"
			},
			withPreposition: {
				one: "ఒక రోజు",
				other: "{{count}} రోజుల"
			}
		},
		aboutXWeeks: {
			standalone: {
				one: "సుమారు ఒక వారం",
				other: "సుమారు {{count}} వారాలు"
			},
			withPreposition: {
				one: "సుమారు ఒక వారం",
				other: "సుమారు {{count}} వారాలల"
			}
		},
		xWeeks: {
			standalone: {
				one: "ఒక వారం",
				other: "{{count}} వారాలు"
			},
			withPreposition: {
				one: "ఒక వారం",
				other: "{{count}} వారాలల"
			}
		},
		aboutXMonths: {
			standalone: {
				one: "సుమారు ఒక నెల",
				other: "సుమారు {{count}} నెలలు"
			},
			withPreposition: {
				one: "సుమారు ఒక నెల",
				other: "సుమారు {{count}} నెలల"
			}
		},
		xMonths: {
			standalone: {
				one: "ఒక నెల",
				other: "{{count}} నెలలు"
			},
			withPreposition: {
				one: "ఒక నెల",
				other: "{{count}} నెలల"
			}
		},
		aboutXYears: {
			standalone: {
				one: "సుమారు ఒక సంవత్సరం",
				other: "సుమారు {{count}} సంవత్సరాలు"
			},
			withPreposition: {
				one: "సుమారు ఒక సంవత్సరం",
				other: "సుమారు {{count}} సంవత్సరాల"
			}
		},
		xYears: {
			standalone: {
				one: "ఒక సంవత్సరం",
				other: "{{count}} సంవత్సరాలు"
			},
			withPreposition: {
				one: "ఒక సంవత్సరం",
				other: "{{count}} సంవత్సరాల"
			}
		},
		overXYears: {
			standalone: {
				one: "ఒక సంవత్సరం పైగా",
				other: "{{count}} సంవత్సరాలకు పైగా"
			},
			withPreposition: {
				one: "ఒక సంవత్సరం",
				other: "{{count}} సంవత్సరాల"
			}
		},
		almostXYears: {
			standalone: {
				one: "దాదాపు ఒక సంవత్సరం",
				other: "దాదాపు {{count}} సంవత్సరాలు"
			},
			withPreposition: {
				one: "దాదాపు ఒక సంవత్సరం",
				other: "దాదాపు {{count}} సంవత్సరాల"
			}
		}
	};
	var formatDistance$10 = (token, count, options) => {
		let result;
		const tokenValue = options?.addSuffix ? formatDistanceLocale$10[token].withPreposition : formatDistanceLocale$10[token].standalone;
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "లో";
		else return result + " క్రితం";
		return result;
	};
	var formatLong$10 = {
		date: buildFormatLongFn({
			formats: {
				full: "d, MMMM y, EEEE",
				long: "d MMMM, y",
				medium: "d MMM, y",
				short: "dd-MM-yy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}'కి'",
				long: "{{date}} {{time}}'కి'",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/te/_lib/formatRelative.js
	var formatRelativeLocale$10 = {
		lastWeek: "'గత' eeee p",
		yesterday: "'నిన్న' p",
		today: "'ఈ రోజు' p",
		tomorrow: "'రేపు' p",
		nextWeek: "'తదుపరి' eeee p",
		other: "P"
	};
	var formatRelative$10 = (token, _date, _baseDate, _options) => formatRelativeLocale$10[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/te/_lib/localize.js
	var eraValues$10 = {
		narrow: ["క్రీ.పూ.", "క్రీ.శ."],
		abbreviated: ["క్రీ.పూ.", "క్రీ.శ."],
		wide: ["క్రీస్తు పూర్వం", "క్రీస్తుశకం"]
	};
	var quarterValues$10 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"త్రై1",
			"త్రై2",
			"త్రై3",
			"త్రై4"
		],
		wide: [
			"1వ త్రైమాసికం",
			"2వ త్రైమాసికం",
			"3వ త్రైమాసికం",
			"4వ త్రైమాసికం"
		]
	};
	var monthValues$10 = {
		narrow: [
			"జ",
			"ఫి",
			"మా",
			"ఏ",
			"మే",
			"జూ",
			"జు",
			"ఆ",
			"సె",
			"అ",
			"న",
			"డి"
		],
		abbreviated: [
			"జన",
			"ఫిబ్ర",
			"మార్చి",
			"ఏప్రి",
			"మే",
			"జూన్",
			"జులై",
			"ఆగ",
			"సెప్టెం",
			"అక్టో",
			"నవం",
			"డిసెం"
		],
		wide: [
			"జనవరి",
			"ఫిబ్రవరి",
			"మార్చి",
			"ఏప్రిల్",
			"మే",
			"జూన్",
			"జులై",
			"ఆగస్టు",
			"సెప్టెంబర్",
			"అక్టోబర్",
			"నవంబర్",
			"డిసెంబర్"
		]
	};
	var dayValues$10 = {
		narrow: [
			"ఆ",
			"సో",
			"మ",
			"బు",
			"గు",
			"శు",
			"శ"
		],
		short: [
			"ఆది",
			"సోమ",
			"మంగళ",
			"బుధ",
			"గురు",
			"శుక్ర",
			"శని"
		],
		abbreviated: [
			"ఆది",
			"సోమ",
			"మంగళ",
			"బుధ",
			"గురు",
			"శుక్ర",
			"శని"
		],
		wide: [
			"ఆదివారం",
			"సోమవారం",
			"మంగళవారం",
			"బుధవారం",
			"గురువారం",
			"శుక్రవారం",
			"శనివారం"
		]
	};
	var dayPeriodValues$10 = {
		narrow: {
			am: "పూర్వాహ్నం",
			pm: "అపరాహ్నం",
			midnight: "అర్ధరాత్రి",
			noon: "మిట్టమధ్యాహ్నం",
			morning: "ఉదయం",
			afternoon: "మధ్యాహ్నం",
			evening: "సాయంత్రం",
			night: "రాత్రి"
		},
		abbreviated: {
			am: "పూర్వాహ్నం",
			pm: "అపరాహ్నం",
			midnight: "అర్ధరాత్రి",
			noon: "మిట్టమధ్యాహ్నం",
			morning: "ఉదయం",
			afternoon: "మధ్యాహ్నం",
			evening: "సాయంత్రం",
			night: "రాత్రి"
		},
		wide: {
			am: "పూర్వాహ్నం",
			pm: "అపరాహ్నం",
			midnight: "అర్ధరాత్రి",
			noon: "మిట్టమధ్యాహ్నం",
			morning: "ఉదయం",
			afternoon: "మధ్యాహ్నం",
			evening: "సాయంత్రం",
			night: "రాత్రి"
		}
	};
	var formattingDayPeriodValues$10 = {
		narrow: {
			am: "పూర్వాహ్నం",
			pm: "అపరాహ్నం",
			midnight: "అర్ధరాత్రి",
			noon: "మిట్టమధ్యాహ్నం",
			morning: "ఉదయం",
			afternoon: "మధ్యాహ్నం",
			evening: "సాయంత్రం",
			night: "రాత్రి"
		},
		abbreviated: {
			am: "పూర్వాహ్నం",
			pm: "అపరాహ్నం",
			midnight: "అర్ధరాత్రి",
			noon: "మిట్టమధ్యాహ్నం",
			morning: "ఉదయం",
			afternoon: "మధ్యాహ్నం",
			evening: "సాయంత్రం",
			night: "రాత్రి"
		},
		wide: {
			am: "పూర్వాహ్నం",
			pm: "అపరాహ్నం",
			midnight: "అర్ధరాత్రి",
			noon: "మిట్టమధ్యాహ్నం",
			morning: "ఉదయం",
			afternoon: "మధ్యాహ్నం",
			evening: "సాయంత్రం",
			night: "రాత్రి"
		}
	};
	var ordinalNumber$10 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + "వ";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/te.js
	/**
	* @category Locales
	* @summary Telugu locale
	* @language Telugu
	* @iso-639-2 tel
	* @author Kranthi Lakum [@kranthilakum](https://github.com/kranthilakum)
	*/
	var te = {
		code: "te",
		formatDistance: formatDistance$10,
		formatLong: formatLong$10,
		formatRelative: formatRelative$10,
		localize: {
			ordinalNumber: ordinalNumber$10,
			era: buildLocalizeFn({
				values: eraValues$10,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$10,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$10,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$10,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$10,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$10,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(వ)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(క్రీ\.పూ\.|క్రీ\.శ\.)/i,
					abbreviated: /^(క్రీ\.?\s?పూ\.?|ప్ర\.?\s?శ\.?\s?పూ\.?|క్రీ\.?\s?శ\.?|సా\.?\s?శ\.?)/i,
					wide: /^(క్రీస్తు పూర్వం|ప్రస్తుత శకానికి పూర్వం|క్రీస్తు శకం|ప్రస్తుత శకం)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(పూ|శ)/i, /^సా/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^త్రై[1234]/i,
					wide: /^[1234](వ)? త్రైమాసికం/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(జూ|జు|జ|ఫి|మా|ఏ|మే|ఆ|సె|అ|న|డి)/i,
					abbreviated: /^(జన|ఫిబ్ర|మార్చి|ఏప్రి|మే|జూన్|జులై|ఆగ|సెప్|అక్టో|నవ|డిసె)/i,
					wide: /^(జనవరి|ఫిబ్రవరి|మార్చి|ఏప్రిల్|మే|జూన్|జులై|ఆగస్టు|సెప్టెంబర్|అక్టోబర్|నవంబర్|డిసెంబర్)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^జ/i,
						/^ఫి/i,
						/^మా/i,
						/^ఏ/i,
						/^మే/i,
						/^జూ/i,
						/^జు/i,
						/^ఆ/i,
						/^సె/i,
						/^అ/i,
						/^న/i,
						/^డి/i
					],
					any: [
						/^జన/i,
						/^ఫి/i,
						/^మా/i,
						/^ఏ/i,
						/^మే/i,
						/^జూన్/i,
						/^జులై/i,
						/^ఆగ/i,
						/^సె/i,
						/^అ/i,
						/^న/i,
						/^డి/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(ఆ|సో|మ|బు|గు|శు|శ)/i,
					short: /^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i,
					abbreviated: /^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i,
					wide: /^(ఆదివారం|సోమవారం|మంగళవారం|బుధవారం|గురువారం|శుక్రవారం|శనివారం)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ఆ/i,
						/^సో/i,
						/^మ/i,
						/^బు/i,
						/^గు/i,
						/^శు/i,
						/^శ/i
					],
					any: [
						/^ఆది/i,
						/^సోమ/i,
						/^మం/i,
						/^బుధ/i,
						/^గురు/i,
						/^శుక్ర/i,
						/^శని/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i,
					any: /^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^పూర్వాహ్నం/i,
					pm: /^అపరాహ్నం/i,
					midnight: /^అర్ధ/i,
					noon: /^మిట్ట/i,
					morning: /ఉదయం/i,
					afternoon: /మధ్యాహ్నం/i,
					evening: /సాయంత్రం/i,
					night: /రాత్రి/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/th/_lib/formatDistance.js
	var formatDistanceLocale$9 = {
		lessThanXSeconds: {
			one: "น้อยกว่า 1 วินาที",
			other: "น้อยกว่า {{count}} วินาที"
		},
		xSeconds: {
			one: "1 วินาที",
			other: "{{count}} วินาที"
		},
		halfAMinute: "ครึ่งนาที",
		lessThanXMinutes: {
			one: "น้อยกว่า 1 นาที",
			other: "น้อยกว่า {{count}} นาที"
		},
		xMinutes: {
			one: "1 นาที",
			other: "{{count}} นาที"
		},
		aboutXHours: {
			one: "ประมาณ 1 ชั่วโมง",
			other: "ประมาณ {{count}} ชั่วโมง"
		},
		xHours: {
			one: "1 ชั่วโมง",
			other: "{{count}} ชั่วโมง"
		},
		xDays: {
			one: "1 วัน",
			other: "{{count}} วัน"
		},
		aboutXWeeks: {
			one: "ประมาณ 1 สัปดาห์",
			other: "ประมาณ {{count}} สัปดาห์"
		},
		xWeeks: {
			one: "1 สัปดาห์",
			other: "{{count}} สัปดาห์"
		},
		aboutXMonths: {
			one: "ประมาณ 1 เดือน",
			other: "ประมาณ {{count}} เดือน"
		},
		xMonths: {
			one: "1 เดือน",
			other: "{{count}} เดือน"
		},
		aboutXYears: {
			one: "ประมาณ 1 ปี",
			other: "ประมาณ {{count}} ปี"
		},
		xYears: {
			one: "1 ปี",
			other: "{{count}} ปี"
		},
		overXYears: {
			one: "มากกว่า 1 ปี",
			other: "มากกว่า {{count}} ปี"
		},
		almostXYears: {
			one: "เกือบ 1 ปี",
			other: "เกือบ {{count}} ปี"
		}
	};
	var formatDistance$9 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$9[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) if (token === "halfAMinute") return "ใน" + result;
		else return "ใน " + result;
		else return result + "ที่ผ่านมา";
		return result;
	};
	var formatLong$9 = {
		date: buildFormatLongFn({
			formats: {
				full: "วันEEEEที่ do MMMM y",
				long: "do MMMM y",
				medium: "d MMM y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss น. zzzz",
				long: "H:mm:ss น. z",
				medium: "H:mm:ss น.",
				short: "H:mm น."
			},
			defaultWidth: "medium"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'เวลา' {{time}}",
				long: "{{date}} 'เวลา' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/th/_lib/formatRelative.js
	var formatRelativeLocale$9 = {
		lastWeek: "eeee'ที่แล้วเวลา' p",
		yesterday: "'เมื่อวานนี้เวลา' p",
		today: "'วันนี้เวลา' p",
		tomorrow: "'พรุ่งนี้เวลา' p",
		nextWeek: "eeee 'เวลา' p",
		other: "P"
	};
	var formatRelative$9 = (token, _date, _baseDate, _options) => formatRelativeLocale$9[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/th/_lib/localize.js
	var eraValues$9 = {
		narrow: ["B", "คศ"],
		abbreviated: ["BC", "ค.ศ."],
		wide: ["ปีก่อนคริสตกาล", "คริสต์ศักราช"]
	};
	var quarterValues$9 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"ไตรมาสแรก",
			"ไตรมาสที่สอง",
			"ไตรมาสที่สาม",
			"ไตรมาสที่สี่"
		]
	};
	var dayValues$9 = {
		narrow: [
			"อา.",
			"จ.",
			"อ.",
			"พ.",
			"พฤ.",
			"ศ.",
			"ส."
		],
		short: [
			"อา.",
			"จ.",
			"อ.",
			"พ.",
			"พฤ.",
			"ศ.",
			"ส."
		],
		abbreviated: [
			"อา.",
			"จ.",
			"อ.",
			"พ.",
			"พฤ.",
			"ศ.",
			"ส."
		],
		wide: [
			"อาทิตย์",
			"จันทร์",
			"อังคาร",
			"พุธ",
			"พฤหัสบดี",
			"ศุกร์",
			"เสาร์"
		]
	};
	var monthValues$9 = {
		narrow: [
			"ม.ค.",
			"ก.พ.",
			"มี.ค.",
			"เม.ย.",
			"พ.ค.",
			"มิ.ย.",
			"ก.ค.",
			"ส.ค.",
			"ก.ย.",
			"ต.ค.",
			"พ.ย.",
			"ธ.ค."
		],
		abbreviated: [
			"ม.ค.",
			"ก.พ.",
			"มี.ค.",
			"เม.ย.",
			"พ.ค.",
			"มิ.ย.",
			"ก.ค.",
			"ส.ค.",
			"ก.ย.",
			"ต.ค.",
			"พ.ย.",
			"ธ.ค."
		],
		wide: [
			"มกราคม",
			"กุมภาพันธ์",
			"มีนาคม",
			"เมษายน",
			"พฤษภาคม",
			"มิถุนายน",
			"กรกฎาคม",
			"สิงหาคม",
			"กันยายน",
			"ตุลาคม",
			"พฤศจิกายน",
			"ธันวาคม"
		]
	};
	var dayPeriodValues$9 = {
		narrow: {
			am: "ก่อนเที่ยง",
			pm: "หลังเที่ยง",
			midnight: "เที่ยงคืน",
			noon: "เที่ยง",
			morning: "เช้า",
			afternoon: "บ่าย",
			evening: "เย็น",
			night: "กลางคืน"
		},
		abbreviated: {
			am: "ก่อนเที่ยง",
			pm: "หลังเที่ยง",
			midnight: "เที่ยงคืน",
			noon: "เที่ยง",
			morning: "เช้า",
			afternoon: "บ่าย",
			evening: "เย็น",
			night: "กลางคืน"
		},
		wide: {
			am: "ก่อนเที่ยง",
			pm: "หลังเที่ยง",
			midnight: "เที่ยงคืน",
			noon: "เที่ยง",
			morning: "เช้า",
			afternoon: "บ่าย",
			evening: "เย็น",
			night: "กลางคืน"
		}
	};
	var formattingDayPeriodValues$9 = {
		narrow: {
			am: "ก่อนเที่ยง",
			pm: "หลังเที่ยง",
			midnight: "เที่ยงคืน",
			noon: "เที่ยง",
			morning: "ตอนเช้า",
			afternoon: "ตอนกลางวัน",
			evening: "ตอนเย็น",
			night: "ตอนกลางคืน"
		},
		abbreviated: {
			am: "ก่อนเที่ยง",
			pm: "หลังเที่ยง",
			midnight: "เที่ยงคืน",
			noon: "เที่ยง",
			morning: "ตอนเช้า",
			afternoon: "ตอนกลางวัน",
			evening: "ตอนเย็น",
			night: "ตอนกลางคืน"
		},
		wide: {
			am: "ก่อนเที่ยง",
			pm: "หลังเที่ยง",
			midnight: "เที่ยงคืน",
			noon: "เที่ยง",
			morning: "ตอนเช้า",
			afternoon: "ตอนกลางวัน",
			evening: "ตอนเย็น",
			night: "ตอนกลางคืน"
		}
	};
	var ordinalNumber$9 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/th.js
	/**
	* @category Locales
	* @summary Thai locale.
	* @language Thai
	* @iso-639-2 tha
	* @author Athiwat Hirunworawongkun [@athivvat](https://github.com/athivvat)
	* @author [@hawkup](https://github.com/hawkup)
	* @author  Jirawat I. [@nodtem66](https://github.com/nodtem66)
	*/
	var th = {
		code: "th",
		formatDistance: formatDistance$9,
		formatLong: formatLong$9,
		formatRelative: formatRelative$9,
		localize: {
			ordinalNumber: ordinalNumber$9,
			era: buildLocalizeFn({
				values: eraValues$9,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$9,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$9,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$9,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$9,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$9,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^\d+/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^([bB]|[aA]|คศ)/i,
					abbreviated: /^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,
					wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^ไตรมาส(ที่)? ?[1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|แรก|หนึ่ง)/i,
					/(2|สอง)/i,
					/(3|สาม)/i,
					/(4|สี่)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,
					abbreviated: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,
					wide: /^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					wide: [
						/^มก/i,
						/^กุม/i,
						/^มี/i,
						/^เม/i,
						/^พฤษ/i,
						/^มิ/i,
						/^กรก/i,
						/^ส/i,
						/^กัน/i,
						/^ต/i,
						/^พฤศ/i,
						/^ธ/i
					],
					any: [
						/^ม\.?ค\.?/i,
						/^ก\.?พ\.?/i,
						/^มี\.?ค\.?/i,
						/^เม\.?ย\.?/i,
						/^พ\.?ค\.?/i,
						/^มิ\.?ย\.?/i,
						/^ก\.?ค\.?/i,
						/^ส\.?ค\.?/i,
						/^ก\.?ย\.?/i,
						/^ต\.?ค\.?/i,
						/^พ\.?ย\.?/i,
						/^ธ\.?ค\.?/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
					short: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
					abbreviated: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
					wide: /^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					wide: [
						/^อา/i,
						/^จั/i,
						/^อั/i,
						/^พุธ/i,
						/^พฤ/i,
						/^ศ/i,
						/^เส/i
					],
					any: [
						/^อา/i,
						/^จ/i,
						/^อ/i,
						/^พ(?!ฤ)/i,
						/^พฤ/i,
						/^ศ/i,
						/^ส/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ก่อนเที่ยง/i,
					pm: /^หลังเที่ยง/i,
					midnight: /^เที่ยงคืน/i,
					noon: /^เที่ยง/i,
					morning: /เช้า/i,
					afternoon: /บ่าย/i,
					evening: /เย็น/i,
					night: /กลางคืน/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/tr/_lib/formatDistance.js
	var formatDistanceLocale$8 = {
		lessThanXSeconds: {
			one: "bir saniyeden az",
			other: "{{count}} saniyeden az"
		},
		xSeconds: {
			one: "1 saniye",
			other: "{{count}} saniye"
		},
		halfAMinute: "yarım dakika",
		lessThanXMinutes: {
			one: "bir dakikadan az",
			other: "{{count}} dakikadan az"
		},
		xMinutes: {
			one: "1 dakika",
			other: "{{count}} dakika"
		},
		aboutXHours: {
			one: "yaklaşık 1 saat",
			other: "yaklaşık {{count}} saat"
		},
		xHours: {
			one: "1 saat",
			other: "{{count}} saat"
		},
		xDays: {
			one: "1 gün",
			other: "{{count}} gün"
		},
		aboutXWeeks: {
			one: "yaklaşık 1 hafta",
			other: "yaklaşık {{count}} hafta"
		},
		xWeeks: {
			one: "1 hafta",
			other: "{{count}} hafta"
		},
		aboutXMonths: {
			one: "yaklaşık 1 ay",
			other: "yaklaşık {{count}} ay"
		},
		xMonths: {
			one: "1 ay",
			other: "{{count}} ay"
		},
		aboutXYears: {
			one: "yaklaşık 1 yıl",
			other: "yaklaşık {{count}} yıl"
		},
		xYears: {
			one: "1 yıl",
			other: "{{count}} yıl"
		},
		overXYears: {
			one: "1 yıldan fazla",
			other: "{{count}} yıldan fazla"
		},
		almostXYears: {
			one: "neredeyse 1 yıl",
			other: "neredeyse {{count}} yıl"
		}
	};
	var formatDistance$8 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$8[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", count.toString());
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " sonra";
		else return result + " önce";
		return result;
	};
	var formatLong$8 = {
		date: buildFormatLongFn({
			formats: {
				full: "d MMMM y EEEE",
				long: "d MMMM y",
				medium: "d MMM y",
				short: "dd.MM.yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'saat' {{time}}",
				long: "{{date}} 'saat' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/tr/_lib/formatRelative.js
	var formatRelativeLocale$8 = {
		lastWeek: "'geçen hafta' eeee 'saat' p",
		yesterday: "'dün saat' p",
		today: "'bugün saat' p",
		tomorrow: "'yarın saat' p",
		nextWeek: "eeee 'saat' p",
		other: "P"
	};
	var formatRelative$8 = (token, _date, _baseDate, _options) => formatRelativeLocale$8[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/tr/_lib/localize.js
	var eraValues$8 = {
		narrow: ["MÖ", "MS"],
		abbreviated: ["MÖ", "MS"],
		wide: ["Milattan Önce", "Milattan Sonra"]
	};
	var quarterValues$8 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1Ç",
			"2Ç",
			"3Ç",
			"4Ç"
		],
		wide: [
			"İlk çeyrek",
			"İkinci Çeyrek",
			"Üçüncü çeyrek",
			"Son çeyrek"
		]
	};
	var monthValues$8 = {
		narrow: [
			"O",
			"Ş",
			"M",
			"N",
			"M",
			"H",
			"T",
			"A",
			"E",
			"E",
			"K",
			"A"
		],
		abbreviated: [
			"Oca",
			"Şub",
			"Mar",
			"Nis",
			"May",
			"Haz",
			"Tem",
			"Ağu",
			"Eyl",
			"Eki",
			"Kas",
			"Ara"
		],
		wide: [
			"Ocak",
			"Şubat",
			"Mart",
			"Nisan",
			"Mayıs",
			"Haziran",
			"Temmuz",
			"Ağustos",
			"Eylül",
			"Ekim",
			"Kasım",
			"Aralık"
		]
	};
	var dayValues$8 = {
		narrow: [
			"P",
			"P",
			"S",
			"Ç",
			"P",
			"C",
			"C"
		],
		short: [
			"Pz",
			"Pt",
			"Sa",
			"Ça",
			"Pe",
			"Cu",
			"Ct"
		],
		abbreviated: [
			"Paz",
			"Pzt",
			"Sal",
			"Çar",
			"Per",
			"Cum",
			"Cts"
		],
		wide: [
			"Pazar",
			"Pazartesi",
			"Salı",
			"Çarşamba",
			"Perşembe",
			"Cuma",
			"Cumartesi"
		]
	};
	var dayPeriodValues$8 = {
		narrow: {
			am: "öö",
			pm: "ös",
			midnight: "gy",
			noon: "ö",
			morning: "sa",
			afternoon: "ös",
			evening: "ak",
			night: "ge"
		},
		abbreviated: {
			am: "ÖÖ",
			pm: "ÖS",
			midnight: "gece yarısı",
			noon: "öğle",
			morning: "sabah",
			afternoon: "öğleden sonra",
			evening: "akşam",
			night: "gece"
		},
		wide: {
			am: "Ö.Ö.",
			pm: "Ö.S.",
			midnight: "gece yarısı",
			noon: "öğle",
			morning: "sabah",
			afternoon: "öğleden sonra",
			evening: "akşam",
			night: "gece"
		}
	};
	var formattingDayPeriodValues$8 = {
		narrow: {
			am: "öö",
			pm: "ös",
			midnight: "gy",
			noon: "ö",
			morning: "sa",
			afternoon: "ös",
			evening: "ak",
			night: "ge"
		},
		abbreviated: {
			am: "ÖÖ",
			pm: "ÖS",
			midnight: "gece yarısı",
			noon: "öğlen",
			morning: "sabahleyin",
			afternoon: "öğleden sonra",
			evening: "akşamleyin",
			night: "geceleyin"
		},
		wide: {
			am: "ö.ö.",
			pm: "ö.s.",
			midnight: "gece yarısı",
			noon: "öğlen",
			morning: "sabahleyin",
			afternoon: "öğleden sonra",
			evening: "akşamleyin",
			night: "geceleyin"
		}
	};
	var ordinalNumber$8 = (dirtyNumber, _options) => {
		return Number(dirtyNumber) + ".";
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/tr.js
	/**
	* @category Locales
	* @summary Turkish locale.
	* @language Turkish
	* @iso-639-2 tur
	* @author Alpcan Aydın [@alpcanaydin](https://github.com/alpcanaydin)
	* @author Berkay Sargın [@berkaey](https://github.com/berkaey)
	* @author Fatih Bulut [@bulutfatih](https://github.com/bulutfatih)
	* @author Ismail Demirbilek [@dbtek](https://github.com/dbtek)
	* @author İsmail Kayar [@ikayar](https://github.com/ikayar)
	*
	*
	*/
	var tr = {
		code: "tr",
		formatDistance: formatDistance$8,
		formatLong: formatLong$8,
		formatRelative: formatRelative$8,
		localize: {
			ordinalNumber: ordinalNumber$8,
			era: buildLocalizeFn({
				values: eraValues$8,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$8,
				defaultWidth: "wide",
				argumentCallback: (quarter) => Number(quarter) - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$8,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$8,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$8,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$8,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(\.)?/i,
				parsePattern: /\d+/i,
				valueCallback: function(value) {
					return parseInt(value, 10);
				}
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(mö|ms)/i,
					abbreviated: /^(mö|ms)/i,
					wide: /^(milattan önce|milattan sonra)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/(^mö|^milattan önce)/i, /(^ms|^milattan sonra)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]ç/i,
					wide: /^((i|İ)lk|(i|İ)kinci|üçüncü|son) çeyrek/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					any: [
						/1/i,
						/2/i,
						/3/i,
						/4/i
					],
					abbreviated: [
						/1ç/i,
						/2ç/i,
						/3ç/i,
						/4ç/i
					],
					wide: [
						/^(i|İ)lk çeyrek/i,
						/(i|İ)kinci çeyrek/i,
						/üçüncü çeyrek/i,
						/son çeyrek/i
					]
				},
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[oşmnhtaek]/i,
					abbreviated: /^(oca|şub|mar|nis|may|haz|tem|ağu|eyl|eki|kas|ara)/i,
					wide: /^(ocak|şubat|mart|nisan|mayıs|haziran|temmuz|ağustos|eylül|ekim|kasım|aralık)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^o/i,
						/^ş/i,
						/^m/i,
						/^n/i,
						/^m/i,
						/^h/i,
						/^t/i,
						/^a/i,
						/^e/i,
						/^e/i,
						/^k/i,
						/^a/i
					],
					any: [
						/^o/i,
						/^ş/i,
						/^mar/i,
						/^n/i,
						/^may/i,
						/^h/i,
						/^t/i,
						/^ağ/i,
						/^ey/i,
						/^ek/i,
						/^k/i,
						/^ar/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[psçc]/i,
					short: /^(pz|pt|sa|ça|pe|cu|ct)/i,
					abbreviated: /^(paz|pzt|sal|çar|per|cum|cts)/i,
					wide: /^(pazar(?!tesi)|pazartesi|salı|çarşamba|perşembe|cuma(?!rtesi)|cumartesi)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^p/i,
						/^p/i,
						/^s/i,
						/^ç/i,
						/^p/i,
						/^c/i,
						/^c/i
					],
					any: [
						/^pz/i,
						/^pt/i,
						/^sa/i,
						/^ça/i,
						/^pe/i,
						/^cu/i,
						/^ct/i
					],
					wide: [
						/^pazar(?!tesi)/i,
						/^pazartesi/i,
						/^salı/i,
						/^çarşamba/i,
						/^perşembe/i,
						/^cuma(?!rtesi)/i,
						/^cumartesi/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(öö|ös|gy|ö|sa|ös|ak|ge)/i,
					any: /^(ö\.?\s?[ös]\.?|öğleden sonra|gece yarısı|öğle|(sabah|öğ|akşam|gece)(leyin))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ö\.?ö\.?/i,
					pm: /^ö\.?s\.?/i,
					midnight: /^(gy|gece yarısı)/i,
					noon: /^öğ/i,
					morning: /^sa/i,
					afternoon: /^öğleden sonra/i,
					evening: /^ak/i,
					night: /^ge/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ug/_lib/formatDistance.js
	var formatDistanceLocale$7 = {
		lessThanXSeconds: {
			one: "بىر سىكۇنت ئىچىدە",
			other: "سىكۇنت ئىچىدە {{count}}"
		},
		xSeconds: {
			one: "بىر سىكۇنت",
			other: "سىكۇنت {{count}}"
		},
		halfAMinute: "يىرىم مىنۇت",
		lessThanXMinutes: {
			one: "بىر مىنۇت ئىچىدە",
			other: "مىنۇت ئىچىدە {{count}}"
		},
		xMinutes: {
			one: "بىر مىنۇت",
			other: "مىنۇت {{count}}"
		},
		aboutXHours: {
			one: "تەخمىنەن بىر سائەت",
			other: "سائەت {{count}} تەخمىنەن"
		},
		xHours: {
			one: "بىر سائەت",
			other: "سائەت {{count}}"
		},
		xDays: {
			one: "بىر كۈن",
			other: "كۈن {{count}}"
		},
		aboutXWeeks: {
			one: "تەخمىنەن بىرھەپتە",
			other: "ھەپتە {{count}} تەخمىنەن"
		},
		xWeeks: {
			one: "بىرھەپتە",
			other: "ھەپتە {{count}}"
		},
		aboutXMonths: {
			one: "تەخمىنەن بىر ئاي",
			other: "ئاي {{count}} تەخمىنەن"
		},
		xMonths: {
			one: "بىر ئاي",
			other: "ئاي {{count}}"
		},
		aboutXYears: {
			one: "تەخمىنەن بىر يىل",
			other: "يىل {{count}} تەخمىنەن"
		},
		xYears: {
			one: "بىر يىل",
			other: "يىل {{count}}"
		},
		overXYears: {
			one: "بىر يىلدىن ئارتۇق",
			other: "يىلدىن ئارتۇق {{count}}"
		},
		almostXYears: {
			one: "ئاساسەن بىر يىل",
			other: "يىل {{count}} ئاساسەن"
		}
	};
	var formatDistance$7 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$7[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result;
		else return result + " بولدى";
		return result;
	};
	var formatLong$7 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, MMMM do, y",
				long: "MMMM do, y",
				medium: "MMM d, y",
				short: "MM/dd/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss a zzzz",
				long: "h:mm:ss a z",
				medium: "h:mm:ss a",
				short: "h:mm a"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'دە' {{time}}",
				long: "{{date}} 'دە' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ug/_lib/formatRelative.js
	var formatRelativeLocale$7 = {
		lastWeek: "'ئ‍ۆتكەن' eeee 'دە' p",
		yesterday: "'تۈنۈگۈن دە' p",
		today: "'بۈگۈن دە' p",
		tomorrow: "'ئەتە دە' p",
		nextWeek: "eeee 'دە' p",
		other: "P"
	};
	var formatRelative$7 = (token, _date, _baseDate, _options) => formatRelativeLocale$7[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/ug/_lib/localize.js
	var eraValues$7 = {
		narrow: ["ب", "ك"],
		abbreviated: ["ب", "ك"],
		wide: ["مىيلادىدىن بۇرۇن", "مىيلادىدىن كىيىن"]
	};
	var quarterValues$7 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1",
			"2",
			"3",
			"4"
		],
		wide: [
			"بىرىنجى چارەك",
			"ئىككىنجى چارەك",
			"ئۈچىنجى چارەك",
			"تۆتىنجى چارەك"
		]
	};
	var monthValues$7 = {
		narrow: [
			"ي",
			"ف",
			"م",
			"ا",
			"م",
			"ى",
			"ى",
			"ا",
			"س",
			"ۆ",
			"ن",
			"د"
		],
		abbreviated: [
			"يانۋار",
			"فېۋىرال",
			"مارت",
			"ئاپرىل",
			"ماي",
			"ئىيۇن",
			"ئىيول",
			"ئاۋغۇست",
			"سىنتەبىر",
			"ئۆكتەبىر",
			"نويابىر",
			"دىكابىر"
		],
		wide: [
			"يانۋار",
			"فېۋىرال",
			"مارت",
			"ئاپرىل",
			"ماي",
			"ئىيۇن",
			"ئىيول",
			"ئاۋغۇست",
			"سىنتەبىر",
			"ئۆكتەبىر",
			"نويابىر",
			"دىكابىر"
		]
	};
	var dayValues$7 = {
		narrow: [
			"ي",
			"د",
			"س",
			"چ",
			"پ",
			"ج",
			"ش"
		],
		short: [
			"ي",
			"د",
			"س",
			"چ",
			"پ",
			"ج",
			"ش"
		],
		abbreviated: [
			"يەكشەنبە",
			"دۈشەنبە",
			"سەيشەنبە",
			"چارشەنبە",
			"پەيشەنبە",
			"جۈمە",
			"شەنبە"
		],
		wide: [
			"يەكشەنبە",
			"دۈشەنبە",
			"سەيشەنبە",
			"چارشەنبە",
			"پەيشەنبە",
			"جۈمە",
			"شەنبە"
		]
	};
	var dayPeriodValues$7 = {
		narrow: {
			am: "ئە",
			pm: "چ",
			midnight: "ك",
			noon: "چ",
			morning: "ئەتىگەن",
			afternoon: "چۈشتىن كىيىن",
			evening: "ئاخشىم",
			night: "كىچە"
		},
		abbreviated: {
			am: "ئە",
			pm: "چ",
			midnight: "ك",
			noon: "چ",
			morning: "ئەتىگەن",
			afternoon: "چۈشتىن كىيىن",
			evening: "ئاخشىم",
			night: "كىچە"
		},
		wide: {
			am: "ئە",
			pm: "چ",
			midnight: "ك",
			noon: "چ",
			morning: "ئەتىگەن",
			afternoon: "چۈشتىن كىيىن",
			evening: "ئاخشىم",
			night: "كىچە"
		}
	};
	var formattingDayPeriodValues$7 = {
		narrow: {
			am: "ئە",
			pm: "چ",
			midnight: "ك",
			noon: "چ",
			morning: "ئەتىگەندە",
			afternoon: "چۈشتىن كىيىن",
			evening: "ئاخشامدا",
			night: "كىچىدە"
		},
		abbreviated: {
			am: "ئە",
			pm: "چ",
			midnight: "ك",
			noon: "چ",
			morning: "ئەتىگەندە",
			afternoon: "چۈشتىن كىيىن",
			evening: "ئاخشامدا",
			night: "كىچىدە"
		},
		wide: {
			am: "ئە",
			pm: "چ",
			midnight: "ك",
			noon: "چ",
			morning: "ئەتىگەندە",
			afternoon: "چۈشتىن كىيىن",
			evening: "ئاخشامدا",
			night: "كىچىدە"
		}
	};
	var ordinalNumber$7 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/ug.js
	/**
	* @category Locales
	* @summary Uighur locale
	* @language Uighur
	* @iso-639-2 uig
	* @author Abduwaly M. [@abduwaly](https://github.com/abduwaly)
	*/
	var ug = {
		code: "ug",
		formatDistance: formatDistance$7,
		formatLong: formatLong$7,
		formatRelative: formatRelative$7,
		localize: {
			ordinalNumber: ordinalNumber$7,
			era: buildLocalizeFn({
				values: eraValues$7,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$7,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$7,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$7,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$7,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$7,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(th|st|nd|rd)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(ب|ك)/i,
					wide: /^(مىيلادىدىن بۇرۇن|مىيلادىدىن كىيىن)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^بۇرۇن/i, /^كىيىن/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^چ[1234]/i,
					wide: /^چارەك [1234]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[يفمئامئ‍ئاسۆند]/i,
					abbreviated: /^(يانۋار|فېۋىرال|مارت|ئاپرىل|ماي|ئىيۇن|ئىيول|ئاۋغۇست|سىنتەبىر|ئۆكتەبىر|نويابىر|دىكابىر)/i,
					wide: /^(يانۋار|فېۋىرال|مارت|ئاپرىل|ماي|ئىيۇن|ئىيول|ئاۋغۇست|سىنتەبىر|ئۆكتەبىر|نويابىر|دىكابىر)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ي/i,
						/^ف/i,
						/^م/i,
						/^ا/i,
						/^م/i,
						/^ى‍/i,
						/^ى‍/i,
						/^ا‍/i,
						/^س/i,
						/^ۆ/i,
						/^ن/i,
						/^د/i
					],
					any: [
						/^يان/i,
						/^فېۋ/i,
						/^مار/i,
						/^ئاپ/i,
						/^ماي/i,
						/^ئىيۇن/i,
						/^ئىيول/i,
						/^ئاۋ/i,
						/^سىن/i,
						/^ئۆك/i,
						/^نوي/i,
						/^دىك/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[دسچپجشي]/i,
					short: /^(يە|دۈ|سە|چا|پە|جۈ|شە)/i,
					abbreviated: /^(يە|دۈ|سە|چا|پە|جۈ|شە)/i,
					wide: /^(يەكشەنبە|دۈشەنبە|سەيشەنبە|چارشەنبە|پەيشەنبە|جۈمە|شەنبە)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^ي/i,
						/^د/i,
						/^س/i,
						/^چ/i,
						/^پ/i,
						/^ج/i,
						/^ش/i
					],
					any: [
						/^ي/i,
						/^د/i,
						/^س/i,
						/^چ/i,
						/^پ/i,
						/^ج/i,
						/^ش/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(ئە|چ|ك|چ|(دە|ئەتىگەن) ( ئە‍|چۈشتىن كىيىن|ئاخشىم|كىچە))/i,
					any: /^(ئە|چ|ك|چ|(دە|ئەتىگەن) ( ئە‍|چۈشتىن كىيىن|ئاخشىم|كىچە))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^ئە/i,
					pm: /^چ/i,
					midnight: /^ك/i,
					noon: /^چ/i,
					morning: /ئەتىگەن/i,
					afternoon: /چۈشتىن كىيىن/i,
					evening: /ئاخشىم/i,
					night: /كىچە/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uk/_lib/formatDistance.js
	function declension(scheme, count) {
		if (scheme.one !== void 0 && count === 1) return scheme.one;
		const rem10 = count % 10;
		const rem100 = count % 100;
		if (rem10 === 1 && rem100 !== 11) return scheme.singularNominative.replace("{{count}}", String(count));
		else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) return scheme.singularGenitive.replace("{{count}}", String(count));
		else return scheme.pluralGenitive.replace("{{count}}", String(count));
	}
	function buildLocalizeTokenFn(scheme) {
		return (count, options) => {
			if (options && options.addSuffix) if (options.comparison && options.comparison > 0) if (scheme.future) return declension(scheme.future, count);
			else return "за " + declension(scheme.regular, count);
			else if (scheme.past) return declension(scheme.past, count);
			else return declension(scheme.regular, count) + " тому";
			else return declension(scheme.regular, count);
		};
	}
	var halfAtMinute = (_, options) => {
		if (options && options.addSuffix) if (options.comparison && options.comparison > 0) return "за півхвилини";
		else return "півхвилини тому";
		return "півхвилини";
	};
	var formatDistanceLocale$6 = {
		lessThanXSeconds: buildLocalizeTokenFn({
			regular: {
				one: "менше секунди",
				singularNominative: "менше {{count}} секунди",
				singularGenitive: "менше {{count}} секунд",
				pluralGenitive: "менше {{count}} секунд"
			},
			future: {
				one: "менше, ніж за секунду",
				singularNominative: "менше, ніж за {{count}} секунду",
				singularGenitive: "менше, ніж за {{count}} секунди",
				pluralGenitive: "менше, ніж за {{count}} секунд"
			}
		}),
		xSeconds: buildLocalizeTokenFn({
			regular: {
				singularNominative: "{{count}} секунда",
				singularGenitive: "{{count}} секунди",
				pluralGenitive: "{{count}} секунд"
			},
			past: {
				singularNominative: "{{count}} секунду тому",
				singularGenitive: "{{count}} секунди тому",
				pluralGenitive: "{{count}} секунд тому"
			},
			future: {
				singularNominative: "за {{count}} секунду",
				singularGenitive: "за {{count}} секунди",
				pluralGenitive: "за {{count}} секунд"
			}
		}),
		halfAMinute: halfAtMinute,
		lessThanXMinutes: buildLocalizeTokenFn({
			regular: {
				one: "менше хвилини",
				singularNominative: "менше {{count}} хвилини",
				singularGenitive: "менше {{count}} хвилин",
				pluralGenitive: "менше {{count}} хвилин"
			},
			future: {
				one: "менше, ніж за хвилину",
				singularNominative: "менше, ніж за {{count}} хвилину",
				singularGenitive: "менше, ніж за {{count}} хвилини",
				pluralGenitive: "менше, ніж за {{count}} хвилин"
			}
		}),
		xMinutes: buildLocalizeTokenFn({
			regular: {
				singularNominative: "{{count}} хвилина",
				singularGenitive: "{{count}} хвилини",
				pluralGenitive: "{{count}} хвилин"
			},
			past: {
				singularNominative: "{{count}} хвилину тому",
				singularGenitive: "{{count}} хвилини тому",
				pluralGenitive: "{{count}} хвилин тому"
			},
			future: {
				singularNominative: "за {{count}} хвилину",
				singularGenitive: "за {{count}} хвилини",
				pluralGenitive: "за {{count}} хвилин"
			}
		}),
		aboutXHours: buildLocalizeTokenFn({
			regular: {
				singularNominative: "близько {{count}} години",
				singularGenitive: "близько {{count}} годин",
				pluralGenitive: "близько {{count}} годин"
			},
			future: {
				singularNominative: "приблизно за {{count}} годину",
				singularGenitive: "приблизно за {{count}} години",
				pluralGenitive: "приблизно за {{count}} годин"
			}
		}),
		xHours: buildLocalizeTokenFn({ regular: {
			singularNominative: "{{count}} годину",
			singularGenitive: "{{count}} години",
			pluralGenitive: "{{count}} годин"
		} }),
		xDays: buildLocalizeTokenFn({ regular: {
			singularNominative: "{{count}} день",
			singularGenitive: "{{count}} днi",
			pluralGenitive: "{{count}} днів"
		} }),
		aboutXWeeks: buildLocalizeTokenFn({
			regular: {
				singularNominative: "близько {{count}} тижня",
				singularGenitive: "близько {{count}} тижнів",
				pluralGenitive: "близько {{count}} тижнів"
			},
			future: {
				singularNominative: "приблизно за {{count}} тиждень",
				singularGenitive: "приблизно за {{count}} тижні",
				pluralGenitive: "приблизно за {{count}} тижнів"
			}
		}),
		xWeeks: buildLocalizeTokenFn({ regular: {
			singularNominative: "{{count}} тиждень",
			singularGenitive: "{{count}} тижні",
			pluralGenitive: "{{count}} тижнів"
		} }),
		aboutXMonths: buildLocalizeTokenFn({
			regular: {
				singularNominative: "близько {{count}} місяця",
				singularGenitive: "близько {{count}} місяців",
				pluralGenitive: "близько {{count}} місяців"
			},
			future: {
				singularNominative: "приблизно за {{count}} місяць",
				singularGenitive: "приблизно за {{count}} місяці",
				pluralGenitive: "приблизно за {{count}} місяців"
			}
		}),
		xMonths: buildLocalizeTokenFn({ regular: {
			singularNominative: "{{count}} місяць",
			singularGenitive: "{{count}} місяці",
			pluralGenitive: "{{count}} місяців"
		} }),
		aboutXYears: buildLocalizeTokenFn({
			regular: {
				singularNominative: "близько {{count}} року",
				singularGenitive: "близько {{count}} років",
				pluralGenitive: "близько {{count}} років"
			},
			future: {
				singularNominative: "приблизно за {{count}} рік",
				singularGenitive: "приблизно за {{count}} роки",
				pluralGenitive: "приблизно за {{count}} років"
			}
		}),
		xYears: buildLocalizeTokenFn({ regular: {
			singularNominative: "{{count}} рік",
			singularGenitive: "{{count}} роки",
			pluralGenitive: "{{count}} років"
		} }),
		overXYears: buildLocalizeTokenFn({
			regular: {
				singularNominative: "більше {{count}} року",
				singularGenitive: "більше {{count}} років",
				pluralGenitive: "більше {{count}} років"
			},
			future: {
				singularNominative: "більше, ніж за {{count}} рік",
				singularGenitive: "більше, ніж за {{count}} роки",
				pluralGenitive: "більше, ніж за {{count}} років"
			}
		}),
		almostXYears: buildLocalizeTokenFn({
			regular: {
				singularNominative: "майже {{count}} рік",
				singularGenitive: "майже {{count}} роки",
				pluralGenitive: "майже {{count}} років"
			},
			future: {
				singularNominative: "майже за {{count}} рік",
				singularGenitive: "майже за {{count}} роки",
				pluralGenitive: "майже за {{count}} років"
			}
		})
	};
	var formatDistance$6 = (token, count, options) => {
		options = options || {};
		return formatDistanceLocale$6[token](count, options);
	};
	var formatLong$6 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM y 'р.'",
				long: "do MMMM y 'р.'",
				medium: "d MMM y 'р.'",
				short: "dd.MM.y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} 'о' {{time}}",
				long: "{{date}} 'о' {{time}}",
				medium: "{{date}}, {{time}}",
				short: "{{date}}, {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uk/_lib/formatRelative.js
	var accusativeWeekdays = [
		"неділю",
		"понеділок",
		"вівторок",
		"середу",
		"четвер",
		"п’ятницю",
		"суботу"
	];
	function lastWeek(day) {
		const weekday = accusativeWeekdays[day];
		switch (day) {
			case 0:
			case 3:
			case 5:
			case 6: return "'у минулу " + weekday + " о' p";
			case 1:
			case 2:
			case 4: return "'у минулий " + weekday + " о' p";
		}
	}
	function thisWeek(day) {
		return "'у " + accusativeWeekdays[day] + " о' p";
	}
	function nextWeek(day) {
		const weekday = accusativeWeekdays[day];
		switch (day) {
			case 0:
			case 3:
			case 5:
			case 6: return "'у наступну " + weekday + " о' p";
			case 1:
			case 2:
			case 4: return "'у наступний " + weekday + " о' p";
		}
	}
	var lastWeekFormat = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek(day);
		else return lastWeek(day);
	};
	var nextWeekFormat = (dirtyDate, baseDate, options) => {
		const date = toDate(dirtyDate);
		const day = date.getDay();
		if (isSameWeek(date, baseDate, options)) return thisWeek(day);
		else return nextWeek(day);
	};
	var formatRelativeLocale$6 = {
		lastWeek: lastWeekFormat,
		yesterday: "'вчора о' p",
		today: "'сьогодні о' p",
		tomorrow: "'завтра о' p",
		nextWeek: nextWeekFormat,
		other: "P"
	};
	var formatRelative$6 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$6[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uk/_lib/localize.js
	var eraValues$6 = {
		narrow: ["до н.е.", "н.е."],
		abbreviated: ["до н. е.", "н. е."],
		wide: ["до нашої ери", "нашої ери"]
	};
	var quarterValues$6 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-й кв.",
			"2-й кв.",
			"3-й кв.",
			"4-й кв."
		],
		wide: [
			"1-й квартал",
			"2-й квартал",
			"3-й квартал",
			"4-й квартал"
		]
	};
	var monthValues$6 = {
		narrow: [
			"С",
			"Л",
			"Б",
			"К",
			"Т",
			"Ч",
			"Л",
			"С",
			"В",
			"Ж",
			"Л",
			"Г"
		],
		abbreviated: [
			"січ.",
			"лют.",
			"берез.",
			"квіт.",
			"трав.",
			"черв.",
			"лип.",
			"серп.",
			"верес.",
			"жовт.",
			"листоп.",
			"груд."
		],
		wide: [
			"січень",
			"лютий",
			"березень",
			"квітень",
			"травень",
			"червень",
			"липень",
			"серпень",
			"вересень",
			"жовтень",
			"листопад",
			"грудень"
		]
	};
	var formattingMonthValues$1 = {
		narrow: [
			"С",
			"Л",
			"Б",
			"К",
			"Т",
			"Ч",
			"Л",
			"С",
			"В",
			"Ж",
			"Л",
			"Г"
		],
		abbreviated: [
			"січ.",
			"лют.",
			"берез.",
			"квіт.",
			"трав.",
			"черв.",
			"лип.",
			"серп.",
			"верес.",
			"жовт.",
			"листоп.",
			"груд."
		],
		wide: [
			"січня",
			"лютого",
			"березня",
			"квітня",
			"травня",
			"червня",
			"липня",
			"серпня",
			"вересня",
			"жовтня",
			"листопада",
			"грудня"
		]
	};
	var dayValues$6 = {
		narrow: [
			"Н",
			"П",
			"В",
			"С",
			"Ч",
			"П",
			"С"
		],
		short: [
			"нд",
			"пн",
			"вт",
			"ср",
			"чт",
			"пт",
			"сб"
		],
		abbreviated: [
			"нед",
			"пон",
			"вів",
			"сер",
			"чтв",
			"птн",
			"суб"
		],
		wide: [
			"неділя",
			"понеділок",
			"вівторок",
			"середа",
			"четвер",
			"п’ятниця",
			"субота"
		]
	};
	var dayPeriodValues$6 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "півн.",
			noon: "пол.",
			morning: "ранок",
			afternoon: "день",
			evening: "веч.",
			night: "ніч"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "півн.",
			noon: "пол.",
			morning: "ранок",
			afternoon: "день",
			evening: "веч.",
			night: "ніч"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "північ",
			noon: "полудень",
			morning: "ранок",
			afternoon: "день",
			evening: "вечір",
			night: "ніч"
		}
	};
	var formattingDayPeriodValues$6 = {
		narrow: {
			am: "ДП",
			pm: "ПП",
			midnight: "півн.",
			noon: "пол.",
			morning: "ранку",
			afternoon: "дня",
			evening: "веч.",
			night: "ночі"
		},
		abbreviated: {
			am: "ДП",
			pm: "ПП",
			midnight: "півн.",
			noon: "пол.",
			morning: "ранку",
			afternoon: "дня",
			evening: "веч.",
			night: "ночі"
		},
		wide: {
			am: "ДП",
			pm: "ПП",
			midnight: "північ",
			noon: "полудень",
			morning: "ранку",
			afternoon: "дня",
			evening: "веч.",
			night: "ночі"
		}
	};
	var ordinalNumber$6 = (dirtyNumber, options) => {
		const unit = String(options?.unit);
		const number = Number(dirtyNumber);
		let suffix;
		if (unit === "date") if (number === 3 || number === 23) suffix = "-є";
		else suffix = "-е";
		else if (unit === "minute" || unit === "second" || unit === "hour") suffix = "-а";
		else suffix = "-й";
		return number + suffix;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uk.js
	/**
	* @category Locales
	* @summary Ukrainian locale.
	* @language Ukrainian
	* @iso-639-2 ukr
	* @author Andrii Korzh [@korzhyk](https://github.com/korzhyk)
	* @author Andriy Shcherbyak [@shcherbyakdev](https://github.com/shcherbyakdev)
	*/
	var uk = {
		code: "uk",
		formatDistance: formatDistance$6,
		formatLong: formatLong$6,
		formatRelative: formatRelative$6,
		localize: {
			ordinalNumber: ordinalNumber$6,
			era: buildLocalizeFn({
				values: eraValues$6,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$6,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$6,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues$1,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$6,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$6,
				defaultWidth: "any",
				formattingValues: formattingDayPeriodValues$6,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(-?(е|й|є|а|я))?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^((до )?н\.?\s?е\.?)/i,
					abbreviated: /^((до )?н\.?\s?е\.?)/i,
					wide: /^(до нашої ери|нашої ери|наша ера)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^д/i, /^н/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234](-?[иі]?й?)? кв.?/i,
					wide: /^[1234](-?[иі]?й?)? квартал/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[слбктчвжг]/i,
					abbreviated: /^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,
					wide: /^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^с/i,
						/^л/i,
						/^б/i,
						/^к/i,
						/^т/i,
						/^ч/i,
						/^л/i,
						/^с/i,
						/^в/i,
						/^ж/i,
						/^л/i,
						/^г/i
					],
					any: [
						/^сі/i,
						/^лю/i,
						/^б/i,
						/^к/i,
						/^т/i,
						/^ч/i,
						/^лип/i,
						/^се/i,
						/^в/i,
						/^ж/i,
						/^лис/i,
						/^г/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[нпвсч]/i,
					short: /^(нд|пн|вт|ср|чт|пт|сб)\.?/i,
					abbreviated: /^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,
					wide: /^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^н/i,
						/^п/i,
						/^в/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^с/i
					],
					any: [
						/^н/i,
						/^п[он]/i,
						/^в/i,
						/^с[ер]/i,
						/^ч/i,
						/^п\W*?[ят]/i,
						/^с[уб]/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,
					abbreviated: /^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,
					wide: /^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^дп/i,
					pm: /^пп/i,
					midnight: /^півн/i,
					noon: /^пол/i,
					morning: /^р/i,
					afternoon: /^д[ен]/i,
					evening: /^в/i,
					night: /^н/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz/_lib/formatDistance.js
	var formatDistanceLocale$5 = {
		lessThanXSeconds: {
			one: "sekunddan kam",
			other: "{{count}} sekunddan kam"
		},
		xSeconds: {
			one: "1 sekund",
			other: "{{count}} sekund"
		},
		halfAMinute: "yarim minut",
		lessThanXMinutes: {
			one: "bir minutdan kam",
			other: "{{count}} minutdan kam"
		},
		xMinutes: {
			one: "1 minut",
			other: "{{count}} minut"
		},
		aboutXHours: {
			one: "tahminan 1 soat",
			other: "tahminan {{count}} soat"
		},
		xHours: {
			one: "1 soat",
			other: "{{count}} soat"
		},
		xDays: {
			one: "1 kun",
			other: "{{count}} kun"
		},
		aboutXWeeks: {
			one: "tahminan 1 hafta",
			other: "tahminan {{count}} hafta"
		},
		xWeeks: {
			one: "1 hafta",
			other: "{{count}} hafta"
		},
		aboutXMonths: {
			one: "tahminan 1 oy",
			other: "tahminan {{count}} oy"
		},
		xMonths: {
			one: "1 oy",
			other: "{{count}} oy"
		},
		aboutXYears: {
			one: "tahminan 1 yil",
			other: "tahminan {{count}} yil"
		},
		xYears: {
			one: "1 yil",
			other: "{{count}} yil"
		},
		overXYears: {
			one: "1 yildan ko'p",
			other: "{{count}} yildan ko'p"
		},
		almostXYears: {
			one: "deyarli 1 yil",
			other: "deyarli {{count}} yil"
		}
	};
	var formatDistance$5 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$5[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " dan keyin";
		else return result + " oldin";
		return result;
	};
	var formatLong$5 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM, y",
				long: "do MMMM, y",
				medium: "d MMM, y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "h:mm:ss zzzz",
				long: "h:mm:ss z",
				medium: "h:mm:ss",
				short: "h:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}}, {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz/_lib/formatRelative.js
	var formatRelativeLocale$5 = {
		lastWeek: "'oldingi' eeee p 'da'",
		yesterday: "'kecha' p 'da'",
		today: "'bugun' p 'da'",
		tomorrow: "'ertaga' p 'da'",
		nextWeek: "eeee p 'da'",
		other: "P"
	};
	var formatRelative$5 = (token, _date, _baseDate, _options) => formatRelativeLocale$5[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz/_lib/localize.js
	var eraValues$5 = {
		narrow: ["M.A", "M."],
		abbreviated: ["M.A", "M."],
		wide: ["Miloddan Avvalgi", "Milodiy"]
	};
	var quarterValues$5 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"CH.1",
			"CH.2",
			"CH.3",
			"CH.4"
		],
		wide: [
			"1-chi chorak",
			"2-chi chorak",
			"3-chi chorak",
			"4-chi chorak"
		]
	};
	var monthValues$5 = {
		narrow: [
			"Y",
			"F",
			"M",
			"A",
			"M",
			"I",
			"I",
			"A",
			"S",
			"O",
			"N",
			"D"
		],
		abbreviated: [
			"Yan",
			"Fev",
			"Mar",
			"Apr",
			"May",
			"Iyun",
			"Iyul",
			"Avg",
			"Sen",
			"Okt",
			"Noy",
			"Dek"
		],
		wide: [
			"Yanvar",
			"Fevral",
			"Mart",
			"Aprel",
			"May",
			"Iyun",
			"Iyul",
			"Avgust",
			"Sentabr",
			"Oktabr",
			"Noyabr",
			"Dekabr"
		]
	};
	var dayValues$5 = {
		narrow: [
			"Y",
			"D",
			"S",
			"CH",
			"P",
			"J",
			"SH"
		],
		short: [
			"Ya",
			"Du",
			"Se",
			"Cho",
			"Pa",
			"Ju",
			"Sha"
		],
		abbreviated: [
			"Yak",
			"Dush",
			"Sesh",
			"Chor",
			"Pay",
			"Jum",
			"Shan"
		],
		wide: [
			"Yakshanba",
			"Dushanba",
			"Seshanba",
			"Chorshanba",
			"Payshanba",
			"Juma",
			"Shanba"
		]
	};
	var dayPeriodValues$5 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "y.t",
			noon: "p.",
			morning: "ertalab",
			afternoon: "tushdan keyin",
			evening: "kechqurun",
			night: "tun"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "yarim tun",
			noon: "peshin",
			morning: "ertalab",
			afternoon: "tushdan keyin",
			evening: "kechqurun",
			night: "tun"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "yarim tun",
			noon: "peshin",
			morning: "ertalab",
			afternoon: "tushdan keyin",
			evening: "kechqurun",
			night: "tun"
		}
	};
	var formattingDayPeriodValues$5 = {
		narrow: {
			am: "a",
			pm: "p",
			midnight: "y.t",
			noon: "p.",
			morning: "ertalab",
			afternoon: "tushdan keyin",
			evening: "kechqurun",
			night: "tun"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "yarim tun",
			noon: "peshin",
			morning: "ertalab",
			afternoon: "tushdan keyin",
			evening: "kechqurun",
			night: "tun"
		},
		wide: {
			am: "a.m.",
			pm: "p.m.",
			midnight: "yarim tun",
			noon: "peshin",
			morning: "ertalab",
			afternoon: "tushdan keyin",
			evening: "kechqurun",
			night: "tun"
		}
	};
	var ordinalNumber$5 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz.js
	/**
	* @category Locales
	* @summary Uzbek locale.
	* @language Uzbek
	* @iso-639-2 uzb
	* @author Mukhammadali [@mukhammadali](https://github.com/Mukhammadali)
	*/
	var uz = {
		code: "uz",
		formatDistance: formatDistance$5,
		formatLong: formatLong$5,
		formatRelative: formatRelative$5,
		localize: {
			ordinalNumber: ordinalNumber$5,
			era: buildLocalizeFn({
				values: eraValues$5,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$5,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$5,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$5,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$5,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$5,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(chi)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(m\.a|m\.)/i,
					abbreviated: /^(m\.a\.?\s?m\.?)/i,
					wide: /^(miloddan avval|miloddan keyin)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^b/i, /^(a|c)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^q[1234]/i,
					wide: /^[1234](chi)? chorak/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[yfmasond]/i,
					abbreviated: /^(yan|fev|mar|apr|may|iyun|iyul|avg|sen|okt|noy|dek)/i,
					wide: /^(yanvar|fevral|mart|aprel|may|iyun|iyul|avgust|sentabr|oktabr|noyabr|dekabr)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^y/i,
						/^f/i,
						/^m/i,
						/^a/i,
						/^m/i,
						/^i/i,
						/^i/i,
						/^a/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					],
					any: [
						/^ya/i,
						/^f/i,
						/^mar/i,
						/^ap/i,
						/^may/i,
						/^iyun/i,
						/^iyul/i,
						/^av/i,
						/^s/i,
						/^o/i,
						/^n/i,
						/^d/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[ydschj]/i,
					short: /^(ya|du|se|cho|pa|ju|sha)/i,
					abbreviated: /^(yak|dush|sesh|chor|pay|jum|shan)/i,
					wide: /^(yakshanba|dushanba|seshanba|chorshanba|payshanba|juma|shanba)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^y/i,
						/^d/i,
						/^s/i,
						/^ch/i,
						/^p/i,
						/^j/i,
						/^sh/i
					],
					any: [
						/^ya/i,
						/^d/i,
						/^se/i,
						/^ch/i,
						/^p/i,
						/^j/i,
						/^sh/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|y\.t|p| (ertalab|tushdan keyin|kechqurun|tun))/i,
					any: /^([ap]\.?\s?m\.?|yarim tun|peshin| (ertalab|tushdan keyin|kechqurun|tun))/i
				},
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^a/i,
					pm: /^p/i,
					midnight: /^y\.t/i,
					noon: /^pe/i,
					morning: /ertalab/i,
					afternoon: /tushdan keyin/i,
					evening: /kechqurun/i,
					night: /tun/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz-Cyrl/_lib/formatDistance.js
	var formatDistanceLocale$4 = {
		lessThanXSeconds: {
			one: "1 сониядан кам",
			other: "{{count}} сониядан кам"
		},
		xSeconds: {
			one: "1 сония",
			other: "{{count}} сония"
		},
		halfAMinute: "ярим дақиқа",
		lessThanXMinutes: {
			one: "1 дақиқадан кам",
			other: "{{count}} дақиқадан кам"
		},
		xMinutes: {
			one: "1 дақиқа",
			other: "{{count}} дақиқа"
		},
		aboutXHours: {
			one: "тахминан 1 соат",
			other: "тахминан {{count}} соат"
		},
		xHours: {
			one: "1 соат",
			other: "{{count}} соат"
		},
		xDays: {
			one: "1 кун",
			other: "{{count}} кун"
		},
		aboutXWeeks: {
			one: "тахминан 1 хафта",
			other: "тахминан {{count}} хафта"
		},
		xWeeks: {
			one: "1 хафта",
			other: "{{count}} хафта"
		},
		aboutXMonths: {
			one: "тахминан 1 ой",
			other: "тахминан {{count}} ой"
		},
		xMonths: {
			one: "1 ой",
			other: "{{count}} ой"
		},
		aboutXYears: {
			one: "тахминан 1 йил",
			other: "тахминан {{count}} йил"
		},
		xYears: {
			one: "1 йил",
			other: "{{count}} йил"
		},
		overXYears: {
			one: "1 йилдан кўп",
			other: "{{count}} йилдан кўп"
		},
		almostXYears: {
			one: "деярли 1 йил",
			other: "деярли {{count}} йил"
		}
	};
	var formatDistance$4 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$4[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "дан кейин";
		else return result + " олдин";
		return result;
	};
	var formatLong$4 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, do MMMM, y",
				long: "do MMMM, y",
				medium: "d MMM, y",
				short: "dd/MM/yyyy"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "H:mm:ss zzzz",
				long: "H:mm:ss z",
				medium: "H:mm:ss",
				short: "H:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: { any: "{{date}}, {{time}}" },
			defaultWidth: "any"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz-Cyrl/_lib/formatRelative.js
	var formatRelativeLocale$4 = {
		lastWeek: "'ўтган' eeee p 'да'",
		yesterday: "'кеча' p 'да'",
		today: "'бугун' p 'да'",
		tomorrow: "'эртага' p 'да'",
		nextWeek: "eeee p 'да'",
		other: "P"
	};
	var formatRelative$4 = (token, _date, _baseDate, _options) => formatRelativeLocale$4[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz-Cyrl/_lib/localize.js
	var eraValues$4 = {
		narrow: ["М.А", "М"],
		abbreviated: ["М.А", "М"],
		wide: ["Милоддан Аввалги", "Милодий"]
	};
	var quarterValues$4 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"1-чор.",
			"2-чор.",
			"3-чор.",
			"4-чор."
		],
		wide: [
			"1-чорак",
			"2-чорак",
			"3-чорак",
			"4-чорак"
		]
	};
	var monthValues$4 = {
		narrow: [
			"Я",
			"Ф",
			"М",
			"А",
			"М",
			"И",
			"И",
			"А",
			"С",
			"О",
			"Н",
			"Д"
		],
		abbreviated: [
			"янв",
			"фев",
			"мар",
			"апр",
			"май",
			"июн",
			"июл",
			"авг",
			"сен",
			"окт",
			"ноя",
			"дек"
		],
		wide: [
			"январ",
			"феврал",
			"март",
			"апрел",
			"май",
			"июн",
			"июл",
			"август",
			"сентабр",
			"октабр",
			"ноябр",
			"декабр"
		]
	};
	var dayValues$4 = {
		narrow: [
			"Я",
			"Д",
			"С",
			"Ч",
			"П",
			"Ж",
			"Ш"
		],
		short: [
			"як",
			"ду",
			"се",
			"чо",
			"па",
			"жу",
			"ша"
		],
		abbreviated: [
			"якш",
			"душ",
			"сеш",
			"чор",
			"пай",
			"жум",
			"шан"
		],
		wide: [
			"якшанба",
			"душанба",
			"сешанба",
			"чоршанба",
			"пайшанба",
			"жума",
			"шанба"
		]
	};
	var dayPeriodValues$4 = { any: {
		am: "П.О.",
		pm: "П.К.",
		midnight: "ярим тун",
		noon: "пешин",
		morning: "эрталаб",
		afternoon: "пешиндан кейин",
		evening: "кечаси",
		night: "тун"
	} };
	var formattingDayPeriodValues$4 = { any: {
		am: "П.О.",
		pm: "П.К.",
		midnight: "ярим тун",
		noon: "пешин",
		morning: "эрталаб",
		afternoon: "пешиндан кейин",
		evening: "кечаси",
		night: "тун"
	} };
	var ordinalNumber$4 = (dirtyNumber, _options) => {
		return String(dirtyNumber);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/uz-Cyrl.js
	/**
	* @category Locales
	* @summary Uzbek Cyrillic locale.
	* @language Uzbek
	* @iso-639-2 uzb
	* @author Kamronbek Shodmonov [@kamronbek28](https://github.com/kamronbek28)
	*/
	var uzCyrl = {
		code: "uz-Cyrl",
		formatDistance: formatDistance$4,
		formatLong: formatLong$4,
		formatRelative: formatRelative$4,
		localize: {
			ordinalNumber: ordinalNumber$4,
			era: buildLocalizeFn({
				values: eraValues$4,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$4,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$4,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$4,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$4,
				defaultWidth: "any",
				formattingValues: formattingDayPeriodValues$4,
				defaultFormattingWidth: "any"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)(чи)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(м\.а|м\.)/i,
					abbreviated: /^(м\.а|м\.)/i,
					wide: /^(милоддан аввал|милоддан кейин)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^м/i, /^а/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^[1234]-чор./i,
					wide: /^[1234]-чорак/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/1/i,
					/2/i,
					/3/i,
					/4/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^[яфмамииасонд]/i,
					abbreviated: /^(янв|фев|мар|апр|май|июн|июл|авг|сен|окт|ноя|дек)/i,
					wide: /^(январ|феврал|март|апрел|май|июн|июл|август|сентабр|октабр|ноябр|декабр)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^я/i,
						/^ф/i,
						/^м/i,
						/^а/i,
						/^м/i,
						/^и/i,
						/^и/i,
						/^а/i,
						/^с/i,
						/^о/i,
						/^н/i,
						/^д/i
					],
					any: [
						/^я/i,
						/^ф/i,
						/^мар/i,
						/^ап/i,
						/^май/i,
						/^июн/i,
						/^июл/i,
						/^ав/i,
						/^с/i,
						/^о/i,
						/^н/i,
						/^д/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[ядсчпжш]/i,
					short: /^(як|ду|се|чо|па|жу|ша)/i,
					abbreviated: /^(якш|душ|сеш|чор|пай|жум|шан)/i,
					wide: /^(якшанба|душанба|сешанба|чоршанба|пайшанба|жума|шанба)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^я/i,
						/^д/i,
						/^с/i,
						/^ч/i,
						/^п/i,
						/^ж/i,
						/^ш/i
					],
					any: [
						/^як/i,
						/^ду/i,
						/^се/i,
						/^чор/i,
						/^пай/i,
						/^жу/i,
						/^шан/i
					]
				},
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(п\.о\.|п\.к\.|ярим тун|пешиндан кейин|(эрталаб|пешиндан кейин|кечаси|тун))/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^п\.о\./i,
					pm: /^п\.к\./i,
					midnight: /^ярим тун/i,
					noon: /^пешиндан кейин/i,
					morning: /эрталаб/i,
					afternoon: /пешиндан кейин/i,
					evening: /кечаси/i,
					night: /тун/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/vi/_lib/formatDistance.js
	var formatDistanceLocale$3 = {
		lessThanXSeconds: {
			one: "dưới 1 giây",
			other: "dưới {{count}} giây"
		},
		xSeconds: {
			one: "1 giây",
			other: "{{count}} giây"
		},
		halfAMinute: "nửa phút",
		lessThanXMinutes: {
			one: "dưới 1 phút",
			other: "dưới {{count}} phút"
		},
		xMinutes: {
			one: "1 phút",
			other: "{{count}} phút"
		},
		aboutXHours: {
			one: "khoảng 1 giờ",
			other: "khoảng {{count}} giờ"
		},
		xHours: {
			one: "1 giờ",
			other: "{{count}} giờ"
		},
		xDays: {
			one: "1 ngày",
			other: "{{count}} ngày"
		},
		aboutXWeeks: {
			one: "khoảng 1 tuần",
			other: "khoảng {{count}} tuần"
		},
		xWeeks: {
			one: "1 tuần",
			other: "{{count}} tuần"
		},
		aboutXMonths: {
			one: "khoảng 1 tháng",
			other: "khoảng {{count}} tháng"
		},
		xMonths: {
			one: "1 tháng",
			other: "{{count}} tháng"
		},
		aboutXYears: {
			one: "khoảng 1 năm",
			other: "khoảng {{count}} năm"
		},
		xYears: {
			one: "1 năm",
			other: "{{count}} năm"
		},
		overXYears: {
			one: "hơn 1 năm",
			other: "hơn {{count}} năm"
		},
		almostXYears: {
			one: "gần 1 năm",
			other: "gần {{count}} năm"
		}
	};
	var formatDistance$3 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$3[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + " nữa";
		else return result + " trước";
		return result;
	};
	var formatLong$3 = {
		date: buildFormatLongFn({
			formats: {
				full: "EEEE, 'ngày' d MMMM 'năm' y",
				long: "'ngày' d MMMM 'năm' y",
				medium: "d MMM 'năm' y",
				short: "dd/MM/y"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "HH:mm:ss zzzz",
				long: "HH:mm:ss z",
				medium: "HH:mm:ss",
				short: "HH:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/vi/_lib/formatRelative.js
	var formatRelativeLocale$3 = {
		lastWeek: "eeee 'tuần trước vào lúc' p",
		yesterday: "'hôm qua vào lúc' p",
		today: "'hôm nay vào lúc' p",
		tomorrow: "'ngày mai vào lúc' p",
		nextWeek: "eeee 'tới vào lúc' p",
		other: "P"
	};
	var formatRelative$3 = (token, _date, _baseDate, _options) => formatRelativeLocale$3[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/vi/_lib/localize.js
	var eraValues$3 = {
		narrow: ["TCN", "SCN"],
		abbreviated: ["trước CN", "sau CN"],
		wide: ["trước Công Nguyên", "sau Công Nguyên"]
	};
	var quarterValues$3 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"Quý 1",
			"Quý 2",
			"Quý 3",
			"Quý 4"
		]
	};
	var formattingQuarterValues = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"Q1",
			"Q2",
			"Q3",
			"Q4"
		],
		wide: [
			"quý I",
			"quý II",
			"quý III",
			"quý IV"
		]
	};
	var monthValues$3 = {
		narrow: [
			"1",
			"2",
			"3",
			"4",
			"5",
			"6",
			"7",
			"8",
			"9",
			"10",
			"11",
			"12"
		],
		abbreviated: [
			"Thg 1",
			"Thg 2",
			"Thg 3",
			"Thg 4",
			"Thg 5",
			"Thg 6",
			"Thg 7",
			"Thg 8",
			"Thg 9",
			"Thg 10",
			"Thg 11",
			"Thg 12"
		],
		wide: [
			"Tháng Một",
			"Tháng Hai",
			"Tháng Ba",
			"Tháng Tư",
			"Tháng Năm",
			"Tháng Sáu",
			"Tháng Bảy",
			"Tháng Tám",
			"Tháng Chín",
			"Tháng Mười",
			"Tháng Mười Một",
			"Tháng Mười Hai"
		]
	};
	var formattingMonthValues = {
		narrow: [
			"01",
			"02",
			"03",
			"04",
			"05",
			"06",
			"07",
			"08",
			"09",
			"10",
			"11",
			"12"
		],
		abbreviated: [
			"thg 1",
			"thg 2",
			"thg 3",
			"thg 4",
			"thg 5",
			"thg 6",
			"thg 7",
			"thg 8",
			"thg 9",
			"thg 10",
			"thg 11",
			"thg 12"
		],
		wide: [
			"tháng 01",
			"tháng 02",
			"tháng 03",
			"tháng 04",
			"tháng 05",
			"tháng 06",
			"tháng 07",
			"tháng 08",
			"tháng 09",
			"tháng 10",
			"tháng 11",
			"tháng 12"
		]
	};
	var dayValues$3 = {
		narrow: [
			"CN",
			"T2",
			"T3",
			"T4",
			"T5",
			"T6",
			"T7"
		],
		short: [
			"CN",
			"Th 2",
			"Th 3",
			"Th 4",
			"Th 5",
			"Th 6",
			"Th 7"
		],
		abbreviated: [
			"CN",
			"Thứ 2",
			"Thứ 3",
			"Thứ 4",
			"Thứ 5",
			"Thứ 6",
			"Thứ 7"
		],
		wide: [
			"Chủ Nhật",
			"Thứ Hai",
			"Thứ Ba",
			"Thứ Tư",
			"Thứ Năm",
			"Thứ Sáu",
			"Thứ Bảy"
		]
	};
	var dayPeriodValues$3 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "nửa đêm",
			noon: "tr",
			morning: "sg",
			afternoon: "ch",
			evening: "tối",
			night: "đêm"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "nửa đêm",
			noon: "trưa",
			morning: "sáng",
			afternoon: "chiều",
			evening: "tối",
			night: "đêm"
		},
		wide: {
			am: "SA",
			pm: "CH",
			midnight: "nửa đêm",
			noon: "trưa",
			morning: "sáng",
			afternoon: "chiều",
			evening: "tối",
			night: "đêm"
		}
	};
	var formattingDayPeriodValues$3 = {
		narrow: {
			am: "am",
			pm: "pm",
			midnight: "nửa đêm",
			noon: "tr",
			morning: "sg",
			afternoon: "ch",
			evening: "tối",
			night: "đêm"
		},
		abbreviated: {
			am: "AM",
			pm: "PM",
			midnight: "nửa đêm",
			noon: "trưa",
			morning: "sáng",
			afternoon: "chiều",
			evening: "tối",
			night: "đêm"
		},
		wide: {
			am: "SA",
			pm: "CH",
			midnight: "nửa đêm",
			noon: "giữa trưa",
			morning: "vào buổi sáng",
			afternoon: "vào buổi chiều",
			evening: "vào buổi tối",
			night: "vào ban đêm"
		}
	};
	var ordinalNumber$3 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		const unit = options?.unit;
		if (unit === "quarter") switch (number) {
			case 1: return "I";
			case 2: return "II";
			case 3: return "III";
			case 4: return "IV";
		}
		else if (unit === "day") switch (number) {
			case 1: return "thứ 2";
			case 2: return "thứ 3";
			case 3: return "thứ 4";
			case 4: return "thứ 5";
			case 5: return "thứ 6";
			case 6: return "thứ 7";
			case 7: return "chủ nhật";
		}
		else if (unit === "week") if (number === 1) return "thứ nhất";
		else return "thứ " + number;
		else if (unit === "dayOfYear") if (number === 1) return "đầu tiên";
		else return "thứ " + number;
		return String(number);
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/vi.js
	/**
	* @category Locales
	* @summary Vietnamese locale (Vietnam).
	* @language Vietnamese
	* @iso-639-2 vie
	* @author Thanh Tran [@trongthanh](https://github.com/trongthanh)
	* @author Leroy Hopson [@lihop](https://github.com/lihop)
	*/
	var vi = {
		code: "vi",
		formatDistance: formatDistance$3,
		formatLong: formatLong$3,
		formatRelative: formatRelative$3,
		localize: {
			ordinalNumber: ordinalNumber$3,
			era: buildLocalizeFn({
				values: eraValues$3,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$3,
				defaultWidth: "wide",
				formattingValues: formattingQuarterValues,
				defaultFormattingWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$3,
				defaultWidth: "wide",
				formattingValues: formattingMonthValues,
				defaultFormattingWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$3,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$3,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$3,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(\d+)/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(tcn|scn)/i,
					abbreviated: /^(trước CN|sau CN)/i,
					wide: /^(trước Công Nguyên|sau Công Nguyên)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^t/i, /^s/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^([1234]|i{1,3}v?)/i,
					abbreviated: /^q([1234]|i{1,3}v?)/i,
					wide: /^quý ([1234]|i{1,3}v?)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|i)$/i,
					/(2|ii)$/i,
					/(3|iii)$/i,
					/(4|iv)$/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(0?[2-9]|10|11|12|0?1)/i,
					abbreviated: /^thg[ _]?(0?[1-9](?!\d)|10|11|12)/i,
					wide: /^tháng ?(Một|Hai|Ba|Tư|Năm|Sáu|Bảy|Tám|Chín|Mười|Mười ?Một|Mười ?Hai|0?[1-9](?!\d)|10|11|12)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/0?1$/i,
						/0?2/i,
						/3/,
						/4/,
						/5/,
						/6/,
						/7/,
						/8/,
						/9/,
						/10/,
						/11/,
						/12/
					],
					abbreviated: [
						/^thg[ _]?0?1(?!\d)/i,
						/^thg[ _]?0?2/i,
						/^thg[ _]?0?3/i,
						/^thg[ _]?0?4/i,
						/^thg[ _]?0?5/i,
						/^thg[ _]?0?6/i,
						/^thg[ _]?0?7/i,
						/^thg[ _]?0?8/i,
						/^thg[ _]?0?9/i,
						/^thg[ _]?10/i,
						/^thg[ _]?11/i,
						/^thg[ _]?12/i
					],
					wide: [
						/^tháng ?(Một|0?1(?!\d))/i,
						/^tháng ?(Hai|0?2)/i,
						/^tháng ?(Ba|0?3)/i,
						/^tháng ?(Tư|0?4)/i,
						/^tháng ?(Năm|0?5)/i,
						/^tháng ?(Sáu|0?6)/i,
						/^tháng ?(Bảy|0?7)/i,
						/^tháng ?(Tám|0?8)/i,
						/^tháng ?(Chín|0?9)/i,
						/^tháng ?(Mười|10)/i,
						/^tháng ?(Mười ?Một|11)/i,
						/^tháng ?(Mười ?Hai|12)/i
					]
				},
				defaultParseWidth: "wide"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^(CN|T2|T3|T4|T5|T6|T7)/i,
					short: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
					abbreviated: /^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,
					wide: /^(Chủ ?Nhật|Chúa ?Nhật|thứ ?Hai|thứ ?Ba|thứ ?Tư|thứ ?Năm|thứ ?Sáu|thứ ?Bảy)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/CN/i,
						/2/i,
						/3/i,
						/4/i,
						/5/i,
						/6/i,
						/7/i
					],
					short: [
						/CN/i,
						/2/i,
						/3/i,
						/4/i,
						/5/i,
						/6/i,
						/7/i
					],
					abbreviated: [
						/CN/i,
						/2/i,
						/3/i,
						/4/i,
						/5/i,
						/6/i,
						/7/i
					],
					wide: [
						/(Chủ|Chúa) ?Nhật/i,
						/Hai/i,
						/Ba/i,
						/Tư/i,
						/Năm/i,
						/Sáu/i,
						/Bảy/i
					]
				},
				defaultParseWidth: "wide"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: {
					narrow: /^(a|p|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
					abbreviated: /^(am|pm|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,
					wide: /^(ch[^i]*|sa|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: {
					am: /^(a|sa)/i,
					pm: /^(p|ch[^i]*)/i,
					midnight: /nửa đêm/i,
					noon: /trưa/i,
					morning: /sáng/i,
					afternoon: /chiều/i,
					evening: /tối/i,
					night: /^đêm/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js
	var formatDistanceLocale$2 = {
		lessThanXSeconds: {
			one: "不到 1 秒",
			other: "不到 {{count}} 秒"
		},
		xSeconds: {
			one: "1 秒",
			other: "{{count}} 秒"
		},
		halfAMinute: "半分钟",
		lessThanXMinutes: {
			one: "不到 1 分钟",
			other: "不到 {{count}} 分钟"
		},
		xMinutes: {
			one: "1 分钟",
			other: "{{count}} 分钟"
		},
		xHours: {
			one: "1 小时",
			other: "{{count}} 小时"
		},
		aboutXHours: {
			one: "大约 1 小时",
			other: "大约 {{count}} 小时"
		},
		xDays: {
			one: "1 天",
			other: "{{count}} 天"
		},
		aboutXWeeks: {
			one: "大约 1 个星期",
			other: "大约 {{count}} 个星期"
		},
		xWeeks: {
			one: "1 个星期",
			other: "{{count}} 个星期"
		},
		aboutXMonths: {
			one: "大约 1 个月",
			other: "大约 {{count}} 个月"
		},
		xMonths: {
			one: "1 个月",
			other: "{{count}} 个月"
		},
		aboutXYears: {
			one: "大约 1 年",
			other: "大约 {{count}} 年"
		},
		xYears: {
			one: "1 年",
			other: "{{count}} 年"
		},
		overXYears: {
			one: "超过 1 年",
			other: "超过 {{count}} 年"
		},
		almostXYears: {
			one: "将近 1 年",
			other: "将近 {{count}} 年"
		}
	};
	var formatDistance$2 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$2[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "内";
		else return result + "前";
		return result;
	};
	var formatLong$2 = {
		date: buildFormatLongFn({
			formats: {
				full: "y'年'M'月'd'日' EEEE",
				long: "y'年'M'月'd'日'",
				medium: "yyyy-MM-dd",
				short: "yy-MM-dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "zzzz a h:mm:ss",
				long: "z a h:mm:ss",
				medium: "a h:mm:ss",
				short: "a h:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js
	function checkWeek(date, baseDate, options) {
		const baseFormat = "eeee p";
		if (isSameWeek(date, baseDate, options)) return baseFormat;
		else if (date.getTime() > baseDate.getTime()) return "'下个'" + baseFormat;
		return "'上个'" + baseFormat;
	}
	var formatRelativeLocale$2 = {
		lastWeek: checkWeek,
		yesterday: "'昨天' p",
		today: "'今天' p",
		tomorrow: "'明天' p",
		nextWeek: checkWeek,
		other: "PP p"
	};
	var formatRelative$2 = (token, date, baseDate, options) => {
		const format = formatRelativeLocale$2[token];
		if (typeof format === "function") return format(date, baseDate, options);
		return format;
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-CN/_lib/localize.js
	var eraValues$2 = {
		narrow: ["前", "公元"],
		abbreviated: ["前", "公元"],
		wide: ["公元前", "公元"]
	};
	var quarterValues$2 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"第一季",
			"第二季",
			"第三季",
			"第四季"
		],
		wide: [
			"第一季度",
			"第二季度",
			"第三季度",
			"第四季度"
		]
	};
	var monthValues$2 = {
		narrow: [
			"一",
			"二",
			"三",
			"四",
			"五",
			"六",
			"七",
			"八",
			"九",
			"十",
			"十一",
			"十二"
		],
		abbreviated: [
			"1月",
			"2月",
			"3月",
			"4月",
			"5月",
			"6月",
			"7月",
			"8月",
			"9月",
			"10月",
			"11月",
			"12月"
		],
		wide: [
			"一月",
			"二月",
			"三月",
			"四月",
			"五月",
			"六月",
			"七月",
			"八月",
			"九月",
			"十月",
			"十一月",
			"十二月"
		]
	};
	var dayValues$2 = {
		narrow: [
			"日",
			"一",
			"二",
			"三",
			"四",
			"五",
			"六"
		],
		short: [
			"日",
			"一",
			"二",
			"三",
			"四",
			"五",
			"六"
		],
		abbreviated: [
			"周日",
			"周一",
			"周二",
			"周三",
			"周四",
			"周五",
			"周六"
		],
		wide: [
			"星期日",
			"星期一",
			"星期二",
			"星期三",
			"星期四",
			"星期五",
			"星期六"
		]
	};
	var dayPeriodValues$2 = {
		narrow: {
			am: "上",
			pm: "下",
			midnight: "凌晨",
			noon: "午",
			morning: "早",
			afternoon: "下午",
			evening: "晚",
			night: "夜"
		},
		abbreviated: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜间"
		},
		wide: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜间"
		}
	};
	var formattingDayPeriodValues$2 = {
		narrow: {
			am: "上",
			pm: "下",
			midnight: "凌晨",
			noon: "午",
			morning: "早",
			afternoon: "下午",
			evening: "晚",
			night: "夜"
		},
		abbreviated: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜间"
		},
		wide: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜间"
		}
	};
	var ordinalNumber$2 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		switch (options?.unit) {
			case "date": return number.toString() + "日";
			case "hour": return number.toString() + "时";
			case "minute": return number.toString() + "分";
			case "second": return number.toString() + "秒";
			default: return "第 " + number.toString();
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-CN.js
	/**
	* @category Locales
	* @summary Chinese Simplified locale.
	* @language Chinese Simplified
	* @iso-639-2 zho
	* @author Changyu Geng [@KingMario](https://github.com/KingMario)
	* @author Song Shuoyun [@fnlctrl](https://github.com/fnlctrl)
	* @author sabrinaM [@sabrinamiao](https://github.com/sabrinamiao)
	* @author Carney Wu [@cubicwork](https://github.com/cubicwork)
	* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
	*/
	var zhCN = {
		code: "zh-CN",
		formatDistance: formatDistance$2,
		formatLong: formatLong$2,
		formatRelative: formatRelative$2,
		localize: {
			ordinalNumber: ordinalNumber$2,
			era: buildLocalizeFn({
				values: eraValues$2,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$2,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$2,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$2,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$2,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$2,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(第\s*)?\d+(日|时|分|秒)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(前)/i,
					abbreviated: /^(前)/i,
					wide: /^(公元前|公元)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(前)/i, /^(公元)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^第[一二三四]刻/i,
					wide: /^第[一二三四]刻钟/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|一)/i,
					/(2|二)/i,
					/(3|三)/i,
					/(4|四)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
					abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
					wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^一/i,
						/^二/i,
						/^三/i,
						/^四/i,
						/^五/i,
						/^六/i,
						/^七/i,
						/^八/i,
						/^九/i,
						/^十(?!(一|二))/i,
						/^十一/i,
						/^十二/i
					],
					any: [
						/^一|1/i,
						/^二|2/i,
						/^三|3/i,
						/^四|4/i,
						/^五|5/i,
						/^六|6/i,
						/^七|7/i,
						/^八|8/i,
						/^九|9/i,
						/^十(?!(一|二))|10/i,
						/^十一|11/i,
						/^十二|12/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[一二三四五六日]/i,
					short: /^[一二三四五六日]/i,
					abbreviated: /^周[一二三四五六日]/i,
					wide: /^星期[一二三四五六日]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/日/i,
					/一/i,
					/二/i,
					/三/i,
					/四/i,
					/五/i,
					/六/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^上午?/i,
					pm: /^下午?/i,
					midnight: /^午夜/i,
					noon: /^[中正]午/i,
					morning: /^早上/i,
					afternoon: /^下午/i,
					evening: /^晚上?/i,
					night: /^凌晨/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-HK/_lib/formatDistance.js
	var formatDistanceLocale$1 = {
		lessThanXSeconds: {
			one: "少於 1 秒",
			other: "少於 {{count}} 秒"
		},
		xSeconds: {
			one: "1 秒",
			other: "{{count}} 秒"
		},
		halfAMinute: "半分鐘",
		lessThanXMinutes: {
			one: "少於 1 分鐘",
			other: "少於 {{count}} 分鐘"
		},
		xMinutes: {
			one: "1 分鐘",
			other: "{{count}} 分鐘"
		},
		xHours: {
			one: "1 小時",
			other: "{{count}} 小時"
		},
		aboutXHours: {
			one: "大約 1 小時",
			other: "大約 {{count}} 小時"
		},
		xDays: {
			one: "1 天",
			other: "{{count}} 天"
		},
		aboutXWeeks: {
			one: "大約 1 個星期",
			other: "大約 {{count}} 個星期"
		},
		xWeeks: {
			one: "1 個星期",
			other: "{{count}} 個星期"
		},
		aboutXMonths: {
			one: "大約 1 個月",
			other: "大約 {{count}} 個月"
		},
		xMonths: {
			one: "1 個月",
			other: "{{count}} 個月"
		},
		aboutXYears: {
			one: "大約 1 年",
			other: "大約 {{count}} 年"
		},
		xYears: {
			one: "1 年",
			other: "{{count}} 年"
		},
		overXYears: {
			one: "超過 1 年",
			other: "超過 {{count}} 年"
		},
		almostXYears: {
			one: "將近 1 年",
			other: "將近 {{count}} 年"
		}
	};
	var formatDistance$1 = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale$1[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "內";
		else return result + "前";
		return result;
	};
	var formatLong$1 = {
		date: buildFormatLongFn({
			formats: {
				full: "y'年'M'月'd'日' EEEE",
				long: "y'年'M'月'd'日'",
				medium: "yyyy-MM-dd",
				short: "yy-MM-dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "zzzz a h:mm:ss",
				long: "z a h:mm:ss",
				medium: "a h:mm:ss",
				short: "a h:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-HK/_lib/formatRelative.js
	var formatRelativeLocale$1 = {
		lastWeek: "'上個'eeee p",
		yesterday: "'昨天' p",
		today: "'今天' p",
		tomorrow: "'明天' p",
		nextWeek: "'下個'eeee p",
		other: "P"
	};
	var formatRelative$1 = (token, _date, _baseDate, _options) => formatRelativeLocale$1[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-HK/_lib/localize.js
	var eraValues$1 = {
		narrow: ["前", "公元"],
		abbreviated: ["前", "公元"],
		wide: ["公元前", "公元"]
	};
	var quarterValues$1 = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"第一季",
			"第二季",
			"第三季",
			"第四季"
		],
		wide: [
			"第一季度",
			"第二季度",
			"第三季度",
			"第四季度"
		]
	};
	var monthValues$1 = {
		narrow: [
			"一",
			"二",
			"三",
			"四",
			"五",
			"六",
			"七",
			"八",
			"九",
			"十",
			"十一",
			"十二"
		],
		abbreviated: [
			"1月",
			"2月",
			"3月",
			"4月",
			"5月",
			"6月",
			"7月",
			"8月",
			"9月",
			"10月",
			"11月",
			"12月"
		],
		wide: [
			"一月",
			"二月",
			"三月",
			"四月",
			"五月",
			"六月",
			"七月",
			"八月",
			"九月",
			"十月",
			"十一月",
			"十二月"
		]
	};
	var dayValues$1 = {
		narrow: [
			"日",
			"一",
			"二",
			"三",
			"四",
			"五",
			"六"
		],
		short: [
			"日",
			"一",
			"二",
			"三",
			"四",
			"五",
			"六"
		],
		abbreviated: [
			"週日",
			"週一",
			"週二",
			"週三",
			"週四",
			"週五",
			"週六"
		],
		wide: [
			"星期日",
			"星期一",
			"星期二",
			"星期三",
			"星期四",
			"星期五",
			"星期六"
		]
	};
	var dayPeriodValues$1 = {
		narrow: {
			am: "上",
			pm: "下",
			midnight: "午夜",
			noon: "晌",
			morning: "早",
			afternoon: "午",
			evening: "晚",
			night: "夜"
		},
		abbreviated: {
			am: "上午",
			pm: "下午",
			midnight: "午夜",
			noon: "中午",
			morning: "上午",
			afternoon: "下午",
			evening: "晚上",
			night: "夜晚"
		},
		wide: {
			am: "上午",
			pm: "下午",
			midnight: "午夜",
			noon: "中午",
			morning: "上午",
			afternoon: "下午",
			evening: "晚上",
			night: "夜晚"
		}
	};
	var formattingDayPeriodValues$1 = {
		narrow: {
			am: "上",
			pm: "下",
			midnight: "午夜",
			noon: "晌",
			morning: "早",
			afternoon: "午",
			evening: "晚",
			night: "夜"
		},
		abbreviated: {
			am: "上午",
			pm: "下午",
			midnight: "午夜",
			noon: "中午",
			morning: "上午",
			afternoon: "下午",
			evening: "晚上",
			night: "夜晚"
		},
		wide: {
			am: "上午",
			pm: "下午",
			midnight: "午夜",
			noon: "中午",
			morning: "上午",
			afternoon: "下午",
			evening: "晚上",
			night: "夜晚"
		}
	};
	var ordinalNumber$1 = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		switch (options?.unit) {
			case "date": return number + "日";
			case "hour": return number + "時";
			case "minute": return number + "分";
			case "second": return number + "秒";
			default: return "第 " + number;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-HK.js
	/**
	* @category Locales
	* @summary Chinese Traditional locale.
	* @language Chinese Traditional
	* @iso-639-2 zho
	* @author Gary Ip [@gaplo](https://github.com/gaplo)
	*/
	var zhHK = {
		code: "zh-HK",
		formatDistance: formatDistance$1,
		formatLong: formatLong$1,
		formatRelative: formatRelative$1,
		localize: {
			ordinalNumber: ordinalNumber$1,
			era: buildLocalizeFn({
				values: eraValues$1,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues$1,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues$1,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues$1,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues$1,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues$1,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(第\s*)?\d+(日|時|分|秒)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(前)/i,
					abbreviated: /^(前)/i,
					wide: /^(公元前|公元)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(前)/i, /^(公元)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^第[一二三四]季/i,
					wide: /^第[一二三四]季度/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|一)/i,
					/(2|二)/i,
					/(3|三)/i,
					/(4|四)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
					abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
					wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^一/i,
						/^二/i,
						/^三/i,
						/^四/i,
						/^五/i,
						/^六/i,
						/^七/i,
						/^八/i,
						/^九/i,
						/^十(?!(一|二))/i,
						/^十一/i,
						/^十二/i
					],
					any: [
						/^一|1/i,
						/^二|2/i,
						/^三|3/i,
						/^四|4/i,
						/^五|5/i,
						/^六|6/i,
						/^七|7/i,
						/^八|8/i,
						/^九|9/i,
						/^十(?!(一|二))|10/i,
						/^十一|11/i,
						/^十二|12/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[一二三四五六日]/i,
					short: /^[一二三四五六日]/i,
					abbreviated: /^週[一二三四五六日]/i,
					wide: /^星期[一二三四五六日]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/日/i,
					/一/i,
					/二/i,
					/三/i,
					/四/i,
					/五/i,
					/六/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^上午?/i,
					pm: /^下午?/i,
					midnight: /^午夜/i,
					noon: /^[中正]午/i,
					morning: /^早上/i,
					afternoon: /^下午/i,
					evening: /^晚上?/i,
					night: /^凌晨/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 0,
			firstWeekContainsDate: 1
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-TW/_lib/formatDistance.js
	var formatDistanceLocale = {
		lessThanXSeconds: {
			one: "少於 1 秒",
			other: "少於 {{count}} 秒"
		},
		xSeconds: {
			one: "1 秒",
			other: "{{count}} 秒"
		},
		halfAMinute: "半分鐘",
		lessThanXMinutes: {
			one: "少於 1 分鐘",
			other: "少於 {{count}} 分鐘"
		},
		xMinutes: {
			one: "1 分鐘",
			other: "{{count}} 分鐘"
		},
		xHours: {
			one: "1 小時",
			other: "{{count}} 小時"
		},
		aboutXHours: {
			one: "大約 1 小時",
			other: "大約 {{count}} 小時"
		},
		xDays: {
			one: "1 天",
			other: "{{count}} 天"
		},
		aboutXWeeks: {
			one: "大約 1 個星期",
			other: "大約 {{count}} 個星期"
		},
		xWeeks: {
			one: "1 個星期",
			other: "{{count}} 個星期"
		},
		aboutXMonths: {
			one: "大約 1 個月",
			other: "大約 {{count}} 個月"
		},
		xMonths: {
			one: "1 個月",
			other: "{{count}} 個月"
		},
		aboutXYears: {
			one: "大約 1 年",
			other: "大約 {{count}} 年"
		},
		xYears: {
			one: "1 年",
			other: "{{count}} 年"
		},
		overXYears: {
			one: "超過 1 年",
			other: "超過 {{count}} 年"
		},
		almostXYears: {
			one: "將近 1 年",
			other: "將近 {{count}} 年"
		}
	};
	var formatDistance = (token, count, options) => {
		let result;
		const tokenValue = formatDistanceLocale[token];
		if (typeof tokenValue === "string") result = tokenValue;
		else if (count === 1) result = tokenValue.one;
		else result = tokenValue.other.replace("{{count}}", String(count));
		if (options?.addSuffix) if (options.comparison && options.comparison > 0) return result + "內";
		else return result + "前";
		return result;
	};
	var formatLong = {
		date: buildFormatLongFn({
			formats: {
				full: "y'年'M'月'd'日' EEEE",
				long: "y'年'M'月'd'日'",
				medium: "yyyy-MM-dd",
				short: "yy-MM-dd"
			},
			defaultWidth: "full"
		}),
		time: buildFormatLongFn({
			formats: {
				full: "zzzz a h:mm:ss",
				long: "z a h:mm:ss",
				medium: "a h:mm:ss",
				short: "a h:mm"
			},
			defaultWidth: "full"
		}),
		dateTime: buildFormatLongFn({
			formats: {
				full: "{{date}} {{time}}",
				long: "{{date}} {{time}}",
				medium: "{{date}} {{time}}",
				short: "{{date}} {{time}}"
			},
			defaultWidth: "full"
		})
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-TW/_lib/formatRelative.js
	var formatRelativeLocale = {
		lastWeek: "'上個'eeee p",
		yesterday: "'昨天' p",
		today: "'今天' p",
		tomorrow: "'明天' p",
		nextWeek: "'下個'eeee p",
		other: "P"
	};
	var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-TW/_lib/localize.js
	var eraValues = {
		narrow: ["前", "公元"],
		abbreviated: ["前", "公元"],
		wide: ["公元前", "公元"]
	};
	var quarterValues = {
		narrow: [
			"1",
			"2",
			"3",
			"4"
		],
		abbreviated: [
			"第一刻",
			"第二刻",
			"第三刻",
			"第四刻"
		],
		wide: [
			"第一刻鐘",
			"第二刻鐘",
			"第三刻鐘",
			"第四刻鐘"
		]
	};
	var monthValues = {
		narrow: [
			"一",
			"二",
			"三",
			"四",
			"五",
			"六",
			"七",
			"八",
			"九",
			"十",
			"十一",
			"十二"
		],
		abbreviated: [
			"1月",
			"2月",
			"3月",
			"4月",
			"5月",
			"6月",
			"7月",
			"8月",
			"9月",
			"10月",
			"11月",
			"12月"
		],
		wide: [
			"一月",
			"二月",
			"三月",
			"四月",
			"五月",
			"六月",
			"七月",
			"八月",
			"九月",
			"十月",
			"十一月",
			"十二月"
		]
	};
	var dayValues = {
		narrow: [
			"日",
			"一",
			"二",
			"三",
			"四",
			"五",
			"六"
		],
		short: [
			"日",
			"一",
			"二",
			"三",
			"四",
			"五",
			"六"
		],
		abbreviated: [
			"週日",
			"週一",
			"週二",
			"週三",
			"週四",
			"週五",
			"週六"
		],
		wide: [
			"星期日",
			"星期一",
			"星期二",
			"星期三",
			"星期四",
			"星期五",
			"星期六"
		]
	};
	var dayPeriodValues = {
		narrow: {
			am: "上",
			pm: "下",
			midnight: "凌晨",
			noon: "午",
			morning: "早",
			afternoon: "下午",
			evening: "晚",
			night: "夜"
		},
		abbreviated: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜間"
		},
		wide: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜間"
		}
	};
	var formattingDayPeriodValues = {
		narrow: {
			am: "上",
			pm: "下",
			midnight: "凌晨",
			noon: "午",
			morning: "早",
			afternoon: "下午",
			evening: "晚",
			night: "夜"
		},
		abbreviated: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜間"
		},
		wide: {
			am: "上午",
			pm: "下午",
			midnight: "凌晨",
			noon: "中午",
			morning: "早晨",
			afternoon: "中午",
			evening: "晚上",
			night: "夜間"
		}
	};
	var ordinalNumber = (dirtyNumber, options) => {
		const number = Number(dirtyNumber);
		switch (options?.unit) {
			case "date": return number + "日";
			case "hour": return number + "時";
			case "minute": return number + "分";
			case "second": return number + "秒";
			default: return "第 " + number;
		}
	};
	//#endregion
	//#region ../../node_modules/date-fns/locale/zh-TW.js
	/**
	* @category Locales
	* @summary Chinese Traditional locale.
	* @language Chinese Traditional
	* @iso-639-2 zho
	* @author tonypai [@tpai](https://github.com/tpai)
	* @author Jack Hsu [@jackhsu978](https://github.com/jackhsu978)
	* @author Terrence Lam [@skyuplam](https://github.com/skyuplam)
	*/
	var zhTW = {
		code: "zh-TW",
		formatDistance,
		formatLong,
		formatRelative,
		localize: {
			ordinalNumber,
			era: buildLocalizeFn({
				values: eraValues,
				defaultWidth: "wide"
			}),
			quarter: buildLocalizeFn({
				values: quarterValues,
				defaultWidth: "wide",
				argumentCallback: (quarter) => quarter - 1
			}),
			month: buildLocalizeFn({
				values: monthValues,
				defaultWidth: "wide"
			}),
			day: buildLocalizeFn({
				values: dayValues,
				defaultWidth: "wide"
			}),
			dayPeriod: buildLocalizeFn({
				values: dayPeriodValues,
				defaultWidth: "wide",
				formattingValues: formattingDayPeriodValues,
				defaultFormattingWidth: "wide"
			})
		},
		match: {
			ordinalNumber: buildMatchPatternFn({
				matchPattern: /^(第\s*)?\d+(日|時|分|秒)?/i,
				parsePattern: /\d+/i,
				valueCallback: (value) => parseInt(value, 10)
			}),
			era: buildMatchFn({
				matchPatterns: {
					narrow: /^(前)/i,
					abbreviated: /^(前)/i,
					wide: /^(公元前|公元)/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [/^(前)/i, /^(公元)/i] },
				defaultParseWidth: "any"
			}),
			quarter: buildMatchFn({
				matchPatterns: {
					narrow: /^[1234]/i,
					abbreviated: /^第[一二三四]刻/i,
					wide: /^第[一二三四]刻鐘/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/(1|一)/i,
					/(2|二)/i,
					/(3|三)/i,
					/(4|四)/i
				] },
				defaultParseWidth: "any",
				valueCallback: (index) => index + 1
			}),
			month: buildMatchFn({
				matchPatterns: {
					narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
					abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
					wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: {
					narrow: [
						/^一/i,
						/^二/i,
						/^三/i,
						/^四/i,
						/^五/i,
						/^六/i,
						/^七/i,
						/^八/i,
						/^九/i,
						/^十(?!(一|二))/i,
						/^十一/i,
						/^十二/i
					],
					any: [
						/^一|1/i,
						/^二|2/i,
						/^三|3/i,
						/^四|4/i,
						/^五|5/i,
						/^六|6/i,
						/^七|7/i,
						/^八|8/i,
						/^九|9/i,
						/^十(?!(一|二))|10/i,
						/^十一|11/i,
						/^十二|12/i
					]
				},
				defaultParseWidth: "any"
			}),
			day: buildMatchFn({
				matchPatterns: {
					narrow: /^[一二三四五六日]/i,
					short: /^[一二三四五六日]/i,
					abbreviated: /^週[一二三四五六日]/i,
					wide: /^星期[一二三四五六日]/i
				},
				defaultMatchWidth: "wide",
				parsePatterns: { any: [
					/日/i,
					/一/i,
					/二/i,
					/三/i,
					/四/i,
					/五/i,
					/六/i
				] },
				defaultParseWidth: "any"
			}),
			dayPeriod: buildMatchFn({
				matchPatterns: { any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i },
				defaultMatchWidth: "any",
				parsePatterns: { any: {
					am: /^上午?/i,
					pm: /^下午?/i,
					midnight: /^午夜/i,
					noon: /^[中正]午/i,
					morning: /^早上/i,
					afternoon: /^下午/i,
					evening: /^晚上?/i,
					night: /^凌晨/i
				} },
				defaultParseWidth: "any"
			})
		},
		options: {
			weekStartsOn: 1,
			firstWeekContainsDate: 4
		}
	};
	//#endregion
	//#region ../loot-core/src/shared/locale.ts
	var locales = { .../* @__PURE__ */ __exportAll({
		af: () => af,
		ar: () => ar,
		arDZ: () => arDZ,
		arEG: () => arEG,
		arMA: () => arMA,
		arSA: () => arSA,
		arTN: () => arTN,
		az: () => az,
		be: () => be,
		beTarask: () => beTarask,
		bg: () => bg,
		bn: () => bn,
		bs: () => bs,
		ca: () => ca,
		ckb: () => ckb,
		cs: () => cs,
		cy: () => cy,
		da: () => da,
		de: () => de,
		deAT: () => deAT,
		el: () => el,
		enAU: () => enAU,
		enCA: () => enCA,
		enGB: () => enGB,
		enIE: () => enIE,
		enIN: () => enIN,
		enNZ: () => enNZ,
		enUS: () => enUS,
		enZA: () => enZA,
		eo: () => eo,
		es: () => es,
		et: () => et,
		eu: () => eu,
		faIR: () => faIR,
		fi: () => fi,
		fr: () => fr,
		frCA: () => frCA,
		frCH: () => frCH,
		fy: () => fy,
		gd: () => gd,
		gl: () => gl,
		gu: () => gu,
		he: () => he,
		hi: () => hi,
		hr: () => hr,
		ht: () => ht,
		hu: () => hu,
		hy: () => hy,
		id: () => id,
		is: () => is,
		it: () => it,
		itCH: () => itCH,
		ja: () => ja,
		jaHira: () => jaHira,
		ka: () => ka,
		kk: () => kk,
		km: () => km,
		kn: () => kn,
		ko: () => ko,
		lb: () => lb,
		lt: () => lt,
		lv: () => lv,
		mk: () => mk,
		mn: () => mn,
		ms: () => ms,
		mt: () => mt,
		nb: () => nb,
		nl: () => nl$2,
		nlBE: () => nlBE,
		nn: () => nn,
		oc: () => oc,
		pl: () => pl,
		pt: () => pt,
		ptBR: () => ptBR,
		ro: () => ro,
		ru: () => ru,
		se: () => se,
		sk: () => sk,
		sl: () => sl,
		sq: () => sq,
		sr: () => sr,
		srLatn: () => srLatn,
		sv: () => sv,
		ta: () => ta,
		te: () => te,
		th: () => th,
		tr: () => tr,
		ug: () => ug,
		uk: () => uk,
		uz: () => uz,
		uzCyrl: () => uzCyrl,
		vi: () => vi,
		zhCN: () => zhCN,
		zhHK: () => zhHK,
		zhTW: () => zhTW
	}) };
	function getLocale(language) {
		if (!language || typeof language !== "string") return locales.enUS;
		let localeKey = language.replace("-", "");
		if (localeKey in locales) return locales[localeKey];
		localeKey = language.replace("-", "").substring(0, 2);
		if (localeKey in locales) return locales[localeKey];
		return locales.enUS;
	}
	//#endregion
	//#region ../loot-core/src/server/budget/actions.ts
	async function getSheetValue(sheetName, cell) {
		const node = getCell$1(sheetName, cell);
		return safeNumber(typeof node.value === "number" ? node.value : 0);
	}
	async function getSheetBoolean(sheetName, cell) {
		const node = getCell$1(sheetName, cell);
		return typeof node.value === "boolean" ? node.value : false;
	}
	function calcBufferedAmount(toBudget, buffered, amount) {
		amount = Math.min(Math.max(amount, -buffered), Math.max(toBudget, 0));
		return buffered + amount;
	}
	function getBudgetTable() {
		return isTrackingBudget() ? "reflect_budgets" : "zero_budgets";
	}
	function isTrackingBudget() {
		const budgetType = firstSync(`SELECT value FROM preferences WHERE id = ?`, ["budgetType"]);
		return (budgetType ? budgetType.value : "envelope") === "tracking";
	}
	function dbMonth(month) {
		return parseInt(month.replace("-", ""));
	}
	function getBudgetData(table, month) {
		return all(`
    SELECT b.*, c.is_income, c.hidden, g.hidden AS group_hidden
    FROM ${table} b
    LEFT JOIN categories c ON b.category = c.id
    LEFT JOIN category_groups g ON c.cat_group = g.id
    WHERE c.tombstone = 0 AND b.month = ?
  `, [month]);
	}
	function getAllMonths(startMonth) {
		const { createdMonths } = get$2().meta();
		let latest = null;
		for (const month of createdMonths) if (latest == null || month > latest) latest = month;
		return rangeInclusive(startMonth, latest);
	}
	function getBudget({ category, month }) {
		const existing = firstSync(`SELECT * FROM ${getBudgetTable()} WHERE month = ? AND category = ?`, [dbMonth(month), category]);
		return existing ? existing.amount || 0 : 0;
	}
	function setBudget({ category, month, amount }) {
		amount = safeNumber(typeof amount === "number" ? amount : 0);
		const table = getBudgetTable();
		const existing = firstSync(`SELECT id FROM ${table} WHERE month = ? AND category = ?`, [dbMonth(month), category]);
		if (existing) return update(table, {
			id: existing.id,
			amount
		});
		return insert(table, {
			id: `${dbMonth(month)}-${category}`,
			month: dbMonth(month),
			category,
			amount
		});
	}
	function setGoal({ month, category, goal, long_goal }) {
		const table = getBudgetTable();
		const existing = firstSync(`SELECT id FROM ${table} WHERE month = ? AND category = ?`, [dbMonth(month), category]);
		if (existing) return update(table, {
			id: existing.id,
			goal,
			long_goal
		});
		return insert(table, {
			id: `${dbMonth(month)}-${category}`,
			month: dbMonth(month),
			category,
			goal,
			long_goal
		});
	}
	function setBuffer(month, amount) {
		const existing = firstSync(`SELECT id FROM zero_budget_months WHERE id = ?`, [month]);
		if (existing) return update("zero_budget_months", {
			id: existing.id,
			buffered: amount
		});
		return insert("zero_budget_months", {
			id: month,
			buffered: amount
		});
	}
	function setCarryover(table, category, month, flag) {
		const existing = firstSync(`SELECT id FROM ${table} WHERE month = ? AND category = ?`, [month, category]);
		if (existing) return update(table, {
			id: existing.id,
			carryover: flag ? 1 : 0
		});
		return insert(table, {
			id: `${month}-${category}`,
			month,
			category,
			carryover: flag ? 1 : 0
		});
	}
	async function copyPreviousMonth({ month }) {
		const prevMonth$6 = dbMonth(prevMonth(month));
		const budgetData = await getBudgetData(getBudgetTable(), prevMonth$6.toString());
		await batchMessages(async () => {
			budgetData.forEach((prevBudget) => {
				if (prevBudget.is_income === 1 && !isTrackingBudget()) return;
				if (prevBudget.hidden === 1 || prevBudget.group_hidden === 1) return;
				setBudget({
					category: prevBudget.category,
					month,
					amount: prevBudget.amount
				});
			});
		});
	}
	async function copySinglePreviousMonth({ month, category }) {
		const newAmount = await getSheetValue(sheetForMonth(prevMonth(month)), "budget-" + category);
		await batchMessages(async () => {
			setBudget({
				category,
				month,
				amount: newAmount
			});
		});
	}
	async function setZero({ month }) {
		const categories = await all("SELECT * FROM v_categories WHERE tombstone = 0");
		await batchMessages(async () => {
			categories.forEach((cat) => {
				if (cat.is_income === 1 && !isTrackingBudget()) return;
				setBudget({
					category: cat.id,
					month,
					amount: 0
				});
			});
		});
	}
	async function set3MonthAvg({ month }) {
		const categories = await all(`
  SELECT c.*
  FROM categories c
  LEFT JOIN category_groups g ON c.cat_group = g.id
  WHERE c.tombstone = 0 AND c.hidden = 0 AND g.hidden = 0
  `);
		const prevMonth1 = prevMonth(month);
		const prevMonth2 = prevMonth(prevMonth1);
		const prevMonth3 = prevMonth(prevMonth2);
		await batchMessages(async () => {
			for (const cat of categories) {
				if (cat.is_income === 1 && !isTrackingBudget()) continue;
				const spent1 = await getSheetValue(sheetForMonth(prevMonth1), "sum-amount-" + cat.id);
				const spent2 = await getSheetValue(sheetForMonth(prevMonth2), "sum-amount-" + cat.id);
				const spent3 = await getSheetValue(sheetForMonth(prevMonth3), "sum-amount-" + cat.id);
				let avg = Math.round((spent1 + spent2 + spent3) / 3);
				if (cat.is_income === 0) avg *= -1;
				setBudget({
					category: cat.id,
					month,
					amount: avg
				});
			}
		});
	}
	async function set12MonthAvg({ month }) {
		const categories = await all(`
  SELECT c.*
  FROM categories c
  LEFT JOIN category_groups g ON c.cat_group = g.id
  WHERE c.tombstone = 0 AND c.hidden = 0 AND g.hidden = 0
  `);
		await batchMessages(async () => {
			for (const cat of categories) {
				if (cat.is_income === 1 && !isTrackingBudget()) continue;
				setNMonthAvg({
					month,
					N: 12,
					category: cat.id
				});
			}
		});
	}
	async function set6MonthAvg({ month }) {
		const categories = await all(`
  SELECT c.*
  FROM categories c
  LEFT JOIN category_groups g ON c.cat_group = g.id
  WHERE c.tombstone = 0 AND c.hidden = 0 AND g.hidden = 0
  `);
		await batchMessages(async () => {
			for (const cat of categories) {
				if (cat.is_income === 1 && !isTrackingBudget()) continue;
				setNMonthAvg({
					month,
					N: 6,
					category: cat.id
				});
			}
		});
	}
	async function setNMonthAvg({ month, N, category }) {
		const categoryFromDb = await first$2("SELECT is_income FROM v_categories WHERE id = ?", [category]);
		let prevMonth$5 = prevMonth(month);
		let sumAmount = 0;
		for (let l = 0; l < N; l++) {
			sumAmount += await getSheetValue(sheetForMonth(prevMonth$5), "sum-amount-" + category);
			prevMonth$5 = prevMonth(prevMonth$5);
		}
		await batchMessages(async () => {
			let avg = Math.round(sumAmount / N);
			if (categoryFromDb.is_income === 0) avg *= -1;
			setBudget({
				category,
				month,
				amount: avg
			});
		});
	}
	async function holdForNextMonth({ month, amount }) {
		const row = await first$2("SELECT buffered FROM zero_budget_months WHERE id = ?", [month]);
		const toBudget = await getSheetValue(sheetForMonth(month), "to-budget");
		if (toBudget > 0) {
			await setBuffer(month, calcBufferedAmount(toBudget, row && row.buffered || 0, amount));
			return true;
		}
		return false;
	}
	async function resetHold({ month }) {
		await setBuffer(month, 0);
	}
	async function coverOverspending({ month, to, from, amount, currencyCode }) {
		const sheetName = sheetForMonth(month);
		const toBudgeted = await getSheetValue(sheetName, "budget-" + to);
		const leftoverFrom = await getSheetValue(sheetName, from === "to-budget" ? "to-budget" : "leftover-" + from);
		const amountToCover = amount ? -amount : await getSheetValue(sheetName, "leftover-" + to);
		if (amountToCover >= 0 || leftoverFrom <= 0) return;
		const coverableAmount = Math.min(Math.abs(amountToCover), leftoverFrom);
		await batchMessages(async () => {
			if (from !== "to-budget") await setBudget({
				category: from,
				month,
				amount: await getSheetValue(sheetName, "budget-" + from) - coverableAmount
			});
			await setBudget({
				category: to,
				month,
				amount: toBudgeted + coverableAmount
			});
			await addMovementNotes({
				month,
				amount: coverableAmount,
				to,
				from,
				currencyCode
			});
		});
	}
	async function transferAvailable({ month, amount, category }) {
		const sheetName = sheetForMonth(month);
		const leftover = await getSheetValue(sheetName, "to-budget");
		amount = Math.max(Math.min(amount, leftover), 0);
		await setBudget({
			category,
			month,
			amount: await getSheetValue(sheetName, "budget-" + category) + amount
		});
	}
	async function coverOverbudgeted({ month, category, amount, currencyCode }) {
		const sheetName = sheetForMonth(month);
		const categoryBudget = await getSheetValue(sheetName, "budget-" + category);
		const categoryLeftover = await getSheetValue(sheetName, "leftover-" + category);
		const amountToCover = amount ? -amount : await getSheetValue(sheetName, "to-budget");
		if (amountToCover >= 0 || categoryLeftover <= 0) return;
		const coverableAmount = Math.min(Math.abs(amountToCover), categoryLeftover);
		await batchMessages(async () => {
			await setBudget({
				category,
				month,
				amount: categoryBudget - coverableAmount
			});
			await addMovementNotes({
				month,
				amount: coverableAmount,
				from: category,
				to: "overbudgeted",
				currencyCode
			});
		});
	}
	async function transferCategory({ month, amount, from, to, currencyCode }) {
		const sheetName = sheetForMonth(month);
		const fromBudgeted = await getSheetValue(sheetName, "budget-" + from);
		await batchMessages(async () => {
			await setBudget({
				category: from,
				month,
				amount: fromBudgeted - amount
			});
			if (to !== "to-budget") await setBudget({
				category: to,
				month,
				amount: await getSheetValue(sheetName, "budget-" + to) + amount
			});
			await addMovementNotes({
				month,
				amount,
				to,
				from,
				currencyCode
			});
		});
	}
	async function copyUntilYearEnd({ month, category }) {
		const amount = await getSheetValue(sheetForMonth(month), "budget-" + category);
		const yearEnd = getYearEnd(month);
		const { createdMonths } = get$2().meta();
		const futureMonths = [...createdMonths].filter((m) => m > month && m <= yearEnd).sort();
		await batchMessages(async () => {
			for (const futureMonth of futureMonths) setBudget({
				category,
				month: futureMonth,
				amount
			});
		});
	}
	async function setCategoryCarryover({ startMonth, category, flag }) {
		const table = getBudgetTable();
		const months = getAllMonths(startMonth);
		await batchMessages(async () => {
			for (const month of months) setCarryover(table, category, dbMonth(month).toString(), flag);
		});
	}
	function addNewLine(notes) {
		return !notes ? "" : `${notes}\n`;
	}
	async function addMovementNotes({ month, amount, to, from, currencyCode }) {
		const displayAmount = integerToCurrency(amount, void 0, getCurrency(currencyCode).decimalPlaces);
		const monthBudgetNotesId = `budget-${month}`;
		const existingMonthBudgetNotes = addNewLine(firstSync(`SELECT n.note FROM notes n WHERE n.id = ?`, [monthBudgetNotesId])?.note);
		const locale = getLocale(await getItem("language"));
		const displayDay = format$1(currentDate(), "MMMM dd", locale);
		const categories = await getCategories$2([from, to].filter((c) => c !== "to-budget" && c !== "overbudgeted"));
		await update("notes", {
			id: monthBudgetNotesId,
			note: `${existingMonthBudgetNotes}- ${`Reassigned ${displayAmount} from ${from === "to-budget" ? "To Budget" : categories.find((c) => c.id === from)?.name} → ${to === "to-budget" ? "To Budget" : to === "overbudgeted" ? "Overbudgeted" : categories.find((c) => c.id === to)?.name} on ${displayDay}`}`
		});
	}
	async function resetIncomeCarryover({ month }) {
		const table = getBudgetTable();
		const categories = await all("SELECT * FROM v_categories WHERE is_income = 1 AND tombstone = 0");
		await batchMessages(async () => {
			for (const category of categories) await setCarryover(table, category.id, dbMonth(month).toString(), false);
		});
	}
	//#endregion
	//#region ../loot-core/src/server/spreadsheet/globals.ts
	function number$1(v) {
		if (typeof v === "number") return v;
		else if (typeof v === "string") {
			const parsed = parseFloat(v);
			if (isNaN(parsed)) return 0;
			return parsed;
		}
		return 0;
	}
	//#endregion
	//#region ../loot-core/src/server/budget/util.ts
	function sumAmounts(...amounts) {
		return safeNumber(amounts.reduce((total, amount) => {
			return total + number$1(amount);
		}, 0));
	}
	function flatten2(arr) {
		return Array.prototype.concat.apply([], arr);
	}
	function unflatten2(arr) {
		const res = [];
		for (let i = 0; i < arr.length; i += 2) res.push([arr[i], arr[i + 1]]);
		return res;
	}
	//#endregion
	//#region ../loot-core/src/server/budget/envelope.ts
	function getBlankSheet(months) {
		return sheetForMonth(prevMonth(months[0]));
	}
	function createBlankCategory(cat, months) {
		if (months.length > 0) {
			const sheetName = getBlankSheet(months);
			get$2().createStatic(sheetName, `carryover-${cat.id}`, false);
			get$2().createStatic(sheetName, `leftover-${cat.id}`, 0);
			get$2().createStatic(sheetName, `leftover-pos-${cat.id}`, 0);
		}
	}
	function createBlankMonth(categories, sheetName, months) {
		get$2().createStatic(sheetName, "is-blank", true);
		get$2().createStatic(sheetName, "to-budget", 0);
		get$2().createStatic(sheetName, "buffered", 0);
		categories.forEach((cat) => createBlankCategory(cat, months));
	}
	function createCategory$3(cat, sheetName, prevSheetName) {
		if (!cat.is_income) {
			get$2().createStatic(sheetName, `budget-${cat.id}`, 0);
			if (get$2().getCellValue(sheetName, `budget-${cat.id}`) == null) get$2().set(resolveName(sheetName, `budget-${cat.id}`), 0);
			get$2().createStatic(sheetName, `carryover-${cat.id}`, false);
			get$2().createDynamic(sheetName, `leftover-${cat.id}`, {
				initialValue: 0,
				dependencies: [
					`budget-${cat.id}`,
					`sum-amount-${cat.id}`,
					`${prevSheetName}!carryover-${cat.id}`,
					`${prevSheetName}!leftover-${cat.id}`,
					`${prevSheetName}!leftover-pos-${cat.id}`
				],
				run: (budgeted, spent, prevCarryover, prevLeftover, prevLeftoverPos) => {
					return safeNumber(number$1(budgeted) + number$1(spent) + (prevCarryover ? number$1(prevLeftover) : number$1(prevLeftoverPos)));
				}
			});
			get$2().createDynamic(sheetName, "leftover-pos-" + cat.id, {
				initialValue: 0,
				dependencies: [`leftover-${cat.id}`],
				run: (leftover) => {
					return leftover < 0 ? 0 : leftover;
				}
			});
		}
	}
	function createCategoryGroup$2(group, sheetName) {
		get$2().createDynamic(sheetName, "group-sum-amount-" + group.id, {
			initialValue: 0,
			dependencies: group.categories.map((cat) => `sum-amount-${cat.id}`),
			run: sumAmounts
		});
		if (!group.is_income) {
			get$2().createDynamic(sheetName, "group-budget-" + group.id, {
				initialValue: 0,
				dependencies: group.categories.map((cat) => `budget-${cat.id}`),
				run: sumAmounts
			});
			get$2().createDynamic(sheetName, "group-leftover-" + group.id, {
				initialValue: 0,
				dependencies: group.categories.map((cat) => `leftover-${cat.id}`),
				run: sumAmounts
			});
		}
	}
	function createSummary$1(groups, categories, prevSheetName, sheetName) {
		const incomeGroup = groups.filter((group) => group.is_income)[0];
		const expenseCategories = categories.filter((cat) => !cat.is_income);
		const incomeCategories = categories.filter((cat) => cat.is_income);
		get$2().createStatic(sheetName, "buffered", 0);
		get$2().createDynamic(sheetName, "from-last-month", {
			initialValue: 0,
			dependencies: [`${prevSheetName}!to-budget`, `${prevSheetName}!buffered-selected`],
			run: (toBudget, buffered) => safeNumber(number$1(toBudget) + number$1(buffered))
		});
		get$2().createDynamic(sheetName, "total-income", {
			initialValue: 0,
			dependencies: [`group-sum-amount-${incomeGroup.id}`],
			run: (amount) => amount
		});
		get$2().createDynamic(sheetName, "available-funds", {
			initialValue: 0,
			dependencies: ["total-income", "from-last-month"],
			run: (income, fromLastMonth) => safeNumber(number$1(income) + number$1(fromLastMonth))
		});
		get$2().createDynamic(sheetName, "last-month-overspent", {
			initialValue: 0,
			dependencies: flatten2(expenseCategories.map((cat) => [`${prevSheetName}!leftover-${cat.id}`, `${prevSheetName}!carryover-${cat.id}`])),
			run: (...data) => {
				data = unflatten2(data);
				return safeNumber(data.reduce((total, [leftover, carryover]) => {
					if (carryover) return total;
					return total + Math.min(0, number$1(leftover));
				}, 0));
			}
		});
		get$2().createDynamic(sheetName, "total-budgeted", {
			initialValue: 0,
			dependencies: groups.filter((group) => !group.is_income).map((group) => `group-budget-${group.id}`),
			run: (...amounts) => {
				return -sumAmounts(...amounts);
			}
		});
		get$2().createDynamic(sheetName, "buffered", { initialValue: 0 });
		get$2().createDynamic(sheetName, "buffered-auto", {
			initialValue: 0,
			dependencies: flatten2(incomeCategories.map((c) => [`${sheetName}!sum-amount-${c.id}`, `${sheetName}!carryover-${c.id}`])),
			run: (...data) => {
				data = unflatten2(data);
				return safeNumber(data.reduce((total, [sumAmount, carryover]) => {
					if (carryover) return total + sumAmount;
					return total;
				}, 0));
			}
		});
		get$2().createDynamic(sheetName, "buffered-selected", {
			initialValue: 0,
			dependencies: [`${sheetName}!buffered`, `${sheetName}!buffered-auto`],
			run: (man, auto) => {
				if (man !== 0) return man;
				return auto;
			}
		});
		get$2().createDynamic(sheetName, "to-budget", {
			initialValue: 0,
			dependencies: [
				"available-funds",
				"last-month-overspent",
				"total-budgeted",
				"buffered-selected"
			],
			run: (available, lastOverspent, totalBudgeted, buffered) => {
				return safeNumber(number$1(available) + number$1(lastOverspent) + number$1(totalBudgeted) - number$1(buffered));
			}
		});
		get$2().createDynamic(sheetName, "total-spent", {
			initialValue: 0,
			dependencies: groups.filter((group) => !group.is_income).map((group) => `group-sum-amount-${group.id}`),
			run: sumAmounts
		});
		get$2().createDynamic(sheetName, "total-leftover", {
			initialValue: 0,
			dependencies: groups.filter((group) => !group.is_income).map((group) => `group-leftover-${group.id}`),
			run: sumAmounts
		});
	}
	function createBudget$3(meta, categories, months) {
		const blankSheet = getBlankSheet(months);
		if (meta.blankSheet !== blankSheet) {
			get$2().clearSheet(meta.blankSheet);
			createBlankMonth(categories, blankSheet, months);
			meta.blankSheet = blankSheet;
		}
	}
	function handleCategoryChange$1(months, oldValue, newValue) {
		function addDeps(sheetName, groupId, catId) {
			get$2().addDependencies(sheetName, `group-sum-amount-${groupId}`, [`sum-amount-${catId}`]);
			get$2().addDependencies(sheetName, `group-budget-${groupId}`, [`budget-${catId}`]);
			get$2().addDependencies(sheetName, `group-leftover-${groupId}`, [`leftover-${catId}`]);
		}
		function removeDeps(sheetName, groupId, catId) {
			get$2().removeDependencies(sheetName, `group-sum-amount-${groupId}`, [`sum-amount-${catId}`]);
			get$2().removeDependencies(sheetName, `group-budget-${groupId}`, [`budget-${catId}`]);
			get$2().removeDependencies(sheetName, `group-leftover-${groupId}`, [`leftover-${catId}`]);
		}
		if (oldValue && oldValue.tombstone === 0 && newValue.tombstone === 1) {
			const id = newValue.id;
			const groupId = newValue.cat_group;
			months.forEach((month) => {
				removeDeps(sheetForMonth(month), groupId, id);
			});
		} else if (newValue.tombstone === 0 && (!oldValue || oldValue.tombstone === 1)) {
			createBlankCategory(newValue, months);
			months.forEach((month) => {
				const prevSheetName = sheetForMonth(prevMonth(month));
				const sheetName = sheetForMonth(month);
				const { start, end } = bounds(month);
				createCategory$1(newValue, sheetName, prevSheetName, start, end);
				const id = newValue.id;
				const groupId = newValue.cat_group;
				get$2().addDependencies(sheetName, "last-month-overspent", [`${prevSheetName}!leftover-${id}`, `${prevSheetName}!carryover-${id}`]);
				addDeps(sheetName, groupId, id);
				if (newValue.is_income) get$2().addDependencies(sheetName, "buffered-auto", flatten2([`${sheetName}!sum-amount-${id}`, `${sheetName}!carryover-${id}`]));
			});
		} else if (oldValue && oldValue.cat_group !== newValue.cat_group) {
			const id = newValue.id;
			months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				removeDeps(sheetName, oldValue.cat_group, id);
				addDeps(sheetName, newValue.cat_group, id);
			});
		}
	}
	function handleCategoryGroupChange$1(months, oldValue, newValue) {
		function addDeps(sheetName, groupId) {
			get$2().addDependencies(sheetName, "total-budgeted", [`group-budget-${groupId}`]);
			get$2().addDependencies(sheetName, "total-spent", [`group-sum-amount-${groupId}`]);
			get$2().addDependencies(sheetName, "total-leftover", [`group-leftover-${groupId}`]);
		}
		function removeDeps(sheetName, groupId) {
			get$2().removeDependencies(sheetName, "total-budgeted", [`group-budget-${groupId}`]);
			get$2().removeDependencies(sheetName, "total-spent", [`group-sum-amount-${groupId}`]);
			get$2().removeDependencies(sheetName, "total-leftover", [`group-leftover-${groupId}`]);
		}
		if (newValue.tombstone === 1 && oldValue && oldValue.tombstone === 0) {
			const id = newValue.id;
			months.forEach((month) => {
				removeDeps(sheetForMonth(month), id);
			});
		} else if (newValue.tombstone === 0 && (!oldValue || oldValue.tombstone === 1)) {
			const group = newValue;
			if (!group.is_income) months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				const categories = runQuery("SELECT * FROM categories WHERE tombstone = 0 AND cat_group = ?", [group.id], true);
				createCategoryGroup$2({
					...group,
					categories
				}, sheetName);
				addDeps(sheetName, group.id);
			});
		}
	}
	//#endregion
	//#region ../loot-core/src/server/budget/tracking.ts
	async function createCategory$2(cat, sheetName, prevSheetName) {
		get$2().createStatic(sheetName, `budget-${cat.id}`, 0);
		if (get$2().getCellValue(sheetName, `budget-${cat.id}`) == null) get$2().set(resolveName(sheetName, `budget-${cat.id}`), 0);
		get$2().createDynamic(sheetName, `leftover-${cat.id}`, {
			initialValue: 0,
			dependencies: [
				`budget-${cat.id}`,
				`sum-amount-${cat.id}`,
				`${prevSheetName}!carryover-${cat.id}`,
				`${prevSheetName}!leftover-${cat.id}`
			],
			run: (budgeted, sumAmount, prevCarryover, prevLeftover) => {
				if (cat.is_income) return safeNumber(number$1(budgeted) - number$1(sumAmount) + (prevCarryover ? number$1(prevLeftover) : 0));
				return safeNumber(number$1(budgeted) + number$1(sumAmount) + (prevCarryover ? number$1(prevLeftover) : 0));
			}
		});
		get$2().createDynamic(sheetName, `spent-with-carryover-${cat.id}`, {
			initialValue: 0,
			dependencies: [
				`budget-${cat.id}`,
				`sum-amount-${cat.id}`,
				`carryover-${cat.id}`
			],
			refresh: true,
			run: (budgeted, sumAmount, carryover) => {
				return carryover ? Math.max(0, safeNumber(number$1(budgeted) + number$1(sumAmount))) : sumAmount;
			}
		});
		get$2().createStatic(sheetName, `carryover-${cat.id}`, false);
	}
	function createCategoryGroup$1(group, sheetName) {
		get$2().createDynamic(sheetName, "group-sum-amount-" + group.id, {
			initialValue: 0,
			dependencies: group.categories.filter((cat) => !cat.hidden).map((cat) => `sum-amount-${cat.id}`),
			run: sumAmounts
		});
		get$2().createDynamic(sheetName, "group-budget-" + group.id, {
			initialValue: 0,
			dependencies: group.categories.filter((cat) => !cat.hidden).map((cat) => `budget-${cat.id}`),
			run: sumAmounts
		});
		get$2().createDynamic(sheetName, "group-leftover-" + group.id, {
			initialValue: 0,
			dependencies: group.categories.filter((cat) => !cat.hidden).map((cat) => `leftover-${cat.id}`),
			run: sumAmounts
		});
	}
	function createSummary(groups, sheetName) {
		const incomeGroup = groups.filter((group) => group.is_income)[0];
		const expenseGroups = groups.filter((group) => !group.is_income && !group.hidden);
		get$2().createDynamic(sheetName, "total-budgeted", {
			initialValue: 0,
			dependencies: expenseGroups.map((group) => `group-budget-${group.id}`),
			run: sumAmounts
		});
		get$2().createDynamic(sheetName, "total-spent", {
			initialValue: 0,
			refresh: true,
			dependencies: expenseGroups.map((group) => `group-sum-amount-${group.id}`),
			run: sumAmounts
		});
		get$2().createDynamic(sheetName, "total-income", {
			initialValue: 0,
			dependencies: [`group-sum-amount-${incomeGroup.id}`],
			run: (amount) => amount
		});
		get$2().createDynamic(sheetName, "total-leftover", {
			initialValue: 0,
			dependencies: expenseGroups.map((g) => `group-leftover-${g.id}`),
			run: sumAmounts
		});
		get$2().createDynamic(sheetName, "total-budget-income", {
			initialValue: 0,
			dependencies: [`group-budget-${incomeGroup.id}`],
			run: (amount) => amount
		});
		get$2().createDynamic(sheetName, "total-saved", {
			initialValue: 0,
			dependencies: ["total-budget-income", "total-budgeted"],
			run: (income, budgeted) => {
				return income - budgeted;
			}
		});
		get$2().createDynamic(sheetName, "real-saved", {
			initialValue: 0,
			dependencies: ["total-income", "total-spent"],
			run: (income, spent) => {
				return safeNumber(income - -spent);
			}
		});
	}
	function handleCategoryChange(months, oldValue, newValue) {
		function addDeps(sheetName, groupId, catId) {
			get$2().addDependencies(sheetName, `group-sum-amount-${groupId}`, [`sum-amount-${catId}`]);
			get$2().addDependencies(sheetName, `group-budget-${groupId}`, [`budget-${catId}`]);
			get$2().addDependencies(sheetName, `group-leftover-${groupId}`, [`leftover-${catId}`]);
		}
		function removeDeps(sheetName, groupId, catId) {
			get$2().removeDependencies(sheetName, `group-sum-amount-${groupId}`, [`sum-amount-${catId}`]);
			get$2().removeDependencies(sheetName, `group-budget-${groupId}`, [`budget-${catId}`]);
			get$2().removeDependencies(sheetName, `group-leftover-${groupId}`, [`leftover-${catId}`]);
		}
		if (oldValue && oldValue.tombstone === 0 && newValue.tombstone === 1) {
			const id = newValue.id;
			const groupId = newValue.cat_group;
			months.forEach((month) => {
				removeDeps(sheetForMonth(month), groupId, id);
			});
		} else if (newValue.tombstone === 0 && (!oldValue || oldValue.tombstone === 1)) months.forEach((month) => {
			const prevSheetName = sheetForMonth(prevMonth(month));
			const sheetName = sheetForMonth(month);
			const { start, end } = bounds(month);
			createCategory$1(newValue, sheetName, prevSheetName, start, end);
			const id = newValue.id;
			const groupId = newValue.cat_group;
			addDeps(sheetName, groupId, id);
		});
		else if (oldValue && oldValue.cat_group !== newValue.cat_group) {
			const id = newValue.id;
			months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				removeDeps(sheetName, oldValue.cat_group, id);
				addDeps(sheetName, newValue.cat_group, id);
			});
		} else if (oldValue && oldValue.hidden !== newValue.hidden) {
			const id = newValue.id;
			const groupId = newValue.cat_group;
			months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				if (newValue.hidden) removeDeps(sheetName, groupId, id);
				else addDeps(sheetName, groupId, id);
			});
		}
	}
	function handleCategoryGroupChange(months, oldValue, newValue) {
		function addDeps(sheetName, groupId) {
			get$2().addDependencies(sheetName, "total-budgeted", [`group-budget-${groupId}`]);
			get$2().addDependencies(sheetName, "total-spent", [`group-sum-amount-${groupId}`]);
			get$2().addDependencies(sheetName, "total-leftover", [`group-leftover-${groupId}`]);
		}
		function removeDeps(sheetName, groupId) {
			get$2().removeDependencies(sheetName, "total-budgeted", [`group-budget-${groupId}`]);
			get$2().removeDependencies(sheetName, "total-spent", [`group-sum-amount-${groupId}`]);
			get$2().removeDependencies(sheetName, "total-leftover", [`group-leftover-${groupId}`]);
		}
		if (newValue.tombstone === 1 && oldValue && oldValue.tombstone === 0) {
			const id = newValue.id;
			months.forEach((month) => {
				removeDeps(sheetForMonth(month), id);
			});
		} else if (newValue.tombstone === 0 && (!oldValue || oldValue.tombstone === 1)) {
			const group = newValue;
			months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				const categories = runQuery("SELECT * FROM categories WHERE tombstone = 0 AND cat_group = ?", [group.id], true);
				createCategoryGroup$1({
					...group,
					categories
				}, sheetName);
				addDeps(sheetName, group.id);
			});
		} else if (oldValue && oldValue.hidden !== newValue.hidden) {
			const group = newValue;
			months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				if (newValue.hidden) removeDeps(sheetName, group.id);
				else addDeps(sheetName, group.id);
			});
		}
	}
	//#endregion
	//#region ../loot-core/src/server/budget/base.ts
	function getBudgetType() {
		return get$2().meta().budgetType || "envelope";
	}
	function getBudgetRange(start, end) {
		start = getMonth(start);
		end = getMonth(end);
		if (start > end) start = end;
		start = subMonths(start, 3);
		end = addMonths(end, 12);
		return {
			start,
			end,
			range: rangeInclusive(start, end)
		};
	}
	function createCategory$1(cat, sheetName, prevSheetName, start, end) {
		get$2().createDynamic(sheetName, "sum-amount-" + cat.id, {
			initialValue: 0,
			run: () => {
				const row = runQuery(`SELECT SUM(amount) as amount FROM v_transactions_internal_alive t
           LEFT JOIN accounts a ON a.id = t.account
         WHERE t.date >= ${start} AND t.date <= ${end}
           AND category = '${cat.id}' AND a.offbudget = 0`, [], true)[0];
				return (row ? row.amount : 0) || 0;
			}
		});
		if (getBudgetType() === "envelope") createCategory$3(cat, sheetName, prevSheetName);
		else createCategory$2(cat, sheetName, prevSheetName);
	}
	function handleAccountChange(months, oldValue, newValue) {
		if (!oldValue || oldValue.offbudget !== newValue.offbudget) {
			const rows = runQuery(`
        SELECT DISTINCT(category) as category FROM transactions
        WHERE acct = ?
      `, [newValue.id], true);
			months.forEach((month) => {
				const sheetName = sheetForMonth(month);
				rows.forEach((row) => {
					get$2().recompute(resolveName(sheetName, "sum-amount-" + row.category));
				});
			});
		}
	}
	function handleTransactionChange(transaction, changedFields) {
		if ((changedFields.has("date") || changedFields.has("acct") || changedFields.has("amount") || changedFields.has("category") || changedFields.has("tombstone") || changedFields.has("isParent")) && transaction.date && transaction.category) {
			const sheetName = sheetForMonth(monthFromDate(fromDateRepr(transaction.date)));
			get$2().recompute(resolveName(sheetName, "sum-amount-" + transaction.category));
		}
	}
	function handleCategoryMappingChange(months, oldValue, newValue) {
		months.forEach((month) => {
			const sheetName = sheetForMonth(month);
			if (oldValue) get$2().recompute(resolveName(sheetName, "sum-amount-" + oldValue.transferId));
			get$2().recompute(resolveName(sheetName, "sum-amount-" + newValue.transferId));
		});
	}
	function handleBudgetMonthChange(budget) {
		const sheetName = sheetForMonth(budget.id);
		get$2().set(`${sheetName}!buffered`, budget.buffered);
	}
	function handleBudgetChange(budget) {
		if (budget.category) {
			const sheetName = sheetForMonth(budget.month.toString());
			get$2().set(`${sheetName}!budget-${budget.category}`, budget.amount || 0);
			get$2().set(`${sheetName}!carryover-${budget.category}`, budget.carryover === 1 ? true : false);
			get$2().set(`${sheetName}!goal-${budget.category}`, budget.goal);
			get$2().set(`${sheetName}!long-goal-${budget.category}`, budget.long_goal);
		}
	}
	function triggerBudgetChanges(oldValues, newValues) {
		const { createdMonths = /* @__PURE__ */ new Set() } = get$2().meta();
		const budgetType = getBudgetType();
		startTransaction();
		try {
			newValues.forEach((items, table) => {
				const old = oldValues.get(table);
				items.forEach((newValue) => {
					const oldValue = old && old.get(newValue.id);
					if (table === "zero_budget_months") handleBudgetMonthChange(newValue);
					else if (table === "zero_budgets" || table === "reflect_budgets") handleBudgetChange(newValue);
					else if (table === "transactions") {
						const changed = new Set(Object.keys(getChangedValues(oldValue || {}, newValue) || {}));
						if (oldValue) handleTransactionChange(oldValue, changed);
						handleTransactionChange(newValue, changed);
					} else if (table === "category_mapping") handleCategoryMappingChange(createdMonths, oldValue, newValue);
					else if (table === "categories") if (budgetType === "envelope") handleCategoryChange$1(createdMonths, oldValue, newValue);
					else handleCategoryChange(createdMonths, oldValue, newValue);
					else if (table === "category_groups") if (budgetType === "envelope") handleCategoryGroupChange$1(createdMonths, oldValue, newValue);
					else handleCategoryGroupChange(createdMonths, oldValue, newValue);
					else if (table === "accounts") handleAccountChange(createdMonths, oldValue, newValue);
				});
			});
		} finally {
			endTransaction();
		}
	}
	async function doTransfer(categoryIds, transferId) {
		const { createdMonths: months } = get$2().meta();
		[...months].forEach((month) => {
			setBudget({
				month,
				category: transferId,
				amount: categoryIds.map((id) => {
					return getBudget({
						month,
						category: id
					});
				}).reduce((total, value) => total + value, 0) + getBudget({
					month,
					category: transferId
				})
			});
		});
	}
	async function createBudget$2(months) {
		const { data: groups } = await aqlQuery(q("category_groups").select("*"));
		const categories = groups.flatMap((group) => group.categories);
		startTransaction();
		const meta = get$2().meta();
		meta.createdMonths = meta.createdMonths || /* @__PURE__ */ new Set();
		const budgetType = getBudgetType();
		if (budgetType === "envelope") createBudget$3(meta, categories, months);
		months.forEach((month) => {
			if (!meta.createdMonths.has(month)) {
				const prevMonth$1 = prevMonth(month);
				const { start, end } = bounds(month);
				const sheetName = sheetForMonth(month);
				const prevSheetName = sheetForMonth(prevMonth$1);
				categories.forEach((cat) => {
					createCategory$1(cat, sheetName, prevSheetName, start, end);
				});
				groups.forEach((group) => {
					if (budgetType === "envelope") createCategoryGroup$2(group, sheetName);
					else createCategoryGroup$1(group, sheetName);
				});
				if (budgetType === "envelope") createSummary$1(groups, categories, prevSheetName, sheetName);
				else createSummary(groups, sheetName);
				meta.createdMonths.add(month);
			}
		});
		get$2().setMeta(meta);
		endTransaction();
		await waitOnSpreadsheet();
	}
	async function createAllBudgets() {
		const earliestTransaction = await first$2("SELECT * FROM transactions WHERE isChild=0 AND date IS NOT NULL ORDER BY date ASC LIMIT 1");
		const earliestDate = earliestTransaction && fromDateRepr(earliestTransaction.date);
		const currentMonth$1 = currentMonth();
		const { start, end, range } = getBudgetRange(earliestDate || currentMonth$1, currentMonth$1);
		const createdMonths = get$2().meta().createdMonths || /* @__PURE__ */ new Set();
		if (range.filter((m) => !createdMonths.has(m)).length > 0) await createBudget$2(range);
		return {
			start,
			end
		};
	}
	async function setType(type) {
		const meta = get$2().meta();
		if (type === meta.budgetType) return;
		meta.budgetType = type;
		meta.createdMonths = /* @__PURE__ */ new Set();
		const nodes = get$2().getNodes();
		transaction(() => {
			for (const name of nodes.keys()) {
				const [sheetName, cellName] = name.split("!");
				if (sheetName.match(/^budget\d+/)) get$2().deleteCell(sheetName, cellName);
			}
		});
		get$2().startCacheBarrier();
		loadUserBudgets(db_exports);
		const bounds = await createAllBudgets();
		get$2().endCacheBarrier();
		return bounds;
	}
	//#endregion
	//#region ../loot-core/src/server/main-app.ts
	var app$20 = createApp();
	app$20.events.on("sync", (event) => {
		send$1("sync-event", event);
	});
	/**
	* Run a handler by name (server-side). Same API shape as the client connection's send.
	* Used by server code that needs to invoke handlers directly, e.g. importers.
	*/
	async function send(name, args) {
		return runHandler(app$20.handlers[name], args, { name });
	}
	//#endregion
	//#region ../loot-core/src/platform/server/fetch/index.ts
	var fetch$1 = async (input, options = {}) => {
		if (!options.redirect) options.redirect = "manual";
		const response = await globalThis.fetch(input, options);
		if (response.type === "opaqueredirect") {
			send$1("api-fetch-redirected");
			throw new Error(`API request redirected`);
		}
		return response;
	};
	//#endregion
	//#region ../loot-core/src/server/post.ts
	init_dist();
	function throwIfNot200(res, text) {
		if (res.status !== 200) {
			if (res.status === 500) throw new PostError(res.status === 500 ? "internal" : text);
			if ((res.headers.get("Content-Type") ?? "").toLowerCase().indexOf("application/json") !== -1) throw new PostError(JSON.parse(text).reason);
			if (["ngrok-error-code"].some((header) => res.headers.has(header))) throw new PostError("network-failure");
			throw new PostError(text);
		}
	}
	async function post(url, data, headers = {}, timeout = null, externalSignal) {
		let text;
		let res;
		const controller = new AbortController();
		const timeoutId = timeout != null ? setTimeout(() => controller.abort(), timeout) : void 0;
		const onExternalAbort = () => controller.abort();
		if (externalSignal) if (externalSignal.aborted) controller.abort();
		else externalSignal.addEventListener("abort", onExternalAbort);
		try {
			const signal = timeout != null || externalSignal ? controller.signal : null;
			res = await fetch$1(url, {
				method: "POST",
				body: JSON.stringify(data),
				signal,
				headers: {
					...headers,
					"Content-Type": "application/json"
				}
			});
			text = await res.text();
		} catch (err) {
			if (err instanceof Error && err.name === "AbortError" && externalSignal?.aborted) throw new PostError("aborted");
			throw new PostError("network-failure");
		} finally {
			if (timeoutId != null) clearTimeout(timeoutId);
			externalSignal?.removeEventListener("abort", onExternalAbort);
		}
		throwIfNot200(res, text);
		let responseData;
		try {
			responseData = JSON.parse(text);
		} catch {
			throw new PostError("parse-json", { meta: text });
		}
		if (responseData.status !== "ok") {
			logger.log("API call failed: " + url + "\nData: " + JSON.stringify(data, null, 2) + "\nResponse: " + JSON.stringify(res, null, 2));
			throw new PostError(responseData.description || responseData.reason || "unknown");
		}
		return responseData.data;
	}
	async function del(url, data, headers = {}, timeout = null) {
		let text;
		let res;
		try {
			const controller = new AbortController();
			const timeoutId = setTimeout(() => controller.abort(), timeout);
			const signal = timeout ? controller.signal : null;
			res = await fetch$1(url, {
				method: "DELETE",
				body: JSON.stringify(data),
				signal,
				headers: {
					...headers,
					"Content-Type": "application/json"
				}
			});
			clearTimeout(timeoutId);
			text = await res.text();
		} catch {
			throw new PostError("network-failure");
		}
		throwIfNot200(res, text);
		try {
			res = JSON.parse(text);
		} catch {
			throw new PostError("parse-json", { meta: text });
		}
		if (res.status !== "ok") {
			logger.log("API call failed: " + url + "\nData: " + JSON.stringify(data, null, 2) + "\nResponse: " + JSON.stringify(res, null, 2));
			throw new PostError(res.description || res.reason || "unknown");
		}
		return res.data;
	}
	async function patch(url, data, headers = {}, timeout = null) {
		let text;
		let res;
		try {
			const controller = new AbortController();
			const timeoutId = setTimeout(() => controller.abort(), timeout);
			const signal = timeout ? controller.signal : null;
			res = await fetch$1(url, {
				method: "PATCH",
				body: JSON.stringify(data),
				signal,
				headers: {
					...headers,
					"Content-Type": "application/json"
				}
			});
			clearTimeout(timeoutId);
			text = await res.text();
		} catch {
			throw new PostError("network-failure");
		}
		throwIfNot200(res, text);
		try {
			res = JSON.parse(text);
		} catch {
			throw new PostError("parse-json", { meta: text });
		}
		if (res.status !== "ok") {
			logger.log("API call failed: " + url + "\nData: " + JSON.stringify(data, null, 2) + "\nResponse: " + JSON.stringify(res, null, 2));
			throw new PostError(res.description || res.reason || "unknown");
		}
		return res.data;
	}
	async function postBinary(url, data, headers) {
		let res;
		try {
			res = await fetch$1(url, {
				method: "POST",
				body: data,
				headers: {
					"Content-Length": data.length,
					"Content-Type": "application/actual-sync",
					...headers
				}
			});
		} catch {
			throw new PostError("network-failure");
		}
		let buffer;
		if (res.arrayBuffer) buffer = Buffer$1.from(await res.arrayBuffer());
		else buffer = await res.buffer();
		throwIfNot200(res, buffer.toString());
		return buffer;
	}
	function get$1(url, opts) {
		return fetch$1(url, opts).then((res) => res.text());
	}
	//#endregion
	//#region ../loot-core/src/server/prefs.ts
	init_dist$1();
	var prefs = null;
	async function loadPrefs(id) {
		if (process$1.env.NODE_ENV === "test" && !id) {
			prefs = getDefaultPrefs("test", "test_LocalPrefs");
			return prefs;
		}
		const fullpath = join$1(getBudgetDir(id), "metadata.json");
		try {
			prefs = JSON.parse(await readFile(fullpath));
		} catch {
			prefs = {
				id,
				budgetName: id
			};
		}
		prefs.id = id;
		return prefs;
	}
	async function savePrefs(prefsToSet, { avoidSync = false } = {}) {
		Object.assign(prefs, prefsToSet);
		if (!avoidSync) {
			const messages = Object.keys(prefsToSet).map((key) => {
				if (key === "budgetName") return {
					dataset: "prefs",
					row: key,
					column: "value",
					value: prefsToSet[key],
					timestamp: Timestamp.send()
				};
				return null;
			}).filter((x) => x);
			if (messages.length > 0) await sendMessages(messages);
		}
		if (process$1.env.NODE_ENV !== "test") await writeFile(join$1(getBudgetDir(prefs.id), "metadata.json"), JSON.stringify(prefs));
	}
	function unloadPrefs() {
		prefs = null;
	}
	function getPrefs() {
		return prefs;
	}
	function getDefaultPrefs(id, budgetName) {
		return {
			id,
			budgetName
		};
	}
	//#endregion
	//#region ../loot-core/src/server/server-config.ts
	var config = null;
	function joinURL(base, ...paths) {
		const url = new URL(base);
		url.pathname = join$1(url.pathname, ...paths);
		return url.toString();
	}
	function isValidBaseURL(base) {
		try {
			return Boolean(new URL(base));
		} catch {
			return false;
		}
	}
	function setServer(url) {
		if (url == null) config = null;
		else config = getServer(url);
	}
	function getServer(url) {
		if (url) try {
			return {
				BASE_SERVER: url,
				SYNC_SERVER: joinURL(url, "/sync"),
				SIGNUP_SERVER: joinURL(url, "/account"),
				GOCARDLESS_SERVER: joinURL(url, "/gocardless"),
				SIMPLEFIN_SERVER: joinURL(url, "/simplefin"),
				PLUGGYAI_SERVER: joinURL(url, "/pluggyai"),
				ENABLEBANKING_SERVER: joinURL(url, "/enablebanking")
			};
		} catch (error) {
			logger.warn("Unable to parse server URL - using the global config.", { config }, error);
			return config;
		}
		return config;
	}
	//#endregion
	//#region ../loot-core/src/server/undo.ts
	var MESSAGE_HISTORY = [{ type: "marker" }];
	var CURSOR = 0;
	var HISTORY_SIZE = 20;
	function trimHistory() {
		MESSAGE_HISTORY = MESSAGE_HISTORY.slice(0, CURSOR + 1);
		const markers = MESSAGE_HISTORY.filter((item) => item.type === "marker");
		if (markers.length > HISTORY_SIZE) {
			const slice = markers.slice(-HISTORY_SIZE);
			const cutoff = MESSAGE_HISTORY.indexOf(slice[0]);
			MESSAGE_HISTORY = MESSAGE_HISTORY.slice(cutoff);
			CURSOR = MESSAGE_HISTORY.length - 1;
		}
	}
	function appendMessages(messages, oldData) {
		const context = getMutatorContext();
		if (context.undoListening && messages.length > 0) {
			trimHistory();
			const { undoTag } = context;
			MESSAGE_HISTORY.push({
				type: "messages",
				messages,
				oldData,
				undoTag
			});
			CURSOR++;
		}
	}
	function clearUndo() {
		MESSAGE_HISTORY = [{ type: "marker" }];
		CURSOR = 0;
	}
	function withUndo(func, meta) {
		const context = getMutatorContext();
		if (context.undoDisabled || context.undoListening) return func();
		MESSAGE_HISTORY = MESSAGE_HISTORY.slice(0, CURSOR + 1);
		const marker = {
			type: "marker",
			meta
		};
		if (MESSAGE_HISTORY[MESSAGE_HISTORY.length - 1].type === "marker") MESSAGE_HISTORY[MESSAGE_HISTORY.length - 1] = marker;
		else {
			MESSAGE_HISTORY.push(marker);
			CURSOR++;
		}
		return withMutatorContext({
			undoListening: true,
			undoTag: context.undoTag
		}, func);
	}
	function undoable(func, metaFunc) {
		return (...args) => {
			return withUndo(() => {
				return func.apply(null, args);
			}, metaFunc ? metaFunc(...args) : void 0);
		};
	}
	async function applyUndoAction(messages, meta, undoTag) {
		await withMutatorContext({ undoListening: false }, () => {
			return sendMessages(messages.map((msg) => ({
				...msg,
				timestamp: Timestamp.send()
			})));
		});
		send$1("undo-event", {
			messages,
			tables: messages.reduce((acc, message) => {
				if (!acc.includes(message.dataset)) acc.push(message.dataset);
				return acc;
			}, []),
			meta,
			undoTag
		});
	}
	async function undo() {
		const end = CURSOR;
		CURSOR = Math.max(CURSOR - 1, 0);
		while (CURSOR > 0 && MESSAGE_HISTORY[CURSOR].type !== "marker") CURSOR--;
		const meta = MESSAGE_HISTORY[CURSOR].meta;
		const start = Math.max(CURSOR, 0);
		const entries = MESSAGE_HISTORY.slice(start, end + 1).filter((entry) => entry.type === "messages");
		if (entries.length > 0) await applyUndoAction(entries.reduce((acc, entry) => {
			return acc.concat(entry.messages.map((message) => undoMessage(message, entry.oldData)).filter((x) => x));
		}, []).reverse(), meta, entries[0].undoTag);
	}
	function undoMessage(message, oldData) {
		const oldItem = getIn(oldData, [message.dataset, message.row]);
		if (oldItem) {
			let column = message.column;
			if (message.dataset === "spreadsheet_cells") column = "cachedValue";
			return {
				...message,
				value: oldItem[column]
			};
		} else if (message.dataset === "spreadsheet_cells") {
			if (message.column === "expr") return {
				...message,
				value: null
			};
			return message;
		} else if (message.dataset !== "category_mapping" && message.dataset !== "payee_mapping") {
			if (message.dataset === "zero_budget_months" || message.dataset === "zero_budgets" || message.dataset === "reflect_budgets") {
				if ([
					"buffered",
					"amount",
					"carryover"
				].includes(message.column)) return {
					...message,
					value: 0
				};
				return null;
			} else if (message.dataset === "notes") return {
				...message,
				value: null
			};
			return {
				...message,
				column: "tombstone",
				value: 1
			};
		}
		return null;
	}
	async function redo() {
		const meta = MESSAGE_HISTORY[CURSOR].type === "marker" ? MESSAGE_HISTORY[CURSOR].meta : null;
		const start = CURSOR;
		CURSOR = Math.min(CURSOR + 1, MESSAGE_HISTORY.length - 1);
		while (CURSOR < MESSAGE_HISTORY.length - 1 && MESSAGE_HISTORY[CURSOR].type !== "marker") CURSOR++;
		const end = CURSOR;
		const entries = MESSAGE_HISTORY.slice(start + 1, end + 1).filter((entry) => entry.type === "messages");
		if (entries.length > 0) await applyUndoAction(entries.reduce((acc, entry) => {
			return acc.concat(entry.messages).concat(redoResurrections(entry.messages, entry.oldData));
		}, []), meta, entries[entries.length - 1].undoTag);
	}
	function redoResurrections(messages, oldData) {
		const resurrect = /* @__PURE__ */ new Set();
		messages.forEach((message) => {
			if (!getIn(oldData, [message.dataset, message.row]) && ![
				"zero_budget_months",
				"zero_budgets",
				"reflect_budgets",
				"notes",
				"category_mapping",
				"payee_mapping"
			].includes(message.dataset)) resurrect.add(message.dataset + "." + message.row);
		});
		return [...resurrect].map((desc) => {
			const [table, row] = desc.split(".");
			return {
				dataset: table,
				row,
				column: "tombstone",
				value: 0,
				timestamp: Timestamp.send()
			};
		});
	}
	//#endregion
	//#region ../loot-core/src/server/encryption/encryption-internals.ts
	init_dist();
	var ENCRYPTION_ALGORITHM = "aes-256-gcm";
	function browserAlgorithmName(name) {
		switch (name) {
			case "aes-256-gcm": return "AES-GCM";
			default: throw new Error("unsupported crypto algorithm: " + name);
		}
	}
	function randomBytes$1(n) {
		return Buffer$1.from(crypto.getRandomValues(new Uint8Array(n)));
	}
	async function encrypt$1(masterKey, value) {
		const iv = crypto.getRandomValues(new Uint8Array(12));
		const encryptedArrayBuffer = await crypto.subtle.encrypt({
			name: browserAlgorithmName(ENCRYPTION_ALGORITHM),
			iv,
			tagLength: 128
		}, masterKey.getValue().raw, value);
		const encrypted = Buffer$1.from(encryptedArrayBuffer);
		const authTag = encrypted.slice(-16);
		return {
			value: encrypted.slice(0, -16),
			meta: {
				keyId: masterKey.getId(),
				algorithm: ENCRYPTION_ALGORITHM,
				iv: Buffer$1.from(iv).toString("base64"),
				authTag: authTag.toString("base64")
			}
		};
	}
	async function decrypt$1(masterKey, encrypted, meta) {
		const { algorithm, iv, authTag } = meta;
		const decrypted = await crypto.subtle.decrypt({
			name: browserAlgorithmName(algorithm),
			iv: Buffer$1.from(iv, "base64"),
			tagLength: 128
		}, masterKey.getValue().raw, Buffer$1.concat([encrypted, Buffer$1.from(authTag, "base64")]));
		return Buffer$1.from(decrypted);
	}
	async function createKey$1({ secret, salt }) {
		const passwordBuffer = Buffer$1.from(secret);
		const saltBuffer = Buffer$1.from(salt);
		const passwordKey = await crypto.subtle.importKey("raw", passwordBuffer, { name: "PBKDF2" }, false, ["deriveBits", "deriveKey"]);
		const derivedKey = await crypto.subtle.deriveKey({
			name: "PBKDF2",
			hash: "SHA-512",
			salt: saltBuffer,
			iterations: 1e4
		}, passwordKey, {
			name: "AES-GCM",
			length: 256
		}, true, ["encrypt", "decrypt"]);
		const exported = await crypto.subtle.exportKey("raw", derivedKey);
		return {
			raw: derivedKey,
			base64: Buffer$1.from(exported).toString("base64")
		};
	}
	async function importKey(str) {
		return {
			raw: await crypto.subtle.importKey("raw", Buffer$1.from(str, "base64"), { name: "AES-GCM" }, false, ["encrypt", "decrypt"]),
			base64: str
		};
	}
	//#endregion
	//#region ../loot-core/src/server/encryption/index.ts
	var keys$1 = {};
	var Key = class {
		constructor({ id }) {
			_defineProperty(this, "id", void 0);
			_defineProperty(this, "value", void 0);
			this.id = id || v4();
		}
		async createFromPassword({ password, salt }) {
			this.value = await createKey$1({
				secret: password,
				salt
			});
		}
		async createFromBase64(str) {
			this.value = await importKey(str);
		}
		getId() {
			return this.id;
		}
		getValue() {
			return this.value;
		}
		serialize() {
			return {
				id: this.id,
				base64: this.value.base64
			};
		}
	};
	function getKey(keyId) {
		if (keyId == null || keys$1[keyId] == null) throw new Error("missing-key");
		return keys$1[keyId];
	}
	function hasKey(keyId) {
		return keyId in keys$1;
	}
	async function encrypt(value, keyId) {
		return encrypt$1(getKey(keyId), value);
	}
	async function decrypt(encrypted, meta) {
		return decrypt$1(getKey(meta.keyId), encrypted, meta);
	}
	function randomBytes(n) {
		return randomBytes$1(n);
	}
	async function loadKey(key) {
		let keyInstance;
		if (!(key instanceof Key)) {
			keyInstance = new Key({ id: key.id });
			await keyInstance.createFromBase64(key.base64);
		} else keyInstance = key;
		keys$1[keyInstance.getId()] = keyInstance;
	}
	function unloadKey(key) {
		delete keys$1[key.getId()];
	}
	function unloadAllKeys() {
		keys$1 = {};
	}
	async function createKey({ id, password, salt }) {
		const key = new Key({ id });
		await key.createFromPassword({
			password,
			salt
		});
		return key;
	}
	//#endregion
	//#region ../loot-core/src/server/sync/encoder.ts
	init_dist();
	function coerceBuffer(value) {
		if (!Buffer$1.isBuffer(value)) return Buffer$1.from(value);
		return value;
	}
	async function encode(groupId, fileId, since, messages) {
		const { encryptKeyId } = getPrefs();
		const requestPb = create(SyncRequestSchema, {
			groupId,
			fileId,
			keyId: encryptKeyId ?? "",
			since: since.toString()
		});
		for (const msg of messages) {
			const binaryMsg = toBinary(MessageSchema, create(MessageSchema, {
				dataset: msg.dataset,
				row: msg.row,
				column: msg.column,
				value: msg.value
			}));
			let content;
			let isEncrypted;
			if (encryptKeyId) {
				let result;
				try {
					result = await encrypt(binaryMsg, encryptKeyId);
				} catch (e) {
					throw new SyncError("encrypt-failure", { isMissingKey: e.message === "missing-key" });
				}
				content = toBinary(EncryptedDataSchema, create(EncryptedDataSchema, {
					data: result.value,
					iv: Buffer$1.from(result.meta.iv, "base64"),
					authTag: Buffer$1.from(result.meta.authTag, "base64")
				}));
				isEncrypted = true;
			} else {
				content = binaryMsg;
				isEncrypted = false;
			}
			requestPb.messages.push(create(MessageEnvelopeSchema, {
				timestamp: msg.timestamp.toString(),
				content,
				isEncrypted
			}));
		}
		return toBinary(SyncRequestSchema, requestPb);
	}
	async function decode(data) {
		const { encryptKeyId } = getPrefs();
		const responsePb = fromBinary(SyncResponseSchema, data);
		const merkle = JSON.parse(responsePb.merkle);
		const messages = [];
		for (const envelopePb of responsePb.messages) {
			let msg;
			if (envelopePb.isEncrypted) {
				const binary = fromBinary(EncryptedDataSchema, envelopePb.content);
				let decrypted;
				try {
					decrypted = await decrypt(coerceBuffer(binary.data), {
						keyId: encryptKeyId,
						algorithm: "aes-256-gcm",
						iv: coerceBuffer(binary.iv),
						authTag: coerceBuffer(binary.authTag)
					});
				} catch (e) {
					logger.log(e);
					throw new SyncError("decrypt-failure", { isMissingKey: e.message === "missing-key" });
				}
				msg = fromBinary(MessageSchema, decrypted);
			} else msg = fromBinary(MessageSchema, envelopePb.content);
			messages.push({
				timestamp: Timestamp.parse(envelopePb.timestamp),
				dataset: msg.dataset,
				row: msg.row,
				column: msg.column,
				value: msg.value
			});
		}
		return {
			messages,
			merkle
		};
	}
	//#endregion
	//#region ../loot-core/src/server/sync/repair.ts
	function rebuildMerkleHash() {
		const rows = runQuery("SELECT timestamp FROM messages_crdt", [], true);
		let trie = emptyTrie();
		for (let i = 0; i < rows.length; i++) trie = insert$1(trie, Timestamp.parse(rows[i].timestamp));
		return {
			numMessages: rows.length,
			trie
		};
	}
	async function repairSync$1() {
		const rebuilt = rebuildMerkleHash();
		const clock = getClock();
		clock.merkle = rebuilt.trie;
		runQuery(cache("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"), [serializeClock(clock)]);
	}
	//#endregion
	//#region ../loot-core/src/server/sync/utils.ts
	function isError$1(value) {
		return value.error !== void 0;
	}
	//#endregion
	//#region ../loot-core/src/server/sync/make-test-message.ts
	function randomString() {
		return randomBytes(12).toString();
	}
	async function makeTestMessage(keyId) {
		return await encrypt(toBinary(MessageSchema, create(MessageSchema, {
			dataset: randomString(),
			row: randomString(),
			column: randomString(),
			value: randomString()
		})), keyId);
	}
	//#endregion
	//#region ../../node_modules/adm-zip/util/constants.js
	var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = {
			LOCHDR: 30,
			LOCSIG: 67324752,
			LOCVER: 4,
			LOCFLG: 6,
			LOCHOW: 8,
			LOCTIM: 10,
			LOCCRC: 14,
			LOCSIZ: 18,
			LOCLEN: 22,
			LOCNAM: 26,
			LOCEXT: 28,
			EXTSIG: 134695760,
			EXTHDR: 16,
			EXTCRC: 4,
			EXTSIZ: 8,
			EXTLEN: 12,
			CENHDR: 46,
			CENSIG: 33639248,
			CENVEM: 4,
			CENVER: 6,
			CENFLG: 8,
			CENHOW: 10,
			CENTIM: 12,
			CENCRC: 16,
			CENSIZ: 20,
			CENLEN: 24,
			CENNAM: 28,
			CENEXT: 30,
			CENCOM: 32,
			CENDSK: 34,
			CENATT: 36,
			CENATX: 38,
			CENOFF: 42,
			ENDHDR: 22,
			ENDSIG: 101010256,
			ENDSUB: 8,
			ENDTOT: 10,
			ENDSIZ: 12,
			ENDOFF: 16,
			ENDCOM: 20,
			END64HDR: 20,
			END64SIG: 117853008,
			END64START: 4,
			END64OFF: 8,
			END64NUMDISKS: 16,
			ZIP64SIG: 101075792,
			ZIP64HDR: 56,
			ZIP64LEAD: 12,
			ZIP64SIZE: 4,
			ZIP64VEM: 12,
			ZIP64VER: 14,
			ZIP64DSK: 16,
			ZIP64DSKDIR: 20,
			ZIP64SUB: 24,
			ZIP64TOT: 32,
			ZIP64SIZB: 40,
			ZIP64OFF: 48,
			ZIP64EXTRA: 56,
			STORED: 0,
			SHRUNK: 1,
			REDUCED1: 2,
			REDUCED2: 3,
			REDUCED3: 4,
			REDUCED4: 5,
			IMPLODED: 6,
			DEFLATED: 8,
			ENHANCED_DEFLATED: 9,
			PKWARE: 10,
			BZIP2: 12,
			LZMA: 14,
			IBM_TERSE: 18,
			IBM_LZ77: 19,
			AES_ENCRYPT: 99,
			FLG_ENC: 1,
			FLG_COMP1: 2,
			FLG_COMP2: 4,
			FLG_DESC: 8,
			FLG_ENH: 16,
			FLG_PATCH: 32,
			FLG_STR: 64,
			FLG_EFS: 2048,
			FLG_MSK: 4096,
			FILE: 2,
			BUFFER: 1,
			NONE: 0,
			EF_ID: 0,
			EF_SIZE: 2,
			ID_ZIP64: 1,
			ID_AVINFO: 7,
			ID_PFS: 8,
			ID_OS2: 9,
			ID_NTFS: 10,
			ID_OPENVMS: 12,
			ID_UNIX: 13,
			ID_FORK: 14,
			ID_PATCH: 15,
			ID_X509_PKCS7: 20,
			ID_X509_CERTID_F: 21,
			ID_X509_CERTID_C: 22,
			ID_STRONGENC: 23,
			ID_RECORD_MGT: 24,
			ID_X509_PKCS7_RL: 25,
			ID_IBM1: 101,
			ID_IBM2: 102,
			ID_POSZIP: 18064,
			EF_ZIP64_OR_32: 4294967295,
			EF_ZIP64_OR_16: 65535,
			EF_ZIP64_SUNCOMP: 0,
			EF_ZIP64_SCOMP: 8,
			EF_ZIP64_RHO: 16,
			EF_ZIP64_DSN: 24
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/util/errors.js
	var require_errors$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var errors = {
			INVALID_LOC: "Invalid LOC header (bad signature)",
			INVALID_CEN: "Invalid CEN header (bad signature)",
			INVALID_END: "Invalid END header (bad signature)",
			DESCRIPTOR_NOT_EXIST: "No descriptor present",
			DESCRIPTOR_UNKNOWN: "Unknown descriptor format",
			DESCRIPTOR_FAULTY: "Descriptor data is malformed",
			NO_DATA: "Nothing to decompress",
			BAD_CRC: "CRC32 checksum failed {0}",
			FILE_IN_THE_WAY: "There is a file in the way: {0}",
			UNKNOWN_METHOD: "Invalid/unsupported compression method",
			AVAIL_DATA: "inflate::Available inflate data did not terminate",
			INVALID_DISTANCE: "inflate::Invalid literal/length or distance code in fixed or dynamic block",
			TO_MANY_CODES: "inflate::Dynamic block code description: too many length or distance codes",
			INVALID_REPEAT_LEN: "inflate::Dynamic block code description: repeat more than specified lengths",
			INVALID_REPEAT_FIRST: "inflate::Dynamic block code description: repeat lengths with no first length",
			INCOMPLETE_CODES: "inflate::Dynamic block code description: code lengths codes incomplete",
			INVALID_DYN_DISTANCE: "inflate::Dynamic block code description: invalid distance code lengths",
			INVALID_CODES_LEN: "inflate::Dynamic block code description: invalid literal/length code lengths",
			INVALID_STORE_BLOCK: "inflate::Stored block length did not match one's complement",
			INVALID_BLOCK_TYPE: "inflate::Invalid block type (type == 3)",
			CANT_EXTRACT_FILE: "Could not extract the file",
			CANT_OVERRIDE: "Target file already exists",
			DISK_ENTRY_TOO_LARGE: "Number of disk entries is too large",
			NO_ZIP: "No zip file was loaded",
			NO_ENTRY: "Entry doesn't exist",
			DIRECTORY_CONTENT_ERROR: "A directory cannot have content",
			FILE_NOT_FOUND: "File not found: \"{0}\"",
			NOT_IMPLEMENTED: "Not implemented",
			INVALID_FILENAME: "Invalid filename",
			INVALID_FORMAT: "Invalid or unsupported zip format. No END header found",
			INVALID_PASS_PARAM: "Incompatible password parameter",
			WRONG_PASSWORD: "Wrong Password",
			COMMENT_TOO_LONG: "Comment is too long",
			EXTRA_FIELD_PARSE_ERROR: "Extra field parsing error"
		};
		function E(message) {
			return function(...args) {
				if (args.length) message = message.replace(/\{(\d)\}/g, (_, n) => args[n] || "");
				return /* @__PURE__ */ new Error("ADM-ZIP: " + message);
			};
		}
		for (const msg of Object.keys(errors)) exports[msg] = E(errors[msg]);
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/util/utils.js
	var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		init_dist$1();
		var fsystem = (init_empty(), __toCommonJS(empty_exports));
		var pth = require_path_browserify();
		var Constants = require_constants$1();
		var Errors = require_errors$1();
		var isWin = typeof process$1 === "object" && "win32" === process$1.platform;
		var is_Obj = (obj) => typeof obj === "object" && obj !== null;
		var crcTable = new Uint32Array(256).map((t, c) => {
			for (let k = 0; k < 8; k++) if ((c & 1) !== 0) c = 3988292384 ^ c >>> 1;
			else c >>>= 1;
			return c >>> 0;
		});
		function Utils(opts) {
			this.sep = pth.sep;
			this.fs = fsystem;
			if (is_Obj(opts)) {
				if (is_Obj(opts.fs) && typeof opts.fs.statSync === "function") this.fs = opts.fs;
			}
		}
		module.exports = Utils;
		Utils.prototype.makeDir = function(folder) {
			const self = this;
			function mkdirSync(fpath) {
				let resolvedPath = fpath.split(self.sep)[0];
				fpath.split(self.sep).forEach(function(name) {
					if (!name || name.substr(-1, 1) === ":") return;
					resolvedPath += self.sep + name;
					var stat;
					try {
						stat = self.fs.statSync(resolvedPath);
					} catch (e) {
						self.fs.mkdirSync(resolvedPath);
					}
					if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY(`"${resolvedPath}"`);
				});
			}
			mkdirSync(folder);
		};
		Utils.prototype.writeFileTo = function(path, content, overwrite, attr) {
			const self = this;
			if (self.fs.existsSync(path)) {
				if (!overwrite) return false;
				if (self.fs.statSync(path).isDirectory()) return false;
			}
			var folder = pth.dirname(path);
			if (!self.fs.existsSync(folder)) self.makeDir(folder);
			var fd;
			try {
				fd = self.fs.openSync(path, "w", 438);
			} catch (e) {
				self.fs.chmodSync(path, 438);
				fd = self.fs.openSync(path, "w", 438);
			}
			if (fd) try {
				self.fs.writeSync(fd, content, 0, content.length, 0);
			} finally {
				self.fs.closeSync(fd);
			}
			self.fs.chmodSync(path, attr || 438);
			return true;
		};
		Utils.prototype.writeFileToAsync = function(path, content, overwrite, attr, callback) {
			if (typeof attr === "function") {
				callback = attr;
				attr = void 0;
			}
			const self = this;
			self.fs.exists(path, function(exist) {
				if (exist && !overwrite) return callback(false);
				self.fs.stat(path, function(err, stat) {
					if (exist && stat.isDirectory()) return callback(false);
					var folder = pth.dirname(path);
					self.fs.exists(folder, function(exists) {
						if (!exists) self.makeDir(folder);
						self.fs.open(path, "w", 438, function(err, fd) {
							if (err) self.fs.chmod(path, 438, function() {
								self.fs.open(path, "w", 438, function(err, fd) {
									self.fs.write(fd, content, 0, content.length, 0, function() {
										self.fs.close(fd, function() {
											self.fs.chmod(path, attr || 438, function() {
												callback(true);
											});
										});
									});
								});
							});
							else if (fd) self.fs.write(fd, content, 0, content.length, 0, function() {
								self.fs.close(fd, function() {
									self.fs.chmod(path, attr || 438, function() {
										callback(true);
									});
								});
							});
							else self.fs.chmod(path, attr || 438, function() {
								callback(true);
							});
						});
					});
				});
			});
		};
		Utils.prototype.findFiles = function(path) {
			const self = this;
			function findSync(dir, pattern, recursive) {
				if (typeof pattern === "boolean") {
					recursive = pattern;
					pattern = void 0;
				}
				let files = [];
				self.fs.readdirSync(dir).forEach(function(file) {
					const path = pth.join(dir, file);
					const stat = self.fs.statSync(path);
					if (!pattern || pattern.test(path)) files.push(pth.normalize(path) + (stat.isDirectory() ? self.sep : ""));
					if (stat.isDirectory() && recursive) files = files.concat(findSync(path, pattern, recursive));
				});
				return files;
			}
			return findSync(path, void 0, true);
		};
		/**
		* Callback for showing if everything was done.
		*
		* @callback filelistCallback
		* @param {Error} err - Error object
		* @param {string[]} list - was request fully completed
		*/
		/**
		*
		* @param {string} dir
		* @param {filelistCallback} cb
		*/
		Utils.prototype.findFilesAsync = function(dir, cb) {
			const self = this;
			let results = [];
			self.fs.readdir(dir, function(err, list) {
				if (err) return cb(err);
				let list_length = list.length;
				if (!list_length) return cb(null, results);
				list.forEach(function(file) {
					file = pth.join(dir, file);
					self.fs.stat(file, function(err, stat) {
						if (err) return cb(err);
						if (stat) {
							results.push(pth.normalize(file) + (stat.isDirectory() ? self.sep : ""));
							if (stat.isDirectory()) self.findFilesAsync(file, function(err, res) {
								if (err) return cb(err);
								results = results.concat(res);
								if (!--list_length) cb(null, results);
							});
							else if (!--list_length) cb(null, results);
						}
					});
				});
			});
		};
		Utils.prototype.getAttributes = function() {};
		Utils.prototype.setAttributes = function() {};
		Utils.crc32update = function(crc, byte) {
			return crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
		};
		Utils.crc32 = function(buf) {
			if (typeof buf === "string") buf = Buffer$1.from(buf, "utf8");
			let len = buf.length;
			let crc = -1;
			for (let off = 0; off < len;) crc = Utils.crc32update(crc, buf[off++]);
			return ~crc >>> 0;
		};
		Utils.methodToString = function(method) {
			switch (method) {
				case Constants.STORED: return "STORED (" + method + ")";
				case Constants.DEFLATED: return "DEFLATED (" + method + ")";
				default: return "UNSUPPORTED (" + method + ")";
			}
		};
		/**
		* removes ".." style path elements
		* @param {string} path - fixable path
		* @returns string - fixed filepath
		*/
		Utils.canonical = function(path) {
			if (!path) return "";
			const safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/"));
			return pth.join(".", safeSuffix);
		};
		/**
		* fix file names in achive
		* @param {string} path - fixable path
		* @returns string - fixed filepath
		*/
		Utils.zipnamefix = function(path) {
			if (!path) return "";
			const safeSuffix = pth.posix.normalize("/" + path.split("\\").join("/"));
			return pth.posix.join(".", safeSuffix);
		};
		/**
		*
		* @param {Array} arr
		* @param {function} callback
		* @returns
		*/
		Utils.findLast = function(arr, callback) {
			if (!Array.isArray(arr)) throw new TypeError("arr is not array");
			const len = arr.length >>> 0;
			for (let i = len - 1; i >= 0; i--) if (callback(arr[i], i, arr)) return arr[i];
		};
		Utils.sanitize = function(prefix, name) {
			prefix = pth.resolve(pth.normalize(prefix));
			var parts = name.split("/");
			for (var i = 0, l = parts.length; i < l; i++) {
				var path = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
				if (path.indexOf(prefix) === 0) return path;
			}
			return pth.normalize(pth.join(prefix, pth.basename(name)));
		};
		Utils.toBuffer = function toBuffer(input, encoder) {
			if (Buffer$1.isBuffer(input)) return input;
			else if (input instanceof Uint8Array) return Buffer$1.from(input);
			else return typeof input === "string" ? encoder(input) : Buffer$1.alloc(0);
		};
		Utils.readBigUInt64LE = function(buffer, index) {
			var slice = Buffer$1.from(buffer.slice(index, index + 8));
			slice.swap64();
			return parseInt(`0x${slice.toString("hex")}`);
		};
		Utils.fromDOS2Date = function(val) {
			return new Date((val >> 25 & 127) + 1980, Math.max((val >> 21 & 15) - 1, 0), Math.max(val >> 16 & 31, 1), val >> 11 & 31, val >> 5 & 63, (val & 31) << 1);
		};
		Utils.fromDate2DOS = function(val) {
			let date = 0;
			let time = 0;
			if (val.getFullYear() > 1979) {
				date = (val.getFullYear() - 1980 & 127) << 9 | val.getMonth() + 1 << 5 | val.getDate();
				time = val.getHours() << 11 | val.getMinutes() << 5 | val.getSeconds() >> 1;
			}
			return date << 16 | time;
		};
		Utils.isWin = isWin;
		Utils.crcTable = crcTable;
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/util/fattr.js
	var require_fattr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var pth = require_path_browserify();
		module.exports = function(path, { fs }) {
			var _path = path || "", _obj = newAttr(), _stat = null;
			function newAttr() {
				return {
					directory: false,
					readonly: false,
					hidden: false,
					executable: false,
					mtime: 0,
					atime: 0
				};
			}
			if (_path && fs.existsSync(_path)) {
				_stat = fs.statSync(_path);
				_obj.directory = _stat.isDirectory();
				_obj.mtime = _stat.mtime;
				_obj.atime = _stat.atime;
				_obj.executable = (73 & _stat.mode) !== 0;
				_obj.readonly = (128 & _stat.mode) === 0;
				_obj.hidden = pth.basename(_path)[0] === ".";
			} else console.warn("Invalid path: " + _path);
			return {
				get directory() {
					return _obj.directory;
				},
				get readOnly() {
					return _obj.readonly;
				},
				get hidden() {
					return _obj.hidden;
				},
				get mtime() {
					return _obj.mtime;
				},
				get atime() {
					return _obj.atime;
				},
				get executable() {
					return _obj.executable;
				},
				decodeAttributes: function() {},
				encodeAttributes: function() {},
				toJSON: function() {
					return {
						path: _path,
						isDirectory: _obj.directory,
						isReadOnly: _obj.readonly,
						isHidden: _obj.hidden,
						isExecutable: _obj.executable,
						mTime: _obj.mtime,
						aTime: _obj.atime
					};
				},
				toString: function() {
					return JSON.stringify(this.toJSON(), null, "	");
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/util/decoder.js
	var require_decoder = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		module.exports = {
			efs: true,
			encode: (data) => Buffer$1.from(data, "utf8"),
			decode: (data) => data.toString("utf8")
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/util/index.js
	var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require_utils$1();
		module.exports.Constants = require_constants$1();
		module.exports.Errors = require_errors$1();
		module.exports.FileAttr = require_fattr();
		module.exports.decoder = require_decoder();
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/headers/entryHeader.js
	var require_entryHeader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var Utils = require_util$1(), Constants = Utils.Constants;
		module.exports = function() {
			var _verMade = 20, _version = 10, _flags = 0, _method = 0, _time = 0, _crc = 0, _compressedSize = 0, _size = 0, _fnameLen = 0, _extraLen = 0, _comLen = 0, _diskStart = 0, _inattr = 0, _attr = 0, _offset = 0;
			_verMade |= Utils.isWin ? 2560 : 768;
			_flags |= Constants.FLG_EFS;
			const _localHeader = { extraLen: 0 };
			const uint32 = (val) => Math.max(0, val) >>> 0;
			const uint8 = (val) => Math.max(0, val) & 255;
			_time = Utils.fromDate2DOS(/* @__PURE__ */ new Date());
			return {
				get made() {
					return _verMade;
				},
				set made(val) {
					_verMade = val;
				},
				get version() {
					return _version;
				},
				set version(val) {
					_version = val;
				},
				get flags() {
					return _flags;
				},
				set flags(val) {
					_flags = val;
				},
				get flags_efs() {
					return (_flags & Constants.FLG_EFS) > 0;
				},
				set flags_efs(val) {
					if (val) _flags |= Constants.FLG_EFS;
					else _flags &= ~Constants.FLG_EFS;
				},
				get flags_desc() {
					return (_flags & Constants.FLG_DESC) > 0;
				},
				set flags_desc(val) {
					if (val) _flags |= Constants.FLG_DESC;
					else _flags &= ~Constants.FLG_DESC;
				},
				get method() {
					return _method;
				},
				set method(val) {
					switch (val) {
						case Constants.STORED: this.version = 10;
						case Constants.DEFLATED:
						default: this.version = 20;
					}
					_method = val;
				},
				get time() {
					return Utils.fromDOS2Date(this.timeval);
				},
				set time(val) {
					this.timeval = Utils.fromDate2DOS(val);
				},
				get timeval() {
					return _time;
				},
				set timeval(val) {
					_time = uint32(val);
				},
				get timeHighByte() {
					return uint8(_time >>> 8);
				},
				get crc() {
					return _crc;
				},
				set crc(val) {
					_crc = uint32(val);
				},
				get compressedSize() {
					return _compressedSize;
				},
				set compressedSize(val) {
					_compressedSize = uint32(val);
				},
				get size() {
					return _size;
				},
				set size(val) {
					_size = uint32(val);
				},
				get fileNameLength() {
					return _fnameLen;
				},
				set fileNameLength(val) {
					_fnameLen = val;
				},
				get extraLength() {
					return _extraLen;
				},
				set extraLength(val) {
					_extraLen = val;
				},
				get extraLocalLength() {
					return _localHeader.extraLen;
				},
				set extraLocalLength(val) {
					_localHeader.extraLen = val;
				},
				get commentLength() {
					return _comLen;
				},
				set commentLength(val) {
					_comLen = val;
				},
				get diskNumStart() {
					return _diskStart;
				},
				set diskNumStart(val) {
					_diskStart = uint32(val);
				},
				get inAttr() {
					return _inattr;
				},
				set inAttr(val) {
					_inattr = uint32(val);
				},
				get attr() {
					return _attr;
				},
				set attr(val) {
					_attr = uint32(val);
				},
				get fileAttr() {
					return (_attr || 0) >> 16 & 4095;
				},
				get offset() {
					return _offset;
				},
				set offset(val) {
					_offset = uint32(val);
				},
				get encrypted() {
					return (_flags & Constants.FLG_ENC) === Constants.FLG_ENC;
				},
				get centralHeaderSize() {
					return Constants.CENHDR + _fnameLen + _extraLen + _comLen;
				},
				get realDataOffset() {
					return _offset + Constants.LOCHDR + _localHeader.fnameLen + _localHeader.extraLen;
				},
				get localHeader() {
					return _localHeader;
				},
				loadLocalHeaderFromBinary: function(input) {
					var data = input.slice(_offset, _offset + Constants.LOCHDR);
					if (data.readUInt32LE(0) !== Constants.LOCSIG) throw Utils.Errors.INVALID_LOC();
					_localHeader.version = data.readUInt16LE(Constants.LOCVER);
					_localHeader.flags = data.readUInt16LE(Constants.LOCFLG);
					_localHeader.method = data.readUInt16LE(Constants.LOCHOW);
					_localHeader.time = data.readUInt32LE(Constants.LOCTIM);
					_localHeader.crc = data.readUInt32LE(Constants.LOCCRC);
					_localHeader.compressedSize = data.readUInt32LE(Constants.LOCSIZ);
					_localHeader.size = data.readUInt32LE(Constants.LOCLEN);
					_localHeader.fnameLen = data.readUInt16LE(Constants.LOCNAM);
					_localHeader.extraLen = data.readUInt16LE(Constants.LOCEXT);
					const extraStart = _offset + Constants.LOCHDR + _localHeader.fnameLen;
					const extraEnd = extraStart + _localHeader.extraLen;
					return input.slice(extraStart, extraEnd);
				},
				loadFromBinary: function(data) {
					if (data.length !== Constants.CENHDR || data.readUInt32LE(0) !== Constants.CENSIG) throw Utils.Errors.INVALID_CEN();
					_verMade = data.readUInt16LE(Constants.CENVEM);
					_version = data.readUInt16LE(Constants.CENVER);
					_flags = data.readUInt16LE(Constants.CENFLG);
					_method = data.readUInt16LE(Constants.CENHOW);
					_time = data.readUInt32LE(Constants.CENTIM);
					_crc = data.readUInt32LE(Constants.CENCRC);
					_compressedSize = data.readUInt32LE(Constants.CENSIZ);
					_size = data.readUInt32LE(Constants.CENLEN);
					_fnameLen = data.readUInt16LE(Constants.CENNAM);
					_extraLen = data.readUInt16LE(Constants.CENEXT);
					_comLen = data.readUInt16LE(Constants.CENCOM);
					_diskStart = data.readUInt16LE(Constants.CENDSK);
					_inattr = data.readUInt16LE(Constants.CENATT);
					_attr = data.readUInt32LE(Constants.CENATX);
					_offset = data.readUInt32LE(Constants.CENOFF);
				},
				localHeaderToBinary: function() {
					var data = Buffer$1.alloc(Constants.LOCHDR);
					data.writeUInt32LE(Constants.LOCSIG, 0);
					data.writeUInt16LE(_version, Constants.LOCVER);
					data.writeUInt16LE(_flags, Constants.LOCFLG);
					data.writeUInt16LE(_method, Constants.LOCHOW);
					data.writeUInt32LE(_time, Constants.LOCTIM);
					data.writeUInt32LE(_crc, Constants.LOCCRC);
					data.writeUInt32LE(_compressedSize, Constants.LOCSIZ);
					data.writeUInt32LE(_size, Constants.LOCLEN);
					data.writeUInt16LE(_fnameLen, Constants.LOCNAM);
					data.writeUInt16LE(_localHeader.extraLen, Constants.LOCEXT);
					return data;
				},
				centralHeaderToBinary: function() {
					var data = Buffer$1.alloc(Constants.CENHDR + _fnameLen + _extraLen + _comLen);
					data.writeUInt32LE(Constants.CENSIG, 0);
					data.writeUInt16LE(_verMade, Constants.CENVEM);
					data.writeUInt16LE(_version, Constants.CENVER);
					data.writeUInt16LE(_flags, Constants.CENFLG);
					data.writeUInt16LE(_method, Constants.CENHOW);
					data.writeUInt32LE(_time, Constants.CENTIM);
					data.writeUInt32LE(_crc, Constants.CENCRC);
					data.writeUInt32LE(_compressedSize, Constants.CENSIZ);
					data.writeUInt32LE(_size, Constants.CENLEN);
					data.writeUInt16LE(_fnameLen, Constants.CENNAM);
					data.writeUInt16LE(_extraLen, Constants.CENEXT);
					data.writeUInt16LE(_comLen, Constants.CENCOM);
					data.writeUInt16LE(_diskStart, Constants.CENDSK);
					data.writeUInt16LE(_inattr, Constants.CENATT);
					data.writeUInt32LE(_attr, Constants.CENATX);
					data.writeUInt32LE(_offset, Constants.CENOFF);
					return data;
				},
				toJSON: function() {
					const bytes = function(nr) {
						return nr + " bytes";
					};
					return {
						made: _verMade,
						version: _version,
						flags: _flags,
						method: Utils.methodToString(_method),
						time: this.time,
						crc: "0x" + _crc.toString(16).toUpperCase(),
						compressedSize: bytes(_compressedSize),
						size: bytes(_size),
						fileNameLength: bytes(_fnameLen),
						extraLength: bytes(_extraLen),
						commentLength: bytes(_comLen),
						diskNumStart: _diskStart,
						inAttr: _inattr,
						attr: _attr,
						offset: _offset,
						centralHeaderSize: bytes(Constants.CENHDR + _fnameLen + _extraLen + _comLen)
					};
				},
				toString: function() {
					return JSON.stringify(this.toJSON(), null, "	");
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/headers/mainHeader.js
	var require_mainHeader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var Utils = require_util$1(), Constants = Utils.Constants;
		module.exports = function() {
			var _volumeEntries = 0, _totalEntries = 0, _size = 0, _offset = 0, _commentLength = 0;
			return {
				get diskEntries() {
					return _volumeEntries;
				},
				set diskEntries(val) {
					_volumeEntries = _totalEntries = val;
				},
				get totalEntries() {
					return _totalEntries;
				},
				set totalEntries(val) {
					_totalEntries = _volumeEntries = val;
				},
				get size() {
					return _size;
				},
				set size(val) {
					_size = val;
				},
				get offset() {
					return _offset;
				},
				set offset(val) {
					_offset = val;
				},
				get commentLength() {
					return _commentLength;
				},
				set commentLength(val) {
					_commentLength = val;
				},
				get mainHeaderSize() {
					return Constants.ENDHDR + _commentLength;
				},
				loadFromBinary: function(data) {
					if ((data.length !== Constants.ENDHDR || data.readUInt32LE(0) !== Constants.ENDSIG) && (data.length < Constants.ZIP64HDR || data.readUInt32LE(0) !== Constants.ZIP64SIG)) throw Utils.Errors.INVALID_END();
					if (data.readUInt32LE(0) === Constants.ENDSIG) {
						_volumeEntries = data.readUInt16LE(Constants.ENDSUB);
						_totalEntries = data.readUInt16LE(Constants.ENDTOT);
						_size = data.readUInt32LE(Constants.ENDSIZ);
						_offset = data.readUInt32LE(Constants.ENDOFF);
						_commentLength = data.readUInt16LE(Constants.ENDCOM);
					} else {
						_volumeEntries = Utils.readBigUInt64LE(data, Constants.ZIP64SUB);
						_totalEntries = Utils.readBigUInt64LE(data, Constants.ZIP64TOT);
						_size = Utils.readBigUInt64LE(data, Constants.ZIP64SIZE);
						_offset = Utils.readBigUInt64LE(data, Constants.ZIP64OFF);
						_commentLength = 0;
					}
				},
				toBinary: function() {
					var b = Buffer$1.alloc(Constants.ENDHDR + _commentLength);
					b.writeUInt32LE(Constants.ENDSIG, 0);
					b.writeUInt32LE(0, 4);
					b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
					b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
					b.writeUInt32LE(_size, Constants.ENDSIZ);
					b.writeUInt32LE(_offset, Constants.ENDOFF);
					b.writeUInt16LE(_commentLength, Constants.ENDCOM);
					b.fill(" ", Constants.ENDHDR);
					return b;
				},
				toJSON: function() {
					const offset = function(nr, len) {
						let offs = nr.toString(16).toUpperCase();
						while (offs.length < len) offs = "0" + offs;
						return "0x" + offs;
					};
					return {
						diskEntries: _volumeEntries,
						totalEntries: _totalEntries,
						size: _size + " bytes",
						offset: offset(_offset, 4),
						commentLength: _commentLength
					};
				},
				toString: function() {
					return JSON.stringify(this.toJSON(), null, "	");
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/headers/index.js
	var require_headers = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.EntryHeader = require_entryHeader();
		exports.MainHeader = require_mainHeader();
	}));
	//#endregion
	//#region ../../node_modules/assert/build/internal/errors.js
	var require_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function _typeof(o) {
			"@babel/helpers - typeof";
			return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
				return typeof o;
			} : function(o) {
				return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
			}, _typeof(o);
		}
		function _defineProperties(target, props) {
			for (var i = 0; i < props.length; i++) {
				var descriptor = props[i];
				descriptor.enumerable = descriptor.enumerable || false;
				descriptor.configurable = true;
				if ("value" in descriptor) descriptor.writable = true;
				Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
			}
		}
		function _createClass(Constructor, protoProps, staticProps) {
			if (protoProps) _defineProperties(Constructor.prototype, protoProps);
			if (staticProps) _defineProperties(Constructor, staticProps);
			Object.defineProperty(Constructor, "prototype", { writable: false });
			return Constructor;
		}
		function _toPropertyKey(arg) {
			var key = _toPrimitive(arg, "string");
			return _typeof(key) === "symbol" ? key : String(key);
		}
		function _toPrimitive(input, hint) {
			if (_typeof(input) !== "object" || input === null) return input;
			var prim = input[Symbol.toPrimitive];
			if (prim !== void 0) {
				var res = prim.call(input, hint || "default");
				if (_typeof(res) !== "object") return res;
				throw new TypeError("@@toPrimitive must return a primitive value.");
			}
			return (hint === "string" ? String : Number)(input);
		}
		function _classCallCheck(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		function _inherits(subClass, superClass) {
			if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
			subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {
				value: subClass,
				writable: true,
				configurable: true
			} });
			Object.defineProperty(subClass, "prototype", { writable: false });
			if (superClass) _setPrototypeOf(subClass, superClass);
		}
		function _setPrototypeOf(o, p) {
			_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
				o.__proto__ = p;
				return o;
			};
			return _setPrototypeOf(o, p);
		}
		function _createSuper(Derived) {
			var hasNativeReflectConstruct = _isNativeReflectConstruct();
			return function _createSuperInternal() {
				var Super = _getPrototypeOf(Derived), result;
				if (hasNativeReflectConstruct) {
					var NewTarget = _getPrototypeOf(this).constructor;
					result = Reflect.construct(Super, arguments, NewTarget);
				} else result = Super.apply(this, arguments);
				return _possibleConstructorReturn(this, result);
			};
		}
		function _possibleConstructorReturn(self, call) {
			if (call && (_typeof(call) === "object" || typeof call === "function")) return call;
			else if (call !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
			return _assertThisInitialized(self);
		}
		function _assertThisInitialized(self) {
			if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
			return self;
		}
		function _isNativeReflectConstruct() {
			if (typeof Reflect === "undefined" || !Reflect.construct) return false;
			if (Reflect.construct.sham) return false;
			if (typeof Proxy === "function") return true;
			try {
				Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
				return true;
			} catch (e) {
				return false;
			}
		}
		function _getPrototypeOf(o) {
			_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
				return o.__proto__ || Object.getPrototypeOf(o);
			};
			return _getPrototypeOf(o);
		}
		var codes = {};
		var assert;
		var util;
		function createErrorType(code, message, Base) {
			if (!Base) Base = Error;
			function getMessage(arg1, arg2, arg3) {
				if (typeof message === "string") return message;
				else return message(arg1, arg2, arg3);
			}
			codes[code] = /* @__PURE__ */ function(_Base) {
				_inherits(NodeError, _Base);
				var _super = _createSuper(NodeError);
				function NodeError(arg1, arg2, arg3) {
					var _this;
					_classCallCheck(this, NodeError);
					_this = _super.call(this, getMessage(arg1, arg2, arg3));
					_this.code = code;
					return _this;
				}
				return _createClass(NodeError);
			}(Base);
		}
		function oneOf(expected, thing) {
			if (Array.isArray(expected)) {
				var len = expected.length;
				expected = expected.map(function(i) {
					return String(i);
				});
				if (len > 2) return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
				else if (len === 2) return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
				else return "of ".concat(thing, " ").concat(expected[0]);
			} else return "of ".concat(thing, " ").concat(String(expected));
		}
		function startsWith(str, search, pos) {
			return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
		}
		function endsWith(str, search, this_len) {
			if (this_len === void 0 || this_len > str.length) this_len = str.length;
			return str.substring(this_len - search.length, this_len) === search;
		}
		function includes(str, search, start) {
			if (typeof start !== "number") start = 0;
			if (start + search.length > str.length) return false;
			else return str.indexOf(search, start) !== -1;
		}
		createErrorType("ERR_AMBIGUOUS_ARGUMENT", "The \"%s\" argument is ambiguous. %s", TypeError);
		createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
			if (assert === void 0) assert = require_assert();
			assert(typeof name === "string", "'name' must be a string");
			var determiner;
			if (typeof expected === "string" && startsWith(expected, "not ")) {
				determiner = "must not be";
				expected = expected.replace(/^not /, "");
			} else determiner = "must be";
			var msg;
			if (endsWith(name, " argument")) msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
			else {
				var type = includes(name, ".") ? "property" : "argument";
				msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
			}
			msg += ". Received type ".concat(_typeof(actual));
			return msg;
		}, TypeError);
		createErrorType("ERR_INVALID_ARG_VALUE", function(name, value) {
			var reason = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "is invalid";
			if (util === void 0) util = require_util$2();
			var inspected = util.inspect(value);
			if (inspected.length > 128) inspected = "".concat(inspected.slice(0, 128), "...");
			return "The argument '".concat(name, "' ").concat(reason, ". Received ").concat(inspected);
		}, TypeError, RangeError);
		createErrorType("ERR_INVALID_RETURN_VALUE", function(input, name, value) {
			var type;
			if (value && value.constructor && value.constructor.name) type = "instance of ".concat(value.constructor.name);
			else type = "type ".concat(_typeof(value));
			return "Expected ".concat(input, " to be returned from the \"").concat(name, "\"") + " function but got ".concat(type, ".");
		}, TypeError);
		createErrorType("ERR_MISSING_ARGS", function() {
			for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
			if (assert === void 0) assert = require_assert();
			assert(args.length > 0, "At least one arg needs to be specified");
			var msg = "The ";
			var len = args.length;
			args = args.map(function(a) {
				return "\"".concat(a, "\"");
			});
			switch (len) {
				case 1:
					msg += "".concat(args[0], " argument");
					break;
				case 2:
					msg += "".concat(args[0], " and ").concat(args[1], " arguments");
					break;
				default:
					msg += args.slice(0, len - 1).join(", ");
					msg += ", and ".concat(args[len - 1], " arguments");
					break;
			}
			return "".concat(msg, " must be specified");
		}, TypeError);
		module.exports.codes = codes;
	}));
	//#endregion
	//#region ../../node_modules/assert/build/internal/assert/assertion_error.js
	var require_assertion_error = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		function ownKeys(e, r) {
			var t = Object.keys(e);
			if (Object.getOwnPropertySymbols) {
				var o = Object.getOwnPropertySymbols(e);
				r && (o = o.filter(function(r) {
					return Object.getOwnPropertyDescriptor(e, r).enumerable;
				})), t.push.apply(t, o);
			}
			return t;
		}
		function _objectSpread(e) {
			for (var r = 1; r < arguments.length; r++) {
				var t = null != arguments[r] ? arguments[r] : {};
				r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
					_defineProperty(e, r, t[r]);
				}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
					Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
				});
			}
			return e;
		}
		function _defineProperty(obj, key, value) {
			key = _toPropertyKey(key);
			if (key in obj) Object.defineProperty(obj, key, {
				value,
				enumerable: true,
				configurable: true,
				writable: true
			});
			else obj[key] = value;
			return obj;
		}
		function _classCallCheck(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		function _defineProperties(target, props) {
			for (var i = 0; i < props.length; i++) {
				var descriptor = props[i];
				descriptor.enumerable = descriptor.enumerable || false;
				descriptor.configurable = true;
				if ("value" in descriptor) descriptor.writable = true;
				Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
			}
		}
		function _createClass(Constructor, protoProps, staticProps) {
			if (protoProps) _defineProperties(Constructor.prototype, protoProps);
			if (staticProps) _defineProperties(Constructor, staticProps);
			Object.defineProperty(Constructor, "prototype", { writable: false });
			return Constructor;
		}
		function _toPropertyKey(arg) {
			var key = _toPrimitive(arg, "string");
			return _typeof(key) === "symbol" ? key : String(key);
		}
		function _toPrimitive(input, hint) {
			if (_typeof(input) !== "object" || input === null) return input;
			var prim = input[Symbol.toPrimitive];
			if (prim !== void 0) {
				var res = prim.call(input, hint || "default");
				if (_typeof(res) !== "object") return res;
				throw new TypeError("@@toPrimitive must return a primitive value.");
			}
			return (hint === "string" ? String : Number)(input);
		}
		function _inherits(subClass, superClass) {
			if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
			subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {
				value: subClass,
				writable: true,
				configurable: true
			} });
			Object.defineProperty(subClass, "prototype", { writable: false });
			if (superClass) _setPrototypeOf(subClass, superClass);
		}
		function _createSuper(Derived) {
			var hasNativeReflectConstruct = _isNativeReflectConstruct();
			return function _createSuperInternal() {
				var Super = _getPrototypeOf(Derived), result;
				if (hasNativeReflectConstruct) {
					var NewTarget = _getPrototypeOf(this).constructor;
					result = Reflect.construct(Super, arguments, NewTarget);
				} else result = Super.apply(this, arguments);
				return _possibleConstructorReturn(this, result);
			};
		}
		function _possibleConstructorReturn(self, call) {
			if (call && (_typeof(call) === "object" || typeof call === "function")) return call;
			else if (call !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
			return _assertThisInitialized(self);
		}
		function _assertThisInitialized(self) {
			if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
			return self;
		}
		function _wrapNativeSuper(Class) {
			var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
			_wrapNativeSuper = function _wrapNativeSuper(Class) {
				if (Class === null || !_isNativeFunction(Class)) return Class;
				if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
				if (typeof _cache !== "undefined") {
					if (_cache.has(Class)) return _cache.get(Class);
					_cache.set(Class, Wrapper);
				}
				function Wrapper() {
					return _construct(Class, arguments, _getPrototypeOf(this).constructor);
				}
				Wrapper.prototype = Object.create(Class.prototype, { constructor: {
					value: Wrapper,
					enumerable: false,
					writable: true,
					configurable: true
				} });
				return _setPrototypeOf(Wrapper, Class);
			};
			return _wrapNativeSuper(Class);
		}
		function _construct(Parent, args, Class) {
			if (_isNativeReflectConstruct()) _construct = Reflect.construct.bind();
			else _construct = function _construct(Parent, args, Class) {
				var a = [null];
				a.push.apply(a, args);
				var instance = new (Function.bind.apply(Parent, a))();
				if (Class) _setPrototypeOf(instance, Class.prototype);
				return instance;
			};
			return _construct.apply(null, arguments);
		}
		function _isNativeReflectConstruct() {
			if (typeof Reflect === "undefined" || !Reflect.construct) return false;
			if (Reflect.construct.sham) return false;
			if (typeof Proxy === "function") return true;
			try {
				Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
				return true;
			} catch (e) {
				return false;
			}
		}
		function _isNativeFunction(fn) {
			return Function.toString.call(fn).indexOf("[native code]") !== -1;
		}
		function _setPrototypeOf(o, p) {
			_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
				o.__proto__ = p;
				return o;
			};
			return _setPrototypeOf(o, p);
		}
		function _getPrototypeOf(o) {
			_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
				return o.__proto__ || Object.getPrototypeOf(o);
			};
			return _getPrototypeOf(o);
		}
		function _typeof(o) {
			"@babel/helpers - typeof";
			return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
				return typeof o;
			} : function(o) {
				return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
			}, _typeof(o);
		}
		var inspect = require_util$2().inspect;
		var ERR_INVALID_ARG_TYPE = require_errors().codes.ERR_INVALID_ARG_TYPE;
		function endsWith(str, search, this_len) {
			if (this_len === void 0 || this_len > str.length) this_len = str.length;
			return str.substring(this_len - search.length, this_len) === search;
		}
		function repeat(str, count) {
			count = Math.floor(count);
			if (str.length == 0 || count == 0) return "";
			var maxCount = str.length * count;
			count = Math.floor(Math.log(count) / Math.log(2));
			while (count) {
				str += str;
				count--;
			}
			str += str.substring(0, maxCount - str.length);
			return str;
		}
		var blue = "";
		var green = "";
		var red = "";
		var white = "";
		var kReadableOperator = {
			deepStrictEqual: "Expected values to be strictly deep-equal:",
			strictEqual: "Expected values to be strictly equal:",
			strictEqualObject: "Expected \"actual\" to be reference-equal to \"expected\":",
			deepEqual: "Expected values to be loosely deep-equal:",
			equal: "Expected values to be loosely equal:",
			notDeepStrictEqual: "Expected \"actual\" not to be strictly deep-equal to:",
			notStrictEqual: "Expected \"actual\" to be strictly unequal to:",
			notStrictEqualObject: "Expected \"actual\" not to be reference-equal to \"expected\":",
			notDeepEqual: "Expected \"actual\" not to be loosely deep-equal to:",
			notEqual: "Expected \"actual\" to be loosely unequal to:",
			notIdentical: "Values identical but not reference-equal:"
		};
		var kMaxShortLength = 10;
		function copyError(source) {
			var keys = Object.keys(source);
			var target = Object.create(Object.getPrototypeOf(source));
			keys.forEach(function(key) {
				target[key] = source[key];
			});
			Object.defineProperty(target, "message", { value: source.message });
			return target;
		}
		function inspectValue(val) {
			return inspect(val, {
				compact: false,
				customInspect: false,
				depth: 1e3,
				maxArrayLength: Infinity,
				showHidden: false,
				breakLength: Infinity,
				showProxy: false,
				sorted: true,
				getters: true
			});
		}
		function createErrDiff(actual, expected, operator) {
			var other = "";
			var res = "";
			var lastPos = 0;
			var end = "";
			var skipped = false;
			var actualInspected = inspectValue(actual);
			var actualLines = actualInspected.split("\n");
			var expectedLines = inspectValue(expected).split("\n");
			var i = 0;
			var indicator = "";
			if (operator === "strictEqual" && _typeof(actual) === "object" && _typeof(expected) === "object" && actual !== null && expected !== null) operator = "strictEqualObject";
			if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {
				var inputLength = actualLines[0].length + expectedLines[0].length;
				if (inputLength <= kMaxShortLength) {
					if ((_typeof(actual) !== "object" || actual === null) && (_typeof(expected) !== "object" || expected === null) && (actual !== 0 || expected !== 0)) return "".concat(kReadableOperator[operator], "\n\n") + "".concat(actualLines[0], " !== ").concat(expectedLines[0], "\n");
				} else if (operator !== "strictEqualObject") {
					if (inputLength < (process$1.stderr && process$1.stderr.isTTY ? process$1.stderr.columns : 80)) {
						while (actualLines[0][i] === expectedLines[0][i]) i++;
						if (i > 2) {
							indicator = "\n  ".concat(repeat(" ", i), "^");
							i = 0;
						}
					}
				}
			}
			var a = actualLines[actualLines.length - 1];
			var b = expectedLines[expectedLines.length - 1];
			while (a === b) {
				if (i++ < 2) end = "\n  ".concat(a).concat(end);
				else other = a;
				actualLines.pop();
				expectedLines.pop();
				if (actualLines.length === 0 || expectedLines.length === 0) break;
				a = actualLines[actualLines.length - 1];
				b = expectedLines[expectedLines.length - 1];
			}
			var maxLines = Math.max(actualLines.length, expectedLines.length);
			if (maxLines === 0) {
				var _actualLines = actualInspected.split("\n");
				if (_actualLines.length > 30) {
					_actualLines[26] = "".concat(blue, "...").concat(white);
					while (_actualLines.length > 27) _actualLines.pop();
				}
				return "".concat(kReadableOperator.notIdentical, "\n\n").concat(_actualLines.join("\n"), "\n");
			}
			if (i > 3) {
				end = "\n".concat(blue, "...").concat(white).concat(end);
				skipped = true;
			}
			if (other !== "") {
				end = "\n  ".concat(other).concat(end);
				other = "";
			}
			var printedLines = 0;
			var msg = kReadableOperator[operator] + "\n".concat(green, "+ actual").concat(white, " ").concat(red, "- expected").concat(white);
			var skippedMsg = " ".concat(blue, "...").concat(white, " Lines skipped");
			for (i = 0; i < maxLines; i++) {
				var cur = i - lastPos;
				if (actualLines.length < i + 1) {
					if (cur > 1 && i > 2) {
						if (cur > 4) {
							res += "\n".concat(blue, "...").concat(white);
							skipped = true;
						} else if (cur > 3) {
							res += "\n  ".concat(expectedLines[i - 2]);
							printedLines++;
						}
						res += "\n  ".concat(expectedLines[i - 1]);
						printedLines++;
					}
					lastPos = i;
					other += "\n".concat(red, "-").concat(white, " ").concat(expectedLines[i]);
					printedLines++;
				} else if (expectedLines.length < i + 1) {
					if (cur > 1 && i > 2) {
						if (cur > 4) {
							res += "\n".concat(blue, "...").concat(white);
							skipped = true;
						} else if (cur > 3) {
							res += "\n  ".concat(actualLines[i - 2]);
							printedLines++;
						}
						res += "\n  ".concat(actualLines[i - 1]);
						printedLines++;
					}
					lastPos = i;
					res += "\n".concat(green, "+").concat(white, " ").concat(actualLines[i]);
					printedLines++;
				} else {
					var expectedLine = expectedLines[i];
					var actualLine = actualLines[i];
					var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ",") || actualLine.slice(0, -1) !== expectedLine);
					if (divergingLines && endsWith(expectedLine, ",") && expectedLine.slice(0, -1) === actualLine) {
						divergingLines = false;
						actualLine += ",";
					}
					if (divergingLines) {
						if (cur > 1 && i > 2) {
							if (cur > 4) {
								res += "\n".concat(blue, "...").concat(white);
								skipped = true;
							} else if (cur > 3) {
								res += "\n  ".concat(actualLines[i - 2]);
								printedLines++;
							}
							res += "\n  ".concat(actualLines[i - 1]);
							printedLines++;
						}
						lastPos = i;
						res += "\n".concat(green, "+").concat(white, " ").concat(actualLine);
						other += "\n".concat(red, "-").concat(white, " ").concat(expectedLine);
						printedLines += 2;
					} else {
						res += other;
						other = "";
						if (cur === 1 || i === 0) {
							res += "\n  ".concat(actualLine);
							printedLines++;
						}
					}
				}
				if (printedLines > 20 && i < maxLines - 2) return "".concat(msg).concat(skippedMsg, "\n").concat(res, "\n").concat(blue, "...").concat(white).concat(other, "\n") + "".concat(blue, "...").concat(white);
			}
			return "".concat(msg).concat(skipped ? skippedMsg : "", "\n").concat(res).concat(other).concat(end).concat(indicator);
		}
		module.exports = /* @__PURE__ */ function(_Error, _inspect$custom) {
			_inherits(AssertionError, _Error);
			var _super = _createSuper(AssertionError);
			function AssertionError(options) {
				var _this;
				_classCallCheck(this, AssertionError);
				if (_typeof(options) !== "object" || options === null) throw new ERR_INVALID_ARG_TYPE("options", "Object", options);
				var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn;
				var actual = options.actual, expected = options.expected;
				var limit = Error.stackTraceLimit;
				Error.stackTraceLimit = 0;
				if (message != null) _this = _super.call(this, String(message));
				else {
					if (process$1.stderr && process$1.stderr.isTTY) if (process$1.stderr && process$1.stderr.getColorDepth && process$1.stderr.getColorDepth() !== 1) {
						blue = "\x1B[34m";
						green = "\x1B[32m";
						white = "\x1B[39m";
						red = "\x1B[31m";
					} else {
						blue = "";
						green = "";
						white = "";
						red = "";
					}
					if (_typeof(actual) === "object" && actual !== null && _typeof(expected) === "object" && expected !== null && "stack" in actual && actual instanceof Error && "stack" in expected && expected instanceof Error) {
						actual = copyError(actual);
						expected = copyError(expected);
					}
					if (operator === "deepStrictEqual" || operator === "strictEqual") _this = _super.call(this, createErrDiff(actual, expected, operator));
					else if (operator === "notDeepStrictEqual" || operator === "notStrictEqual") {
						var base = kReadableOperator[operator];
						var res = inspectValue(actual).split("\n");
						if (operator === "notStrictEqual" && _typeof(actual) === "object" && actual !== null) base = kReadableOperator.notStrictEqualObject;
						if (res.length > 30) {
							res[26] = "".concat(blue, "...").concat(white);
							while (res.length > 27) res.pop();
						}
						if (res.length === 1) _this = _super.call(this, "".concat(base, " ").concat(res[0]));
						else _this = _super.call(this, "".concat(base, "\n\n").concat(res.join("\n"), "\n"));
					} else {
						var _res = inspectValue(actual);
						var other = "";
						var knownOperators = kReadableOperator[operator];
						if (operator === "notDeepEqual" || operator === "notEqual") {
							_res = "".concat(kReadableOperator[operator], "\n\n").concat(_res);
							if (_res.length > 1024) _res = "".concat(_res.slice(0, 1021), "...");
						} else {
							other = "".concat(inspectValue(expected));
							if (_res.length > 512) _res = "".concat(_res.slice(0, 509), "...");
							if (other.length > 512) other = "".concat(other.slice(0, 509), "...");
							if (operator === "deepEqual" || operator === "equal") _res = "".concat(knownOperators, "\n\n").concat(_res, "\n\nshould equal\n\n");
							else other = " ".concat(operator, " ").concat(other);
						}
						_this = _super.call(this, "".concat(_res).concat(other));
					}
				}
				Error.stackTraceLimit = limit;
				_this.generatedMessage = !message;
				Object.defineProperty(_assertThisInitialized(_this), "name", {
					value: "AssertionError [ERR_ASSERTION]",
					enumerable: false,
					writable: true,
					configurable: true
				});
				_this.code = "ERR_ASSERTION";
				_this.actual = actual;
				_this.expected = expected;
				_this.operator = operator;
				if (Error.captureStackTrace) Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);
				_this.stack;
				_this.name = "AssertionError";
				return _possibleConstructorReturn(_this);
			}
			_createClass(AssertionError, [{
				key: "toString",
				value: function toString() {
					return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message);
				}
			}, {
				key: _inspect$custom,
				value: function value(recurseTimes, ctx) {
					return inspect(this, _objectSpread(_objectSpread({}, ctx), {}, {
						customInspect: false,
						depth: 0
					}));
				}
			}]);
			return AssertionError;
		}(/* @__PURE__ */ _wrapNativeSuper(Error), inspect.custom);
	}));
	//#endregion
	//#region ../../node_modules/object-keys/isArguments.js
	var require_isArguments$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var toStr = Object.prototype.toString;
		module.exports = function isArguments(value) {
			var str = toStr.call(value);
			var isArgs = str === "[object Arguments]";
			if (!isArgs) isArgs = str !== "[object Array]" && value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && toStr.call(value.callee) === "[object Function]";
			return isArgs;
		};
	}));
	//#endregion
	//#region ../../node_modules/object-keys/implementation.js
	var require_implementation$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var keysShim;
		if (!Object.keys) {
			var has = Object.prototype.hasOwnProperty;
			var toStr = Object.prototype.toString;
			var isArgs = require_isArguments$1();
			var isEnumerable = Object.prototype.propertyIsEnumerable;
			var hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString");
			var hasProtoEnumBug = isEnumerable.call(function() {}, "prototype");
			var dontEnums = [
				"toString",
				"toLocaleString",
				"valueOf",
				"hasOwnProperty",
				"isPrototypeOf",
				"propertyIsEnumerable",
				"constructor"
			];
			var equalsConstructorPrototype = function(o) {
				var ctor = o.constructor;
				return ctor && ctor.prototype === o;
			};
			var excludedKeys = {
				$applicationCache: true,
				$console: true,
				$external: true,
				$frame: true,
				$frameElement: true,
				$frames: true,
				$innerHeight: true,
				$innerWidth: true,
				$onmozfullscreenchange: true,
				$onmozfullscreenerror: true,
				$outerHeight: true,
				$outerWidth: true,
				$pageXOffset: true,
				$pageYOffset: true,
				$parent: true,
				$scrollLeft: true,
				$scrollTop: true,
				$scrollX: true,
				$scrollY: true,
				$self: true,
				$webkitIndexedDB: true,
				$webkitStorageInfo: true,
				$window: true
			};
			var hasAutomationEqualityBug = function() {
				if (typeof window === "undefined") return false;
				for (var k in window) try {
					if (!excludedKeys["$" + k] && has.call(window, k) && window[k] !== null && typeof window[k] === "object") try {
						equalsConstructorPrototype(window[k]);
					} catch (e) {
						return true;
					}
				} catch (e) {
					return true;
				}
				return false;
			}();
			var equalsConstructorPrototypeIfNotBuggy = function(o) {
				if (typeof window === "undefined" || !hasAutomationEqualityBug) return equalsConstructorPrototype(o);
				try {
					return equalsConstructorPrototype(o);
				} catch (e) {
					return false;
				}
			};
			keysShim = function keys(object) {
				var isObject = object !== null && typeof object === "object";
				var isFunction = toStr.call(object) === "[object Function]";
				var isArguments = isArgs(object);
				var isString = isObject && toStr.call(object) === "[object String]";
				var theKeys = [];
				if (!isObject && !isFunction && !isArguments) throw new TypeError("Object.keys called on a non-object");
				var skipProto = hasProtoEnumBug && isFunction;
				if (isString && object.length > 0 && !has.call(object, 0)) for (var i = 0; i < object.length; ++i) theKeys.push(String(i));
				if (isArguments && object.length > 0) for (var j = 0; j < object.length; ++j) theKeys.push(String(j));
				else for (var name in object) if (!(skipProto && name === "prototype") && has.call(object, name)) theKeys.push(String(name));
				if (hasDontEnumBug) {
					var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
					for (var k = 0; k < dontEnums.length; ++k) if (!(skipConstructor && dontEnums[k] === "constructor") && has.call(object, dontEnums[k])) theKeys.push(dontEnums[k]);
				}
				return theKeys;
			};
		}
		module.exports = keysShim;
	}));
	//#endregion
	//#region ../../node_modules/object-keys/index.js
	var require_object_keys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var slice = Array.prototype.slice;
		var isArgs = require_isArguments$1();
		var origKeys = Object.keys;
		var keysShim = origKeys ? function keys(o) {
			return origKeys(o);
		} : require_implementation$3();
		var originalKeys = Object.keys;
		keysShim.shim = function shimObjectKeys() {
			if (Object.keys) {
				if (!function() {
					var args = Object.keys(arguments);
					return args && args.length === arguments.length;
				}(1, 2)) Object.keys = function keys(object) {
					if (isArgs(object)) return originalKeys(slice.call(object));
					return originalKeys(object);
				};
			} else Object.keys = keysShim;
			return Object.keys || keysShim;
		};
		module.exports = keysShim;
	}));
	//#endregion
	//#region ../../node_modules/object.assign/implementation.js
	var require_implementation$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var objectKeys = require_object_keys();
		var hasSymbols = require_shams$1()();
		var callBound = require_call_bound();
		var $Object = require_es_object_atoms();
		var $push = callBound("Array.prototype.push");
		var $propIsEnumerable = callBound("Object.prototype.propertyIsEnumerable");
		var originalGetSymbols = hasSymbols ? $Object.getOwnPropertySymbols : null;
		module.exports = function assign(target, source1) {
			if (target == null) throw new TypeError("target must be an object");
			var to = $Object(target);
			if (arguments.length === 1) return to;
			for (var s = 1; s < arguments.length; ++s) {
				var from = $Object(arguments[s]);
				var keys = objectKeys(from);
				var getSymbols = hasSymbols && ($Object.getOwnPropertySymbols || originalGetSymbols);
				if (getSymbols) {
					var syms = getSymbols(from);
					for (var j = 0; j < syms.length; ++j) {
						var key = syms[j];
						if ($propIsEnumerable(from, key)) $push(keys, key);
					}
				}
				for (var i = 0; i < keys.length; ++i) {
					var nextKey = keys[i];
					if ($propIsEnumerable(from, nextKey)) to[nextKey] = from[nextKey];
				}
			}
			return to;
		};
	}));
	//#endregion
	//#region ../../node_modules/object.assign/polyfill.js
	var require_polyfill$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var implementation = require_implementation$2();
		var lacksProperEnumerationOrder = function() {
			if (!Object.assign) return false;
			var str = "abcdefghijklmnopqrst";
			var letters = str.split("");
			var map = {};
			for (var i = 0; i < letters.length; ++i) map[letters[i]] = letters[i];
			var obj = Object.assign({}, map);
			var actual = "";
			for (var k in obj) actual += k;
			return str !== actual;
		};
		var assignHasPendingExceptions = function() {
			if (!Object.assign || !Object.preventExtensions) return false;
			var thrower = Object.preventExtensions({ 1: 2 });
			try {
				Object.assign(thrower, "xy");
			} catch (e) {
				return thrower[1] === "y";
			}
			return false;
		};
		module.exports = function getPolyfill() {
			if (!Object.assign) return implementation;
			if (lacksProperEnumerationOrder()) return implementation;
			if (assignHasPendingExceptions()) return implementation;
			return Object.assign;
		};
	}));
	//#endregion
	//#region ../../node_modules/object-is/implementation.js
	var require_implementation$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var numberIsNaN = function(value) {
			return value !== value;
		};
		module.exports = function is(a, b) {
			if (a === 0 && b === 0) return 1 / a === 1 / b;
			if (a === b) return true;
			if (numberIsNaN(a) && numberIsNaN(b)) return true;
			return false;
		};
	}));
	//#endregion
	//#region ../../node_modules/object-is/polyfill.js
	var require_polyfill$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var implementation = require_implementation$1();
		module.exports = function getPolyfill() {
			return typeof Object.is === "function" ? Object.is : implementation;
		};
	}));
	//#endregion
	//#region ../../node_modules/call-bind/callBound.js
	var require_callBound = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var GetIntrinsic = require_get_intrinsic();
		var callBind = require_call_bind();
		var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
		module.exports = function callBoundIntrinsic(name, allowMissing) {
			var intrinsic = GetIntrinsic(name, !!allowMissing);
			if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) return callBind(intrinsic);
			return intrinsic;
		};
	}));
	//#endregion
	//#region ../../node_modules/define-properties/index.js
	var require_define_properties = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var keys = require_object_keys();
		var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol";
		var toStr = Object.prototype.toString;
		var concat = Array.prototype.concat;
		var defineDataProperty = require_define_data_property();
		var isFunction = function(fn) {
			return typeof fn === "function" && toStr.call(fn) === "[object Function]";
		};
		var supportsDescriptors = require_has_property_descriptors()();
		var defineProperty = function(object, name, value, predicate) {
			if (name in object) {
				if (predicate === true) {
					if (object[name] === value) return;
				} else if (!isFunction(predicate) || !predicate()) return;
			}
			if (supportsDescriptors) defineDataProperty(object, name, value, true);
			else defineDataProperty(object, name, value);
		};
		var defineProperties = function(object, map) {
			var predicates = arguments.length > 2 ? arguments[2] : {};
			var props = keys(map);
			if (hasSymbols) props = concat.call(props, Object.getOwnPropertySymbols(map));
			for (var i = 0; i < props.length; i += 1) defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
		};
		defineProperties.supportsDescriptors = !!supportsDescriptors;
		module.exports = defineProperties;
	}));
	//#endregion
	//#region ../../node_modules/object-is/shim.js
	var require_shim$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getPolyfill = require_polyfill$1();
		var define = require_define_properties();
		module.exports = function shimObjectIs() {
			var polyfill = getPolyfill();
			define(Object, { is: polyfill }, { is: function testObjectIs() {
				return Object.is !== polyfill;
			} });
			return polyfill;
		};
	}));
	//#endregion
	//#region ../../node_modules/object-is/index.js
	var require_object_is = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var define = require_define_properties();
		var callBind = require_call_bind();
		var implementation = require_implementation$1();
		var getPolyfill = require_polyfill$1();
		var shim = require_shim$1();
		var polyfill = callBind(getPolyfill(), Object);
		define(polyfill, {
			getPolyfill,
			implementation,
			shim
		});
		module.exports = polyfill;
	}));
	//#endregion
	//#region ../../node_modules/is-nan/implementation.js
	var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = function isNaN(value) {
			return value !== value;
		};
	}));
	//#endregion
	//#region ../../node_modules/is-nan/polyfill.js
	var require_polyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var implementation = require_implementation();
		module.exports = function getPolyfill() {
			if (Number.isNaN && !Number.isNaN("a")) return Number.isNaN;
			return implementation;
		};
	}));
	//#endregion
	//#region ../../node_modules/is-nan/shim.js
	var require_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var define = require_define_properties();
		var getPolyfill = require_polyfill();
		module.exports = function shimNumberIsNaN() {
			var polyfill = getPolyfill();
			define(Number, { isNaN: polyfill }, { isNaN: function testIsNaN() {
				return Number.isNaN !== polyfill;
			} });
			return polyfill;
		};
	}));
	//#endregion
	//#region ../../node_modules/is-nan/index.js
	var require_is_nan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var callBind = require_call_bind();
		var define = require_define_properties();
		var implementation = require_implementation();
		var getPolyfill = require_polyfill();
		var shim = require_shim();
		var polyfill = callBind(getPolyfill(), Number);
		define(polyfill, {
			getPolyfill,
			implementation,
			shim
		});
		module.exports = polyfill;
	}));
	//#endregion
	//#region ../../node_modules/assert/build/internal/util/comparisons.js
	var require_comparisons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function _slicedToArray(arr, i) {
			return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
		}
		function _nonIterableRest() {
			throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
		}
		function _unsupportedIterableToArray(o, minLen) {
			if (!o) return;
			if (typeof o === "string") return _arrayLikeToArray(o, minLen);
			var n = Object.prototype.toString.call(o).slice(8, -1);
			if (n === "Object" && o.constructor) n = o.constructor.name;
			if (n === "Map" || n === "Set") return Array.from(o);
			if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
		}
		function _arrayLikeToArray(arr, len) {
			if (len == null || len > arr.length) len = arr.length;
			for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
			return arr2;
		}
		function _iterableToArrayLimit(r, l) {
			var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
			if (null != t) {
				var e, n, i, u, a = [], f = !0, o = !1;
				try {
					if (i = (t = t.call(r)).next, 0 === l) {
						if (Object(t) !== t) return;
						f = !1;
					} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
				} catch (r) {
					o = !0, n = r;
				} finally {
					try {
						if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
					} finally {
						if (o) throw n;
					}
				}
				return a;
			}
		}
		function _arrayWithHoles(arr) {
			if (Array.isArray(arr)) return arr;
		}
		function _typeof(o) {
			"@babel/helpers - typeof";
			return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
				return typeof o;
			} : function(o) {
				return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
			}, _typeof(o);
		}
		var regexFlagsSupported = /a/g.flags !== void 0;
		var arrayFromSet = function arrayFromSet(set) {
			var array = [];
			set.forEach(function(value) {
				return array.push(value);
			});
			return array;
		};
		var arrayFromMap = function arrayFromMap(map) {
			var array = [];
			map.forEach(function(value, key) {
				return array.push([key, value]);
			});
			return array;
		};
		var objectIs = Object.is ? Object.is : require_object_is();
		var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {
			return [];
		};
		var numberIsNaN = Number.isNaN ? Number.isNaN : require_is_nan();
		function uncurryThis(f) {
			return f.call.bind(f);
		}
		var hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
		var propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);
		var objectToString = uncurryThis(Object.prototype.toString);
		var _require$types = require_util$2().types, isAnyArrayBuffer = _require$types.isAnyArrayBuffer, isArrayBufferView = _require$types.isArrayBufferView, isDate = _require$types.isDate, isMap = _require$types.isMap, isRegExp = _require$types.isRegExp, isSet = _require$types.isSet, isNativeError = _require$types.isNativeError, isBoxedPrimitive = _require$types.isBoxedPrimitive, isNumberObject = _require$types.isNumberObject, isStringObject = _require$types.isStringObject, isBooleanObject = _require$types.isBooleanObject, isBigIntObject = _require$types.isBigIntObject, isSymbolObject = _require$types.isSymbolObject, isFloat32Array = _require$types.isFloat32Array, isFloat64Array = _require$types.isFloat64Array;
		function isNonIndex(key) {
			if (key.length === 0 || key.length > 10) return true;
			for (var i = 0; i < key.length; i++) {
				var code = key.charCodeAt(i);
				if (code < 48 || code > 57) return true;
			}
			return key.length === 10 && key >= Math.pow(2, 32);
		}
		function getOwnNonIndexProperties(value) {
			return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));
		}
		/*!
		* The buffer module from node.js, for the browser.
		*
		* @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
		* @license  MIT
		*/
		function compare(a, b) {
			if (a === b) return 0;
			var x = a.length;
			var y = b.length;
			for (var i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) {
				x = a[i];
				y = b[i];
				break;
			}
			if (x < y) return -1;
			if (y < x) return 1;
			return 0;
		}
		var ONLY_ENUMERABLE = void 0;
		var kStrict = true;
		var kLoose = false;
		var kNoIterator = 0;
		var kIsArray = 1;
		var kIsSet = 2;
		var kIsMap = 3;
		function areSimilarRegExps(a, b) {
			return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);
		}
		function areSimilarFloatArrays(a, b) {
			if (a.byteLength !== b.byteLength) return false;
			for (var offset = 0; offset < a.byteLength; offset++) if (a[offset] !== b[offset]) return false;
			return true;
		}
		function areSimilarTypedArrays(a, b) {
			if (a.byteLength !== b.byteLength) return false;
			return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;
		}
		function areEqualArrayBuffers(buf1, buf2) {
			return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
		}
		function isEqualBoxedPrimitive(val1, val2) {
			if (isNumberObject(val1)) return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));
			if (isStringObject(val1)) return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);
			if (isBooleanObject(val1)) return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);
			if (isBigIntObject(val1)) return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);
			return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);
		}
		function innerDeepEqual(val1, val2, strict, memos) {
			if (val1 === val2) {
				if (val1 !== 0) return true;
				return strict ? objectIs(val1, val2) : true;
			}
			if (strict) {
				if (_typeof(val1) !== "object") return typeof val1 === "number" && numberIsNaN(val1) && numberIsNaN(val2);
				if (_typeof(val2) !== "object" || val1 === null || val2 === null) return false;
				if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) return false;
			} else {
				if (val1 === null || _typeof(val1) !== "object") {
					if (val2 === null || _typeof(val2) !== "object") return val1 == val2;
					return false;
				}
				if (val2 === null || _typeof(val2) !== "object") return false;
			}
			var val1Tag = objectToString(val1);
			if (val1Tag !== objectToString(val2)) return false;
			if (Array.isArray(val1)) {
				if (val1.length !== val2.length) return false;
				var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
				var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
				if (keys1.length !== keys2.length) return false;
				return keyCheck(val1, val2, strict, memos, kIsArray, keys1);
			}
			if (val1Tag === "[object Object]") {
				if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) return false;
			}
			if (isDate(val1)) {
				if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) return false;
			} else if (isRegExp(val1)) {
				if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) return false;
			} else if (isNativeError(val1) || val1 instanceof Error) {
				if (val1.message !== val2.message || val1.name !== val2.name) return false;
			} else if (isArrayBufferView(val1)) {
				if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {
					if (!areSimilarFloatArrays(val1, val2)) return false;
				} else if (!areSimilarTypedArrays(val1, val2)) return false;
				var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
				var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
				if (_keys.length !== _keys2.length) return false;
				return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);
			} else if (isSet(val1)) {
				if (!isSet(val2) || val1.size !== val2.size) return false;
				return keyCheck(val1, val2, strict, memos, kIsSet);
			} else if (isMap(val1)) {
				if (!isMap(val2) || val1.size !== val2.size) return false;
				return keyCheck(val1, val2, strict, memos, kIsMap);
			} else if (isAnyArrayBuffer(val1)) {
				if (!areEqualArrayBuffers(val1, val2)) return false;
			} else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) return false;
			return keyCheck(val1, val2, strict, memos, kNoIterator);
		}
		function getEnumerables(val, keys) {
			return keys.filter(function(k) {
				return propertyIsEnumerable(val, k);
			});
		}
		function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
			if (arguments.length === 5) {
				aKeys = Object.keys(val1);
				var bKeys = Object.keys(val2);
				if (aKeys.length !== bKeys.length) return false;
			}
			var i = 0;
			for (; i < aKeys.length; i++) if (!hasOwnProperty(val2, aKeys[i])) return false;
			if (strict && arguments.length === 5) {
				var symbolKeysA = objectGetOwnPropertySymbols(val1);
				if (symbolKeysA.length !== 0) {
					var count = 0;
					for (i = 0; i < symbolKeysA.length; i++) {
						var key = symbolKeysA[i];
						if (propertyIsEnumerable(val1, key)) {
							if (!propertyIsEnumerable(val2, key)) return false;
							aKeys.push(key);
							count++;
						} else if (propertyIsEnumerable(val2, key)) return false;
					}
					var symbolKeysB = objectGetOwnPropertySymbols(val2);
					if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) return false;
				} else {
					var _symbolKeysB = objectGetOwnPropertySymbols(val2);
					if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) return false;
				}
			}
			if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) return true;
			if (memos === void 0) memos = {
				val1: /* @__PURE__ */ new Map(),
				val2: /* @__PURE__ */ new Map(),
				position: 0
			};
			else {
				var val2MemoA = memos.val1.get(val1);
				if (val2MemoA !== void 0) {
					var val2MemoB = memos.val2.get(val2);
					if (val2MemoB !== void 0) return val2MemoA === val2MemoB;
				}
				memos.position++;
			}
			memos.val1.set(val1, memos.position);
			memos.val2.set(val2, memos.position);
			var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);
			memos.val1.delete(val1);
			memos.val2.delete(val2);
			return areEq;
		}
		function setHasEqualElement(set, val1, strict, memo) {
			var setValues = arrayFromSet(set);
			for (var i = 0; i < setValues.length; i++) {
				var val2 = setValues[i];
				if (innerDeepEqual(val1, val2, strict, memo)) {
					set.delete(val2);
					return true;
				}
			}
			return false;
		}
		function findLooseMatchingPrimitives(prim) {
			switch (_typeof(prim)) {
				case "undefined": return null;
				case "object": return;
				case "symbol": return false;
				case "string": prim = +prim;
				case "number": if (numberIsNaN(prim)) return false;
			}
			return true;
		}
		function setMightHaveLoosePrim(a, b, prim) {
			var altValue = findLooseMatchingPrimitives(prim);
			if (altValue != null) return altValue;
			return b.has(altValue) && !a.has(altValue);
		}
		function mapMightHaveLoosePrim(a, b, prim, item, memo) {
			var altValue = findLooseMatchingPrimitives(prim);
			if (altValue != null) return altValue;
			var curB = b.get(altValue);
			if (curB === void 0 && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) return false;
			return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);
		}
		function setEquiv(a, b, strict, memo) {
			var set = null;
			var aValues = arrayFromSet(a);
			for (var i = 0; i < aValues.length; i++) {
				var val = aValues[i];
				if (_typeof(val) === "object" && val !== null) {
					if (set === null) set = /* @__PURE__ */ new Set();
					set.add(val);
				} else if (!b.has(val)) {
					if (strict) return false;
					if (!setMightHaveLoosePrim(a, b, val)) return false;
					if (set === null) set = /* @__PURE__ */ new Set();
					set.add(val);
				}
			}
			if (set !== null) {
				var bValues = arrayFromSet(b);
				for (var _i = 0; _i < bValues.length; _i++) {
					var _val = bValues[_i];
					if (_typeof(_val) === "object" && _val !== null) {
						if (!setHasEqualElement(set, _val, strict, memo)) return false;
					} else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) return false;
				}
				return set.size === 0;
			}
			return true;
		}
		function mapHasEqualEntry(set, map, key1, item1, strict, memo) {
			var setValues = arrayFromSet(set);
			for (var i = 0; i < setValues.length; i++) {
				var key2 = setValues[i];
				if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {
					set.delete(key2);
					return true;
				}
			}
			return false;
		}
		function mapEquiv(a, b, strict, memo) {
			var set = null;
			var aEntries = arrayFromMap(a);
			for (var i = 0; i < aEntries.length; i++) {
				var _aEntries$i = _slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1];
				if (_typeof(key) === "object" && key !== null) {
					if (set === null) set = /* @__PURE__ */ new Set();
					set.add(key);
				} else {
					var item2 = b.get(key);
					if (item2 === void 0 && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {
						if (strict) return false;
						if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;
						if (set === null) set = /* @__PURE__ */ new Set();
						set.add(key);
					}
				}
			}
			if (set !== null) {
				var bEntries = arrayFromMap(b);
				for (var _i2 = 0; _i2 < bEntries.length; _i2++) {
					var _bEntries$_i = _slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1];
					if (_typeof(_key) === "object" && _key !== null) {
						if (!mapHasEqualEntry(set, a, _key, item, strict, memo)) return false;
					} else if (!strict && (!a.has(_key) || !innerDeepEqual(a.get(_key), item, false, memo)) && !mapHasEqualEntry(set, a, _key, item, false, memo)) return false;
				}
				return set.size === 0;
			}
			return true;
		}
		function objEquiv(a, b, strict, keys, memos, iterationType) {
			var i = 0;
			if (iterationType === kIsSet) {
				if (!setEquiv(a, b, strict, memos)) return false;
			} else if (iterationType === kIsMap) {
				if (!mapEquiv(a, b, strict, memos)) return false;
			} else if (iterationType === kIsArray) for (; i < a.length; i++) if (hasOwnProperty(a, i)) {
				if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) return false;
			} else if (hasOwnProperty(b, i)) return false;
			else {
				var keysA = Object.keys(a);
				for (; i < keysA.length; i++) {
					var key = keysA[i];
					if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) return false;
				}
				if (keysA.length !== Object.keys(b).length) return false;
				return true;
			}
			for (i = 0; i < keys.length; i++) {
				var _key2 = keys[i];
				if (!innerDeepEqual(a[_key2], b[_key2], strict, memos)) return false;
			}
			return true;
		}
		function isDeepEqual(val1, val2) {
			return innerDeepEqual(val1, val2, kLoose);
		}
		function isDeepStrictEqual(val1, val2) {
			return innerDeepEqual(val1, val2, kStrict);
		}
		module.exports = {
			isDeepEqual,
			isDeepStrictEqual
		};
	}));
	//#endregion
	//#region ../../node_modules/assert/build/assert.js
	var require_assert = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$1();
		function _typeof(o) {
			"@babel/helpers - typeof";
			return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
				return typeof o;
			} : function(o) {
				return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
			}, _typeof(o);
		}
		function _defineProperties(target, props) {
			for (var i = 0; i < props.length; i++) {
				var descriptor = props[i];
				descriptor.enumerable = descriptor.enumerable || false;
				descriptor.configurable = true;
				if ("value" in descriptor) descriptor.writable = true;
				Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
			}
		}
		function _createClass(Constructor, protoProps, staticProps) {
			if (protoProps) _defineProperties(Constructor.prototype, protoProps);
			if (staticProps) _defineProperties(Constructor, staticProps);
			Object.defineProperty(Constructor, "prototype", { writable: false });
			return Constructor;
		}
		function _toPropertyKey(arg) {
			var key = _toPrimitive(arg, "string");
			return _typeof(key) === "symbol" ? key : String(key);
		}
		function _toPrimitive(input, hint) {
			if (_typeof(input) !== "object" || input === null) return input;
			var prim = input[Symbol.toPrimitive];
			if (prim !== void 0) {
				var res = prim.call(input, hint || "default");
				if (_typeof(res) !== "object") return res;
				throw new TypeError("@@toPrimitive must return a primitive value.");
			}
			return (hint === "string" ? String : Number)(input);
		}
		function _classCallCheck(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		var _require$codes = require_errors().codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;
		var AssertionError = require_assertion_error();
		var inspect = require_util$2().inspect;
		var _require$types = require_util$2().types, isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp;
		var objectAssign = require_polyfill$2()();
		var objectIs = require_polyfill$1()();
		var RegExpPrototypeTest = require_callBound()("RegExp.prototype.test");
		var isDeepEqual;
		var isDeepStrictEqual;
		function lazyLoadComparison() {
			var comparison = require_comparisons();
			isDeepEqual = comparison.isDeepEqual;
			isDeepStrictEqual = comparison.isDeepStrictEqual;
		}
		var warned = false;
		var assert = module.exports = ok;
		var NO_EXCEPTION_SENTINEL = {};
		function innerFail(obj) {
			if (obj.message instanceof Error) throw obj.message;
			throw new AssertionError(obj);
		}
		function fail(actual, expected, message, operator, stackStartFn) {
			var argsLen = arguments.length;
			var internalMessage;
			if (argsLen === 0) internalMessage = "Failed";
			else if (argsLen === 1) {
				message = actual;
				actual = void 0;
			} else {
				if (warned === false) {
					warned = true;
					(process$1.emitWarning ? process$1.emitWarning : console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094");
				}
				if (argsLen === 2) operator = "!=";
			}
			if (message instanceof Error) throw message;
			var errArgs = {
				actual,
				expected,
				operator: operator === void 0 ? "fail" : operator,
				stackStartFn: stackStartFn || fail
			};
			if (message !== void 0) errArgs.message = message;
			var err = new AssertionError(errArgs);
			if (internalMessage) {
				err.message = internalMessage;
				err.generatedMessage = true;
			}
			throw err;
		}
		assert.fail = fail;
		assert.AssertionError = AssertionError;
		function innerOk(fn, argLen, value, message) {
			if (!value) {
				var generatedMessage = false;
				if (argLen === 0) {
					generatedMessage = true;
					message = "No value argument passed to `assert.ok()`";
				} else if (message instanceof Error) throw message;
				var err = new AssertionError({
					actual: value,
					expected: true,
					message,
					operator: "==",
					stackStartFn: fn
				});
				err.generatedMessage = generatedMessage;
				throw err;
			}
		}
		function ok() {
			for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
			innerOk.apply(void 0, [ok, args.length].concat(args));
		}
		assert.ok = ok;
		assert.equal = function equal(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (actual != expected) innerFail({
				actual,
				expected,
				message,
				operator: "==",
				stackStartFn: equal
			});
		};
		assert.notEqual = function notEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (actual == expected) innerFail({
				actual,
				expected,
				message,
				operator: "!=",
				stackStartFn: notEqual
			});
		};
		assert.deepEqual = function deepEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (isDeepEqual === void 0) lazyLoadComparison();
			if (!isDeepEqual(actual, expected)) innerFail({
				actual,
				expected,
				message,
				operator: "deepEqual",
				stackStartFn: deepEqual
			});
		};
		assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (isDeepEqual === void 0) lazyLoadComparison();
			if (isDeepEqual(actual, expected)) innerFail({
				actual,
				expected,
				message,
				operator: "notDeepEqual",
				stackStartFn: notDeepEqual
			});
		};
		assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (isDeepEqual === void 0) lazyLoadComparison();
			if (!isDeepStrictEqual(actual, expected)) innerFail({
				actual,
				expected,
				message,
				operator: "deepStrictEqual",
				stackStartFn: deepStrictEqual
			});
		};
		assert.notDeepStrictEqual = notDeepStrictEqual;
		function notDeepStrictEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (isDeepEqual === void 0) lazyLoadComparison();
			if (isDeepStrictEqual(actual, expected)) innerFail({
				actual,
				expected,
				message,
				operator: "notDeepStrictEqual",
				stackStartFn: notDeepStrictEqual
			});
		}
		assert.strictEqual = function strictEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (!objectIs(actual, expected)) innerFail({
				actual,
				expected,
				message,
				operator: "strictEqual",
				stackStartFn: strictEqual
			});
		};
		assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
			if (arguments.length < 2) throw new ERR_MISSING_ARGS("actual", "expected");
			if (objectIs(actual, expected)) innerFail({
				actual,
				expected,
				message,
				operator: "notStrictEqual",
				stackStartFn: notStrictEqual
			});
		};
		var Comparison = /* @__PURE__ */ _createClass(function Comparison(obj, keys, actual) {
			var _this = this;
			_classCallCheck(this, Comparison);
			keys.forEach(function(key) {
				if (key in obj) if (actual !== void 0 && typeof actual[key] === "string" && isRegExp(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) _this[key] = actual[key];
				else _this[key] = obj[key];
			});
		});
		function compareExceptionKey(actual, expected, key, message, keys, fn) {
			if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {
				if (!message) {
					var err = new AssertionError({
						actual: new Comparison(actual, keys),
						expected: new Comparison(expected, keys, actual),
						operator: "deepStrictEqual",
						stackStartFn: fn
					});
					err.actual = actual;
					err.expected = expected;
					err.operator = fn.name;
					throw err;
				}
				innerFail({
					actual,
					expected,
					message,
					operator: fn.name,
					stackStartFn: fn
				});
			}
		}
		function expectedException(actual, expected, msg, fn) {
			if (typeof expected !== "function") {
				if (isRegExp(expected)) return RegExpPrototypeTest(expected, actual);
				if (arguments.length === 2) throw new ERR_INVALID_ARG_TYPE("expected", ["Function", "RegExp"], expected);
				if (_typeof(actual) !== "object" || actual === null) {
					var err = new AssertionError({
						actual,
						expected,
						message: msg,
						operator: "deepStrictEqual",
						stackStartFn: fn
					});
					err.operator = fn.name;
					throw err;
				}
				var keys = Object.keys(expected);
				if (expected instanceof Error) keys.push("name", "message");
				else if (keys.length === 0) throw new ERR_INVALID_ARG_VALUE("error", expected, "may not be an empty object");
				if (isDeepEqual === void 0) lazyLoadComparison();
				keys.forEach(function(key) {
					if (typeof actual[key] === "string" && isRegExp(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) return;
					compareExceptionKey(actual, expected, key, msg, keys, fn);
				});
				return true;
			}
			if (expected.prototype !== void 0 && actual instanceof expected) return true;
			if (Error.isPrototypeOf(expected)) return false;
			return expected.call({}, actual) === true;
		}
		function getActual(fn) {
			if (typeof fn !== "function") throw new ERR_INVALID_ARG_TYPE("fn", "Function", fn);
			try {
				fn();
			} catch (e) {
				return e;
			}
			return NO_EXCEPTION_SENTINEL;
		}
		function checkIsPromise(obj) {
			return isPromise(obj) || obj !== null && _typeof(obj) === "object" && typeof obj.then === "function" && typeof obj.catch === "function";
		}
		function waitForActual(promiseFn) {
			return Promise.resolve().then(function() {
				var resultPromise;
				if (typeof promiseFn === "function") {
					resultPromise = promiseFn();
					if (!checkIsPromise(resultPromise)) throw new ERR_INVALID_RETURN_VALUE("instance of Promise", "promiseFn", resultPromise);
				} else if (checkIsPromise(promiseFn)) resultPromise = promiseFn;
				else throw new ERR_INVALID_ARG_TYPE("promiseFn", ["Function", "Promise"], promiseFn);
				return Promise.resolve().then(function() {
					return resultPromise;
				}).then(function() {
					return NO_EXCEPTION_SENTINEL;
				}).catch(function(e) {
					return e;
				});
			});
		}
		function expectsError(stackStartFn, actual, error, message) {
			if (typeof error === "string") {
				if (arguments.length === 4) throw new ERR_INVALID_ARG_TYPE("error", [
					"Object",
					"Error",
					"Function",
					"RegExp"
				], error);
				if (_typeof(actual) === "object" && actual !== null) {
					if (actual.message === error) throw new ERR_AMBIGUOUS_ARGUMENT("error/message", "The error message \"".concat(actual.message, "\" is identical to the message."));
				} else if (actual === error) throw new ERR_AMBIGUOUS_ARGUMENT("error/message", "The error \"".concat(actual, "\" is identical to the message."));
				message = error;
				error = void 0;
			} else if (error != null && _typeof(error) !== "object" && typeof error !== "function") throw new ERR_INVALID_ARG_TYPE("error", [
				"Object",
				"Error",
				"Function",
				"RegExp"
			], error);
			if (actual === NO_EXCEPTION_SENTINEL) {
				var details = "";
				if (error && error.name) details += " (".concat(error.name, ")");
				details += message ? ": ".concat(message) : ".";
				var fnType = stackStartFn.name === "rejects" ? "rejection" : "exception";
				innerFail({
					actual: void 0,
					expected: error,
					operator: stackStartFn.name,
					message: "Missing expected ".concat(fnType).concat(details),
					stackStartFn
				});
			}
			if (error && !expectedException(actual, error, message, stackStartFn)) throw actual;
		}
		function expectsNoError(stackStartFn, actual, error, message) {
			if (actual === NO_EXCEPTION_SENTINEL) return;
			if (typeof error === "string") {
				message = error;
				error = void 0;
			}
			if (!error || expectedException(actual, error)) {
				var details = message ? ": ".concat(message) : ".";
				var fnType = stackStartFn.name === "doesNotReject" ? "rejection" : "exception";
				innerFail({
					actual,
					expected: error,
					operator: stackStartFn.name,
					message: "Got unwanted ".concat(fnType).concat(details, "\n") + "Actual message: \"".concat(actual && actual.message, "\""),
					stackStartFn
				});
			}
			throw actual;
		}
		assert.throws = function throws(promiseFn) {
			for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
			expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));
		};
		assert.rejects = function rejects(promiseFn) {
			for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
			return waitForActual(promiseFn).then(function(result) {
				return expectsError.apply(void 0, [rejects, result].concat(args));
			});
		};
		assert.doesNotThrow = function doesNotThrow(fn) {
			for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];
			expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));
		};
		assert.doesNotReject = function doesNotReject(fn) {
			for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) args[_key5 - 1] = arguments[_key5];
			return waitForActual(fn).then(function(result) {
				return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));
			});
		};
		assert.ifError = function ifError(err) {
			if (err !== null && err !== void 0) {
				var message = "ifError got unwanted exception: ";
				if (_typeof(err) === "object" && typeof err.message === "string") if (err.message.length === 0 && err.constructor) message += err.constructor.name;
				else message += err.message;
				else message += inspect(err);
				var newErr = new AssertionError({
					actual: err,
					expected: null,
					operator: "ifError",
					message,
					stackStartFn: ifError
				});
				var origStack = err.stack;
				if (typeof origStack === "string") {
					var tmp2 = origStack.split("\n");
					tmp2.shift();
					var tmp1 = newErr.stack.split("\n");
					for (var i = 0; i < tmp2.length; i++) {
						var pos = tmp1.indexOf(tmp2[i]);
						if (pos !== -1) {
							tmp1 = tmp1.slice(0, pos);
							break;
						}
					}
					newErr.stack = "".concat(tmp1.join("\n"), "\n").concat(tmp2.join("\n"));
				}
				throw newErr;
			}
		};
		function internalMatch(string, regexp, message, fn, fnName) {
			if (!isRegExp(regexp)) throw new ERR_INVALID_ARG_TYPE("regexp", "RegExp", regexp);
			var match = fnName === "match";
			if (typeof string !== "string" || RegExpPrototypeTest(regexp, string) !== match) {
				if (message instanceof Error) throw message;
				var generatedMessage = !message;
				message = message || (typeof string !== "string" ? "The \"string\" argument must be of type string. Received type " + "".concat(_typeof(string), " (").concat(inspect(string), ")") : (match ? "The input did not match the regular expression " : "The input was expected to not match the regular expression ") + "".concat(inspect(regexp), ". Input:\n\n").concat(inspect(string), "\n"));
				var err = new AssertionError({
					actual: string,
					expected: regexp,
					message,
					operator: fnName,
					stackStartFn: fn
				});
				err.generatedMessage = generatedMessage;
				throw err;
			}
		}
		assert.match = function match(string, regexp, message) {
			internalMatch(string, regexp, message, match, "match");
		};
		assert.doesNotMatch = function doesNotMatch(string, regexp, message) {
			internalMatch(string, regexp, message, doesNotMatch, "doesNotMatch");
		};
		function strict() {
			for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) args[_key6] = arguments[_key6];
			innerOk.apply(void 0, [strict, args.length].concat(args));
		}
		assert.strict = objectAssign(strict, assert, {
			equal: assert.strictEqual,
			deepEqual: assert.deepStrictEqual,
			notEqual: assert.notStrictEqual,
			notDeepEqual: assert.notDeepStrictEqual
		});
		assert.strict.strict = assert.strict;
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/zstream.js
	var require_zstream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function ZStream() {
			this.input = null;
			this.next_in = 0;
			this.avail_in = 0;
			this.total_in = 0;
			this.output = null;
			this.next_out = 0;
			this.avail_out = 0;
			this.total_out = 0;
			this.msg = "";
			this.state = null;
			this.data_type = 2;
			this.adler = 0;
		}
		module.exports = ZStream;
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/utils/common.js
	var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
		var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined";
		function _has(obj, key) {
			return Object.prototype.hasOwnProperty.call(obj, key);
		}
		exports.assign = function(obj) {
			var sources = Array.prototype.slice.call(arguments, 1);
			while (sources.length) {
				var source = sources.shift();
				if (!source) continue;
				if (typeof source !== "object") throw new TypeError(source + "must be non-object");
				for (var p in source) if (_has(source, p)) obj[p] = source[p];
			}
			return obj;
		};
		exports.shrinkBuf = function(buf, size) {
			if (buf.length === size) return buf;
			if (buf.subarray) return buf.subarray(0, size);
			buf.length = size;
			return buf;
		};
		var fnTyped = {
			arraySet: function(dest, src, src_offs, len, dest_offs) {
				if (src.subarray && dest.subarray) {
					dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
					return;
				}
				for (var i = 0; i < len; i++) dest[dest_offs + i] = src[src_offs + i];
			},
			flattenChunks: function(chunks) {
				var i, l, len = 0, pos, chunk, result;
				for (i = 0, l = chunks.length; i < l; i++) len += chunks[i].length;
				result = new Uint8Array(len);
				pos = 0;
				for (i = 0, l = chunks.length; i < l; i++) {
					chunk = chunks[i];
					result.set(chunk, pos);
					pos += chunk.length;
				}
				return result;
			}
		};
		var fnUntyped = {
			arraySet: function(dest, src, src_offs, len, dest_offs) {
				for (var i = 0; i < len; i++) dest[dest_offs + i] = src[src_offs + i];
			},
			flattenChunks: function(chunks) {
				return [].concat.apply([], chunks);
			}
		};
		exports.setTyped = function(on) {
			if (on) {
				exports.Buf8 = Uint8Array;
				exports.Buf16 = Uint16Array;
				exports.Buf32 = Int32Array;
				exports.assign(exports, fnTyped);
			} else {
				exports.Buf8 = Array;
				exports.Buf16 = Array;
				exports.Buf32 = Array;
				exports.assign(exports, fnUntyped);
			}
		};
		exports.setTyped(TYPED_OK);
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/trees.js
	var require_trees = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = require_common();
		var Z_FIXED = 4;
		var Z_BINARY = 0;
		var Z_TEXT = 1;
		var Z_UNKNOWN = 2;
		function zero(buf) {
			var len = buf.length;
			while (--len >= 0) buf[len] = 0;
		}
		var STORED_BLOCK = 0;
		var STATIC_TREES = 1;
		var DYN_TREES = 2;
		var MIN_MATCH = 3;
		var MAX_MATCH = 258;
		var LENGTH_CODES = 29;
		var LITERALS = 256;
		var L_CODES = LITERALS + 1 + LENGTH_CODES;
		var D_CODES = 30;
		var BL_CODES = 19;
		var HEAP_SIZE = 2 * L_CODES + 1;
		var MAX_BITS = 15;
		var Buf_size = 16;
		var MAX_BL_BITS = 7;
		var END_BLOCK = 256;
		var REP_3_6 = 16;
		var REPZ_3_10 = 17;
		var REPZ_11_138 = 18;
		var extra_lbits = [
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			1,
			1,
			1,
			1,
			2,
			2,
			2,
			2,
			3,
			3,
			3,
			3,
			4,
			4,
			4,
			4,
			5,
			5,
			5,
			5,
			0
		];
		var extra_dbits = [
			0,
			0,
			0,
			0,
			1,
			1,
			2,
			2,
			3,
			3,
			4,
			4,
			5,
			5,
			6,
			6,
			7,
			7,
			8,
			8,
			9,
			9,
			10,
			10,
			11,
			11,
			12,
			12,
			13,
			13
		];
		var extra_blbits = [
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			0,
			2,
			3,
			7
		];
		var bl_order = [
			16,
			17,
			18,
			0,
			8,
			7,
			9,
			6,
			10,
			5,
			11,
			4,
			12,
			3,
			13,
			2,
			14,
			1,
			15
		];
		var DIST_CODE_LEN = 512;
		var static_ltree = new Array((L_CODES + 2) * 2);
		zero(static_ltree);
		var static_dtree = new Array(D_CODES * 2);
		zero(static_dtree);
		var _dist_code = new Array(DIST_CODE_LEN);
		zero(_dist_code);
		var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
		zero(_length_code);
		var base_length = new Array(LENGTH_CODES);
		zero(base_length);
		var base_dist = new Array(D_CODES);
		zero(base_dist);
		function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
			this.static_tree = static_tree;
			this.extra_bits = extra_bits;
			this.extra_base = extra_base;
			this.elems = elems;
			this.max_length = max_length;
			this.has_stree = static_tree && static_tree.length;
		}
		var static_l_desc;
		var static_d_desc;
		var static_bl_desc;
		function TreeDesc(dyn_tree, stat_desc) {
			this.dyn_tree = dyn_tree;
			this.max_code = 0;
			this.stat_desc = stat_desc;
		}
		function d_code(dist) {
			return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
		}
		function put_short(s, w) {
			s.pending_buf[s.pending++] = w & 255;
			s.pending_buf[s.pending++] = w >>> 8 & 255;
		}
		function send_bits(s, value, length) {
			if (s.bi_valid > Buf_size - length) {
				s.bi_buf |= value << s.bi_valid & 65535;
				put_short(s, s.bi_buf);
				s.bi_buf = value >> Buf_size - s.bi_valid;
				s.bi_valid += length - Buf_size;
			} else {
				s.bi_buf |= value << s.bi_valid & 65535;
				s.bi_valid += length;
			}
		}
		function send_code(s, c, tree) {
			send_bits(s, tree[c * 2], tree[c * 2 + 1]);
		}
		function bi_reverse(code, len) {
			var res = 0;
			do {
				res |= code & 1;
				code >>>= 1;
				res <<= 1;
			} while (--len > 0);
			return res >>> 1;
		}
		function bi_flush(s) {
			if (s.bi_valid === 16) {
				put_short(s, s.bi_buf);
				s.bi_buf = 0;
				s.bi_valid = 0;
			} else if (s.bi_valid >= 8) {
				s.pending_buf[s.pending++] = s.bi_buf & 255;
				s.bi_buf >>= 8;
				s.bi_valid -= 8;
			}
		}
		function gen_bitlen(s, desc) {
			var tree = desc.dyn_tree;
			var max_code = desc.max_code;
			var stree = desc.stat_desc.static_tree;
			var has_stree = desc.stat_desc.has_stree;
			var extra = desc.stat_desc.extra_bits;
			var base = desc.stat_desc.extra_base;
			var max_length = desc.stat_desc.max_length;
			var h;
			var n, m;
			var bits;
			var xbits;
			var f;
			var overflow = 0;
			for (bits = 0; bits <= MAX_BITS; bits++) s.bl_count[bits] = 0;
			tree[s.heap[s.heap_max] * 2 + 1] = 0;
			for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
				n = s.heap[h];
				bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
				if (bits > max_length) {
					bits = max_length;
					overflow++;
				}
				tree[n * 2 + 1] = bits;
				if (n > max_code) continue;
				s.bl_count[bits]++;
				xbits = 0;
				if (n >= base) xbits = extra[n - base];
				f = tree[n * 2];
				s.opt_len += f * (bits + xbits);
				if (has_stree) s.static_len += f * (stree[n * 2 + 1] + xbits);
			}
			if (overflow === 0) return;
			do {
				bits = max_length - 1;
				while (s.bl_count[bits] === 0) bits--;
				s.bl_count[bits]--;
				s.bl_count[bits + 1] += 2;
				s.bl_count[max_length]--;
				overflow -= 2;
			} while (overflow > 0);
			for (bits = max_length; bits !== 0; bits--) {
				n = s.bl_count[bits];
				while (n !== 0) {
					m = s.heap[--h];
					if (m > max_code) continue;
					if (tree[m * 2 + 1] !== bits) {
						s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
						tree[m * 2 + 1] = bits;
					}
					n--;
				}
			}
		}
		function gen_codes(tree, max_code, bl_count) {
			var next_code = new Array(MAX_BITS + 1);
			var code = 0;
			var bits;
			var n;
			for (bits = 1; bits <= MAX_BITS; bits++) next_code[bits] = code = code + bl_count[bits - 1] << 1;
			for (n = 0; n <= max_code; n++) {
				var len = tree[n * 2 + 1];
				if (len === 0) continue;
				tree[n * 2] = bi_reverse(next_code[len]++, len);
			}
		}
		function tr_static_init() {
			var n;
			var bits;
			var length;
			var code;
			var dist;
			var bl_count = new Array(MAX_BITS + 1);
			length = 0;
			for (code = 0; code < LENGTH_CODES - 1; code++) {
				base_length[code] = length;
				for (n = 0; n < 1 << extra_lbits[code]; n++) _length_code[length++] = code;
			}
			_length_code[length - 1] = code;
			dist = 0;
			for (code = 0; code < 16; code++) {
				base_dist[code] = dist;
				for (n = 0; n < 1 << extra_dbits[code]; n++) _dist_code[dist++] = code;
			}
			dist >>= 7;
			for (; code < D_CODES; code++) {
				base_dist[code] = dist << 7;
				for (n = 0; n < 1 << extra_dbits[code] - 7; n++) _dist_code[256 + dist++] = code;
			}
			for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
			n = 0;
			while (n <= 143) {
				static_ltree[n * 2 + 1] = 8;
				n++;
				bl_count[8]++;
			}
			while (n <= 255) {
				static_ltree[n * 2 + 1] = 9;
				n++;
				bl_count[9]++;
			}
			while (n <= 279) {
				static_ltree[n * 2 + 1] = 7;
				n++;
				bl_count[7]++;
			}
			while (n <= 287) {
				static_ltree[n * 2 + 1] = 8;
				n++;
				bl_count[8]++;
			}
			gen_codes(static_ltree, L_CODES + 1, bl_count);
			for (n = 0; n < D_CODES; n++) {
				static_dtree[n * 2 + 1] = 5;
				static_dtree[n * 2] = bi_reverse(n, 5);
			}
			static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
			static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
			static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
		}
		function init_block(s) {
			var n;
			for (n = 0; n < L_CODES; n++) s.dyn_ltree[n * 2] = 0;
			for (n = 0; n < D_CODES; n++) s.dyn_dtree[n * 2] = 0;
			for (n = 0; n < BL_CODES; n++) s.bl_tree[n * 2] = 0;
			s.dyn_ltree[END_BLOCK * 2] = 1;
			s.opt_len = s.static_len = 0;
			s.last_lit = s.matches = 0;
		}
		function bi_windup(s) {
			if (s.bi_valid > 8) put_short(s, s.bi_buf);
			else if (s.bi_valid > 0) s.pending_buf[s.pending++] = s.bi_buf;
			s.bi_buf = 0;
			s.bi_valid = 0;
		}
		function copy_block(s, buf, len, header) {
			bi_windup(s);
			if (header) {
				put_short(s, len);
				put_short(s, ~len);
			}
			utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
			s.pending += len;
		}
		function smaller(tree, n, m, depth) {
			var _n2 = n * 2;
			var _m2 = m * 2;
			return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m];
		}
		function pqdownheap(s, tree, k) {
			var v = s.heap[k];
			var j = k << 1;
			while (j <= s.heap_len) {
				if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) j++;
				if (smaller(tree, v, s.heap[j], s.depth)) break;
				s.heap[k] = s.heap[j];
				k = j;
				j <<= 1;
			}
			s.heap[k] = v;
		}
		function compress_block(s, ltree, dtree) {
			var dist;
			var lc;
			var lx = 0;
			var code;
			var extra;
			if (s.last_lit !== 0) do {
				dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1];
				lc = s.pending_buf[s.l_buf + lx];
				lx++;
				if (dist === 0) send_code(s, lc, ltree);
				else {
					code = _length_code[lc];
					send_code(s, code + LITERALS + 1, ltree);
					extra = extra_lbits[code];
					if (extra !== 0) {
						lc -= base_length[code];
						send_bits(s, lc, extra);
					}
					dist--;
					code = d_code(dist);
					send_code(s, code, dtree);
					extra = extra_dbits[code];
					if (extra !== 0) {
						dist -= base_dist[code];
						send_bits(s, dist, extra);
					}
				}
			} while (lx < s.last_lit);
			send_code(s, END_BLOCK, ltree);
		}
		function build_tree(s, desc) {
			var tree = desc.dyn_tree;
			var stree = desc.stat_desc.static_tree;
			var has_stree = desc.stat_desc.has_stree;
			var elems = desc.stat_desc.elems;
			var n, m;
			var max_code = -1;
			var node;
			s.heap_len = 0;
			s.heap_max = HEAP_SIZE;
			for (n = 0; n < elems; n++) if (tree[n * 2] !== 0) {
				s.heap[++s.heap_len] = max_code = n;
				s.depth[n] = 0;
			} else tree[n * 2 + 1] = 0;
			while (s.heap_len < 2) {
				node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
				tree[node * 2] = 1;
				s.depth[node] = 0;
				s.opt_len--;
				if (has_stree) s.static_len -= stree[node * 2 + 1];
			}
			desc.max_code = max_code;
			for (n = s.heap_len >> 1; n >= 1; n--) pqdownheap(s, tree, n);
			node = elems;
			do {
				/*** pqremove ***/
				n = s.heap[1];
				s.heap[1] = s.heap[s.heap_len--];
				pqdownheap(s, tree, 1);
				m = s.heap[1];
				s.heap[--s.heap_max] = n;
				s.heap[--s.heap_max] = m;
				tree[node * 2] = tree[n * 2] + tree[m * 2];
				s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
				tree[n * 2 + 1] = tree[m * 2 + 1] = node;
				s.heap[1] = node++;
				pqdownheap(s, tree, 1);
			} while (s.heap_len >= 2);
			s.heap[--s.heap_max] = s.heap[1];
			gen_bitlen(s, desc);
			gen_codes(tree, max_code, s.bl_count);
		}
		function scan_tree(s, tree, max_code) {
			var n;
			var prevlen = -1;
			var curlen;
			var nextlen = tree[1];
			var count = 0;
			var max_count = 7;
			var min_count = 4;
			if (nextlen === 0) {
				max_count = 138;
				min_count = 3;
			}
			tree[(max_code + 1) * 2 + 1] = 65535;
			for (n = 0; n <= max_code; n++) {
				curlen = nextlen;
				nextlen = tree[(n + 1) * 2 + 1];
				if (++count < max_count && curlen === nextlen) continue;
				else if (count < min_count) s.bl_tree[curlen * 2] += count;
				else if (curlen !== 0) {
					if (curlen !== prevlen) s.bl_tree[curlen * 2]++;
					s.bl_tree[REP_3_6 * 2]++;
				} else if (count <= 10) s.bl_tree[REPZ_3_10 * 2]++;
				else s.bl_tree[REPZ_11_138 * 2]++;
				count = 0;
				prevlen = curlen;
				if (nextlen === 0) {
					max_count = 138;
					min_count = 3;
				} else if (curlen === nextlen) {
					max_count = 6;
					min_count = 3;
				} else {
					max_count = 7;
					min_count = 4;
				}
			}
		}
		function send_tree(s, tree, max_code) {
			var n;
			var prevlen = -1;
			var curlen;
			var nextlen = tree[1];
			var count = 0;
			var max_count = 7;
			var min_count = 4;
			if (nextlen === 0) {
				max_count = 138;
				min_count = 3;
			}
			for (n = 0; n <= max_code; n++) {
				curlen = nextlen;
				nextlen = tree[(n + 1) * 2 + 1];
				if (++count < max_count && curlen === nextlen) continue;
				else if (count < min_count) do
					send_code(s, curlen, s.bl_tree);
				while (--count !== 0);
				else if (curlen !== 0) {
					if (curlen !== prevlen) {
						send_code(s, curlen, s.bl_tree);
						count--;
					}
					send_code(s, REP_3_6, s.bl_tree);
					send_bits(s, count - 3, 2);
				} else if (count <= 10) {
					send_code(s, REPZ_3_10, s.bl_tree);
					send_bits(s, count - 3, 3);
				} else {
					send_code(s, REPZ_11_138, s.bl_tree);
					send_bits(s, count - 11, 7);
				}
				count = 0;
				prevlen = curlen;
				if (nextlen === 0) {
					max_count = 138;
					min_count = 3;
				} else if (curlen === nextlen) {
					max_count = 6;
					min_count = 3;
				} else {
					max_count = 7;
					min_count = 4;
				}
			}
		}
		function build_bl_tree(s) {
			var max_blindex;
			scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
			scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
			build_tree(s, s.bl_desc);
			for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) break;
			s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
			return max_blindex;
		}
		function send_all_trees(s, lcodes, dcodes, blcodes) {
			var rank;
			send_bits(s, lcodes - 257, 5);
			send_bits(s, dcodes - 1, 5);
			send_bits(s, blcodes - 4, 4);
			for (rank = 0; rank < blcodes; rank++) send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3);
			send_tree(s, s.dyn_ltree, lcodes - 1);
			send_tree(s, s.dyn_dtree, dcodes - 1);
		}
		function detect_data_type(s) {
			var black_mask = 4093624447;
			var n;
			for (n = 0; n <= 31; n++, black_mask >>>= 1) if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) return Z_BINARY;
			if (s.dyn_ltree[18] !== 0 || s.dyn_ltree[20] !== 0 || s.dyn_ltree[26] !== 0) return Z_TEXT;
			for (n = 32; n < LITERALS; n++) if (s.dyn_ltree[n * 2] !== 0) return Z_TEXT;
			return Z_BINARY;
		}
		var static_init_done = false;
		function _tr_init(s) {
			if (!static_init_done) {
				tr_static_init();
				static_init_done = true;
			}
			s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
			s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
			s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
			s.bi_buf = 0;
			s.bi_valid = 0;
			init_block(s);
		}
		function _tr_stored_block(s, buf, stored_len, last) {
			send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);
			copy_block(s, buf, stored_len, true);
		}
		function _tr_align(s) {
			send_bits(s, STATIC_TREES << 1, 3);
			send_code(s, END_BLOCK, static_ltree);
			bi_flush(s);
		}
		function _tr_flush_block(s, buf, stored_len, last) {
			var opt_lenb, static_lenb;
			var max_blindex = 0;
			if (s.level > 0) {
				if (s.strm.data_type === Z_UNKNOWN) s.strm.data_type = detect_data_type(s);
				build_tree(s, s.l_desc);
				build_tree(s, s.d_desc);
				max_blindex = build_bl_tree(s);
				opt_lenb = s.opt_len + 3 + 7 >>> 3;
				static_lenb = s.static_len + 3 + 7 >>> 3;
				if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
			} else opt_lenb = static_lenb = stored_len + 5;
			if (stored_len + 4 <= opt_lenb && buf !== -1) _tr_stored_block(s, buf, stored_len, last);
			else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
				send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
				compress_block(s, static_ltree, static_dtree);
			} else {
				send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
				send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
				compress_block(s, s.dyn_ltree, s.dyn_dtree);
			}
			init_block(s);
			if (last) bi_windup(s);
		}
		function _tr_tally(s, dist, lc) {
			s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255;
			s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255;
			s.pending_buf[s.l_buf + s.last_lit] = lc & 255;
			s.last_lit++;
			if (dist === 0) s.dyn_ltree[lc * 2]++;
			else {
				s.matches++;
				dist--;
				s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++;
				s.dyn_dtree[d_code(dist) * 2]++;
			}
			return s.last_lit === s.lit_bufsize - 1;
		}
		exports._tr_init = _tr_init;
		exports._tr_stored_block = _tr_stored_block;
		exports._tr_flush_block = _tr_flush_block;
		exports._tr_tally = _tr_tally;
		exports._tr_align = _tr_align;
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/adler32.js
	var require_adler32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function adler32(adler, buf, len, pos) {
			var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0;
			while (len !== 0) {
				n = len > 2e3 ? 2e3 : len;
				len -= n;
				do {
					s1 = s1 + buf[pos++] | 0;
					s2 = s2 + s1 | 0;
				} while (--n);
				s1 %= 65521;
				s2 %= 65521;
			}
			return s1 | s2 << 16 | 0;
		}
		module.exports = adler32;
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/crc32.js
	var require_crc32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		function makeTable() {
			var c, table = [];
			for (var n = 0; n < 256; n++) {
				c = n;
				for (var k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
				table[n] = c;
			}
			return table;
		}
		var crcTable = makeTable();
		function crc32(crc, buf, len, pos) {
			var t = crcTable, end = pos + len;
			crc ^= -1;
			for (var i = pos; i < end; i++) crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255];
			return crc ^ -1;
		}
		module.exports = crc32;
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/messages.js
	var require_messages = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = {
			2: "need dictionary",
			1: "stream end",
			0: "",
			"-1": "file error",
			"-2": "stream error",
			"-3": "data error",
			"-4": "insufficient memory",
			"-5": "buffer error",
			"-6": "incompatible version"
		};
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/deflate.js
	var require_deflate = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = require_common();
		var trees = require_trees();
		var adler32 = require_adler32();
		var crc32 = require_crc32();
		var msg = require_messages();
		var Z_NO_FLUSH = 0;
		var Z_PARTIAL_FLUSH = 1;
		var Z_FULL_FLUSH = 3;
		var Z_FINISH = 4;
		var Z_BLOCK = 5;
		var Z_OK = 0;
		var Z_STREAM_END = 1;
		var Z_STREAM_ERROR = -2;
		var Z_DATA_ERROR = -3;
		var Z_BUF_ERROR = -5;
		var Z_DEFAULT_COMPRESSION = -1;
		var Z_FILTERED = 1;
		var Z_HUFFMAN_ONLY = 2;
		var Z_RLE = 3;
		var Z_FIXED = 4;
		var Z_DEFAULT_STRATEGY = 0;
		var Z_UNKNOWN = 2;
		var Z_DEFLATED = 8;
		var MAX_MEM_LEVEL = 9;
		var MAX_WBITS = 15;
		var DEF_MEM_LEVEL = 8;
		var L_CODES = 286;
		var D_CODES = 30;
		var BL_CODES = 19;
		var HEAP_SIZE = 2 * L_CODES + 1;
		var MAX_BITS = 15;
		var MIN_MATCH = 3;
		var MAX_MATCH = 258;
		var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
		var PRESET_DICT = 32;
		var INIT_STATE = 42;
		var EXTRA_STATE = 69;
		var NAME_STATE = 73;
		var COMMENT_STATE = 91;
		var HCRC_STATE = 103;
		var BUSY_STATE = 113;
		var FINISH_STATE = 666;
		var BS_NEED_MORE = 1;
		var BS_BLOCK_DONE = 2;
		var BS_FINISH_STARTED = 3;
		var BS_FINISH_DONE = 4;
		var OS_CODE = 3;
		function err(strm, errorCode) {
			strm.msg = msg[errorCode];
			return errorCode;
		}
		function rank(f) {
			return (f << 1) - (f > 4 ? 9 : 0);
		}
		function zero(buf) {
			var len = buf.length;
			while (--len >= 0) buf[len] = 0;
		}
		function flush_pending(strm) {
			var s = strm.state;
			var len = s.pending;
			if (len > strm.avail_out) len = strm.avail_out;
			if (len === 0) return;
			utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
			strm.next_out += len;
			s.pending_out += len;
			strm.total_out += len;
			strm.avail_out -= len;
			s.pending -= len;
			if (s.pending === 0) s.pending_out = 0;
		}
		function flush_block_only(s, last) {
			trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last);
			s.block_start = s.strstart;
			flush_pending(s.strm);
		}
		function put_byte(s, b) {
			s.pending_buf[s.pending++] = b;
		}
		function putShortMSB(s, b) {
			s.pending_buf[s.pending++] = b >>> 8 & 255;
			s.pending_buf[s.pending++] = b & 255;
		}
		function read_buf(strm, buf, start, size) {
			var len = strm.avail_in;
			if (len > size) len = size;
			if (len === 0) return 0;
			strm.avail_in -= len;
			utils.arraySet(buf, strm.input, strm.next_in, len, start);
			if (strm.state.wrap === 1) strm.adler = adler32(strm.adler, buf, len, start);
			else if (strm.state.wrap === 2) strm.adler = crc32(strm.adler, buf, len, start);
			strm.next_in += len;
			strm.total_in += len;
			return len;
		}
		function longest_match(s, cur_match) {
			var chain_length = s.max_chain_length;
			var scan = s.strstart;
			var match;
			var len;
			var best_len = s.prev_length;
			var nice_match = s.nice_match;
			var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0;
			var _win = s.window;
			var wmask = s.w_mask;
			var prev = s.prev;
			var strend = s.strstart + MAX_MATCH;
			var scan_end1 = _win[scan + best_len - 1];
			var scan_end = _win[scan + best_len];
			if (s.prev_length >= s.good_match) chain_length >>= 2;
			if (nice_match > s.lookahead) nice_match = s.lookahead;
			do {
				match = cur_match;
				if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) continue;
				scan += 2;
				match++;
				do				;
while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend);
				len = MAX_MATCH - (strend - scan);
				scan = strend - MAX_MATCH;
				if (len > best_len) {
					s.match_start = cur_match;
					best_len = len;
					if (len >= nice_match) break;
					scan_end1 = _win[scan + best_len - 1];
					scan_end = _win[scan + best_len];
				}
			} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
			if (best_len <= s.lookahead) return best_len;
			return s.lookahead;
		}
		function fill_window(s) {
			var _w_size = s.w_size;
			var p, n, m, more, str;
			do {
				more = s.window_size - s.lookahead - s.strstart;
				if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
					utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
					s.match_start -= _w_size;
					s.strstart -= _w_size;
					s.block_start -= _w_size;
					n = s.hash_size;
					p = n;
					do {
						m = s.head[--p];
						s.head[p] = m >= _w_size ? m - _w_size : 0;
					} while (--n);
					n = _w_size;
					p = n;
					do {
						m = s.prev[--p];
						s.prev[p] = m >= _w_size ? m - _w_size : 0;
					} while (--n);
					more += _w_size;
				}
				if (s.strm.avail_in === 0) break;
				n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
				s.lookahead += n;
				if (s.lookahead + s.insert >= MIN_MATCH) {
					str = s.strstart - s.insert;
					s.ins_h = s.window[str];
					s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask;
					while (s.insert) {
						s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
						s.prev[str & s.w_mask] = s.head[s.ins_h];
						s.head[s.ins_h] = str;
						str++;
						s.insert--;
						if (s.lookahead + s.insert < MIN_MATCH) break;
					}
				}
			} while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
		}
		function deflate_stored(s, flush) {
			var max_block_size = 65535;
			if (max_block_size > s.pending_buf_size - 5) max_block_size = s.pending_buf_size - 5;
			for (;;) {
				if (s.lookahead <= 1) {
					fill_window(s);
					if (s.lookahead === 0 && flush === Z_NO_FLUSH) return BS_NEED_MORE;
					if (s.lookahead === 0) break;
				}
				s.strstart += s.lookahead;
				s.lookahead = 0;
				var max_start = s.block_start + max_block_size;
				if (s.strstart === 0 || s.strstart >= max_start) {
					s.lookahead = s.strstart - max_start;
					s.strstart = max_start;
					/*** FLUSH_BLOCK(s, 0); ***/
					flush_block_only(s, false);
					if (s.strm.avail_out === 0) return BS_NEED_MORE;
				}
				if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) {
					/*** FLUSH_BLOCK(s, 0); ***/
					flush_block_only(s, false);
					if (s.strm.avail_out === 0) return BS_NEED_MORE;
				}
			}
			s.insert = 0;
			if (flush === Z_FINISH) {
				/*** FLUSH_BLOCK(s, 1); ***/
				flush_block_only(s, true);
				if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
				return BS_FINISH_DONE;
			}
			if (s.strstart > s.block_start) {
				/*** FLUSH_BLOCK(s, 0); ***/
				flush_block_only(s, false);
				if (s.strm.avail_out === 0) return BS_NEED_MORE;
			}
			return BS_NEED_MORE;
		}
		function deflate_fast(s, flush) {
			var hash_head;
			var bflush;
			for (;;) {
				if (s.lookahead < MIN_LOOKAHEAD) {
					fill_window(s);
					if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) return BS_NEED_MORE;
					if (s.lookahead === 0) break;
				}
				hash_head = 0;
				if (s.lookahead >= MIN_MATCH) {
					/*** INSERT_STRING(s, s.strstart, hash_head); ***/
					s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
					hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
					s.head[s.ins_h] = s.strstart;
				}
				if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) s.match_length = longest_match(s, hash_head);
				if (s.match_length >= MIN_MATCH) {
					/*** _tr_tally_dist(s, s.strstart - s.match_start,
					s.match_length - MIN_MATCH, bflush); ***/
					bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
					s.lookahead -= s.match_length;
					if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) {
						s.match_length--;
						do {
							s.strstart++;
							/*** INSERT_STRING(s, s.strstart, hash_head); ***/
							s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
							hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
							s.head[s.ins_h] = s.strstart;
						} while (--s.match_length !== 0);
						s.strstart++;
					} else {
						s.strstart += s.match_length;
						s.match_length = 0;
						s.ins_h = s.window[s.strstart];
						s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask;
					}
				} else {
					/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
					bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
					s.lookahead--;
					s.strstart++;
				}
				if (bflush) {
					/*** FLUSH_BLOCK(s, 0); ***/
					flush_block_only(s, false);
					if (s.strm.avail_out === 0) return BS_NEED_MORE;
				}
			}
			s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
			if (flush === Z_FINISH) {
				/*** FLUSH_BLOCK(s, 1); ***/
				flush_block_only(s, true);
				if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
				return BS_FINISH_DONE;
			}
			if (s.last_lit) {
				/*** FLUSH_BLOCK(s, 0); ***/
				flush_block_only(s, false);
				if (s.strm.avail_out === 0) return BS_NEED_MORE;
			}
			return BS_BLOCK_DONE;
		}
		function deflate_slow(s, flush) {
			var hash_head;
			var bflush;
			var max_insert;
			for (;;) {
				if (s.lookahead < MIN_LOOKAHEAD) {
					fill_window(s);
					if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) return BS_NEED_MORE;
					if (s.lookahead === 0) break;
				}
				hash_head = 0;
				if (s.lookahead >= MIN_MATCH) {
					/*** INSERT_STRING(s, s.strstart, hash_head); ***/
					s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
					hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
					s.head[s.ins_h] = s.strstart;
				}
				s.prev_length = s.match_length;
				s.prev_match = s.match_start;
				s.match_length = MIN_MATCH - 1;
				if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) {
					s.match_length = longest_match(s, hash_head);
					if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) s.match_length = MIN_MATCH - 1;
				}
				if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
					max_insert = s.strstart + s.lookahead - MIN_MATCH;
					/***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
					s.prev_length - MIN_MATCH, bflush);***/
					bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
					s.lookahead -= s.prev_length - 1;
					s.prev_length -= 2;
					do
						if (++s.strstart <= max_insert) {
							/*** INSERT_STRING(s, s.strstart, hash_head); ***/
							s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
							hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
							s.head[s.ins_h] = s.strstart;
						}
					while (--s.prev_length !== 0);
					s.match_available = 0;
					s.match_length = MIN_MATCH - 1;
					s.strstart++;
					if (bflush) {
						/*** FLUSH_BLOCK(s, 0); ***/
						flush_block_only(s, false);
						if (s.strm.avail_out === 0) return BS_NEED_MORE;
					}
				} else if (s.match_available) {
					/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
					bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
					if (bflush)
 /*** FLUSH_BLOCK_ONLY(s, 0) ***/
					flush_block_only(s, false);
					s.strstart++;
					s.lookahead--;
					if (s.strm.avail_out === 0) return BS_NEED_MORE;
				} else {
					s.match_available = 1;
					s.strstart++;
					s.lookahead--;
				}
			}
			if (s.match_available) {
				/*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
				bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
				s.match_available = 0;
			}
			s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
			if (flush === Z_FINISH) {
				/*** FLUSH_BLOCK(s, 1); ***/
				flush_block_only(s, true);
				if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
				return BS_FINISH_DONE;
			}
			if (s.last_lit) {
				/*** FLUSH_BLOCK(s, 0); ***/
				flush_block_only(s, false);
				if (s.strm.avail_out === 0) return BS_NEED_MORE;
			}
			return BS_BLOCK_DONE;
		}
		function deflate_rle(s, flush) {
			var bflush;
			var prev;
			var scan, strend;
			var _win = s.window;
			for (;;) {
				if (s.lookahead <= MAX_MATCH) {
					fill_window(s);
					if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) return BS_NEED_MORE;
					if (s.lookahead === 0) break;
				}
				s.match_length = 0;
				if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
					scan = s.strstart - 1;
					prev = _win[scan];
					if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
						strend = s.strstart + MAX_MATCH;
						do						;
while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend);
						s.match_length = MAX_MATCH - (strend - scan);
						if (s.match_length > s.lookahead) s.match_length = s.lookahead;
					}
				}
				if (s.match_length >= MIN_MATCH) {
					/*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
					bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
					s.lookahead -= s.match_length;
					s.strstart += s.match_length;
					s.match_length = 0;
				} else {
					/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
					bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
					s.lookahead--;
					s.strstart++;
				}
				if (bflush) {
					/*** FLUSH_BLOCK(s, 0); ***/
					flush_block_only(s, false);
					if (s.strm.avail_out === 0) return BS_NEED_MORE;
				}
			}
			s.insert = 0;
			if (flush === Z_FINISH) {
				/*** FLUSH_BLOCK(s, 1); ***/
				flush_block_only(s, true);
				if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
				return BS_FINISH_DONE;
			}
			if (s.last_lit) {
				/*** FLUSH_BLOCK(s, 0); ***/
				flush_block_only(s, false);
				if (s.strm.avail_out === 0) return BS_NEED_MORE;
			}
			return BS_BLOCK_DONE;
		}
		function deflate_huff(s, flush) {
			var bflush;
			for (;;) {
				if (s.lookahead === 0) {
					fill_window(s);
					if (s.lookahead === 0) {
						if (flush === Z_NO_FLUSH) return BS_NEED_MORE;
						break;
					}
				}
				s.match_length = 0;
				/*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
				bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
				s.lookahead--;
				s.strstart++;
				if (bflush) {
					/*** FLUSH_BLOCK(s, 0); ***/
					flush_block_only(s, false);
					if (s.strm.avail_out === 0) return BS_NEED_MORE;
				}
			}
			s.insert = 0;
			if (flush === Z_FINISH) {
				/*** FLUSH_BLOCK(s, 1); ***/
				flush_block_only(s, true);
				if (s.strm.avail_out === 0) return BS_FINISH_STARTED;
				return BS_FINISH_DONE;
			}
			if (s.last_lit) {
				/*** FLUSH_BLOCK(s, 0); ***/
				flush_block_only(s, false);
				if (s.strm.avail_out === 0) return BS_NEED_MORE;
			}
			return BS_BLOCK_DONE;
		}
		function Config(good_length, max_lazy, nice_length, max_chain, func) {
			this.good_length = good_length;
			this.max_lazy = max_lazy;
			this.nice_length = nice_length;
			this.max_chain = max_chain;
			this.func = func;
		}
		var configuration_table = [
			new Config(0, 0, 0, 0, deflate_stored),
			new Config(4, 4, 8, 4, deflate_fast),
			new Config(4, 5, 16, 8, deflate_fast),
			new Config(4, 6, 32, 32, deflate_fast),
			new Config(4, 4, 16, 16, deflate_slow),
			new Config(8, 16, 32, 32, deflate_slow),
			new Config(8, 16, 128, 128, deflate_slow),
			new Config(8, 32, 128, 256, deflate_slow),
			new Config(32, 128, 258, 1024, deflate_slow),
			new Config(32, 258, 258, 4096, deflate_slow)
		];
		function lm_init(s) {
			s.window_size = 2 * s.w_size;
			/*** CLEAR_HASH(s); ***/
			zero(s.head);
			s.max_lazy_match = configuration_table[s.level].max_lazy;
			s.good_match = configuration_table[s.level].good_length;
			s.nice_match = configuration_table[s.level].nice_length;
			s.max_chain_length = configuration_table[s.level].max_chain;
			s.strstart = 0;
			s.block_start = 0;
			s.lookahead = 0;
			s.insert = 0;
			s.match_length = s.prev_length = MIN_MATCH - 1;
			s.match_available = 0;
			s.ins_h = 0;
		}
		function DeflateState() {
			this.strm = null;
			this.status = 0;
			this.pending_buf = null;
			this.pending_buf_size = 0;
			this.pending_out = 0;
			this.pending = 0;
			this.wrap = 0;
			this.gzhead = null;
			this.gzindex = 0;
			this.method = Z_DEFLATED;
			this.last_flush = -1;
			this.w_size = 0;
			this.w_bits = 0;
			this.w_mask = 0;
			this.window = null;
			this.window_size = 0;
			this.prev = null;
			this.head = null;
			this.ins_h = 0;
			this.hash_size = 0;
			this.hash_bits = 0;
			this.hash_mask = 0;
			this.hash_shift = 0;
			this.block_start = 0;
			this.match_length = 0;
			this.prev_match = 0;
			this.match_available = 0;
			this.strstart = 0;
			this.match_start = 0;
			this.lookahead = 0;
			this.prev_length = 0;
			this.max_chain_length = 0;
			this.max_lazy_match = 0;
			this.level = 0;
			this.strategy = 0;
			this.good_match = 0;
			this.nice_match = 0;
			this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
			this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
			this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
			zero(this.dyn_ltree);
			zero(this.dyn_dtree);
			zero(this.bl_tree);
			this.l_desc = null;
			this.d_desc = null;
			this.bl_desc = null;
			this.bl_count = new utils.Buf16(MAX_BITS + 1);
			this.heap = new utils.Buf16(2 * L_CODES + 1);
			zero(this.heap);
			this.heap_len = 0;
			this.heap_max = 0;
			this.depth = new utils.Buf16(2 * L_CODES + 1);
			zero(this.depth);
			this.l_buf = 0;
			this.lit_bufsize = 0;
			this.last_lit = 0;
			this.d_buf = 0;
			this.opt_len = 0;
			this.static_len = 0;
			this.matches = 0;
			this.insert = 0;
			this.bi_buf = 0;
			this.bi_valid = 0;
		}
		function deflateResetKeep(strm) {
			var s;
			if (!strm || !strm.state) return err(strm, Z_STREAM_ERROR);
			strm.total_in = strm.total_out = 0;
			strm.data_type = Z_UNKNOWN;
			s = strm.state;
			s.pending = 0;
			s.pending_out = 0;
			if (s.wrap < 0) s.wrap = -s.wrap;
			s.status = s.wrap ? INIT_STATE : BUSY_STATE;
			strm.adler = s.wrap === 2 ? 0 : 1;
			s.last_flush = Z_NO_FLUSH;
			trees._tr_init(s);
			return Z_OK;
		}
		function deflateReset(strm) {
			var ret = deflateResetKeep(strm);
			if (ret === Z_OK) lm_init(strm.state);
			return ret;
		}
		function deflateSetHeader(strm, head) {
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			if (strm.state.wrap !== 2) return Z_STREAM_ERROR;
			strm.state.gzhead = head;
			return Z_OK;
		}
		function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
			if (!strm) return Z_STREAM_ERROR;
			var wrap = 1;
			if (level === Z_DEFAULT_COMPRESSION) level = 6;
			if (windowBits < 0) {
				wrap = 0;
				windowBits = -windowBits;
			} else if (windowBits > 15) {
				wrap = 2;
				windowBits -= 16;
			}
			if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) return err(strm, Z_STREAM_ERROR);
			if (windowBits === 8) windowBits = 9;
			var s = new DeflateState();
			strm.state = s;
			s.strm = strm;
			s.wrap = wrap;
			s.gzhead = null;
			s.w_bits = windowBits;
			s.w_size = 1 << s.w_bits;
			s.w_mask = s.w_size - 1;
			s.hash_bits = memLevel + 7;
			s.hash_size = 1 << s.hash_bits;
			s.hash_mask = s.hash_size - 1;
			s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
			s.window = new utils.Buf8(s.w_size * 2);
			s.head = new utils.Buf16(s.hash_size);
			s.prev = new utils.Buf16(s.w_size);
			s.lit_bufsize = 1 << memLevel + 6;
			s.pending_buf_size = s.lit_bufsize * 4;
			s.pending_buf = new utils.Buf8(s.pending_buf_size);
			s.d_buf = 1 * s.lit_bufsize;
			s.l_buf = 3 * s.lit_bufsize;
			s.level = level;
			s.strategy = strategy;
			s.method = method;
			return deflateReset(strm);
		}
		function deflateInit(strm, level) {
			return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
		}
		function deflate(strm, flush) {
			var old_flush, s;
			var beg, val;
			if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
			s = strm.state;
			if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush !== Z_FINISH) return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR);
			s.strm = strm;
			old_flush = s.last_flush;
			s.last_flush = flush;
			if (s.status === INIT_STATE) if (s.wrap === 2) {
				strm.adler = 0;
				put_byte(s, 31);
				put_byte(s, 139);
				put_byte(s, 8);
				if (!s.gzhead) {
					put_byte(s, 0);
					put_byte(s, 0);
					put_byte(s, 0);
					put_byte(s, 0);
					put_byte(s, 0);
					put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
					put_byte(s, OS_CODE);
					s.status = BUSY_STATE;
				} else {
					put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16));
					put_byte(s, s.gzhead.time & 255);
					put_byte(s, s.gzhead.time >> 8 & 255);
					put_byte(s, s.gzhead.time >> 16 & 255);
					put_byte(s, s.gzhead.time >> 24 & 255);
					put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0);
					put_byte(s, s.gzhead.os & 255);
					if (s.gzhead.extra && s.gzhead.extra.length) {
						put_byte(s, s.gzhead.extra.length & 255);
						put_byte(s, s.gzhead.extra.length >> 8 & 255);
					}
					if (s.gzhead.hcrc) strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
					s.gzindex = 0;
					s.status = EXTRA_STATE;
				}
			} else {
				var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8;
				var level_flags = -1;
				if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) level_flags = 0;
				else if (s.level < 6) level_flags = 1;
				else if (s.level === 6) level_flags = 2;
				else level_flags = 3;
				header |= level_flags << 6;
				if (s.strstart !== 0) header |= PRESET_DICT;
				header += 31 - header % 31;
				s.status = BUSY_STATE;
				putShortMSB(s, header);
				if (s.strstart !== 0) {
					putShortMSB(s, strm.adler >>> 16);
					putShortMSB(s, strm.adler & 65535);
				}
				strm.adler = 1;
			}
			if (s.status === EXTRA_STATE) if (s.gzhead.extra) {
				beg = s.pending;
				while (s.gzindex < (s.gzhead.extra.length & 65535)) {
					if (s.pending === s.pending_buf_size) {
						if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
						flush_pending(strm);
						beg = s.pending;
						if (s.pending === s.pending_buf_size) break;
					}
					put_byte(s, s.gzhead.extra[s.gzindex] & 255);
					s.gzindex++;
				}
				if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
				if (s.gzindex === s.gzhead.extra.length) {
					s.gzindex = 0;
					s.status = NAME_STATE;
				}
			} else s.status = NAME_STATE;
			if (s.status === NAME_STATE) if (s.gzhead.name) {
				beg = s.pending;
				do {
					if (s.pending === s.pending_buf_size) {
						if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
						flush_pending(strm);
						beg = s.pending;
						if (s.pending === s.pending_buf_size) {
							val = 1;
							break;
						}
					}
					if (s.gzindex < s.gzhead.name.length) val = s.gzhead.name.charCodeAt(s.gzindex++) & 255;
					else val = 0;
					put_byte(s, val);
				} while (val !== 0);
				if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
				if (val === 0) {
					s.gzindex = 0;
					s.status = COMMENT_STATE;
				}
			} else s.status = COMMENT_STATE;
			if (s.status === COMMENT_STATE) if (s.gzhead.comment) {
				beg = s.pending;
				do {
					if (s.pending === s.pending_buf_size) {
						if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
						flush_pending(strm);
						beg = s.pending;
						if (s.pending === s.pending_buf_size) {
							val = 1;
							break;
						}
					}
					if (s.gzindex < s.gzhead.comment.length) val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255;
					else val = 0;
					put_byte(s, val);
				} while (val !== 0);
				if (s.gzhead.hcrc && s.pending > beg) strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
				if (val === 0) s.status = HCRC_STATE;
			} else s.status = HCRC_STATE;
			if (s.status === HCRC_STATE) if (s.gzhead.hcrc) {
				if (s.pending + 2 > s.pending_buf_size) flush_pending(strm);
				if (s.pending + 2 <= s.pending_buf_size) {
					put_byte(s, strm.adler & 255);
					put_byte(s, strm.adler >> 8 & 255);
					strm.adler = 0;
					s.status = BUSY_STATE;
				}
			} else s.status = BUSY_STATE;
			if (s.pending !== 0) {
				flush_pending(strm);
				if (strm.avail_out === 0) {
					s.last_flush = -1;
					return Z_OK;
				}
			} else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) return err(strm, Z_BUF_ERROR);
			if (s.status === FINISH_STATE && strm.avail_in !== 0) return err(strm, Z_BUF_ERROR);
			if (strm.avail_in !== 0 || s.lookahead !== 0 || flush !== Z_NO_FLUSH && s.status !== FINISH_STATE) {
				var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : s.strategy === Z_RLE ? deflate_rle(s, flush) : configuration_table[s.level].func(s, flush);
				if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) s.status = FINISH_STATE;
				if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
					if (strm.avail_out === 0) s.last_flush = -1;
					return Z_OK;
				}
				if (bstate === BS_BLOCK_DONE) {
					if (flush === Z_PARTIAL_FLUSH) trees._tr_align(s);
					else if (flush !== Z_BLOCK) {
						trees._tr_stored_block(s, 0, 0, false);
						if (flush === Z_FULL_FLUSH) {
							/*** CLEAR_HASH(s); ***/ zero(s.head);
							if (s.lookahead === 0) {
								s.strstart = 0;
								s.block_start = 0;
								s.insert = 0;
							}
						}
					}
					flush_pending(strm);
					if (strm.avail_out === 0) {
						s.last_flush = -1;
						return Z_OK;
					}
				}
			}
			if (flush !== Z_FINISH) return Z_OK;
			if (s.wrap <= 0) return Z_STREAM_END;
			if (s.wrap === 2) {
				put_byte(s, strm.adler & 255);
				put_byte(s, strm.adler >> 8 & 255);
				put_byte(s, strm.adler >> 16 & 255);
				put_byte(s, strm.adler >> 24 & 255);
				put_byte(s, strm.total_in & 255);
				put_byte(s, strm.total_in >> 8 & 255);
				put_byte(s, strm.total_in >> 16 & 255);
				put_byte(s, strm.total_in >> 24 & 255);
			} else {
				putShortMSB(s, strm.adler >>> 16);
				putShortMSB(s, strm.adler & 65535);
			}
			flush_pending(strm);
			if (s.wrap > 0) s.wrap = -s.wrap;
			return s.pending !== 0 ? Z_OK : Z_STREAM_END;
		}
		function deflateEnd(strm) {
			var status;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			status = strm.state.status;
			if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) return err(strm, Z_STREAM_ERROR);
			strm.state = null;
			return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
		}
		function deflateSetDictionary(strm, dictionary) {
			var dictLength = dictionary.length;
			var s;
			var str, n;
			var wrap;
			var avail;
			var next;
			var input;
			var tmpDict;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			s = strm.state;
			wrap = s.wrap;
			if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) return Z_STREAM_ERROR;
			if (wrap === 1) strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
			s.wrap = 0;
			if (dictLength >= s.w_size) {
				if (wrap === 0) {
					/*** CLEAR_HASH(s); ***/
					zero(s.head);
					s.strstart = 0;
					s.block_start = 0;
					s.insert = 0;
				}
				tmpDict = new utils.Buf8(s.w_size);
				utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
				dictionary = tmpDict;
				dictLength = s.w_size;
			}
			avail = strm.avail_in;
			next = strm.next_in;
			input = strm.input;
			strm.avail_in = dictLength;
			strm.next_in = 0;
			strm.input = dictionary;
			fill_window(s);
			while (s.lookahead >= MIN_MATCH) {
				str = s.strstart;
				n = s.lookahead - (MIN_MATCH - 1);
				do {
					s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
					s.prev[str & s.w_mask] = s.head[s.ins_h];
					s.head[s.ins_h] = str;
					str++;
				} while (--n);
				s.strstart = str;
				s.lookahead = MIN_MATCH - 1;
				fill_window(s);
			}
			s.strstart += s.lookahead;
			s.block_start = s.strstart;
			s.insert = s.lookahead;
			s.lookahead = 0;
			s.match_length = s.prev_length = MIN_MATCH - 1;
			s.match_available = 0;
			strm.next_in = next;
			strm.input = input;
			strm.avail_in = avail;
			s.wrap = wrap;
			return Z_OK;
		}
		exports.deflateInit = deflateInit;
		exports.deflateInit2 = deflateInit2;
		exports.deflateReset = deflateReset;
		exports.deflateResetKeep = deflateResetKeep;
		exports.deflateSetHeader = deflateSetHeader;
		exports.deflate = deflate;
		exports.deflateEnd = deflateEnd;
		exports.deflateSetDictionary = deflateSetDictionary;
		exports.deflateInfo = "pako deflate (from Nodeca project)";
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/inffast.js
	var require_inffast = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var BAD = 30;
		var TYPE = 12;
		module.exports = function inflate_fast(strm, start) {
			var state;
			var _in;
			var last;
			var _out;
			var beg;
			var end;
			var dmax;
			var wsize;
			var whave;
			var wnext;
			var s_window;
			var hold;
			var bits;
			var lcode;
			var dcode;
			var lmask;
			var dmask;
			var here;
			var op;
			var len;
			var dist;
			var from;
			var from_source;
			var input, output;
			state = strm.state;
			_in = strm.next_in;
			input = strm.input;
			last = _in + (strm.avail_in - 5);
			_out = strm.next_out;
			output = strm.output;
			beg = _out - (start - strm.avail_out);
			end = _out + (strm.avail_out - 257);
			dmax = state.dmax;
			wsize = state.wsize;
			whave = state.whave;
			wnext = state.wnext;
			s_window = state.window;
			hold = state.hold;
			bits = state.bits;
			lcode = state.lencode;
			dcode = state.distcode;
			lmask = (1 << state.lenbits) - 1;
			dmask = (1 << state.distbits) - 1;
			top: do {
				if (bits < 15) {
					hold += input[_in++] << bits;
					bits += 8;
					hold += input[_in++] << bits;
					bits += 8;
				}
				here = lcode[hold & lmask];
				dolen: for (;;) {
					op = here >>> 24;
					hold >>>= op;
					bits -= op;
					op = here >>> 16 & 255;
					if (op === 0) output[_out++] = here & 65535;
					else if (op & 16) {
						len = here & 65535;
						op &= 15;
						if (op) {
							if (bits < op) {
								hold += input[_in++] << bits;
								bits += 8;
							}
							len += hold & (1 << op) - 1;
							hold >>>= op;
							bits -= op;
						}
						if (bits < 15) {
							hold += input[_in++] << bits;
							bits += 8;
							hold += input[_in++] << bits;
							bits += 8;
						}
						here = dcode[hold & dmask];
						dodist: for (;;) {
							op = here >>> 24;
							hold >>>= op;
							bits -= op;
							op = here >>> 16 & 255;
							if (op & 16) {
								dist = here & 65535;
								op &= 15;
								if (bits < op) {
									hold += input[_in++] << bits;
									bits += 8;
									if (bits < op) {
										hold += input[_in++] << bits;
										bits += 8;
									}
								}
								dist += hold & (1 << op) - 1;
								if (dist > dmax) {
									strm.msg = "invalid distance too far back";
									state.mode = BAD;
									break top;
								}
								hold >>>= op;
								bits -= op;
								op = _out - beg;
								if (dist > op) {
									op = dist - op;
									if (op > whave) {
										if (state.sane) {
											strm.msg = "invalid distance too far back";
											state.mode = BAD;
											break top;
										}
									}
									from = 0;
									from_source = s_window;
									if (wnext === 0) {
										from += wsize - op;
										if (op < len) {
											len -= op;
											do
												output[_out++] = s_window[from++];
											while (--op);
											from = _out - dist;
											from_source = output;
										}
									} else if (wnext < op) {
										from += wsize + wnext - op;
										op -= wnext;
										if (op < len) {
											len -= op;
											do
												output[_out++] = s_window[from++];
											while (--op);
											from = 0;
											if (wnext < len) {
												op = wnext;
												len -= op;
												do
													output[_out++] = s_window[from++];
												while (--op);
												from = _out - dist;
												from_source = output;
											}
										}
									} else {
										from += wnext - op;
										if (op < len) {
											len -= op;
											do
												output[_out++] = s_window[from++];
											while (--op);
											from = _out - dist;
											from_source = output;
										}
									}
									while (len > 2) {
										output[_out++] = from_source[from++];
										output[_out++] = from_source[from++];
										output[_out++] = from_source[from++];
										len -= 3;
									}
									if (len) {
										output[_out++] = from_source[from++];
										if (len > 1) output[_out++] = from_source[from++];
									}
								} else {
									from = _out - dist;
									do {
										output[_out++] = output[from++];
										output[_out++] = output[from++];
										output[_out++] = output[from++];
										len -= 3;
									} while (len > 2);
									if (len) {
										output[_out++] = output[from++];
										if (len > 1) output[_out++] = output[from++];
									}
								}
							} else if ((op & 64) === 0) {
								here = dcode[(here & 65535) + (hold & (1 << op) - 1)];
								continue dodist;
							} else {
								strm.msg = "invalid distance code";
								state.mode = BAD;
								break top;
							}
							break;
						}
					} else if ((op & 64) === 0) {
						here = lcode[(here & 65535) + (hold & (1 << op) - 1)];
						continue dolen;
					} else if (op & 32) {
						state.mode = TYPE;
						break top;
					} else {
						strm.msg = "invalid literal/length code";
						state.mode = BAD;
						break top;
					}
					break;
				}
			} while (_in < last && _out < end);
			len = bits >> 3;
			_in -= len;
			bits -= len << 3;
			hold &= (1 << bits) - 1;
			strm.next_in = _in;
			strm.next_out = _out;
			strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last);
			strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end);
			state.hold = hold;
			state.bits = bits;
		};
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/inftrees.js
	var require_inftrees = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var utils = require_common();
		var MAXBITS = 15;
		var ENOUGH_LENS = 852;
		var ENOUGH_DISTS = 592;
		var CODES = 0;
		var LENS = 1;
		var DISTS = 2;
		var lbase = [
			3,
			4,
			5,
			6,
			7,
			8,
			9,
			10,
			11,
			13,
			15,
			17,
			19,
			23,
			27,
			31,
			35,
			43,
			51,
			59,
			67,
			83,
			99,
			115,
			131,
			163,
			195,
			227,
			258,
			0,
			0
		];
		var lext = [
			16,
			16,
			16,
			16,
			16,
			16,
			16,
			16,
			17,
			17,
			17,
			17,
			18,
			18,
			18,
			18,
			19,
			19,
			19,
			19,
			20,
			20,
			20,
			20,
			21,
			21,
			21,
			21,
			16,
			72,
			78
		];
		var dbase = [
			1,
			2,
			3,
			4,
			5,
			7,
			9,
			13,
			17,
			25,
			33,
			49,
			65,
			97,
			129,
			193,
			257,
			385,
			513,
			769,
			1025,
			1537,
			2049,
			3073,
			4097,
			6145,
			8193,
			12289,
			16385,
			24577,
			0,
			0
		];
		var dext = [
			16,
			16,
			16,
			16,
			17,
			17,
			18,
			18,
			19,
			19,
			20,
			20,
			21,
			21,
			22,
			22,
			23,
			23,
			24,
			24,
			25,
			25,
			26,
			26,
			27,
			27,
			28,
			28,
			29,
			29,
			64,
			64
		];
		module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) {
			var bits = opts.bits;
			var len = 0;
			var sym = 0;
			var min = 0, max = 0;
			var root = 0;
			var curr = 0;
			var drop = 0;
			var left = 0;
			var used = 0;
			var huff = 0;
			var incr;
			var fill;
			var low;
			var mask;
			var next;
			var base = null;
			var base_index = 0;
			var end;
			var count = new utils.Buf16(MAXBITS + 1);
			var offs = new utils.Buf16(MAXBITS + 1);
			var extra = null;
			var extra_index = 0;
			var here_bits, here_op, here_val;
			for (len = 0; len <= MAXBITS; len++) count[len] = 0;
			for (sym = 0; sym < codes; sym++) count[lens[lens_index + sym]]++;
			root = bits;
			for (max = MAXBITS; max >= 1; max--) if (count[max] !== 0) break;
			if (root > max) root = max;
			if (max === 0) {
				table[table_index++] = 20971520;
				table[table_index++] = 20971520;
				opts.bits = 1;
				return 0;
			}
			for (min = 1; min < max; min++) if (count[min] !== 0) break;
			if (root < min) root = min;
			left = 1;
			for (len = 1; len <= MAXBITS; len++) {
				left <<= 1;
				left -= count[len];
				if (left < 0) return -1;
			}
			if (left > 0 && (type === CODES || max !== 1)) return -1;
			offs[1] = 0;
			for (len = 1; len < MAXBITS; len++) offs[len + 1] = offs[len] + count[len];
			for (sym = 0; sym < codes; sym++) if (lens[lens_index + sym] !== 0) work[offs[lens[lens_index + sym]]++] = sym;
			if (type === CODES) {
				base = extra = work;
				end = 19;
			} else if (type === LENS) {
				base = lbase;
				base_index -= 257;
				extra = lext;
				extra_index -= 257;
				end = 256;
			} else {
				base = dbase;
				extra = dext;
				end = -1;
			}
			huff = 0;
			sym = 0;
			len = min;
			next = table_index;
			curr = root;
			drop = 0;
			low = -1;
			used = 1 << root;
			mask = used - 1;
			if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) return 1;
			for (;;) {
				here_bits = len - drop;
				if (work[sym] < end) {
					here_op = 0;
					here_val = work[sym];
				} else if (work[sym] > end) {
					here_op = extra[extra_index + work[sym]];
					here_val = base[base_index + work[sym]];
				} else {
					here_op = 96;
					here_val = 0;
				}
				incr = 1 << len - drop;
				fill = 1 << curr;
				min = fill;
				do {
					fill -= incr;
					table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0;
				} while (fill !== 0);
				incr = 1 << len - 1;
				while (huff & incr) incr >>= 1;
				if (incr !== 0) {
					huff &= incr - 1;
					huff += incr;
				} else huff = 0;
				sym++;
				if (--count[len] === 0) {
					if (len === max) break;
					len = lens[lens_index + work[sym]];
				}
				if (len > root && (huff & mask) !== low) {
					if (drop === 0) drop = root;
					next += min;
					curr = len - drop;
					left = 1 << curr;
					while (curr + drop < max) {
						left -= count[curr + drop];
						if (left <= 0) break;
						curr++;
						left <<= 1;
					}
					used += 1 << curr;
					if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) return 1;
					low = huff & mask;
					table[low] = root << 24 | curr << 16 | next - table_index | 0;
				}
			}
			if (huff !== 0) table[next + huff] = len - drop << 24 | 4194304;
			opts.bits = root;
			return 0;
		};
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/inflate.js
	var require_inflate = /* @__PURE__ */ __commonJSMin(((exports) => {
		var utils = require_common();
		var adler32 = require_adler32();
		var crc32 = require_crc32();
		var inflate_fast = require_inffast();
		var inflate_table = require_inftrees();
		var CODES = 0;
		var LENS = 1;
		var DISTS = 2;
		var Z_FINISH = 4;
		var Z_BLOCK = 5;
		var Z_TREES = 6;
		var Z_OK = 0;
		var Z_STREAM_END = 1;
		var Z_NEED_DICT = 2;
		var Z_STREAM_ERROR = -2;
		var Z_DATA_ERROR = -3;
		var Z_MEM_ERROR = -4;
		var Z_BUF_ERROR = -5;
		var Z_DEFLATED = 8;
		var HEAD = 1;
		var FLAGS = 2;
		var TIME = 3;
		var OS = 4;
		var EXLEN = 5;
		var EXTRA = 6;
		var NAME = 7;
		var COMMENT = 8;
		var HCRC = 9;
		var DICTID = 10;
		var DICT = 11;
		var TYPE = 12;
		var TYPEDO = 13;
		var STORED = 14;
		var COPY_ = 15;
		var COPY = 16;
		var TABLE = 17;
		var LENLENS = 18;
		var CODELENS = 19;
		var LEN_ = 20;
		var LEN = 21;
		var LENEXT = 22;
		var DIST = 23;
		var DISTEXT = 24;
		var MATCH = 25;
		var LIT = 26;
		var CHECK = 27;
		var LENGTH = 28;
		var DONE = 29;
		var BAD = 30;
		var MEM = 31;
		var SYNC = 32;
		var ENOUGH_LENS = 852;
		var ENOUGH_DISTS = 592;
		var DEF_WBITS = 15;
		function zswap32(q) {
			return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24);
		}
		function InflateState() {
			this.mode = 0;
			this.last = false;
			this.wrap = 0;
			this.havedict = false;
			this.flags = 0;
			this.dmax = 0;
			this.check = 0;
			this.total = 0;
			this.head = null;
			this.wbits = 0;
			this.wsize = 0;
			this.whave = 0;
			this.wnext = 0;
			this.window = null;
			this.hold = 0;
			this.bits = 0;
			this.length = 0;
			this.offset = 0;
			this.extra = 0;
			this.lencode = null;
			this.distcode = null;
			this.lenbits = 0;
			this.distbits = 0;
			this.ncode = 0;
			this.nlen = 0;
			this.ndist = 0;
			this.have = 0;
			this.next = null;
			this.lens = new utils.Buf16(320);
			this.work = new utils.Buf16(288);
			this.lendyn = null;
			this.distdyn = null;
			this.sane = 0;
			this.back = 0;
			this.was = 0;
		}
		function inflateResetKeep(strm) {
			var state;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			state = strm.state;
			strm.total_in = strm.total_out = state.total = 0;
			strm.msg = "";
			if (state.wrap) strm.adler = state.wrap & 1;
			state.mode = HEAD;
			state.last = 0;
			state.havedict = 0;
			state.dmax = 32768;
			state.head = null;
			state.hold = 0;
			state.bits = 0;
			state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
			state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
			state.sane = 1;
			state.back = -1;
			return Z_OK;
		}
		function inflateReset(strm) {
			var state;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			state = strm.state;
			state.wsize = 0;
			state.whave = 0;
			state.wnext = 0;
			return inflateResetKeep(strm);
		}
		function inflateReset2(strm, windowBits) {
			var wrap;
			var state;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			state = strm.state;
			if (windowBits < 0) {
				wrap = 0;
				windowBits = -windowBits;
			} else {
				wrap = (windowBits >> 4) + 1;
				if (windowBits < 48) windowBits &= 15;
			}
			if (windowBits && (windowBits < 8 || windowBits > 15)) return Z_STREAM_ERROR;
			if (state.window !== null && state.wbits !== windowBits) state.window = null;
			state.wrap = wrap;
			state.wbits = windowBits;
			return inflateReset(strm);
		}
		function inflateInit2(strm, windowBits) {
			var ret;
			var state;
			if (!strm) return Z_STREAM_ERROR;
			state = new InflateState();
			strm.state = state;
			state.window = null;
			ret = inflateReset2(strm, windowBits);
			if (ret !== Z_OK) strm.state = null;
			return ret;
		}
		function inflateInit(strm) {
			return inflateInit2(strm, DEF_WBITS);
		}
		var virgin = true;
		var lenfix, distfix;
		function fixedtables(state) {
			if (virgin) {
				var sym;
				lenfix = new utils.Buf32(512);
				distfix = new utils.Buf32(32);
				sym = 0;
				while (sym < 144) state.lens[sym++] = 8;
				while (sym < 256) state.lens[sym++] = 9;
				while (sym < 280) state.lens[sym++] = 7;
				while (sym < 288) state.lens[sym++] = 8;
				inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
				sym = 0;
				while (sym < 32) state.lens[sym++] = 5;
				inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
				virgin = false;
			}
			state.lencode = lenfix;
			state.lenbits = 9;
			state.distcode = distfix;
			state.distbits = 5;
		}
		function updatewindow(strm, src, end, copy) {
			var dist;
			var state = strm.state;
			if (state.window === null) {
				state.wsize = 1 << state.wbits;
				state.wnext = 0;
				state.whave = 0;
				state.window = new utils.Buf8(state.wsize);
			}
			if (copy >= state.wsize) {
				utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
				state.wnext = 0;
				state.whave = state.wsize;
			} else {
				dist = state.wsize - state.wnext;
				if (dist > copy) dist = copy;
				utils.arraySet(state.window, src, end - copy, dist, state.wnext);
				copy -= dist;
				if (copy) {
					utils.arraySet(state.window, src, end - copy, copy, 0);
					state.wnext = copy;
					state.whave = state.wsize;
				} else {
					state.wnext += dist;
					if (state.wnext === state.wsize) state.wnext = 0;
					if (state.whave < state.wsize) state.whave += dist;
				}
			}
			return 0;
		}
		function inflate(strm, flush) {
			var state;
			var input, output;
			var next;
			var put;
			var have, left;
			var hold;
			var bits;
			var _in, _out;
			var copy;
			var from;
			var from_source;
			var here = 0;
			var here_bits, here_op, here_val;
			var last_bits, last_op, last_val;
			var len;
			var ret;
			var hbuf = new utils.Buf8(4);
			var opts;
			var n;
			var order = [
				16,
				17,
				18,
				0,
				8,
				7,
				9,
				6,
				10,
				5,
				11,
				4,
				12,
				3,
				13,
				2,
				14,
				1,
				15
			];
			if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) return Z_STREAM_ERROR;
			state = strm.state;
			if (state.mode === TYPE) state.mode = TYPEDO;
			put = strm.next_out;
			output = strm.output;
			left = strm.avail_out;
			next = strm.next_in;
			input = strm.input;
			have = strm.avail_in;
			hold = state.hold;
			bits = state.bits;
			_in = have;
			_out = left;
			ret = Z_OK;
			inf_leave: for (;;) switch (state.mode) {
				case HEAD:
					if (state.wrap === 0) {
						state.mode = TYPEDO;
						break;
					}
					while (bits < 16) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					if (state.wrap & 2 && hold === 35615) {
						state.check = 0;
						hbuf[0] = hold & 255;
						hbuf[1] = hold >>> 8 & 255;
						state.check = crc32(state.check, hbuf, 2, 0);
						hold = 0;
						bits = 0;
						state.mode = FLAGS;
						break;
					}
					state.flags = 0;
					if (state.head) state.head.done = false;
					if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) {
						strm.msg = "incorrect header check";
						state.mode = BAD;
						break;
					}
					if ((hold & 15) !== Z_DEFLATED) {
						strm.msg = "unknown compression method";
						state.mode = BAD;
						break;
					}
					hold >>>= 4;
					bits -= 4;
					len = (hold & 15) + 8;
					if (state.wbits === 0) state.wbits = len;
					else if (len > state.wbits) {
						strm.msg = "invalid window size";
						state.mode = BAD;
						break;
					}
					state.dmax = 1 << len;
					strm.adler = state.check = 1;
					state.mode = hold & 512 ? DICTID : TYPE;
					hold = 0;
					bits = 0;
					break;
				case FLAGS:
					while (bits < 16) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					state.flags = hold;
					if ((state.flags & 255) !== Z_DEFLATED) {
						strm.msg = "unknown compression method";
						state.mode = BAD;
						break;
					}
					if (state.flags & 57344) {
						strm.msg = "unknown header flags set";
						state.mode = BAD;
						break;
					}
					if (state.head) state.head.text = hold >> 8 & 1;
					if (state.flags & 512) {
						hbuf[0] = hold & 255;
						hbuf[1] = hold >>> 8 & 255;
						state.check = crc32(state.check, hbuf, 2, 0);
					}
					hold = 0;
					bits = 0;
					state.mode = TIME;
				case TIME:
					while (bits < 32) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					if (state.head) state.head.time = hold;
					if (state.flags & 512) {
						hbuf[0] = hold & 255;
						hbuf[1] = hold >>> 8 & 255;
						hbuf[2] = hold >>> 16 & 255;
						hbuf[3] = hold >>> 24 & 255;
						state.check = crc32(state.check, hbuf, 4, 0);
					}
					hold = 0;
					bits = 0;
					state.mode = OS;
				case OS:
					while (bits < 16) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					if (state.head) {
						state.head.xflags = hold & 255;
						state.head.os = hold >> 8;
					}
					if (state.flags & 512) {
						hbuf[0] = hold & 255;
						hbuf[1] = hold >>> 8 & 255;
						state.check = crc32(state.check, hbuf, 2, 0);
					}
					hold = 0;
					bits = 0;
					state.mode = EXLEN;
				case EXLEN:
					if (state.flags & 1024) {
						while (bits < 16) {
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						state.length = hold;
						if (state.head) state.head.extra_len = hold;
						if (state.flags & 512) {
							hbuf[0] = hold & 255;
							hbuf[1] = hold >>> 8 & 255;
							state.check = crc32(state.check, hbuf, 2, 0);
						}
						hold = 0;
						bits = 0;
					} else if (state.head) state.head.extra = null;
					state.mode = EXTRA;
				case EXTRA:
					if (state.flags & 1024) {
						copy = state.length;
						if (copy > have) copy = have;
						if (copy) {
							if (state.head) {
								len = state.head.extra_len - state.length;
								if (!state.head.extra) state.head.extra = new Array(state.head.extra_len);
								utils.arraySet(state.head.extra, input, next, copy, len);
							}
							if (state.flags & 512) state.check = crc32(state.check, input, copy, next);
							have -= copy;
							next += copy;
							state.length -= copy;
						}
						if (state.length) break inf_leave;
					}
					state.length = 0;
					state.mode = NAME;
				case NAME:
					if (state.flags & 2048) {
						if (have === 0) break inf_leave;
						copy = 0;
						do {
							len = input[next + copy++];
							if (state.head && len && state.length < 65536) state.head.name += String.fromCharCode(len);
						} while (len && copy < have);
						if (state.flags & 512) state.check = crc32(state.check, input, copy, next);
						have -= copy;
						next += copy;
						if (len) break inf_leave;
					} else if (state.head) state.head.name = null;
					state.length = 0;
					state.mode = COMMENT;
				case COMMENT:
					if (state.flags & 4096) {
						if (have === 0) break inf_leave;
						copy = 0;
						do {
							len = input[next + copy++];
							if (state.head && len && state.length < 65536) state.head.comment += String.fromCharCode(len);
						} while (len && copy < have);
						if (state.flags & 512) state.check = crc32(state.check, input, copy, next);
						have -= copy;
						next += copy;
						if (len) break inf_leave;
					} else if (state.head) state.head.comment = null;
					state.mode = HCRC;
				case HCRC:
					if (state.flags & 512) {
						while (bits < 16) {
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						if (hold !== (state.check & 65535)) {
							strm.msg = "header crc mismatch";
							state.mode = BAD;
							break;
						}
						hold = 0;
						bits = 0;
					}
					if (state.head) {
						state.head.hcrc = state.flags >> 9 & 1;
						state.head.done = true;
					}
					strm.adler = state.check = 0;
					state.mode = TYPE;
					break;
				case DICTID:
					while (bits < 32) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					strm.adler = state.check = zswap32(hold);
					hold = 0;
					bits = 0;
					state.mode = DICT;
				case DICT:
					if (state.havedict === 0) {
						strm.next_out = put;
						strm.avail_out = left;
						strm.next_in = next;
						strm.avail_in = have;
						state.hold = hold;
						state.bits = bits;
						return Z_NEED_DICT;
					}
					strm.adler = state.check = 1;
					state.mode = TYPE;
				case TYPE: if (flush === Z_BLOCK || flush === Z_TREES) break inf_leave;
				case TYPEDO:
					if (state.last) {
						hold >>>= bits & 7;
						bits -= bits & 7;
						state.mode = CHECK;
						break;
					}
					while (bits < 3) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					state.last = hold & 1;
					hold >>>= 1;
					bits -= 1;
					switch (hold & 3) {
						case 0:
							state.mode = STORED;
							break;
						case 1:
							fixedtables(state);
							state.mode = LEN_;
							if (flush === Z_TREES) {
								hold >>>= 2;
								bits -= 2;
								break inf_leave;
							}
							break;
						case 2:
							state.mode = TABLE;
							break;
						case 3:
							strm.msg = "invalid block type";
							state.mode = BAD;
					}
					hold >>>= 2;
					bits -= 2;
					break;
				case STORED:
					hold >>>= bits & 7;
					bits -= bits & 7;
					while (bits < 32) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					if ((hold & 65535) !== (hold >>> 16 ^ 65535)) {
						strm.msg = "invalid stored block lengths";
						state.mode = BAD;
						break;
					}
					state.length = hold & 65535;
					hold = 0;
					bits = 0;
					state.mode = COPY_;
					if (flush === Z_TREES) break inf_leave;
				case COPY_: state.mode = COPY;
				case COPY:
					copy = state.length;
					if (copy) {
						if (copy > have) copy = have;
						if (copy > left) copy = left;
						if (copy === 0) break inf_leave;
						utils.arraySet(output, input, next, copy, put);
						have -= copy;
						next += copy;
						left -= copy;
						put += copy;
						state.length -= copy;
						break;
					}
					state.mode = TYPE;
					break;
				case TABLE:
					while (bits < 14) {
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					state.nlen = (hold & 31) + 257;
					hold >>>= 5;
					bits -= 5;
					state.ndist = (hold & 31) + 1;
					hold >>>= 5;
					bits -= 5;
					state.ncode = (hold & 15) + 4;
					hold >>>= 4;
					bits -= 4;
					if (state.nlen > 286 || state.ndist > 30) {
						strm.msg = "too many length or distance symbols";
						state.mode = BAD;
						break;
					}
					state.have = 0;
					state.mode = LENLENS;
				case LENLENS:
					while (state.have < state.ncode) {
						while (bits < 3) {
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						state.lens[order[state.have++]] = hold & 7;
						hold >>>= 3;
						bits -= 3;
					}
					while (state.have < 19) state.lens[order[state.have++]] = 0;
					state.lencode = state.lendyn;
					state.lenbits = 7;
					opts = { bits: state.lenbits };
					ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
					state.lenbits = opts.bits;
					if (ret) {
						strm.msg = "invalid code lengths set";
						state.mode = BAD;
						break;
					}
					state.have = 0;
					state.mode = CODELENS;
				case CODELENS:
					while (state.have < state.nlen + state.ndist) {
						for (;;) {
							here = state.lencode[hold & (1 << state.lenbits) - 1];
							here_bits = here >>> 24;
							here_op = here >>> 16 & 255;
							here_val = here & 65535;
							if (here_bits <= bits) break;
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						if (here_val < 16) {
							hold >>>= here_bits;
							bits -= here_bits;
							state.lens[state.have++] = here_val;
						} else {
							if (here_val === 16) {
								n = here_bits + 2;
								while (bits < n) {
									if (have === 0) break inf_leave;
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								hold >>>= here_bits;
								bits -= here_bits;
								if (state.have === 0) {
									strm.msg = "invalid bit length repeat";
									state.mode = BAD;
									break;
								}
								len = state.lens[state.have - 1];
								copy = 3 + (hold & 3);
								hold >>>= 2;
								bits -= 2;
							} else if (here_val === 17) {
								n = here_bits + 3;
								while (bits < n) {
									if (have === 0) break inf_leave;
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								hold >>>= here_bits;
								bits -= here_bits;
								len = 0;
								copy = 3 + (hold & 7);
								hold >>>= 3;
								bits -= 3;
							} else {
								n = here_bits + 7;
								while (bits < n) {
									if (have === 0) break inf_leave;
									have--;
									hold += input[next++] << bits;
									bits += 8;
								}
								hold >>>= here_bits;
								bits -= here_bits;
								len = 0;
								copy = 11 + (hold & 127);
								hold >>>= 7;
								bits -= 7;
							}
							if (state.have + copy > state.nlen + state.ndist) {
								strm.msg = "invalid bit length repeat";
								state.mode = BAD;
								break;
							}
							while (copy--) state.lens[state.have++] = len;
						}
					}
					if (state.mode === BAD) break;
					if (state.lens[256] === 0) {
						strm.msg = "invalid code -- missing end-of-block";
						state.mode = BAD;
						break;
					}
					state.lenbits = 9;
					opts = { bits: state.lenbits };
					ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
					state.lenbits = opts.bits;
					if (ret) {
						strm.msg = "invalid literal/lengths set";
						state.mode = BAD;
						break;
					}
					state.distbits = 6;
					state.distcode = state.distdyn;
					opts = { bits: state.distbits };
					ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
					state.distbits = opts.bits;
					if (ret) {
						strm.msg = "invalid distances set";
						state.mode = BAD;
						break;
					}
					state.mode = LEN_;
					if (flush === Z_TREES) break inf_leave;
				case LEN_: state.mode = LEN;
				case LEN:
					if (have >= 6 && left >= 258) {
						strm.next_out = put;
						strm.avail_out = left;
						strm.next_in = next;
						strm.avail_in = have;
						state.hold = hold;
						state.bits = bits;
						inflate_fast(strm, _out);
						put = strm.next_out;
						output = strm.output;
						left = strm.avail_out;
						next = strm.next_in;
						input = strm.input;
						have = strm.avail_in;
						hold = state.hold;
						bits = state.bits;
						if (state.mode === TYPE) state.back = -1;
						break;
					}
					state.back = 0;
					for (;;) {
						here = state.lencode[hold & (1 << state.lenbits) - 1];
						here_bits = here >>> 24;
						here_op = here >>> 16 & 255;
						here_val = here & 65535;
						if (here_bits <= bits) break;
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					if (here_op && (here_op & 240) === 0) {
						last_bits = here_bits;
						last_op = here_op;
						last_val = here_val;
						for (;;) {
							here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
							here_bits = here >>> 24;
							here_op = here >>> 16 & 255;
							here_val = here & 65535;
							if (last_bits + here_bits <= bits) break;
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						hold >>>= last_bits;
						bits -= last_bits;
						state.back += last_bits;
					}
					hold >>>= here_bits;
					bits -= here_bits;
					state.back += here_bits;
					state.length = here_val;
					if (here_op === 0) {
						state.mode = LIT;
						break;
					}
					if (here_op & 32) {
						state.back = -1;
						state.mode = TYPE;
						break;
					}
					if (here_op & 64) {
						strm.msg = "invalid literal/length code";
						state.mode = BAD;
						break;
					}
					state.extra = here_op & 15;
					state.mode = LENEXT;
				case LENEXT:
					if (state.extra) {
						n = state.extra;
						while (bits < n) {
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						state.length += hold & (1 << state.extra) - 1;
						hold >>>= state.extra;
						bits -= state.extra;
						state.back += state.extra;
					}
					state.was = state.length;
					state.mode = DIST;
				case DIST:
					for (;;) {
						here = state.distcode[hold & (1 << state.distbits) - 1];
						here_bits = here >>> 24;
						here_op = here >>> 16 & 255;
						here_val = here & 65535;
						if (here_bits <= bits) break;
						if (have === 0) break inf_leave;
						have--;
						hold += input[next++] << bits;
						bits += 8;
					}
					if ((here_op & 240) === 0) {
						last_bits = here_bits;
						last_op = here_op;
						last_val = here_val;
						for (;;) {
							here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)];
							here_bits = here >>> 24;
							here_op = here >>> 16 & 255;
							here_val = here & 65535;
							if (last_bits + here_bits <= bits) break;
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						hold >>>= last_bits;
						bits -= last_bits;
						state.back += last_bits;
					}
					hold >>>= here_bits;
					bits -= here_bits;
					state.back += here_bits;
					if (here_op & 64) {
						strm.msg = "invalid distance code";
						state.mode = BAD;
						break;
					}
					state.offset = here_val;
					state.extra = here_op & 15;
					state.mode = DISTEXT;
				case DISTEXT:
					if (state.extra) {
						n = state.extra;
						while (bits < n) {
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						state.offset += hold & (1 << state.extra) - 1;
						hold >>>= state.extra;
						bits -= state.extra;
						state.back += state.extra;
					}
					if (state.offset > state.dmax) {
						strm.msg = "invalid distance too far back";
						state.mode = BAD;
						break;
					}
					state.mode = MATCH;
				case MATCH:
					if (left === 0) break inf_leave;
					copy = _out - left;
					if (state.offset > copy) {
						copy = state.offset - copy;
						if (copy > state.whave) {
							if (state.sane) {
								strm.msg = "invalid distance too far back";
								state.mode = BAD;
								break;
							}
						}
						if (copy > state.wnext) {
							copy -= state.wnext;
							from = state.wsize - copy;
						} else from = state.wnext - copy;
						if (copy > state.length) copy = state.length;
						from_source = state.window;
					} else {
						from_source = output;
						from = put - state.offset;
						copy = state.length;
					}
					if (copy > left) copy = left;
					left -= copy;
					state.length -= copy;
					do
						output[put++] = from_source[from++];
					while (--copy);
					if (state.length === 0) state.mode = LEN;
					break;
				case LIT:
					if (left === 0) break inf_leave;
					output[put++] = state.length;
					left--;
					state.mode = LEN;
					break;
				case CHECK:
					if (state.wrap) {
						while (bits < 32) {
							if (have === 0) break inf_leave;
							have--;
							hold |= input[next++] << bits;
							bits += 8;
						}
						_out -= left;
						strm.total_out += _out;
						state.total += _out;
						if (_out) strm.adler = state.check = state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out);
						_out = left;
						if ((state.flags ? hold : zswap32(hold)) !== state.check) {
							strm.msg = "incorrect data check";
							state.mode = BAD;
							break;
						}
						hold = 0;
						bits = 0;
					}
					state.mode = LENGTH;
				case LENGTH:
					if (state.wrap && state.flags) {
						while (bits < 32) {
							if (have === 0) break inf_leave;
							have--;
							hold += input[next++] << bits;
							bits += 8;
						}
						if (hold !== (state.total & 4294967295)) {
							strm.msg = "incorrect length check";
							state.mode = BAD;
							break;
						}
						hold = 0;
						bits = 0;
					}
					state.mode = DONE;
				case DONE:
					ret = Z_STREAM_END;
					break inf_leave;
				case BAD:
					ret = Z_DATA_ERROR;
					break inf_leave;
				case MEM: return Z_MEM_ERROR;
				case SYNC:
				default: return Z_STREAM_ERROR;
			}
			strm.next_out = put;
			strm.avail_out = left;
			strm.next_in = next;
			strm.avail_in = have;
			state.hold = hold;
			state.bits = bits;
			if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) {
				if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
					state.mode = MEM;
					return Z_MEM_ERROR;
				}
			}
			_in -= strm.avail_in;
			_out -= strm.avail_out;
			strm.total_in += _in;
			strm.total_out += _out;
			state.total += _out;
			if (state.wrap && _out) strm.adler = state.check = state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out);
			strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
			if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) ret = Z_BUF_ERROR;
			return ret;
		}
		function inflateEnd(strm) {
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			var state = strm.state;
			if (state.window) state.window = null;
			strm.state = null;
			return Z_OK;
		}
		function inflateGetHeader(strm, head) {
			var state;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			state = strm.state;
			if ((state.wrap & 2) === 0) return Z_STREAM_ERROR;
			state.head = head;
			head.done = false;
			return Z_OK;
		}
		function inflateSetDictionary(strm, dictionary) {
			var dictLength = dictionary.length;
			var state;
			var dictid;
			var ret;
			if (!strm || !strm.state) return Z_STREAM_ERROR;
			state = strm.state;
			if (state.wrap !== 0 && state.mode !== DICT) return Z_STREAM_ERROR;
			if (state.mode === DICT) {
				dictid = 1;
				dictid = adler32(dictid, dictionary, dictLength, 0);
				if (dictid !== state.check) return Z_DATA_ERROR;
			}
			ret = updatewindow(strm, dictionary, dictLength, dictLength);
			if (ret) {
				state.mode = MEM;
				return Z_MEM_ERROR;
			}
			state.havedict = 1;
			return Z_OK;
		}
		exports.inflateReset = inflateReset;
		exports.inflateReset2 = inflateReset2;
		exports.inflateResetKeep = inflateResetKeep;
		exports.inflateInit = inflateInit;
		exports.inflateInit2 = inflateInit2;
		exports.inflate = inflate;
		exports.inflateEnd = inflateEnd;
		exports.inflateGetHeader = inflateGetHeader;
		exports.inflateSetDictionary = inflateSetDictionary;
		exports.inflateInfo = "pako inflate (from Nodeca project)";
	}));
	//#endregion
	//#region ../../node_modules/pako/lib/zlib/constants.js
	var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = {
			Z_NO_FLUSH: 0,
			Z_PARTIAL_FLUSH: 1,
			Z_SYNC_FLUSH: 2,
			Z_FULL_FLUSH: 3,
			Z_FINISH: 4,
			Z_BLOCK: 5,
			Z_TREES: 6,
			Z_OK: 0,
			Z_STREAM_END: 1,
			Z_NEED_DICT: 2,
			Z_ERRNO: -1,
			Z_STREAM_ERROR: -2,
			Z_DATA_ERROR: -3,
			Z_BUF_ERROR: -5,
			Z_NO_COMPRESSION: 0,
			Z_BEST_SPEED: 1,
			Z_BEST_COMPRESSION: 9,
			Z_DEFAULT_COMPRESSION: -1,
			Z_FILTERED: 1,
			Z_HUFFMAN_ONLY: 2,
			Z_RLE: 3,
			Z_FIXED: 4,
			Z_DEFAULT_STRATEGY: 0,
			Z_BINARY: 0,
			Z_TEXT: 1,
			Z_UNKNOWN: 2,
			Z_DEFLATED: 8
		};
	}));
	//#endregion
	//#region ../../node_modules/browserify-zlib/lib/binding.js
	var require_binding = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist();
		init_dist$1();
		var assert = require_assert();
		var Zstream = require_zstream();
		var zlib_deflate = require_deflate();
		var zlib_inflate = require_inflate();
		var constants = require_constants();
		for (var key in constants) exports[key] = constants[key];
		exports.NONE = 0;
		exports.DEFLATE = 1;
		exports.INFLATE = 2;
		exports.GZIP = 3;
		exports.GUNZIP = 4;
		exports.DEFLATERAW = 5;
		exports.INFLATERAW = 6;
		exports.UNZIP = 7;
		var GZIP_HEADER_ID1 = 31;
		var GZIP_HEADER_ID2 = 139;
		/**
		* Emulate Node's zlib C++ layer for use by the JS layer in index.js
		*/
		function Zlib(mode) {
			if (typeof mode !== "number" || mode < exports.DEFLATE || mode > exports.UNZIP) throw new TypeError("Bad argument");
			this.dictionary = null;
			this.err = 0;
			this.flush = 0;
			this.init_done = false;
			this.level = 0;
			this.memLevel = 0;
			this.mode = mode;
			this.strategy = 0;
			this.windowBits = 0;
			this.write_in_progress = false;
			this.pending_close = false;
			this.gzip_id_bytes_read = 0;
		}
		Zlib.prototype.close = function() {
			if (this.write_in_progress) {
				this.pending_close = true;
				return;
			}
			this.pending_close = false;
			assert(this.init_done, "close before init");
			assert(this.mode <= exports.UNZIP);
			if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) zlib_deflate.deflateEnd(this.strm);
			else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) zlib_inflate.inflateEnd(this.strm);
			this.mode = exports.NONE;
			this.dictionary = null;
		};
		Zlib.prototype.write = function(flush, input, in_off, in_len, out, out_off, out_len) {
			return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);
		};
		Zlib.prototype.writeSync = function(flush, input, in_off, in_len, out, out_off, out_len) {
			return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);
		};
		Zlib.prototype._write = function(async, flush, input, in_off, in_len, out, out_off, out_len) {
			assert.equal(arguments.length, 8);
			assert(this.init_done, "write before init");
			assert(this.mode !== exports.NONE, "already finalized");
			assert.equal(false, this.write_in_progress, "write already in progress");
			assert.equal(false, this.pending_close, "close is pending");
			this.write_in_progress = true;
			assert.equal(false, flush === void 0, "must provide flush value");
			this.write_in_progress = true;
			if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) throw new Error("Invalid flush value");
			if (input == null) {
				input = Buffer$1.alloc(0);
				in_len = 0;
				in_off = 0;
			}
			this.strm.avail_in = in_len;
			this.strm.input = input;
			this.strm.next_in = in_off;
			this.strm.avail_out = out_len;
			this.strm.output = out;
			this.strm.next_out = out_off;
			this.flush = flush;
			if (!async) {
				this._process();
				if (this._checkError()) return this._afterSync();
				return;
			}
			var self = this;
			process$1.nextTick(function() {
				self._process();
				self._after();
			});
			return this;
		};
		Zlib.prototype._afterSync = function() {
			var avail_out = this.strm.avail_out;
			var avail_in = this.strm.avail_in;
			this.write_in_progress = false;
			return [avail_in, avail_out];
		};
		Zlib.prototype._process = function() {
			var next_expected_header_byte = null;
			switch (this.mode) {
				case exports.DEFLATE:
				case exports.GZIP:
				case exports.DEFLATERAW:
					this.err = zlib_deflate.deflate(this.strm, this.flush);
					break;
				case exports.UNZIP:
					if (this.strm.avail_in > 0) next_expected_header_byte = this.strm.next_in;
					switch (this.gzip_id_bytes_read) {
						case 0:
							if (next_expected_header_byte === null) break;
							if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {
								this.gzip_id_bytes_read = 1;
								next_expected_header_byte++;
								if (this.strm.avail_in === 1) break;
							} else {
								this.mode = exports.INFLATE;
								break;
							}
						case 1:
							if (next_expected_header_byte === null) break;
							if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {
								this.gzip_id_bytes_read = 2;
								this.mode = exports.GUNZIP;
							} else this.mode = exports.INFLATE;
							break;
						default: throw new Error("invalid number of gzip magic number bytes read");
					}
				case exports.INFLATE:
				case exports.GUNZIP:
				case exports.INFLATERAW:
					this.err = zlib_inflate.inflate(this.strm, this.flush);
					if (this.err === exports.Z_NEED_DICT && this.dictionary) {
						this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);
						if (this.err === exports.Z_OK) this.err = zlib_inflate.inflate(this.strm, this.flush);
						else if (this.err === exports.Z_DATA_ERROR) this.err = exports.Z_NEED_DICT;
					}
					while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0) {
						this.reset();
						this.err = zlib_inflate.inflate(this.strm, this.flush);
					}
					break;
				default: throw new Error("Unknown mode " + this.mode);
			}
		};
		Zlib.prototype._checkError = function() {
			switch (this.err) {
				case exports.Z_OK:
				case exports.Z_BUF_ERROR:
					if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {
						this._error("unexpected end of file");
						return false;
					}
					break;
				case exports.Z_STREAM_END: break;
				case exports.Z_NEED_DICT:
					if (this.dictionary == null) this._error("Missing dictionary");
					else this._error("Bad dictionary");
					return false;
				default:
					this._error("Zlib error");
					return false;
			}
			return true;
		};
		Zlib.prototype._after = function() {
			if (!this._checkError()) return;
			var avail_out = this.strm.avail_out;
			var avail_in = this.strm.avail_in;
			this.write_in_progress = false;
			this.callback(avail_in, avail_out);
			if (this.pending_close) this.close();
		};
		Zlib.prototype._error = function(message) {
			if (this.strm.msg) message = this.strm.msg;
			this.onerror(message, this.err);
			this.write_in_progress = false;
			if (this.pending_close) this.close();
		};
		Zlib.prototype.init = function(windowBits, level, memLevel, strategy, dictionary) {
			assert(arguments.length === 4 || arguments.length === 5, "init(windowBits, level, memLevel, strategy, [dictionary])");
			assert(windowBits >= 8 && windowBits <= 15, "invalid windowBits");
			assert(level >= -1 && level <= 9, "invalid compression level");
			assert(memLevel >= 1 && memLevel <= 9, "invalid memlevel");
			assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, "invalid strategy");
			this._init(level, windowBits, memLevel, strategy, dictionary);
			this._setDictionary();
		};
		Zlib.prototype.params = function() {
			throw new Error("deflateParams Not supported");
		};
		Zlib.prototype.reset = function() {
			this._reset();
			this._setDictionary();
		};
		Zlib.prototype._init = function(level, windowBits, memLevel, strategy, dictionary) {
			this.level = level;
			this.windowBits = windowBits;
			this.memLevel = memLevel;
			this.strategy = strategy;
			this.flush = exports.Z_NO_FLUSH;
			this.err = exports.Z_OK;
			if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) this.windowBits += 16;
			if (this.mode === exports.UNZIP) this.windowBits += 32;
			if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) this.windowBits = -1 * this.windowBits;
			this.strm = new Zstream();
			switch (this.mode) {
				case exports.DEFLATE:
				case exports.GZIP:
				case exports.DEFLATERAW:
					this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);
					break;
				case exports.INFLATE:
				case exports.GUNZIP:
				case exports.INFLATERAW:
				case exports.UNZIP:
					this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);
					break;
				default: throw new Error("Unknown mode " + this.mode);
			}
			if (this.err !== exports.Z_OK) this._error("Init error");
			this.dictionary = dictionary;
			this.write_in_progress = false;
			this.init_done = true;
		};
		Zlib.prototype._setDictionary = function() {
			if (this.dictionary == null) return;
			this.err = exports.Z_OK;
			switch (this.mode) {
				case exports.DEFLATE:
				case exports.DEFLATERAW:
					this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);
					break;
				default: break;
			}
			if (this.err !== exports.Z_OK) this._error("Failed to set dictionary");
		};
		Zlib.prototype._reset = function() {
			this.err = exports.Z_OK;
			switch (this.mode) {
				case exports.DEFLATE:
				case exports.DEFLATERAW:
				case exports.GZIP:
					this.err = zlib_deflate.deflateReset(this.strm);
					break;
				case exports.INFLATE:
				case exports.INFLATERAW:
				case exports.GUNZIP:
					this.err = zlib_inflate.inflateReset(this.strm);
					break;
				default: break;
			}
			if (this.err !== exports.Z_OK) this._error("Failed to reset stream");
		};
		exports.Zlib = Zlib;
	}));
	//#endregion
	//#region ../../node_modules/browserify-zlib/lib/index.js
	var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist$1();
		var Buffer = require_dist().Buffer;
		var Transform = require_stream_browserify().Transform;
		var binding = require_binding();
		var util = require_util$2();
		var assert = require_assert().ok;
		var kMaxLength = require_dist().kMaxLength;
		var kRangeErrorMessage = "Cannot create final Buffer. It would be larger than 0x" + kMaxLength.toString(16) + " bytes";
		binding.Z_MIN_WINDOWBITS = 8;
		binding.Z_MAX_WINDOWBITS = 15;
		binding.Z_DEFAULT_WINDOWBITS = 15;
		binding.Z_MIN_CHUNK = 64;
		binding.Z_MAX_CHUNK = Infinity;
		binding.Z_DEFAULT_CHUNK = 16 * 1024;
		binding.Z_MIN_MEMLEVEL = 1;
		binding.Z_MAX_MEMLEVEL = 9;
		binding.Z_DEFAULT_MEMLEVEL = 8;
		binding.Z_MIN_LEVEL = -1;
		binding.Z_MAX_LEVEL = 9;
		binding.Z_DEFAULT_LEVEL = binding.Z_DEFAULT_COMPRESSION;
		var bkeys = Object.keys(binding);
		for (var bk = 0; bk < bkeys.length; bk++) {
			var bkey = bkeys[bk];
			if (bkey.match(/^Z/)) Object.defineProperty(exports, bkey, {
				enumerable: true,
				value: binding[bkey],
				writable: false
			});
		}
		var codes = {
			Z_OK: binding.Z_OK,
			Z_STREAM_END: binding.Z_STREAM_END,
			Z_NEED_DICT: binding.Z_NEED_DICT,
			Z_ERRNO: binding.Z_ERRNO,
			Z_STREAM_ERROR: binding.Z_STREAM_ERROR,
			Z_DATA_ERROR: binding.Z_DATA_ERROR,
			Z_MEM_ERROR: binding.Z_MEM_ERROR,
			Z_BUF_ERROR: binding.Z_BUF_ERROR,
			Z_VERSION_ERROR: binding.Z_VERSION_ERROR
		};
		var ckeys = Object.keys(codes);
		for (var ck = 0; ck < ckeys.length; ck++) {
			var ckey = ckeys[ck];
			codes[codes[ckey]] = ckey;
		}
		Object.defineProperty(exports, "codes", {
			enumerable: true,
			value: Object.freeze(codes),
			writable: false
		});
		exports.Deflate = Deflate;
		exports.Inflate = Inflate;
		exports.Gzip = Gzip;
		exports.Gunzip = Gunzip;
		exports.DeflateRaw = DeflateRaw;
		exports.InflateRaw = InflateRaw;
		exports.Unzip = Unzip;
		exports.createDeflate = function(o) {
			return new Deflate(o);
		};
		exports.createInflate = function(o) {
			return new Inflate(o);
		};
		exports.createDeflateRaw = function(o) {
			return new DeflateRaw(o);
		};
		exports.createInflateRaw = function(o) {
			return new InflateRaw(o);
		};
		exports.createGzip = function(o) {
			return new Gzip(o);
		};
		exports.createGunzip = function(o) {
			return new Gunzip(o);
		};
		exports.createUnzip = function(o) {
			return new Unzip(o);
		};
		exports.deflate = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new Deflate(opts), buffer, callback);
		};
		exports.deflateSync = function(buffer, opts) {
			return zlibBufferSync(new Deflate(opts), buffer);
		};
		exports.gzip = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new Gzip(opts), buffer, callback);
		};
		exports.gzipSync = function(buffer, opts) {
			return zlibBufferSync(new Gzip(opts), buffer);
		};
		exports.deflateRaw = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new DeflateRaw(opts), buffer, callback);
		};
		exports.deflateRawSync = function(buffer, opts) {
			return zlibBufferSync(new DeflateRaw(opts), buffer);
		};
		exports.unzip = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new Unzip(opts), buffer, callback);
		};
		exports.unzipSync = function(buffer, opts) {
			return zlibBufferSync(new Unzip(opts), buffer);
		};
		exports.inflate = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new Inflate(opts), buffer, callback);
		};
		exports.inflateSync = function(buffer, opts) {
			return zlibBufferSync(new Inflate(opts), buffer);
		};
		exports.gunzip = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new Gunzip(opts), buffer, callback);
		};
		exports.gunzipSync = function(buffer, opts) {
			return zlibBufferSync(new Gunzip(opts), buffer);
		};
		exports.inflateRaw = function(buffer, opts, callback) {
			if (typeof opts === "function") {
				callback = opts;
				opts = {};
			}
			return zlibBuffer(new InflateRaw(opts), buffer, callback);
		};
		exports.inflateRawSync = function(buffer, opts) {
			return zlibBufferSync(new InflateRaw(opts), buffer);
		};
		function zlibBuffer(engine, buffer, callback) {
			var buffers = [];
			var nread = 0;
			engine.on("error", onError);
			engine.on("end", onEnd);
			engine.end(buffer);
			flow();
			function flow() {
				var chunk;
				while (null !== (chunk = engine.read())) {
					buffers.push(chunk);
					nread += chunk.length;
				}
				engine.once("readable", flow);
			}
			function onError(err) {
				engine.removeListener("end", onEnd);
				engine.removeListener("readable", flow);
				callback(err);
			}
			function onEnd() {
				var buf;
				var err = null;
				if (nread >= kMaxLength) err = new RangeError(kRangeErrorMessage);
				else buf = Buffer.concat(buffers, nread);
				buffers = [];
				engine.close();
				callback(err, buf);
			}
		}
		function zlibBufferSync(engine, buffer) {
			if (typeof buffer === "string") buffer = Buffer.from(buffer);
			if (!Buffer.isBuffer(buffer)) throw new TypeError("Not a string or buffer");
			var flushFlag = engine._finishFlushFlag;
			return engine._processChunk(buffer, flushFlag);
		}
		function Deflate(opts) {
			if (!(this instanceof Deflate)) return new Deflate(opts);
			Zlib.call(this, opts, binding.DEFLATE);
		}
		function Inflate(opts) {
			if (!(this instanceof Inflate)) return new Inflate(opts);
			Zlib.call(this, opts, binding.INFLATE);
		}
		function Gzip(opts) {
			if (!(this instanceof Gzip)) return new Gzip(opts);
			Zlib.call(this, opts, binding.GZIP);
		}
		function Gunzip(opts) {
			if (!(this instanceof Gunzip)) return new Gunzip(opts);
			Zlib.call(this, opts, binding.GUNZIP);
		}
		function DeflateRaw(opts) {
			if (!(this instanceof DeflateRaw)) return new DeflateRaw(opts);
			Zlib.call(this, opts, binding.DEFLATERAW);
		}
		function InflateRaw(opts) {
			if (!(this instanceof InflateRaw)) return new InflateRaw(opts);
			Zlib.call(this, opts, binding.INFLATERAW);
		}
		function Unzip(opts) {
			if (!(this instanceof Unzip)) return new Unzip(opts);
			Zlib.call(this, opts, binding.UNZIP);
		}
		function isValidFlushFlag(flag) {
			return flag === binding.Z_NO_FLUSH || flag === binding.Z_PARTIAL_FLUSH || flag === binding.Z_SYNC_FLUSH || flag === binding.Z_FULL_FLUSH || flag === binding.Z_FINISH || flag === binding.Z_BLOCK;
		}
		function Zlib(opts, mode) {
			var _this = this;
			this._opts = opts = opts || {};
			this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;
			Transform.call(this, opts);
			if (opts.flush && !isValidFlushFlag(opts.flush)) throw new Error("Invalid flush flag: " + opts.flush);
			if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) throw new Error("Invalid flush flag: " + opts.finishFlush);
			this._flushFlag = opts.flush || binding.Z_NO_FLUSH;
			this._finishFlushFlag = typeof opts.finishFlush !== "undefined" ? opts.finishFlush : binding.Z_FINISH;
			if (opts.chunkSize) {
				if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) throw new Error("Invalid chunk size: " + opts.chunkSize);
			}
			if (opts.windowBits) {
				if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) throw new Error("Invalid windowBits: " + opts.windowBits);
			}
			if (opts.level) {
				if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) throw new Error("Invalid compression level: " + opts.level);
			}
			if (opts.memLevel) {
				if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) throw new Error("Invalid memLevel: " + opts.memLevel);
			}
			if (opts.strategy) {
				if (opts.strategy != exports.Z_FILTERED && opts.strategy != exports.Z_HUFFMAN_ONLY && opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) throw new Error("Invalid strategy: " + opts.strategy);
			}
			if (opts.dictionary) {
				if (!Buffer.isBuffer(opts.dictionary)) throw new Error("Invalid dictionary: it should be a Buffer instance");
			}
			this._handle = new binding.Zlib(mode);
			var self = this;
			this._hadError = false;
			this._handle.onerror = function(message, errno) {
				_close(self);
				self._hadError = true;
				var error = new Error(message);
				error.errno = errno;
				error.code = exports.codes[errno];
				self.emit("error", error);
			};
			var level = exports.Z_DEFAULT_COMPRESSION;
			if (typeof opts.level === "number") level = opts.level;
			var strategy = exports.Z_DEFAULT_STRATEGY;
			if (typeof opts.strategy === "number") strategy = opts.strategy;
			this._handle.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, level, opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, strategy, opts.dictionary);
			this._buffer = Buffer.allocUnsafe(this._chunkSize);
			this._offset = 0;
			this._level = level;
			this._strategy = strategy;
			this.once("end", this.close);
			Object.defineProperty(this, "_closed", {
				get: function() {
					return !_this._handle;
				},
				configurable: true,
				enumerable: true
			});
		}
		util.inherits(Zlib, Transform);
		Zlib.prototype.params = function(level, strategy, callback) {
			if (level < exports.Z_MIN_LEVEL || level > exports.Z_MAX_LEVEL) throw new RangeError("Invalid compression level: " + level);
			if (strategy != exports.Z_FILTERED && strategy != exports.Z_HUFFMAN_ONLY && strategy != exports.Z_RLE && strategy != exports.Z_FIXED && strategy != exports.Z_DEFAULT_STRATEGY) throw new TypeError("Invalid strategy: " + strategy);
			if (this._level !== level || this._strategy !== strategy) {
				var self = this;
				this.flush(binding.Z_SYNC_FLUSH, function() {
					assert(self._handle, "zlib binding closed");
					self._handle.params(level, strategy);
					if (!self._hadError) {
						self._level = level;
						self._strategy = strategy;
						if (callback) callback();
					}
				});
			} else process$1.nextTick(callback);
		};
		Zlib.prototype.reset = function() {
			assert(this._handle, "zlib binding closed");
			return this._handle.reset();
		};
		Zlib.prototype._flush = function(callback) {
			this._transform(Buffer.alloc(0), "", callback);
		};
		Zlib.prototype.flush = function(kind, callback) {
			var _this2 = this;
			var ws = this._writableState;
			if (typeof kind === "function" || kind === void 0 && !callback) {
				callback = kind;
				kind = binding.Z_FULL_FLUSH;
			}
			if (ws.ended) {
				if (callback) process$1.nextTick(callback);
			} else if (ws.ending) {
				if (callback) this.once("end", callback);
			} else if (ws.needDrain) {
				if (callback) this.once("drain", function() {
					return _this2.flush(kind, callback);
				});
			} else {
				this._flushFlag = kind;
				this.write(Buffer.alloc(0), "", callback);
			}
		};
		Zlib.prototype.close = function(callback) {
			_close(this, callback);
			process$1.nextTick(emitCloseNT, this);
		};
		function _close(engine, callback) {
			if (callback) process$1.nextTick(callback);
			if (!engine._handle) return;
			engine._handle.close();
			engine._handle = null;
		}
		function emitCloseNT(self) {
			self.emit("close");
		}
		Zlib.prototype._transform = function(chunk, encoding, cb) {
			var flushFlag;
			var ws = this._writableState;
			var last = (ws.ending || ws.ended) && (!chunk || ws.length === chunk.length);
			if (chunk !== null && !Buffer.isBuffer(chunk)) return cb(/* @__PURE__ */ new Error("invalid input"));
			if (!this._handle) return cb(/* @__PURE__ */ new Error("zlib binding closed"));
			if (last) flushFlag = this._finishFlushFlag;
			else {
				flushFlag = this._flushFlag;
				if (chunk.length >= ws.length) this._flushFlag = this._opts.flush || binding.Z_NO_FLUSH;
			}
			this._processChunk(chunk, flushFlag, cb);
		};
		Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {
			var availInBefore = chunk && chunk.length;
			var availOutBefore = this._chunkSize - this._offset;
			var inOff = 0;
			var self = this;
			var async = typeof cb === "function";
			if (!async) {
				var buffers = [];
				var nread = 0;
				var error;
				this.on("error", function(er) {
					error = er;
				});
				assert(this._handle, "zlib binding closed");
				do
					var res = this._handle.writeSync(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);
				while (!this._hadError && callback(res[0], res[1]));
				if (this._hadError) throw error;
				if (nread >= kMaxLength) {
					_close(this);
					throw new RangeError(kRangeErrorMessage);
				}
				var buf = Buffer.concat(buffers, nread);
				_close(this);
				return buf;
			}
			assert(this._handle, "zlib binding closed");
			var req = this._handle.write(flushFlag, chunk, inOff, availInBefore, this._buffer, this._offset, availOutBefore);
			req.buffer = chunk;
			req.callback = callback;
			function callback(availInAfter, availOutAfter) {
				if (this) {
					this.buffer = null;
					this.callback = null;
				}
				if (self._hadError) return;
				var have = availOutBefore - availOutAfter;
				assert(have >= 0, "have should not go down");
				if (have > 0) {
					var out = self._buffer.slice(self._offset, self._offset + have);
					self._offset += have;
					if (async) self.push(out);
					else {
						buffers.push(out);
						nread += out.length;
					}
				}
				if (availOutAfter === 0 || self._offset >= self._chunkSize) {
					availOutBefore = self._chunkSize;
					self._offset = 0;
					self._buffer = Buffer.allocUnsafe(self._chunkSize);
				}
				if (availOutAfter === 0) {
					inOff += availInBefore - availInAfter;
					availInBefore = availInAfter;
					if (!async) return true;
					var newReq = self._handle.write(flushFlag, chunk, inOff, availInBefore, self._buffer, self._offset, self._chunkSize);
					newReq.callback = callback;
					newReq.buffer = chunk;
					return;
				}
				if (!async) return false;
				cb();
			}
		};
		util.inherits(Deflate, Zlib);
		util.inherits(Inflate, Zlib);
		util.inherits(Gzip, Zlib);
		util.inherits(Gunzip, Zlib);
		util.inherits(DeflateRaw, Zlib);
		util.inherits(InflateRaw, Zlib);
		util.inherits(Unzip, Zlib);
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/methods/deflater.js
	var require_deflater = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		module.exports = function(inbuf) {
			var zlib = require_lib$1();
			var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 };
			return {
				deflate: function() {
					return zlib.deflateRawSync(inbuf, opts);
				},
				deflateAsync: function(callback) {
					var tmp = zlib.createDeflateRaw(opts), parts = [], total = 0;
					tmp.on("data", function(data) {
						parts.push(data);
						total += data.length;
					});
					tmp.on("end", function() {
						var buf = Buffer$1.alloc(total), written = 0;
						buf.fill(0);
						for (var i = 0; i < parts.length; i++) {
							var part = parts[i];
							part.copy(buf, written);
							written += part.length;
						}
						callback && callback(buf);
					});
					tmp.end(inbuf);
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/methods/inflater.js
	var require_inflater = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		init_dist$1();
		var version = +(process$1?.versions?.node ?? "").split(".")[0] || 0;
		module.exports = function(inbuf, expectedLength) {
			var zlib = require_lib$1();
			const option = version >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {};
			return {
				inflate: function() {
					return zlib.inflateRawSync(inbuf, option);
				},
				inflateAsync: function(callback) {
					var tmp = zlib.createInflateRaw(option), parts = [], total = 0;
					tmp.on("data", function(data) {
						parts.push(data);
						total += data.length;
					});
					tmp.on("end", function() {
						var buf = Buffer$1.alloc(total), written = 0;
						buf.fill(0);
						for (var i = 0; i < parts.length; i++) {
							var part = parts[i];
							part.copy(buf, written);
							written += part.length;
						}
						callback && callback(buf);
					});
					tmp.end(inbuf);
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/methods/zipcrypto.js
	var require_zipcrypto = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var { randomFillSync } = require_crypto_browserify();
		var Errors = require_errors$1();
		var crctable = new Uint32Array(256).map((t, crc) => {
			for (let j = 0; j < 8; j++) if (0 !== (crc & 1)) crc = crc >>> 1 ^ 3988292384;
			else crc >>>= 1;
			return crc >>> 0;
		});
		var uMul = (a, b) => Math.imul(a, b) >>> 0;
		var crc32update = (pCrc32, bval) => {
			return crctable[(pCrc32 ^ bval) & 255] ^ pCrc32 >>> 8;
		};
		var genSalt = () => {
			if ("function" === typeof randomFillSync) return randomFillSync(Buffer$1.alloc(12));
			else return genSalt.node();
		};
		genSalt.node = () => {
			const salt = Buffer$1.alloc(12);
			const len = salt.length;
			for (let i = 0; i < len; i++) salt[i] = Math.random() * 256 & 255;
			return salt;
		};
		var config = { genSalt };
		function Initkeys(pw) {
			const pass = Buffer$1.isBuffer(pw) ? pw : Buffer$1.from(pw);
			this.keys = new Uint32Array([
				305419896,
				591751049,
				878082192
			]);
			for (let i = 0; i < pass.length; i++) this.updateKeys(pass[i]);
		}
		Initkeys.prototype.updateKeys = function(byteValue) {
			const keys = this.keys;
			keys[0] = crc32update(keys[0], byteValue);
			keys[1] += keys[0] & 255;
			keys[1] = uMul(keys[1], 134775813) + 1;
			keys[2] = crc32update(keys[2], keys[1] >>> 24);
			return byteValue;
		};
		Initkeys.prototype.next = function() {
			const k = (this.keys[2] | 2) >>> 0;
			return uMul(k, k ^ 1) >> 8 & 255;
		};
		function make_decrypter(pwd) {
			const keys = new Initkeys(pwd);
			return function(data) {
				const result = Buffer$1.alloc(data.length);
				let pos = 0;
				for (let c of data) result[pos++] = keys.updateKeys(c ^ keys.next());
				return result;
			};
		}
		function make_encrypter(pwd) {
			const keys = new Initkeys(pwd);
			return function(data, result, pos = 0) {
				if (!result) result = Buffer$1.alloc(data.length);
				for (let c of data) {
					const k = keys.next();
					result[pos++] = c ^ k;
					keys.updateKeys(c);
				}
				return result;
			};
		}
		function decrypt(data, header, pwd) {
			if (!data || !Buffer$1.isBuffer(data) || data.length < 12) return Buffer$1.alloc(0);
			const decrypter = make_decrypter(pwd);
			const salt = decrypter(data.slice(0, 12));
			const verifyByte = (header.flags & 8) === 8 ? header.timeHighByte : header.crc >>> 24;
			if (salt[11] !== verifyByte) throw Errors.WRONG_PASSWORD();
			return decrypter(data.slice(12));
		}
		function _salter(data) {
			if (Buffer$1.isBuffer(data) && data.length >= 12) config.genSalt = function() {
				return data.slice(0, 12);
			};
			else if (data === "node") config.genSalt = genSalt.node;
			else config.genSalt = genSalt;
		}
		function encrypt(data, header, pwd, oldlike = false) {
			if (data == null) data = Buffer$1.alloc(0);
			if (!Buffer$1.isBuffer(data)) data = Buffer$1.from(data.toString());
			const encrypter = make_encrypter(pwd);
			const salt = config.genSalt();
			salt[11] = header.crc >>> 24 & 255;
			if (oldlike) salt[10] = header.crc >>> 16 & 255;
			const result = Buffer$1.alloc(data.length + 12);
			encrypter(salt, result);
			return encrypter(data, result, 12);
		}
		module.exports = {
			decrypt,
			encrypt,
			_salter
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/methods/index.js
	var require_methods = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.Deflater = require_deflater();
		exports.Inflater = require_inflater();
		exports.ZipCrypto = require_zipcrypto();
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/zipEntry.js
	var require_zipEntry = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var Utils = require_util$1(), Headers = require_headers(), Constants = Utils.Constants, Methods = require_methods();
		module.exports = function(options, input) {
			var _centralHeader = new Headers.EntryHeader(), _entryName = Buffer$1.alloc(0), _comment = Buffer$1.alloc(0), _isDirectory = false, uncompressedData = null, _extra = Buffer$1.alloc(0), _extralocal = Buffer$1.alloc(0), _efs = true;
			const opts = options;
			const decoder = typeof opts.decoder === "object" ? opts.decoder : Utils.decoder;
			_efs = decoder.hasOwnProperty("efs") ? decoder.efs : false;
			function getCompressedDataFromZip() {
				if (!input || !(input instanceof Uint8Array)) return Buffer$1.alloc(0);
				_extralocal = _centralHeader.loadLocalHeaderFromBinary(input);
				return input.slice(_centralHeader.realDataOffset, _centralHeader.realDataOffset + _centralHeader.compressedSize);
			}
			function crc32OK(data) {
				if (!_centralHeader.flags_desc) {
					if (Utils.crc32(data) !== _centralHeader.localHeader.crc) return false;
				} else {
					const descriptor = {};
					const dataEndOffset = _centralHeader.realDataOffset + _centralHeader.compressedSize;
					if (input.readUInt32LE(dataEndOffset) == Constants.LOCSIG || input.readUInt32LE(dataEndOffset) == Constants.CENSIG) throw Utils.Errors.DESCRIPTOR_NOT_EXIST();
					if (input.readUInt32LE(dataEndOffset) == Constants.EXTSIG) {
						descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC);
						descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ);
						descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN);
					} else if (input.readUInt16LE(dataEndOffset + 12) === 19280) {
						descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC - 4);
						descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ - 4);
						descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN - 4);
					} else throw Utils.Errors.DESCRIPTOR_UNKNOWN();
					if (descriptor.compressedSize !== _centralHeader.compressedSize || descriptor.size !== _centralHeader.size || descriptor.crc !== _centralHeader.crc) throw Utils.Errors.DESCRIPTOR_FAULTY();
					if (Utils.crc32(data) !== descriptor.crc) return false;
				}
				return true;
			}
			function decompress(async, callback, pass) {
				if (typeof callback === "undefined" && typeof async === "string") {
					pass = async;
					async = void 0;
				}
				if (_isDirectory) {
					if (async && callback) callback(Buffer$1.alloc(0), Utils.Errors.DIRECTORY_CONTENT_ERROR());
					return Buffer$1.alloc(0);
				}
				var compressedData = getCompressedDataFromZip();
				if (compressedData.length === 0) {
					if (async && callback) callback(compressedData);
					return compressedData;
				}
				if (_centralHeader.encrypted) {
					if ("string" !== typeof pass && !Buffer$1.isBuffer(pass)) throw Utils.Errors.INVALID_PASS_PARAM();
					compressedData = Methods.ZipCrypto.decrypt(compressedData, _centralHeader, pass);
				}
				var data = Buffer$1.alloc(_centralHeader.size);
				switch (_centralHeader.method) {
					case Utils.Constants.STORED:
						compressedData.copy(data);
						if (!crc32OK(data)) {
							if (async && callback) callback(data, Utils.Errors.BAD_CRC());
							throw Utils.Errors.BAD_CRC();
						} else {
							if (async && callback) callback(data);
							return data;
						}
					case Utils.Constants.DEFLATED:
						var inflater = new Methods.Inflater(compressedData, _centralHeader.size);
						if (!async) {
							inflater.inflate(data).copy(data, 0);
							if (!crc32OK(data)) throw Utils.Errors.BAD_CRC(`"${decoder.decode(_entryName)}"`);
							return data;
						} else inflater.inflateAsync(function(result) {
							result.copy(result, 0);
							if (callback) if (!crc32OK(result)) callback(result, Utils.Errors.BAD_CRC());
							else callback(result);
						});
						break;
					default:
						if (async && callback) callback(Buffer$1.alloc(0), Utils.Errors.UNKNOWN_METHOD());
						throw Utils.Errors.UNKNOWN_METHOD();
				}
			}
			function compress(async, callback) {
				if ((!uncompressedData || !uncompressedData.length) && Buffer$1.isBuffer(input)) {
					if (async && callback) callback(getCompressedDataFromZip());
					return getCompressedDataFromZip();
				}
				if (uncompressedData.length && !_isDirectory) {
					var compressedData;
					switch (_centralHeader.method) {
						case Utils.Constants.STORED:
							_centralHeader.compressedSize = _centralHeader.size;
							compressedData = Buffer$1.alloc(uncompressedData.length);
							uncompressedData.copy(compressedData);
							if (async && callback) callback(compressedData);
							return compressedData;
						default:
						case Utils.Constants.DEFLATED:
							var deflater = new Methods.Deflater(uncompressedData);
							if (!async) {
								var deflated = deflater.deflate();
								_centralHeader.compressedSize = deflated.length;
								return deflated;
							} else deflater.deflateAsync(function(data) {
								compressedData = Buffer$1.alloc(data.length);
								_centralHeader.compressedSize = data.length;
								data.copy(compressedData);
								callback && callback(compressedData);
							});
							deflater = null;
							break;
					}
				} else if (async && callback) callback(Buffer$1.alloc(0));
				else return Buffer$1.alloc(0);
			}
			function readUInt64LE(buffer, offset) {
				return (buffer.readUInt32LE(offset + 4) << 4) + buffer.readUInt32LE(offset);
			}
			function parseExtra(data) {
				try {
					var offset = 0;
					var signature, size, part;
					while (offset + 4 < data.length) {
						signature = data.readUInt16LE(offset);
						offset += 2;
						size = data.readUInt16LE(offset);
						offset += 2;
						part = data.slice(offset, offset + size);
						offset += size;
						if (Constants.ID_ZIP64 === signature) parseZip64ExtendedInformation(part);
					}
				} catch (error) {
					throw Utils.Errors.EXTRA_FIELD_PARSE_ERROR();
				}
			}
			function parseZip64ExtendedInformation(data) {
				var size, compressedSize, offset, diskNumStart;
				if (data.length >= Constants.EF_ZIP64_SCOMP) {
					size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);
					if (_centralHeader.size === Constants.EF_ZIP64_OR_32) _centralHeader.size = size;
				}
				if (data.length >= Constants.EF_ZIP64_RHO) {
					compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);
					if (_centralHeader.compressedSize === Constants.EF_ZIP64_OR_32) _centralHeader.compressedSize = compressedSize;
				}
				if (data.length >= Constants.EF_ZIP64_DSN) {
					offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);
					if (_centralHeader.offset === Constants.EF_ZIP64_OR_32) _centralHeader.offset = offset;
				}
				if (data.length >= Constants.EF_ZIP64_DSN + 4) {
					diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);
					if (_centralHeader.diskNumStart === Constants.EF_ZIP64_OR_16) _centralHeader.diskNumStart = diskNumStart;
				}
			}
			return {
				get entryName() {
					return decoder.decode(_entryName);
				},
				get rawEntryName() {
					return _entryName;
				},
				set entryName(val) {
					_entryName = Utils.toBuffer(val, decoder.encode);
					var lastChar = _entryName[_entryName.length - 1];
					_isDirectory = lastChar === 47 || lastChar === 92;
					_centralHeader.fileNameLength = _entryName.length;
				},
				get efs() {
					if (typeof _efs === "function") return _efs(this.entryName);
					else return _efs;
				},
				get extra() {
					return _extra;
				},
				set extra(val) {
					_extra = val;
					_centralHeader.extraLength = val.length;
					parseExtra(val);
				},
				get comment() {
					return decoder.decode(_comment);
				},
				set comment(val) {
					_comment = Utils.toBuffer(val, decoder.encode);
					_centralHeader.commentLength = _comment.length;
					if (_comment.length > 65535) throw Utils.Errors.COMMENT_TOO_LONG();
				},
				get name() {
					var n = decoder.decode(_entryName);
					return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop();
				},
				get isDirectory() {
					return _isDirectory;
				},
				getCompressedData: function() {
					return compress(false, null);
				},
				getCompressedDataAsync: function(callback) {
					compress(true, callback);
				},
				setData: function(value) {
					uncompressedData = Utils.toBuffer(value, Utils.decoder.encode);
					if (!_isDirectory && uncompressedData.length) {
						_centralHeader.size = uncompressedData.length;
						_centralHeader.method = Utils.Constants.DEFLATED;
						_centralHeader.crc = Utils.crc32(value);
						_centralHeader.changed = true;
					} else _centralHeader.method = Utils.Constants.STORED;
				},
				getData: function(pass) {
					if (_centralHeader.changed) return uncompressedData;
					else return decompress(false, null, pass);
				},
				getDataAsync: function(callback, pass) {
					if (_centralHeader.changed) callback(uncompressedData);
					else decompress(true, callback, pass);
				},
				set attr(attr) {
					_centralHeader.attr = attr;
				},
				get attr() {
					return _centralHeader.attr;
				},
				set header(data) {
					_centralHeader.loadFromBinary(data);
				},
				get header() {
					return _centralHeader;
				},
				packCentralHeader: function() {
					_centralHeader.flags_efs = this.efs;
					_centralHeader.extraLength = _extra.length;
					var header = _centralHeader.centralHeaderToBinary();
					var addpos = Utils.Constants.CENHDR;
					_entryName.copy(header, addpos);
					addpos += _entryName.length;
					_extra.copy(header, addpos);
					addpos += _centralHeader.extraLength;
					_comment.copy(header, addpos);
					return header;
				},
				packLocalHeader: function() {
					let addpos = 0;
					_centralHeader.flags_efs = this.efs;
					_centralHeader.extraLocalLength = _extralocal.length;
					const localHeaderBuf = _centralHeader.localHeaderToBinary();
					const localHeader = Buffer$1.alloc(localHeaderBuf.length + _entryName.length + _centralHeader.extraLocalLength);
					localHeaderBuf.copy(localHeader, addpos);
					addpos += localHeaderBuf.length;
					_entryName.copy(localHeader, addpos);
					addpos += _entryName.length;
					_extralocal.copy(localHeader, addpos);
					addpos += _extralocal.length;
					return localHeader;
				},
				toJSON: function() {
					const bytes = function(nr) {
						return "<" + (nr && nr.length + " bytes buffer" || "null") + ">";
					};
					return {
						entryName: this.entryName,
						name: this.name,
						comment: this.comment,
						isDirectory: this.isDirectory,
						header: _centralHeader.toJSON(),
						compressedData: bytes(input),
						data: bytes(uncompressedData)
					};
				},
				toString: function() {
					return JSON.stringify(this.toJSON(), null, "	");
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/zipFile.js
	var require_zipFile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		var ZipEntry = require_zipEntry();
		var Headers = require_headers();
		var Utils = require_util$1();
		module.exports = function(inBuffer, options) {
			var entryList = [], entryTable = {}, _comment = Buffer$1.alloc(0), mainHeader = new Headers.MainHeader(), loadedEntries = false;
			const temporary = /* @__PURE__ */ new Set();
			const opts = options;
			const { noSort, decoder } = opts;
			if (inBuffer) readMainHeader(opts.readEntries);
			else loadedEntries = true;
			function makeTemporaryFolders() {
				const foldersList = /* @__PURE__ */ new Set();
				for (const elem of Object.keys(entryTable)) {
					const elements = elem.split("/");
					elements.pop();
					if (!elements.length) continue;
					for (let i = 0; i < elements.length; i++) {
						const sub = elements.slice(0, i + 1).join("/") + "/";
						foldersList.add(sub);
					}
				}
				for (const elem of foldersList) if (!(elem in entryTable)) {
					const tempfolder = new ZipEntry(opts);
					tempfolder.entryName = elem;
					tempfolder.attr = 16;
					tempfolder.temporary = true;
					entryList.push(tempfolder);
					entryTable[tempfolder.entryName] = tempfolder;
					temporary.add(tempfolder);
				}
			}
			function readEntries() {
				loadedEntries = true;
				entryTable = {};
				if (mainHeader.diskEntries > (inBuffer.length - mainHeader.offset) / Utils.Constants.CENHDR) throw Utils.Errors.DISK_ENTRY_TOO_LARGE();
				entryList = new Array(mainHeader.diskEntries);
				var index = mainHeader.offset;
				for (var i = 0; i < entryList.length; i++) {
					var tmp = index, entry = new ZipEntry(opts, inBuffer);
					entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR);
					entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength);
					if (entry.header.extraLength) entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength);
					if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength);
					index += entry.header.centralHeaderSize;
					entryList[i] = entry;
					entryTable[entry.entryName] = entry;
				}
				temporary.clear();
				makeTemporaryFolders();
			}
			function readMainHeader(readNow) {
				var i = inBuffer.length - Utils.Constants.ENDHDR, max = Math.max(0, i - 65535), n = max, endStart = inBuffer.length, endOffset = -1, commentEnd = 0;
				if (typeof opts.trailingSpace === "boolean" ? opts.trailingSpace : false) max = 0;
				for (; i >= n; i--) {
					if (inBuffer[i] !== 80) continue;
					if (inBuffer.readUInt32LE(i) === Utils.Constants.ENDSIG) {
						endOffset = i;
						commentEnd = i;
						endStart = i + Utils.Constants.ENDHDR;
						n = i - Utils.Constants.END64HDR;
						continue;
					}
					if (inBuffer.readUInt32LE(i) === Utils.Constants.END64SIG) {
						n = max;
						continue;
					}
					if (inBuffer.readUInt32LE(i) === Utils.Constants.ZIP64SIG) {
						endOffset = i;
						endStart = i + Utils.readBigUInt64LE(inBuffer, i + Utils.Constants.ZIP64SIZE) + Utils.Constants.ZIP64LEAD;
						break;
					}
				}
				if (endOffset == -1) throw Utils.Errors.INVALID_FORMAT();
				mainHeader.loadFromBinary(inBuffer.slice(endOffset, endStart));
				if (mainHeader.commentLength) _comment = inBuffer.slice(commentEnd + Utils.Constants.ENDHDR);
				if (readNow) readEntries();
			}
			function sortEntries() {
				if (entryList.length > 1 && !noSort) entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase()));
			}
			return {
				get entries() {
					if (!loadedEntries) readEntries();
					return entryList.filter((e) => !temporary.has(e));
				},
				get comment() {
					return decoder.decode(_comment);
				},
				set comment(val) {
					_comment = Utils.toBuffer(val, decoder.encode);
					mainHeader.commentLength = _comment.length;
				},
				getEntryCount: function() {
					if (!loadedEntries) return mainHeader.diskEntries;
					return entryList.length;
				},
				forEach: function(callback) {
					this.entries.forEach(callback);
				},
				getEntry: function(entryName) {
					if (!loadedEntries) readEntries();
					return entryTable[entryName] || null;
				},
				setEntry: function(entry) {
					if (!loadedEntries) readEntries();
					entryList.push(entry);
					entryTable[entry.entryName] = entry;
					mainHeader.totalEntries = entryList.length;
				},
				deleteFile: function(entryName, withsubfolders = true) {
					if (!loadedEntries) readEntries();
					const entry = entryTable[entryName];
					this.getEntryChildren(entry, withsubfolders).map((child) => child.entryName).forEach(this.deleteEntry);
				},
				deleteEntry: function(entryName) {
					if (!loadedEntries) readEntries();
					const entry = entryTable[entryName];
					const index = entryList.indexOf(entry);
					if (index >= 0) {
						entryList.splice(index, 1);
						delete entryTable[entryName];
						mainHeader.totalEntries = entryList.length;
					}
				},
				getEntryChildren: function(entry, subfolders = true) {
					if (!loadedEntries) readEntries();
					if (typeof entry === "object") if (entry.isDirectory && subfolders) {
						const list = [];
						const name = entry.entryName;
						for (const zipEntry of entryList) if (zipEntry.entryName.startsWith(name)) list.push(zipEntry);
						return list;
					} else return [entry];
					return [];
				},
				getChildCount: function(entry) {
					if (entry && entry.isDirectory) {
						const list = this.getEntryChildren(entry);
						return list.includes(entry) ? list.length - 1 : list.length;
					}
					return 0;
				},
				compressToBuffer: function() {
					if (!loadedEntries) readEntries();
					sortEntries();
					const dataBlock = [];
					const headerBlocks = [];
					let totalSize = 0;
					let dindex = 0;
					mainHeader.size = 0;
					mainHeader.offset = 0;
					let totalEntries = 0;
					for (const entry of this.entries) {
						const compressedData = entry.getCompressedData();
						entry.header.offset = dindex;
						const localHeader = entry.packLocalHeader();
						const dataLength = localHeader.length + compressedData.length;
						dindex += dataLength;
						dataBlock.push(localHeader);
						dataBlock.push(compressedData);
						const centralHeader = entry.packCentralHeader();
						headerBlocks.push(centralHeader);
						mainHeader.size += centralHeader.length;
						totalSize += dataLength + centralHeader.length;
						totalEntries++;
					}
					totalSize += mainHeader.mainHeaderSize;
					mainHeader.offset = dindex;
					mainHeader.totalEntries = totalEntries;
					dindex = 0;
					const outBuffer = Buffer$1.alloc(totalSize);
					for (const content of dataBlock) {
						content.copy(outBuffer, dindex);
						dindex += content.length;
					}
					for (const content of headerBlocks) {
						content.copy(outBuffer, dindex);
						dindex += content.length;
					}
					const mh = mainHeader.toBinary();
					if (_comment) _comment.copy(mh, Utils.Constants.ENDHDR);
					mh.copy(outBuffer, dindex);
					inBuffer = outBuffer;
					loadedEntries = false;
					return outBuffer;
				},
				toAsyncBuffer: function(onSuccess, onFail, onItemStart, onItemEnd) {
					try {
						if (!loadedEntries) readEntries();
						sortEntries();
						const dataBlock = [];
						const centralHeaders = [];
						let totalSize = 0;
						let dindex = 0;
						let totalEntries = 0;
						mainHeader.size = 0;
						mainHeader.offset = 0;
						const compress2Buffer = function(entryLists) {
							if (entryLists.length > 0) {
								const entry = entryLists.shift();
								const name = entry.entryName + entry.extra.toString();
								if (onItemStart) onItemStart(name);
								entry.getCompressedDataAsync(function(compressedData) {
									if (onItemEnd) onItemEnd(name);
									entry.header.offset = dindex;
									const localHeader = entry.packLocalHeader();
									const dataLength = localHeader.length + compressedData.length;
									dindex += dataLength;
									dataBlock.push(localHeader);
									dataBlock.push(compressedData);
									const centalHeader = entry.packCentralHeader();
									centralHeaders.push(centalHeader);
									mainHeader.size += centalHeader.length;
									totalSize += dataLength + centalHeader.length;
									totalEntries++;
									compress2Buffer(entryLists);
								});
							} else {
								totalSize += mainHeader.mainHeaderSize;
								mainHeader.offset = dindex;
								mainHeader.totalEntries = totalEntries;
								dindex = 0;
								const outBuffer = Buffer$1.alloc(totalSize);
								dataBlock.forEach(function(content) {
									content.copy(outBuffer, dindex);
									dindex += content.length;
								});
								centralHeaders.forEach(function(content) {
									content.copy(outBuffer, dindex);
									dindex += content.length;
								});
								const mh = mainHeader.toBinary();
								if (_comment) _comment.copy(mh, Utils.Constants.ENDHDR);
								mh.copy(outBuffer, dindex);
								inBuffer = outBuffer;
								loadedEntries = false;
								onSuccess(outBuffer);
							}
						};
						compress2Buffer(Array.from(this.entries));
					} catch (e) {
						onFail(e);
					}
				}
			};
		};
	}));
	//#endregion
	//#region ../../node_modules/adm-zip/adm-zip.js
	var require_adm_zip = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist();
		init_dist$1();
		var Utils = require_util$1();
		var pth = require_path_browserify();
		var ZipEntry = require_zipEntry();
		var ZipFile = require_zipFile();
		var get_Bool = (...val) => Utils.findLast(val, (c) => typeof c === "boolean");
		var get_Str = (...val) => Utils.findLast(val, (c) => typeof c === "string");
		var get_Fun = (...val) => Utils.findLast(val, (c) => typeof c === "function");
		var defaultOptions = {
			noSort: false,
			readEntries: false,
			method: Utils.Constants.NONE,
			fs: null
		};
		module.exports = function(input, options) {
			let inBuffer = null;
			const opts = Object.assign(Object.create(null), defaultOptions);
			if (input && "object" === typeof input) {
				if (!(input instanceof Uint8Array)) {
					Object.assign(opts, input);
					input = opts.input ? opts.input : void 0;
					if (opts.input) delete opts.input;
				}
				if (Buffer$1.isBuffer(input)) {
					inBuffer = input;
					opts.method = Utils.Constants.BUFFER;
					input = void 0;
				}
			}
			Object.assign(opts, options);
			const filetools = new Utils(opts);
			if (typeof opts.decoder !== "object" || typeof opts.decoder.encode !== "function" || typeof opts.decoder.decode !== "function") opts.decoder = Utils.decoder;
			if (input && "string" === typeof input) if (filetools.fs.existsSync(input)) {
				opts.method = Utils.Constants.FILE;
				opts.filename = input;
				inBuffer = filetools.fs.readFileSync(input);
			} else throw Utils.Errors.INVALID_FILENAME();
			const _zip = new ZipFile(inBuffer, opts);
			const { canonical, sanitize, zipnamefix } = Utils;
			function getEntry(entry) {
				if (entry && _zip) {
					var item;
					if (typeof entry === "string") item = _zip.getEntry(pth.posix.normalize(entry));
					if (typeof entry === "object" && typeof entry.entryName !== "undefined" && typeof entry.header !== "undefined") item = _zip.getEntry(entry.entryName);
					if (item) return item;
				}
				return null;
			}
			function fixPath(zipPath) {
				const { join, normalize, sep } = pth.posix;
				return join(".", normalize(sep + zipPath.split("\\").join(sep) + sep));
			}
			function filenameFilter(filterfn) {
				if (filterfn instanceof RegExp) return (function(rx) {
					return function(filename) {
						return rx.test(filename);
					};
				})(filterfn);
				else if ("function" !== typeof filterfn) return () => true;
				return filterfn;
			}
			const relativePath = (local, entry) => {
				let lastChar = entry.slice(-1);
				lastChar = lastChar === filetools.sep ? filetools.sep : "";
				return pth.relative(local, entry) + lastChar;
			};
			return {
				readFile: function(entry, pass) {
					var item = getEntry(entry);
					return item && item.getData(pass) || null;
				},
				childCount: function(entry) {
					const item = getEntry(entry);
					if (item) return _zip.getChildCount(item);
				},
				readFileAsync: function(entry, callback) {
					var item = getEntry(entry);
					if (item) item.getDataAsync(callback);
					else callback(null, "getEntry failed for:" + entry);
				},
				readAsText: function(entry, encoding) {
					var item = getEntry(entry);
					if (item) {
						var data = item.getData();
						if (data && data.length) return data.toString(encoding || "utf8");
					}
					return "";
				},
				readAsTextAsync: function(entry, callback, encoding) {
					var item = getEntry(entry);
					if (item) item.getDataAsync(function(data, err) {
						if (err) {
							callback(data, err);
							return;
						}
						if (data && data.length) callback(data.toString(encoding || "utf8"));
						else callback("");
					});
					else callback("");
				},
				deleteFile: function(entry, withsubfolders = true) {
					var item = getEntry(entry);
					if (item) _zip.deleteFile(item.entryName, withsubfolders);
				},
				deleteEntry: function(entry) {
					var item = getEntry(entry);
					if (item) _zip.deleteEntry(item.entryName);
				},
				addZipComment: function(comment) {
					_zip.comment = comment;
				},
				getZipComment: function() {
					return _zip.comment || "";
				},
				addZipEntryComment: function(entry, comment) {
					var item = getEntry(entry);
					if (item) item.comment = comment;
				},
				getZipEntryComment: function(entry) {
					var item = getEntry(entry);
					if (item) return item.comment || "";
					return "";
				},
				updateFile: function(entry, content) {
					var item = getEntry(entry);
					if (item) item.setData(content);
				},
				addLocalFile: function(localPath, zipPath, zipName, comment) {
					if (filetools.fs.existsSync(localPath)) {
						zipPath = zipPath ? fixPath(zipPath) : "";
						const p = pth.win32.basename(pth.win32.normalize(localPath));
						zipPath += zipName ? zipName : p;
						const _attr = filetools.fs.statSync(localPath);
						const data = _attr.isFile() ? filetools.fs.readFileSync(localPath) : Buffer$1.alloc(0);
						if (_attr.isDirectory()) zipPath += filetools.sep;
						this.addFile(zipPath, data, comment, _attr);
					} else throw Utils.Errors.FILE_NOT_FOUND(localPath);
				},
				addLocalFileAsync: function(options, callback) {
					options = typeof options === "object" ? options : { localPath: options };
					const localPath = pth.resolve(options.localPath);
					const { comment } = options;
					let { zipPath, zipName } = options;
					const self = this;
					filetools.fs.stat(localPath, function(err, stats) {
						if (err) return callback(err, false);
						zipPath = zipPath ? fixPath(zipPath) : "";
						const p = pth.win32.basename(pth.win32.normalize(localPath));
						zipPath += zipName ? zipName : p;
						if (stats.isFile()) filetools.fs.readFile(localPath, function(err, data) {
							if (err) return callback(err, false);
							self.addFile(zipPath, data, comment, stats);
							return setImmediate(callback, void 0, true);
						});
						else if (stats.isDirectory()) {
							zipPath += filetools.sep;
							self.addFile(zipPath, Buffer$1.alloc(0), comment, stats);
							return setImmediate(callback, void 0, true);
						}
					});
				},
				addLocalFolder: function(localPath, zipPath, filter) {
					filter = filenameFilter(filter);
					zipPath = zipPath ? fixPath(zipPath) : "";
					localPath = pth.normalize(localPath);
					if (filetools.fs.existsSync(localPath)) {
						const items = filetools.findFiles(localPath);
						const self = this;
						if (items.length) for (const filepath of items) {
							const p = pth.join(zipPath, relativePath(localPath, filepath));
							if (filter(p)) self.addLocalFile(filepath, pth.dirname(p));
						}
					} else throw Utils.Errors.FILE_NOT_FOUND(localPath);
				},
				addLocalFolderAsync: function(localPath, callback, zipPath, filter) {
					filter = filenameFilter(filter);
					zipPath = zipPath ? fixPath(zipPath) : "";
					localPath = pth.normalize(localPath);
					var self = this;
					filetools.fs.open(localPath, "r", function(err) {
						if (err && err.code === "ENOENT") callback(void 0, Utils.Errors.FILE_NOT_FOUND(localPath));
						else if (err) callback(void 0, err);
						else {
							var items = filetools.findFiles(localPath);
							var i = -1;
							var next = function() {
								i += 1;
								if (i < items.length) {
									var filepath = items[i];
									var p = relativePath(localPath, filepath).split("\\").join("/");
									p = p.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, "");
									if (filter(p)) filetools.fs.stat(filepath, function(er0, stats) {
										if (er0) callback(void 0, er0);
										if (stats.isFile()) filetools.fs.readFile(filepath, function(er1, data) {
											if (er1) callback(void 0, er1);
											else {
												self.addFile(zipPath + p, data, "", stats);
												next();
											}
										});
										else {
											self.addFile(zipPath + p + "/", Buffer$1.alloc(0), "", stats);
											next();
										}
									});
									else process$1.nextTick(() => {
										next();
									});
								} else callback(true, void 0);
							};
							next();
						}
					});
				},
				addLocalFolderAsync2: function(options, callback) {
					const self = this;
					options = typeof options === "object" ? options : { localPath: options };
					localPath = pth.resolve(fixPath(options.localPath));
					let { zipPath, filter, namefix } = options;
					if (filter instanceof RegExp) filter = (function(rx) {
						return function(filename) {
							return rx.test(filename);
						};
					})(filter);
					else if ("function" !== typeof filter) filter = function() {
						return true;
					};
					zipPath = zipPath ? fixPath(zipPath) : "";
					if (namefix == "latin1") namefix = (str) => str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, "");
					if (typeof namefix !== "function") namefix = (str) => str;
					const relPathFix = (entry) => pth.join(zipPath, namefix(relativePath(localPath, entry)));
					const fileNameFix = (entry) => pth.win32.basename(pth.win32.normalize(namefix(entry)));
					filetools.fs.open(localPath, "r", function(err) {
						if (err && err.code === "ENOENT") callback(void 0, Utils.Errors.FILE_NOT_FOUND(localPath));
						else if (err) callback(void 0, err);
						else filetools.findFilesAsync(localPath, function(err, fileEntries) {
							if (err) return callback(err);
							fileEntries = fileEntries.filter((dir) => filter(relPathFix(dir)));
							if (!fileEntries.length) callback(void 0, false);
							setImmediate(fileEntries.reverse().reduce(function(next, entry) {
								return function(err, done) {
									if (err || done === false) return setImmediate(next, err, false);
									self.addLocalFileAsync({
										localPath: entry,
										zipPath: pth.dirname(relPathFix(entry)),
										zipName: fileNameFix(entry)
									}, next);
								};
							}, callback));
						});
					});
				},
				addLocalFolderPromise: function(localPath, props) {
					return new Promise((resolve, reject) => {
						this.addLocalFolderAsync2(Object.assign({ localPath }, props), (err, done) => {
							if (err) reject(err);
							if (done) resolve(this);
						});
					});
				},
				addFile: function(entryName, content, comment, attr) {
					entryName = zipnamefix(entryName);
					let entry = getEntry(entryName);
					const update = entry != null;
					if (!update) {
						entry = new ZipEntry(opts);
						entry.entryName = entryName;
					}
					entry.comment = comment || "";
					const isStat = "object" === typeof attr && attr instanceof filetools.fs.Stats;
					if (isStat) entry.header.time = attr.mtime;
					var fileattr = entry.isDirectory ? 16 : 0;
					let unix = entry.isDirectory ? 16384 : 32768;
					if (isStat) unix |= 4095 & attr.mode;
					else if ("number" === typeof attr) unix |= 4095 & attr;
					else unix |= entry.isDirectory ? 493 : 420;
					fileattr = (fileattr | unix << 16) >>> 0;
					entry.attr = fileattr;
					entry.setData(content);
					if (!update) _zip.setEntry(entry);
					return entry;
				},
				getEntries: function(password) {
					_zip.password = password;
					return _zip ? _zip.entries : [];
				},
				getEntry: function(name) {
					return getEntry(name);
				},
				getEntryCount: function() {
					return _zip.getEntryCount();
				},
				forEach: function(callback) {
					return _zip.forEach(callback);
				},
				extractEntryTo: function(entry, targetPath, maintainEntryPath, overwrite, keepOriginalPermission, outFileName) {
					overwrite = get_Bool(false, overwrite);
					keepOriginalPermission = get_Bool(false, keepOriginalPermission);
					maintainEntryPath = get_Bool(true, maintainEntryPath);
					outFileName = get_Str(keepOriginalPermission, outFileName);
					var item = getEntry(entry);
					if (!item) throw Utils.Errors.NO_ENTRY();
					var entryName = canonical(item.entryName);
					var target = sanitize(targetPath, outFileName && !item.isDirectory ? outFileName : maintainEntryPath ? entryName : pth.basename(entryName));
					if (item.isDirectory) {
						_zip.getEntryChildren(item).forEach(function(child) {
							if (child.isDirectory) return;
							var content = child.getData();
							if (!content) throw Utils.Errors.CANT_EXTRACT_FILE();
							var name = canonical(child.entryName);
							var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name));
							const fileAttr = keepOriginalPermission ? child.header.fileAttr : void 0;
							filetools.writeFileTo(childName, content, overwrite, fileAttr);
						});
						return true;
					}
					var content = item.getData(_zip.password);
					if (!content) throw Utils.Errors.CANT_EXTRACT_FILE();
					if (filetools.fs.existsSync(target) && !overwrite) throw Utils.Errors.CANT_OVERRIDE();
					const fileAttr = keepOriginalPermission ? entry.header.fileAttr : void 0;
					filetools.writeFileTo(target, content, overwrite, fileAttr);
					return true;
				},
				test: function(pass) {
					if (!_zip) return false;
					for (var entry in _zip.entries) try {
						if (entry.isDirectory) continue;
						if (!_zip.entries[entry].getData(pass)) return false;
					} catch (err) {
						return false;
					}
					return true;
				},
				extractAllTo: function(targetPath, overwrite, keepOriginalPermission, pass) {
					keepOriginalPermission = get_Bool(false, keepOriginalPermission);
					pass = get_Str(keepOriginalPermission, pass);
					overwrite = get_Bool(false, overwrite);
					if (!_zip) throw Utils.Errors.NO_ZIP();
					_zip.entries.forEach(function(entry) {
						var entryName = sanitize(targetPath, canonical(entry.entryName));
						if (entry.isDirectory) {
							filetools.makeDir(entryName);
							return;
						}
						var content = entry.getData(pass);
						if (!content) throw Utils.Errors.CANT_EXTRACT_FILE();
						const fileAttr = keepOriginalPermission ? entry.header.fileAttr : void 0;
						filetools.writeFileTo(entryName, content, overwrite, fileAttr);
						try {
							filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time);
						} catch (err) {
							throw Utils.Errors.CANT_EXTRACT_FILE();
						}
					});
				},
				extractAllToAsync: function(targetPath, overwrite, keepOriginalPermission, callback) {
					callback = get_Fun(overwrite, keepOriginalPermission, callback);
					keepOriginalPermission = get_Bool(false, keepOriginalPermission);
					overwrite = get_Bool(false, overwrite);
					if (!callback) return new Promise((resolve, reject) => {
						this.extractAllToAsync(targetPath, overwrite, keepOriginalPermission, function(err) {
							if (err) reject(err);
							else resolve(this);
						});
					});
					if (!_zip) {
						callback(Utils.Errors.NO_ZIP());
						return;
					}
					targetPath = pth.resolve(targetPath);
					const getPath = (entry) => sanitize(targetPath, pth.normalize(canonical(entry.entryName)));
					const getError = (msg, file) => /* @__PURE__ */ new Error(msg + ": \"" + file + "\"");
					const dirEntries = [];
					const fileEntries = [];
					_zip.entries.forEach((e) => {
						if (e.isDirectory) dirEntries.push(e);
						else fileEntries.push(e);
					});
					for (const entry of dirEntries) {
						const dirPath = getPath(entry);
						const dirAttr = keepOriginalPermission ? entry.header.fileAttr : void 0;
						try {
							filetools.makeDir(dirPath);
							if (dirAttr) filetools.fs.chmodSync(dirPath, dirAttr);
							filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time);
						} catch (er) {
							callback(getError("Unable to create folder", dirPath));
						}
					}
					fileEntries.reverse().reduce(function(next, entry) {
						return function(err) {
							if (err) next(err);
							else {
								const entryName = pth.normalize(canonical(entry.entryName));
								const filePath = sanitize(targetPath, entryName);
								entry.getDataAsync(function(content, err_1) {
									if (err_1) next(err_1);
									else if (!content) next(Utils.Errors.CANT_EXTRACT_FILE());
									else {
										const fileAttr = keepOriginalPermission ? entry.header.fileAttr : void 0;
										filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function(succ) {
											if (!succ) next(getError("Unable to write file", filePath));
											filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function(err_2) {
												if (err_2) next(getError("Unable to set times", filePath));
												else next();
											});
										});
									}
								});
							}
						};
					}, callback)();
				},
				writeZip: function(targetFileName, callback) {
					if (arguments.length === 1) {
						if (typeof targetFileName === "function") {
							callback = targetFileName;
							targetFileName = "";
						}
					}
					if (!targetFileName && opts.filename) targetFileName = opts.filename;
					if (!targetFileName) return;
					var zipData = _zip.compressToBuffer();
					if (zipData) {
						var ok = filetools.writeFileTo(targetFileName, zipData, true);
						if (typeof callback === "function") callback(!ok ? /* @__PURE__ */ new Error("failed") : null, "");
					}
				},
				writeZipPromise: function(targetFileName, props) {
					const { overwrite, perm } = Object.assign({ overwrite: true }, props);
					return new Promise((resolve, reject) => {
						if (!targetFileName && opts.filename) targetFileName = opts.filename;
						if (!targetFileName) reject("ADM-ZIP: ZIP File Name Missing");
						this.toBufferPromise().then((zipData) => {
							const ret = (done) => done ? resolve(done) : reject("ADM-ZIP: Wasn't able to write zip file");
							filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret);
						}, reject);
					});
				},
				toBufferPromise: function() {
					return new Promise((resolve, reject) => {
						_zip.toAsyncBuffer(resolve, reject);
					});
				},
				toBuffer: function(onSuccess, onFail, onItemStart, onItemEnd) {
					if (typeof onSuccess === "function") {
						_zip.toAsyncBuffer(onSuccess, onFail, onItemStart, onItemEnd);
						return null;
					}
					return _zip.compressToBuffer();
				}
			};
		};
	}));
	//#endregion
	//#region ../loot-core/src/server/cloud-storage.ts
	init_dist();
	var import_adm_zip = /* @__PURE__ */ __toESM(require_adm_zip());
	var UPLOAD_FREQUENCY_IN_DAYS = 7;
	async function checkHTTPStatus(res) {
		if (res.status !== 200) {
			if (res.status === 403) try {
				const text = await res.text();
				if ((JSON.parse(text)?.data)?.reason === "token-expired") {
					await removeItem("user-token");
					throw new HTTPError(403, "token-expired");
				}
			} catch (e) {
				if (e instanceof HTTPError) throw e;
			}
			return res.text().then((str) => {
				throw new HTTPError(res.status, str);
			});
		} else return res;
	}
	async function fetchJSON(...args) {
		let res = await fetch$1(...args);
		res = await checkHTTPStatus(res);
		return res.json();
	}
	async function checkKey() {
		const userToken = await getItem("user-token");
		const { cloudFileId, encryptKeyId } = getPrefs();
		let res;
		try {
			res = await post(getServer().SYNC_SERVER + "/user-get-key", {
				token: userToken,
				fileId: cloudFileId
			});
		} catch (e) {
			logger.log(e);
			return {
				valid: false,
				error: { reason: "network" }
			};
		}
		return { valid: res.id == encryptKeyId && (encryptKeyId == null || hasKey(encryptKeyId)) };
	}
	async function resetSyncState(newKeyState) {
		const userToken = await getItem("user-token");
		const { cloudFileId } = getPrefs();
		try {
			await post(getServer().SYNC_SERVER + "/reset-user-file", {
				token: userToken,
				fileId: cloudFileId
			});
		} catch (e) {
			if (e instanceof PostError) return { error: { reason: e.reason === "unauthorized" ? "unauthorized" : "network" } };
			return { error: { reason: "internal" } };
		}
		if (newKeyState) try {
			await post(getServer().SYNC_SERVER + "/user-create-key", {
				token: userToken,
				fileId: cloudFileId,
				keyId: newKeyState.key.getId(),
				keySalt: newKeyState.salt,
				testContent: newKeyState.testContent
			});
		} catch (e) {
			if (e instanceof PostError) return { error: { reason: "network" } };
			return { error: { reason: "internal" } };
		}
		return {};
	}
	async function exportBuffer() {
		const { id, budgetName } = getPrefs();
		if (!budgetName) return null;
		const budgetDir = getBudgetDir(id);
		const zipped = new import_adm_zip.default();
		await runMutator(async () => {
			const memDb = await openDatabase$1(await readFile(join$1(budgetDir, "db.sqlite"), "binary"));
			execQuery$2(memDb, `
        DELETE FROM kvcache;
        DELETE FROM kvcache_key;
      `);
			const dbContent = await exportDatabase(memDb);
			closeDatabase$1(memDb);
			const meta = JSON.parse(await readFile(join$1(budgetDir, "metadata.json")));
			meta.resetClock = true;
			const metaContent = Buffer$1.from(JSON.stringify(meta), "utf8");
			zipped.addFile("db.sqlite", Buffer$1.from(dbContent));
			zipped.addFile("metadata.json", metaContent);
		});
		return Buffer$1.from(zipped.toBuffer());
	}
	async function importBuffer(fileData, buffer) {
		let zipped, entries;
		try {
			zipped = new import_adm_zip.default(buffer);
			entries = zipped.getEntries();
		} catch {
			throw FileDownloadError("not-zip-file");
		}
		const dbEntry = entries.find((e) => e.entryName.includes("db.sqlite"));
		const metaEntry = entries.find((e) => e.entryName.includes("metadata.json"));
		if (!dbEntry || !metaEntry) throw FileDownloadError("invalid-zip-file");
		const dbContent = zipped.readFile(dbEntry);
		const metaContent = zipped.readFile(metaEntry);
		let meta;
		try {
			meta = JSON.parse(metaContent.toString("utf8"));
		} catch {
			throw FileDownloadError("invalid-meta-file");
		}
		meta = {
			...meta,
			cloudFileId: fileData.fileId,
			groupId: fileData.groupId,
			lastUploaded: currentDay(),
			encryptKeyId: fileData.encryptMeta ? fileData.encryptMeta.keyId : null
		};
		const budgetDir = getBudgetDir(meta.id);
		if (await exists$1(budgetDir)) {
			const dbFile = join$1(budgetDir, "db.sqlite");
			const metaFile = join$1(budgetDir, "metadata.json");
			if (await exists$1(dbFile)) await removeFile$1(dbFile);
			if (await exists$1(metaFile)) await removeFile$1(metaFile);
		} else await mkdir(budgetDir);
		await writeFile(join$1(budgetDir, "db.sqlite"), dbContent);
		await writeFile(join$1(budgetDir, "metadata.json"), JSON.stringify(meta));
		return { id: meta.id };
	}
	async function upload() {
		const userToken = await getItem("user-token");
		if (!userToken) throw FileUploadError("unauthorized");
		const zipContent = await exportBuffer();
		if (zipContent == null) return;
		const { id, groupId, budgetName, cloudFileId: originalCloudFileId, encryptKeyId } = getPrefs();
		let cloudFileId = originalCloudFileId;
		let uploadContent = zipContent;
		let uploadMeta = null;
		if (encryptKeyId) {
			let encrypted;
			try {
				encrypted = await encrypt(zipContent, encryptKeyId);
			} catch (e) {
				throw FileUploadError("encrypt-failure", { isMissingKey: e.message === "missing-key" });
			}
			uploadContent = encrypted.value;
			uploadMeta = encrypted.meta;
		}
		if (!cloudFileId) cloudFileId = v4();
		let res;
		try {
			res = await fetchJSON(getServer().SYNC_SERVER + "/upload-user-file", {
				method: "POST",
				headers: {
					"Content-Length": String(uploadContent.length),
					"Content-Type": "application/encrypted-file",
					"X-ACTUAL-TOKEN": userToken,
					"X-ACTUAL-FILE-ID": cloudFileId,
					"X-ACTUAL-NAME": encodeURIComponent(budgetName),
					"X-ACTUAL-FORMAT": "2",
					...uploadMeta ? { "X-ACTUAL-ENCRYPT-META": JSON.stringify(uploadMeta) } : null,
					...groupId ? { "X-ACTUAL-GROUP-ID": groupId } : null
				},
				body: uploadContent
			});
		} catch (err) {
			logger.log("Upload failure", err);
			if (err instanceof PostError) throw FileUploadError(err.reason === "unauthorized" ? "unauthorized" : err.reason || "network");
			throw FileUploadError("internal");
		}
		if (res.status === "ok") {
			if (getPrefs() && getPrefs().id === id) await savePrefs({
				lastUploaded: currentDay(),
				cloudFileId,
				groupId: res.groupId
			});
		} else throw FileUploadError("internal");
	}
	async function possiblyUpload() {
		const { cloudFileId, groupId, lastUploaded } = getPrefs();
		const threshold = lastUploaded && addDays(lastUploaded, UPLOAD_FREQUENCY_IN_DAYS);
		const currentDay$2 = currentDay();
		if (lastUploaded && currentDay$2 < threshold) return;
		if (!cloudFileId || !groupId) return;
		upload().catch(() => {});
	}
	async function removeFile(fileId) {
		const userToken = await getItem("user-token");
		await post(getServer().SYNC_SERVER + "/delete-user-file", {
			token: userToken,
			fileId
		});
	}
	async function listRemoteFiles() {
		const userToken = await getItem("user-token");
		if (!userToken) return null;
		let res;
		try {
			res = await fetchJSON(getServer().SYNC_SERVER + "/list-user-files", { headers: { "X-ACTUAL-TOKEN": userToken } });
		} catch (e) {
			logger.log("Unexpected error fetching file list from server", e);
			return null;
		}
		if (res.status === "error") {
			logger.log("Error fetching file list from server", res);
			return null;
		}
		return res.data.map((file) => ({
			...file,
			hasKey: hasKey(file.encryptKeyId)
		})).filter(Boolean);
	}
	async function download(cloudFileId) {
		const userToken = await getItem("user-token");
		const syncServer = getServer().SYNC_SERVER;
		const userFileFetch = fetch$1(`${syncServer}/download-user-file`, { headers: {
			"X-ACTUAL-TOKEN": userToken,
			"X-ACTUAL-FILE-ID": cloudFileId
		} }).then(checkHTTPStatus).then((res) => {
			if (res.arrayBuffer) return res.arrayBuffer().then((ab) => Buffer$1.from(ab));
			return res.buffer();
		}).catch((err) => {
			logger.log("Download failure", err);
			throw FileDownloadError("download-failure");
		});
		const userFileInfoFetch = fetchJSON(`${syncServer}/get-user-file-info`, { headers: {
			"X-ACTUAL-TOKEN": userToken,
			"X-ACTUAL-FILE-ID": cloudFileId
		} }).catch((err) => {
			logger.log("Error fetching file info", err);
			throw FileDownloadError("internal", { fileId: cloudFileId });
		});
		const [userFileInfoRes, userFileRes] = await Promise.all([userFileInfoFetch, userFileFetch]);
		if (userFileInfoRes.status !== "ok") {
			logger.log("Could not download file from the server. Are you sure you have the right file ID?", userFileInfoRes);
			throw FileDownloadError("internal", { fileId: cloudFileId });
		}
		const fileData = userFileInfoRes.data;
		let buffer = userFileRes;
		if (fileData.encryptMeta) try {
			buffer = await decrypt(buffer, fileData.encryptMeta);
		} catch (e) {
			throw FileDownloadError("decrypt-failure", { isMissingKey: e.message === "missing-key" });
		}
		return importBuffer(fileData, buffer);
	}
	//#endregion
	//#region ../loot-core/src/server/sync/reset.ts
	async function resetSync$1(keyState) {
		if (!keyState) {
			const { valid, error } = await checkKey();
			if (error) return { error };
			else if (!valid) return { error: { reason: "file-has-new-key" } };
		}
		const { error } = await resetSyncState(keyState);
		if (error) return { error };
		await runMutator(async () => {
			execQuery(`
      DELETE FROM messages_crdt;
      DELETE FROM messages_clock;
      DELETE FROM transactions WHERE tombstone = 1;
      DELETE FROM accounts WHERE tombstone = 1;
      DELETE FROM payees WHERE tombstone = 1;
      DELETE FROM categories WHERE tombstone = 1;
      DELETE FROM category_groups WHERE tombstone = 1;
      DELETE FROM schedules WHERE tombstone = 1;
      DELETE FROM rules WHERE tombstone = 1;
      ANALYZE;
      VACUUM;
    `);
			await loadClock();
		});
		await savePrefs({
			groupId: null,
			lastSyncedTimestamp: null,
			lastUploaded: null
		});
		if (keyState) {
			const { key } = keyState;
			const { cloudFileId } = getPrefs();
			const keys = JSON.parse(await getItem(`encrypt-keys`) || "{}");
			keys[cloudFileId] = key.serialize();
			await setItem("encrypt-keys", JSON.stringify(keys));
			await savePrefs({ encryptKeyId: key.getId() });
		}
		try {
			await upload();
		} catch (e) {
			if (e.reason) return { error: e };
			captureException(e);
			return { error: { reason: "upload-failure" } };
		} finally {
			send$1("prefs-updated");
		}
		return {};
	}
	//#endregion
	//#region ../loot-core/src/server/sync/index.ts
	init_dist$1();
	var FULL_SYNC_DELAY = 1e3;
	var SYNCING_MODE = "enabled";
	function setSyncingMode(mode) {
		const prevMode = SYNCING_MODE;
		switch (mode) {
			case "enabled":
				SYNCING_MODE = "enabled";
				break;
			case "offline":
				SYNCING_MODE = "offline";
				break;
			case "disabled":
				SYNCING_MODE = "disabled";
				break;
			case "import":
				SYNCING_MODE = "import";
				break;
			default: throw new Error("setSyncingMode: invalid mode: " + mode);
		}
		return prevMode;
	}
	function checkSyncingMode(mode) {
		switch (mode) {
			case "enabled": return SYNCING_MODE === "enabled" || SYNCING_MODE === "offline";
			case "disabled": return SYNCING_MODE === "disabled" || SYNCING_MODE === "import";
			case "offline": return SYNCING_MODE === "offline";
			case "import": return SYNCING_MODE === "import";
			default: throw new Error("checkSyncingMode: invalid mode: " + mode);
		}
	}
	function apply(msg, prev) {
		const { dataset, row, column, value } = msg;
		if (dataset === "prefs") {} else {
			let query;
			try {
				if (prev) query = {
					sql: `UPDATE ${dataset} SET ${column} = ? WHERE id = ?`,
					params: [value, row]
				};
				else query = {
					sql: `INSERT INTO ${dataset} (id, ${column}) VALUES (?, ?)`,
					params: [row, value]
				};
				runQuery(cache(query.sql), query.params);
			} catch (error) {
				throw new SyncError("invalid-schema", {
					error: {
						message: error.message,
						stack: error.stack
					},
					query
				});
			}
		}
	}
	async function fetchAll(table, ids) {
		let results = [];
		const batchSize = 100;
		for (let i = 0; i < ids.length; i += batchSize) {
			const partIds = ids.slice(i, i + batchSize);
			let sql;
			let column = `${table}.id`;
			if (table === "transactions") {
				sql = `
        SELECT t.*, c.transferId AS category
        FROM transactions t
        LEFT JOIN category_mapping c ON c.id = t.category
      `;
				column = "t.id";
			} else sql = `SELECT * FROM ${table}`;
			sql += ` WHERE `;
			sql += partIds.map(() => `${column} = ?`).join(" OR ");
			try {
				const rows = runQuery(sql, partIds, true);
				results = results.concat(rows);
			} catch (error) {
				throw new SyncError("invalid-schema", {
					error: {
						message: error.message,
						stack: error.stack
					},
					query: {
						sql,
						params: partIds
					}
				});
			}
		}
		return results;
	}
	function serializeValue(value) {
		if (value === null) return "0:";
		else if (typeof value === "number") return "N:" + value;
		else if (typeof value === "string") return "S:" + value;
		throw new Error("Unserializable value type: " + JSON.stringify(value));
	}
	function deserializeValue(value) {
		switch (value[0]) {
			case "0": return null;
			case "N": return parseFloat(value.slice(2));
			case "S": return value.slice(2);
			default:
		}
		throw new Error("Invalid type key for value: " + value);
	}
	var _syncListeners = [];
	function addSyncListener(func) {
		_syncListeners.push(func);
		return () => {
			_syncListeners = _syncListeners.filter((f) => f !== func);
		};
	}
	async function compareMessages(messages) {
		const newMessages = [];
		for (let i = 0; i < messages.length; i++) {
			const message = messages[i];
			const { dataset, row, column, timestamp } = message;
			const timestampStr = timestamp.toString();
			const res = runQuery(cache("SELECT timestamp FROM messages_crdt WHERE dataset = ? AND row = ? AND column = ? AND timestamp >= ?"), [
				dataset,
				row,
				column,
				timestampStr
			], true);
			if (res.length === 0) newMessages.push(message);
			else if (res[0].timestamp !== timestampStr) newMessages.push({
				...message,
				old: true
			});
		}
		return newMessages;
	}
	function applyMessagesForImport(messages) {
		transaction(() => {
			for (let i = 0; i < messages.length; i++) {
				const msg = messages[i];
				const { dataset } = msg;
				if (!msg.old) {
					try {
						apply(msg);
					} catch {
						apply(msg, true);
					}
					if (dataset === "prefs") throw new Error("Cannot set prefs while importing");
				}
			}
		});
	}
	var applyMessages = sequential(async (messages) => {
		if (checkSyncingMode("import")) {
			applyMessagesForImport(messages);
			return;
		} else if (checkSyncingMode("enabled")) messages = await compareMessages(messages);
		messages = [...messages].sort((m1, m2) => {
			const t1 = m1.timestamp ? m1.timestamp.toString() : "";
			const t2 = m2.timestamp ? m2.timestamp.toString() : "";
			if (t1 < t2) return -1;
			else if (t1 > t2) return 1;
			return 0;
		});
		const idsPerTable = {};
		messages.forEach((msg) => {
			if (msg.dataset === "prefs") return;
			if (idsPerTable[msg.dataset] == null) idsPerTable[msg.dataset] = [];
			idsPerTable[msg.dataset].push(msg.row);
		});
		async function fetchData() {
			const data = /* @__PURE__ */ new Map();
			for (const table of Object.keys(idsPerTable)) {
				const rows = await fetchAll(table, idsPerTable[table]);
				for (let i = 0; i < rows.length; i++) {
					const row = rows[i];
					setIn(data, [table, row.id], row);
				}
			}
			return data;
		}
		const prefsToSet = {};
		const oldData = await fetchData();
		appendMessages(messages, oldData);
		let clock;
		let currentMerkle;
		if (checkSyncingMode("enabled")) {
			clock = getClock();
			currentMerkle = clock.merkle;
		}
		if (get$2()) get$2().startCacheBarrier();
		transaction(() => {
			const added = /* @__PURE__ */ new Set();
			for (const msg of messages) {
				const { dataset, row, column, timestamp, value } = msg;
				if (!msg.old) {
					apply(msg, getIn(oldData, [dataset, row]) || added.has(dataset + row));
					if (dataset === "prefs") prefsToSet[row] = value;
					else added.add(dataset + row);
				}
				if (checkSyncingMode("enabled")) {
					runQuery(cache(`INSERT INTO messages_crdt (timestamp, dataset, row, column, value)
           VALUES (?, ?, ?, ?, ?)`), [
						timestamp.toString(),
						dataset,
						row,
						column,
						serializeValue(value)
					]);
					currentMerkle = insert$1(currentMerkle, timestamp);
				}
				if (dataset === "preferences" && row === "budgetType") setType(value);
			}
			if (checkSyncingMode("enabled")) {
				currentMerkle = prune(currentMerkle);
				runQuery(cache("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"), [serializeClock({
					...clock,
					merkle: currentMerkle
				})]);
			}
		});
		if (checkSyncingMode("enabled")) clock.merkle = currentMerkle;
		if (Object.keys(prefsToSet).length > 0) {
			savePrefs(prefsToSet, { avoidSync: true });
			send$1("prefs-updated");
		}
		const newData = await fetchData();
		if (get$2()) {
			startTransaction();
			triggerBudgetChanges(oldData, newData);
			get$2().triggerDatabaseChanges(oldData, newData);
			endTransaction();
			if (idsPerTable.transactions?.length) {
				const s = get$2();
				for (const cellName of [
					"accounts-balance",
					"onbudget-accounts-balance",
					"offbudget-accounts-balance",
					"closed-accounts-balance"
				]) {
					const fullName = resolveName("__global", cellName);
					if (s.hasCell(fullName)) s.recompute(fullName);
				}
			}
			get$2().endCacheBarrier();
		}
		_syncListeners.forEach((func) => func(oldData, newData));
		const tables = getTablesFromMessages(messages.filter((msg) => !msg.old));
		app$20.events.emit("sync", {
			type: "applied",
			tables,
			data: newData,
			prevData: oldData
		});
		return messages;
	});
	function receiveMessages(messages) {
		try {
			messages.forEach((msg) => {
				Timestamp.recv(msg.timestamp);
			});
		} catch (e) {
			if (e instanceof Timestamp.ClockDriftError) throw new SyncError("clock-drift");
			throw e;
		}
		return runMutator(() => applyMessages(messages));
	}
	async function errorHandler(e) {
		captureException(e);
		if (e instanceof SyncError) if (e.reason === "invalid-schema") app$20.events.emit("sync", {
			type: "error",
			subtype: "apply-failure",
			meta: e.meta
		});
		else app$20.events.emit("sync", {
			type: "error",
			meta: e.meta
		});
		else if (e instanceof Timestamp.ClockDriftError) app$20.events.emit("sync", {
			type: "error",
			subtype: "clock-drift",
			meta: { message: e.message }
		});
	}
	async function _sendMessages(messages) {
		try {
			await applyMessages(messages);
		} catch (e) {
			errorHandler(e);
			throw e;
		}
		await scheduleFullSync();
	}
	var IS_BATCHING = false;
	var _BATCHED = [];
	async function batchMessages(func) {
		if (IS_BATCHING) {
			await func();
			return;
		}
		IS_BATCHING = true;
		let batched = [];
		try {
			await func();
		} catch (e) {
			errorHandler(e);
			throw e;
		} finally {
			IS_BATCHING = false;
			batched = _BATCHED;
			_BATCHED = [];
		}
		if (batched.length > 0) await _sendMessages(batched);
	}
	async function sendMessages(messages) {
		if (IS_BATCHING) _BATCHED = _BATCHED.concat(messages);
		else return _sendMessages(messages);
	}
	function getMessagesSince(since) {
		return runQuery("SELECT timestamp, dataset, row, column, value FROM messages_crdt WHERE timestamp > ?", [since], true);
	}
	function clearFullSyncTimeout() {
		if (syncTimeout) {
			clearTimeout(syncTimeout);
			syncTimeout = null;
		}
	}
	var syncTimeout = null;
	function scheduleFullSync() {
		clearFullSyncTimeout();
		if (checkSyncingMode("enabled") && !checkSyncingMode("offline")) if (process$1.env.NODE_ENV === "test") return fullSync().then((res) => {
			if (isError$1(res)) throw res.error;
			return res;
		});
		else syncTimeout = setTimeout(fullSync, FULL_SYNC_DELAY);
	}
	function getTablesFromMessages(messages) {
		return messages.reduce((acc, message) => {
			const dataset = message.dataset === "schedules_next_date" ? "schedules" : message.dataset;
			if (!acc.includes(dataset)) acc.push(dataset);
			return acc;
		}, []);
	}
	async function initialFullSync() {
		const result = await fullSync();
		if (isError$1(result)) {
			await waitOnSpreadsheet();
			return result;
		}
		return {};
	}
	var fullSync = once(async function() {
		app$20.events.emit("sync", { type: "start" });
		let messages;
		try {
			messages = await _fullSync(null, 0, null);
		} catch (e) {
			logger.log(e);
			if (e instanceof SyncError) if (e.reason === "out-of-sync") {
				captureException(e);
				app$20.events.emit("sync", {
					type: "error",
					subtype: "out-of-sync",
					meta: e.meta
				});
			} else if (e.reason === "invalid-schema") app$20.events.emit("sync", {
				type: "error",
				subtype: "invalid-schema",
				meta: e.meta
			});
			else if (e.reason === "decrypt-failure" || e.reason === "encrypt-failure") app$20.events.emit("sync", {
				type: "error",
				subtype: e.reason,
				meta: e.meta
			});
			else if (e.reason === "clock-drift") app$20.events.emit("sync", {
				type: "error",
				subtype: "clock-drift",
				meta: e.meta
			});
			else app$20.events.emit("sync", {
				type: "error",
				meta: e.meta
			});
			else if (e instanceof PostError) {
				logger.log(e);
				if (e.reason === "unauthorized") {
					app$20.events.emit("sync", { type: "unauthorized" });
					setItem("readOnly", "true");
				} else if (e.reason === "network-failure") app$20.events.emit("sync", {
					type: "error",
					subtype: "network"
				});
				else app$20.events.emit("sync", {
					type: "error",
					subtype: e.reason
				});
			} else {
				captureException(e);
				app$20.events.emit("sync", { type: "error" });
			}
			return { error: {
				message: e.message,
				reason: e.reason,
				meta: e.meta
			} };
		}
		const tables = getTablesFromMessages(messages);
		app$20.events.emit("sync", {
			type: "success",
			tables,
			syncDisabled: checkSyncingMode("disabled")
		});
		return { messages };
	});
	async function _fullSync(sinceTimestamp, count, prevDiffTime) {
		const { id: currentId, cloudFileId, groupId, lastSyncedTimestamp } = getPrefs() || {};
		clearFullSyncTimeout();
		if (checkSyncingMode("disabled") || checkSyncingMode("offline") || !currentId) return [];
		const currentTime = getClock().timestamp.toString();
		const since = sinceTimestamp || lastSyncedTimestamp || new Timestamp(Date.now() - 300 * 1e3, 0, "0").toString();
		const messages = getMessagesSince(since);
		const userToken = await getItem("user-token");
		logger.info("Syncing since", since, messages.length, "(attempt: " + count + ")");
		const buffer = await encode(groupId, cloudFileId, since, messages);
		const resBuffer = await postBinary(getServer().SYNC_SERVER + "/sync", buffer, { "X-ACTUAL-TOKEN": userToken });
		if (!getPrefs() || getPrefs().groupId !== groupId) return [];
		const res = await decode(resBuffer);
		logger.info("Got messages from server", res.messages.length);
		const localTimeChanged = getClock().timestamp.toString() !== currentTime;
		let receivedMessages = [];
		if (res.messages.length > 0) receivedMessages = await receiveMessages(res.messages.map((msg) => ({
			...msg,
			value: deserializeValue(msg.value)
		})));
		const diffTime = diff(res.merkle, getClock().merkle);
		if (diffTime !== null) {
			if (count >= 10 && diffTime === prevDiffTime || count >= 100) {
				logger.info("SENT -------");
				logger.info(JSON.stringify(messages));
				logger.info("RECEIVED -------");
				logger.info(JSON.stringify(res.messages));
				const rebuiltMerkle = rebuildMerkleHash();
				logger.log(count, "messages:", messages.length, messages.length > 0 ? messages[0] : null, "res.messages:", res.messages.length, res.messages.length > 0 ? res.messages[0] : null, "clientId", getClock().timestamp.node(), "groupId", groupId, "diffTime:", diffTime, diffTime === prevDiffTime, "local clock:", getClock().timestamp.toString(), getClock().merkle.hash, "rebuilt hash:", rebuiltMerkle.numMessages, rebuiltMerkle.trie.hash, "server hash:", res.merkle.hash, "localTimeChanged:", localTimeChanged);
				if (rebuiltMerkle.trie.hash === res.merkle.hash) {
					const clocks = await all("SELECT * FROM messages_clock");
					if (clocks.length !== 1) logger.log("Bad number of clocks:", clocks.length);
					const hash = deserializeClock(clocks[0].clock).merkle.hash;
					logger.log("Merkle hash in db:", hash);
				}
				throw new SyncError("out-of-sync");
			}
			receivedMessages = receivedMessages.concat(await _fullSync(new Timestamp(diffTime, 0, "0").toString(), localTimeChanged ? 0 : count + 1, diffTime));
		} else if (getClock().timestamp.toString() !== lastSyncedTimestamp) await savePrefs({ lastSyncedTimestamp: getClock().timestamp.toString() });
		return receivedMessages;
	}
	//#endregion
	//#region ../loot-core/src/server/db/sort.ts
	var SORT_INCREMENT = 16384;
	var TRANSACTION_SORT_INCREMENT = 1024;
	function midpoint(items, to, sortIncrement = SORT_INCREMENT) {
		const below = items[to - 1];
		const above = items[to];
		if (!below) return above.sort_order / 2;
		else if (!above) return below.sort_order + sortIncrement;
		else return (below.sort_order + above.sort_order) / 2;
	}
	function shoveSortOrders(items, targetId = null, sortIncrement = SORT_INCREMENT) {
		const to = items.findIndex((item) => item.id === targetId);
		const target = items[to];
		const before = items[to - 1];
		const updates = [];
		if (!targetId || to === -1) {
			let order;
			if (items.length > 0) order = items[items.length - 1].sort_order + sortIncrement;
			else order = sortIncrement;
			return {
				updates,
				sort_order: order
			};
		} else {
			if (target.sort_order - (before ? before.sort_order : 0) <= 2) {
				let next = to;
				let order = Math.floor(items[next].sort_order) + sortIncrement;
				while (next < items.length) {
					if (order <= items[next].sort_order) break;
					updates.push({
						id: items[next].id,
						sort_order: order
					});
					next++;
					order += sortIncrement;
				}
			}
			return {
				updates,
				sort_order: midpoint(items, to, sortIncrement)
			};
		}
	}
	/**
	* Midpoint calculation for descending-ordered lists.
	* Places the new item between the target and the next item (lower sort_order).
	*
	* @param items - Array of items sorted by sort_order descending
	* @param targetIdx - Index of the target item
	* @param sortIncrement - The increment to use when no next item exists
	* @param nextIdx - Optional index of the next item (to skip movingId)
	*/
	function midpointDescending(items, targetIdx, sortIncrement = SORT_INCREMENT, nextIdx = null) {
		const target = items[targetIdx];
		const next = nextIdx === null ? items[targetIdx + 1] : items[nextIdx];
		if (!next) return target.sort_order - sortIncrement;
		else return Math.round((target.sort_order + next.sort_order) / 2);
	}
	/**
	* Calculate sort_order for placing an item after a target in a descending-ordered list.
	* Mirrors shoveSortOrders but for lists sorted by sort_order DESC (higher values first).
	*
	* Use this when:
	* - Items are displayed with highest sort_order at top
	* - You want to place an item AFTER the target (visually below it)
	* - Items need to be shoved DOWN (decreased sort_order) to make room
	*
	* @param items - Array of items sorted by sort_order descending
	* @param targetId - ID of the item to place after, or null to place at top
	* @param movingId - ID of the item being moved (skipped when shoving)
	* @param sortIncrement - The increment to use when shoving items
	* @returns Object with sort_order for the new position and updates array for shoved items
	*/
	function shoveSortOrdersDescending(items, targetId = null, movingId = null, sortIncrement = SORT_INCREMENT) {
		const updates = [];
		if (!targetId) {
			let order;
			if (items.length > 0) order = items[0].sort_order + sortIncrement;
			else order = sortIncrement;
			return {
				updates,
				sort_order: order
			};
		}
		const targetIdx = items.findIndex((item) => item.id === targetId);
		if (targetIdx === -1) return {
			updates,
			sort_order: items.length > 0 ? items[items.length - 1].sort_order - sortIncrement : sortIncrement
		};
		const target = items[targetIdx];
		const nextIdx = items.findIndex((item, idx) => idx > targetIdx && (!movingId || item.id !== movingId));
		const next = nextIdx === -1 ? null : items[nextIdx];
		if (target.sort_order - (next ? next.sort_order : 0) > 2) return {
			updates,
			sort_order: nextIdx === -1 ? target.sort_order - sortIncrement : midpointDescending(items, targetIdx, sortIncrement, nextIdx)
		};
		let newOrder = target.sort_order - sortIncrement;
		for (let i = targetIdx + 1; i < items.length; i++) {
			if (movingId && items[i].id === movingId) continue;
			if (items[i].sort_order >= newOrder) {
				updates.push({
					id: items[i].id,
					sort_order: newOrder
				});
				newOrder = newOrder - sortIncrement;
			} else break;
		}
		return {
			updates,
			sort_order: Math.round(target.sort_order - sortIncrement / 2)
		};
	}
	//#endregion
	//#region ../loot-core/src/server/db/index.ts
	var db_exports = /* @__PURE__ */ __exportAll({
		all: () => all,
		asyncTransaction: () => asyncTransaction,
		cache: () => cache,
		closeDatabase: () => closeDatabase,
		deleteAccount: () => deleteAccount,
		deleteAll: () => deleteAll,
		deleteCategory: () => deleteCategory$1,
		deleteCategoryGroup: () => deleteCategoryGroup$1,
		deletePayee: () => deletePayee,
		deleteTag: () => deleteTag$1,
		deleteTransaction: () => deleteTransaction$2,
		deleteTransferPayee: () => deleteTransferPayee,
		delete_: () => delete_,
		execQuery: () => execQuery,
		findTags: () => findTags,
		first: () => first$2,
		firstSync: () => firstSync,
		fromDateRepr: () => fromDateRepr,
		getAccount: () => getAccount,
		getAccounts: () => getAccounts$2,
		getAllTags: () => getAllTags,
		getCategories: () => getCategories$2,
		getCategoriesGrouped: () => getCategoriesGrouped,
		getCategory: () => getCategory,
		getCommonPayees: () => getCommonPayees$1,
		getDatabase: () => getDatabase,
		getDatabasePath: () => getDatabasePath,
		getOrphanedPayees: () => getOrphanedPayees$1,
		getPayee: () => getPayee$1,
		getPayeeByName: () => getPayeeByName,
		getPayees: () => getPayees$1,
		getTags: () => getTags$1,
		getTransaction: () => getTransaction,
		getTransactions: () => getTransactions$2,
		insert: () => insert,
		insertAccount: () => insertAccount,
		insertCategory: () => insertCategory,
		insertCategoryGroup: () => insertCategoryGroup,
		insertPayee: () => insertPayee,
		insertTag: () => insertTag,
		insertTransaction: () => insertTransaction,
		insertWithSchema: () => insertWithSchema,
		insertWithUUID: () => insertWithUUID,
		loadClock: () => loadClock,
		mergePayees: () => mergePayees$1,
		moveAccount: () => moveAccount$1,
		moveCategory: () => moveCategory$1,
		moveCategoryGroup: () => moveCategoryGroup$1,
		moveTransaction: () => moveTransaction$1,
		openDatabase: () => openDatabase,
		run: () => run,
		runQuery: () => runQuery,
		select: () => select,
		selectFirstWithSchema: () => selectFirstWithSchema,
		selectWithSchema: () => selectWithSchema,
		setDatabase: () => setDatabase,
		syncGetOrphanedPayees: () => syncGetOrphanedPayees,
		toDateRepr: () => toDateRepr,
		transaction: () => transaction,
		update: () => update,
		updateAccount: () => updateAccount$1,
		updateCategory: () => updateCategory$1,
		updateCategoryGroup: () => updateCategoryGroup$1,
		updatePayee: () => updatePayee,
		updateTag: () => updateTag$1,
		updateTransaction: () => updateTransaction$2,
		updateWithSchema: () => updateWithSchema
	});
	var dbPath = null;
	var db = null;
	function getDatabasePath() {
		return dbPath;
	}
	async function openDatabase(id) {
		if (db) closeDatabase$1(db);
		dbPath = join$1(getBudgetDir(id), "db.sqlite");
		setDatabase(await openDatabase$1(dbPath));
	}
	function closeDatabase() {
		if (db) {
			closeDatabase$1(db);
			setDatabase(null);
		}
	}
	function setDatabase(db_) {
		db = db_;
		resetQueryCache();
	}
	function getDatabase() {
		return db;
	}
	async function loadClock() {
		const row = await first$2("SELECT * FROM messages_clock");
		if (row) setClock(deserializeClock(row.clock));
		else {
			const clock = makeClock(new Timestamp(0, 0, makeClientId()));
			setClock(clock);
			runQuery("INSERT INTO messages_clock (id, clock) VALUES (?, ?)", [1, serializeClock(clock)]);
		}
	}
	function runQuery(sql, params, fetchAll) {
		if (fetchAll) return runQuery$1(db, sql, params, true);
		else return runQuery$1(db, sql, params, false);
	}
	function execQuery(sql) {
		execQuery$2(db, sql);
	}
	var _queryCache = new M$1({ max: 100 });
	function cache(sql) {
		const cached = _queryCache.get(sql);
		if (cached) return cached;
		const prepared = prepare(db, sql);
		_queryCache.set(sql, prepared);
		return prepared;
	}
	function resetQueryCache() {
		_queryCache = new M$1({ max: 100 });
	}
	function transaction(fn) {
		return transaction$1(db, fn);
	}
	function asyncTransaction(fn) {
		return asyncTransaction$1(db, fn);
	}
	async function all(sql, params) {
		return runQuery(sql, params, true);
	}
	async function first$2(sql, params) {
		const arr = runQuery(sql, params, true);
		return arr.length === 0 ? null : arr[0];
	}
	function firstSync(sql, params) {
		const arr = runQuery(sql, params, true);
		return arr.length === 0 ? null : arr[0];
	}
	async function run(sql, params) {
		return runQuery(sql, params);
	}
	async function select(table, id) {
		return runQuery("SELECT * FROM " + table + " WHERE id = ?", [id], true)[0];
	}
	async function update(table, params) {
		const fields = Object.keys(params).filter((k) => k !== "id");
		if (params.id == null) throw new Error("update: id is required");
		await sendMessages(fields.map((k) => {
			return {
				dataset: table,
				row: params.id,
				column: k,
				value: params[k],
				timestamp: Timestamp.send()
			};
		}));
	}
	async function insertWithUUID(table, row) {
		if (!row.id) row = {
			...row,
			id: v4()
		};
		await insert(table, row);
		return row.id;
	}
	async function insert(table, row) {
		const fields = Object.keys(row).filter((k) => k !== "id");
		if (row.id == null) throw new Error("insert: id is required");
		await sendMessages(fields.map((k) => {
			return {
				dataset: table,
				row: row.id,
				column: k,
				value: row[k],
				timestamp: Timestamp.send()
			};
		}));
	}
	async function delete_(table, id) {
		await sendMessages([{
			dataset: table,
			row: id,
			column: "tombstone",
			value: 1,
			timestamp: Timestamp.send()
		}]);
	}
	async function deleteAll(table) {
		const rows = await all(`
    SELECT id FROM ${table} WHERE tombstone = 0
  `);
		await Promise.all(rows.map(({ id }) => delete_(table, id)));
	}
	async function selectWithSchema(table, sql, params) {
		return runQuery(sql, params, true).map((row) => convertFromSelect(schema, schemaConfig, table, row)).filter(Boolean);
	}
	async function selectFirstWithSchema(table, sql, params) {
		const rows = await selectWithSchema(table, sql, params);
		return rows.length > 0 ? rows[0] : null;
	}
	function insertWithSchema(table, row) {
		if (!row.id) row = {
			...row,
			id: v4()
		};
		return insertWithUUID(table, convertForInsert(schema, schemaConfig, table, row));
	}
	function updateWithSchema(table, fields) {
		return update(table, convertForUpdate(schema, schemaConfig, table, fields));
	}
	async function getCategories$2(ids) {
		const query = `SELECT c.* FROM categories c WHERE ${ids ? `c.id IN (${toSqlQueryParameters(ids)}) AND` : ""} c.tombstone = 0 ORDER BY c.sort_order, c.id`;
		return ids ? await all(query, [...ids]) : await all(query);
	}
	async function getCategoriesGrouped(ids) {
		const categoryGroupQuery = `SELECT cg.* FROM category_groups cg WHERE ${ids ? `cg.id IN (${toSqlQueryParameters(ids)}) AND` : ""} cg.tombstone = 0
                              ORDER BY cg.is_income, cg.sort_order, cg.id`;
		const categoryQuery = `SELECT c.* FROM categories c WHERE ${ids ? `c.cat_group IN (${toSqlQueryParameters(ids)}) AND` : ""} c.tombstone = 0
                         ORDER BY c.sort_order, c.id`;
		const groups = ids ? await all(categoryGroupQuery, [...ids]) : await all(categoryGroupQuery);
		const categories = ids ? await all(categoryQuery, [...ids]) : await all(categoryQuery);
		return groups.map((group) => ({
			...group,
			categories: categories.filter((c) => c.cat_group === group.id)
		}));
	}
	async function insertCategoryGroup(group) {
		const existingGroup = await first$2(`SELECT id, name, hidden FROM category_groups WHERE UPPER(name) = ? and tombstone = 0 LIMIT 1`, [group.name.toUpperCase()]);
		if (existingGroup) throw new Error(`A ${existingGroup.hidden ? "hidden " : ""}'${existingGroup.name}' category group already exists.`);
		const lastGroup = await first$2(`
    SELECT sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1
  `);
		const sort_order = (lastGroup ? lastGroup.sort_order : 0) + SORT_INCREMENT;
		group = {
			...categoryGroupModel$1.validate(group),
			sort_order
		};
		return await insertWithUUID("category_groups", group);
	}
	async function updateCategoryGroup$1(group) {
		const existingGroup = await first$2(`SELECT id, name, hidden FROM category_groups WHERE UPPER(name) = ? AND id != ? AND tombstone = 0 LIMIT 1`, [group.name.toUpperCase(), group.id]);
		if (existingGroup) throw new Error(`A ${existingGroup.hidden ? "hidden " : ""}'${existingGroup.name}' category group already exists.`);
		group = categoryGroupModel$1.validate(group, { update: true });
		return update("category_groups", group);
	}
	async function moveCategoryGroup$1(id, targetId) {
		const { updates, sort_order } = shoveSortOrders(await all(`SELECT id, sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order, id`), targetId);
		for (const info of updates) await update("category_groups", info);
		await update("category_groups", {
			id,
			sort_order
		});
	}
	async function deleteCategoryGroup$1(group, transferId) {
		const categories = await all("SELECT * FROM categories WHERE cat_group = ?", [group.id]);
		await Promise.all(categories.map((cat) => deleteCategory$1(cat, transferId)));
		await delete_("category_groups", group.id);
	}
	async function insertCategory(category, { atEnd } = { atEnd: void 0 }) {
		let sort_order;
		let id_;
		await batchMessages(async () => {
			if (await first$2(`SELECT id FROM categories WHERE cat_group = ? and UPPER(name) = ? and tombstone = 0 LIMIT 1`, [category.cat_group, category.name.toUpperCase()])) throw new Error(`Category '${category.name}' already exists in group '${category.cat_group}'`);
			if (atEnd) {
				const lastCat = await first$2(`
        SELECT sort_order FROM categories WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1
      `);
				sort_order = (lastCat ? lastCat.sort_order : 0) + SORT_INCREMENT;
			} else {
				const categories = await all(`SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id`, [category.cat_group]);
				const { updates, sort_order: order } = shoveSortOrders(categories, categories.length > 0 ? categories[0].id : null);
				for (const info of updates) await update("categories", info);
				sort_order = order;
			}
			category = {
				...categoryModel$1.validate(category),
				sort_order
			};
			const id = await insertWithUUID("categories", category);
			await insert("category_mapping", {
				id,
				transferId: id
			});
			id_ = id;
		});
		return id_;
	}
	function updateCategory$1(category) {
		category = categoryModel$1.validate(category, { update: true });
		return update("categories", category);
	}
	async function moveCategory$1(id, groupId, targetId) {
		if (!groupId) throw new Error("moveCategory: groupId is required");
		const { updates, sort_order } = shoveSortOrders(await all(`SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id`, [groupId]), targetId);
		for (const info of updates) await update("categories", info);
		await update("categories", {
			id,
			sort_order,
			cat_group: groupId
		});
	}
	async function deleteCategory$1(category, transferId) {
		if (transferId) {
			const existingTransfers = await all("SELECT * FROM category_mapping WHERE transferId = ?", [category.id]);
			for (const mapping of existingTransfers) await update("category_mapping", {
				id: mapping.id,
				transferId
			});
			await update("category_mapping", {
				id: category.id,
				transferId
			});
		}
		return delete_("categories", category.id);
	}
	async function getPayee$1(id) {
		return first$2(`SELECT * FROM payees WHERE id = ?`, [id]);
	}
	async function getAccount(id) {
		return first$2(`SELECT * FROM accounts WHERE id = ?`, [id]);
	}
	async function getCategory(id) {
		return first$2(`SELECT * FROM categories WHERE id = ?`, [id]);
	}
	async function insertPayee(payee) {
		payee = payeeModel$1.validate(payee);
		let id;
		await batchMessages(async () => {
			id = await insertWithUUID("payees", payee);
			await insert("payee_mapping", {
				id,
				targetId: id
			});
		});
		return id;
	}
	async function deletePayee(payee) {
		const { transfer_acct } = await first$2("SELECT * FROM payees WHERE id = ?", [payee.id]);
		if (transfer_acct) return;
		return delete_("payees", payee.id);
	}
	async function deleteTransferPayee(payee) {
		return delete_("payees", payee.id);
	}
	function updatePayee(payee) {
		payee = payeeModel$1.validate(payee, { update: true });
		return update("payees", payee);
	}
	async function mergePayees$1(target, ids) {
		const payees = groupById(await all("SELECT * FROM payees"));
		if (payees[target].transfer_acct != null) return;
		ids = ids.filter((id) => payees[id].transfer_acct == null);
		await batchMessages(async () => {
			await Promise.all(ids.map(async (id) => {
				const mappings = await all("SELECT id FROM payee_mapping WHERE targetId = ?", [id]);
				await Promise.all(mappings.map((m) => update("payee_mapping", {
					id: m.id,
					targetId: target
				})));
			}));
			await Promise.all(ids.map((id) => Promise.all([update("payee_mapping", {
				id,
				targetId: target
			}), delete_("payees", id)])));
		});
	}
	function getPayees$1() {
		return all(`
    SELECT p.*, COALESCE(a.name, p.name) AS name FROM payees p
    LEFT JOIN accounts a ON (p.transfer_acct = a.id AND a.tombstone = 0)
    WHERE p.tombstone = 0 AND (p.transfer_acct IS NULL OR a.id IS NOT NULL)
    ORDER BY p.transfer_acct IS NULL DESC, p.name COLLATE NOCASE, a.offbudget, a.sort_order
  `);
	}
	function getCommonPayees$1() {
		return all(`
    SELECT     p.id as id, p.name as name, p.favorite as favorite,
      p.category as category, TRUE as common, NULL as transfer_acct,
    count(*) as c,
    max(t.date) as latest
    FROM payees p
    LEFT JOIN v_transactions_internal_alive t on t.payee == p.id
    WHERE LENGTH(p.name) > 0
    AND p.tombstone = 0
    AND t.date > ${toDateRepr(subWeeks(currentDate(), 12))}
    GROUP BY p.id
    ORDER BY c DESC ,p.transfer_acct IS NULL DESC, p.name
    COLLATE NOCASE
    LIMIT 10
  `);
	}
	var orphanedPayeesQuery = `
  SELECT p.id
  FROM payees p
    LEFT JOIN payee_mapping pm ON pm.id = p.id
    LEFT JOIN v_transactions_internal_alive t ON t.payee = pm.targetId
  WHERE p.tombstone = 0
    AND p.transfer_acct IS NULL
    AND t.id IS NULL
    AND NOT EXISTS (
      SELECT 1
      FROM rules r,
      json_each(r.conditions) as cond
      WHERE r.tombstone = 0
        AND json_extract(cond.value, '$.field') = 'description'
        AND json_extract(cond.value, '$.value') = pm.targetId
    );
`;
	function syncGetOrphanedPayees() {
		return all(orphanedPayeesQuery);
	}
	async function getOrphanedPayees$1() {
		return (await all(orphanedPayeesQuery)).map((row) => row.id);
	}
	async function getPayeeByName(name) {
		return first$2(`SELECT * FROM payees WHERE UNICODE_LOWER(name) = ? AND tombstone = 0`, [name.toLowerCase()]);
	}
	function getAccounts$2() {
		return all(`SELECT a.*, b.name as bankName, b.id as bankId FROM accounts a
       LEFT JOIN banks b ON a.bank = b.id
       WHERE a.tombstone = 0
       ORDER BY sort_order, name`);
	}
	async function insertAccount(account) {
		const { sort_order } = shoveSortOrders(await all("SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name", [account.offbudget ? 1 : 0]));
		account = accountModel$1.validate({
			...account,
			sort_order
		});
		return insertWithUUID("accounts", account);
	}
	function updateAccount$1(account) {
		account = accountModel$1.validate(account, { update: true });
		return update("accounts", account);
	}
	function deleteAccount(account) {
		return delete_("accounts", account.id);
	}
	async function moveAccount$1(id, targetId) {
		const account = await first$2("SELECT * FROM accounts WHERE id = ?", [id]);
		let accounts;
		if (account.closed) accounts = await all(`SELECT id, sort_order FROM accounts WHERE closed = 1 ORDER BY sort_order, name`);
		else accounts = await all(`SELECT id, sort_order FROM accounts WHERE tombstone = 0 AND offbudget = ? ORDER BY sort_order, name`, [account.offbudget ? 1 : 0]);
		const { updates, sort_order } = shoveSortOrders(accounts, targetId);
		await batchMessages(async () => {
			for (const info of updates) update("accounts", info);
			update("accounts", {
				id,
				sort_order
			});
		});
	}
	async function getTransaction(id) {
		return (await selectWithSchema("transactions", "SELECT * FROM v_transactions WHERE id = ?", [id]))[0];
	}
	async function getTransactions$2(accountId) {
		if (arguments.length > 1) throw new Error("`getTransactions` was given a second argument, it now only takes a single argument `accountId`");
		return selectWithSchema("transactions", "SELECT * FROM v_transactions WHERE account = ?", [accountId]);
	}
	function insertTransaction(transaction) {
		return insertWithSchema("transactions", transaction);
	}
	function updateTransaction$2(transaction) {
		return updateWithSchema("transactions", transaction);
	}
	async function deleteTransaction$2(transaction) {
		return delete_("transactions", transaction.id);
	}
	/**
	* Move a transaction to a new position within the same date.
	* Uses the same midpoint/shove algorithm as category reordering.
	*
	* @param id - The ID of the transaction to move
	* @param accountId - The account the transaction belongs to
	* @param targetId - The ID of the transaction to place AFTER, or null to place at top
	*/
	async function moveTransaction$1(id, accountId, targetId) {
		await batchMessages(async () => {
			const transaction = await getTransaction(id);
			if (!transaction) throw new Error(`Transaction not found: ${id}`);
			if (transaction.account !== accountId) throw new Error(`Transaction ${id} does not belong to account ${accountId}`);
			const dateInt = parseInt(transaction.date.replace(/-/g, ""), 10);
			const isChild = transaction.is_child && transaction.parent_id;
			const { sort_order: newSortOrder, updates } = shoveSortOrdersDescending(await all(isChild ? `SELECT vt.id, vt.sort_order
           FROM v_transactions vt
           WHERE vt.parent_id = ?
           ORDER BY sort_order DESC, id` : `SELECT vt.id, vt.sort_order
           FROM v_transactions vt
           WHERE vt.account = ?
             AND vt.date = ?
             AND vt.is_child = 0
           ORDER BY sort_order DESC, id`, isChild ? [transaction.parent_id] : [accountId, dateInt]), targetId, id, TRANSACTION_SORT_INCREMENT);
			for (const info of updates) {
				await update("transactions", info);
				if (!isChild) await moveSubtransactions(info.id, info.sort_order, accountId, dateInt);
			}
			await update("transactions", {
				id,
				sort_order: newSortOrder
			});
			if (!isChild) await moveSubtransactions(id, newSortOrder, accountId, dateInt);
		});
	}
	/**
	* Update sort_order of child/subtransactions to maintain relative ordering.
	* Children are distributed evenly between the parent's sort_order and the
	* next sibling's sort_order to avoid collisions.
	*
	* This ensures split transaction children move with their parent.
	*
	* @param parentId - The ID of the parent transaction
	* @param parentSortOrder - The sort_order of the parent transaction
	* @param accountId - The account ID to scope the next sibling lookup
	* @param txnDate - The transaction date (as integer YYYYMMDD) to scope the next sibling lookup
	*/
	async function moveSubtransactions(parentId, parentSortOrder, accountId, txnDate) {
		const subtransactions = await all("SELECT id FROM v_transactions WHERE parent_id = ? ORDER BY sort_order DESC", [parentId]);
		if (subtransactions.length === 0) return;
		const gap = parentSortOrder - ((await first$2(`SELECT sort_order FROM v_transactions
     WHERE parent_id IS NULL
       AND is_child = 0
       AND sort_order < ?
       AND account = ?
       AND date = ?
     ORDER BY sort_order DESC
     LIMIT 1`, [
			parentSortOrder,
			accountId,
			txnDate
		]))?.sort_order ?? parentSortOrder - 1024);
		for (const [index, sub] of subtransactions.entries()) {
			const newSortOrder = parentSortOrder - (index + 1) * gap / (subtransactions.length + 1);
			await update("transactions", {
				id: sub.id,
				sort_order: newSortOrder
			});
		}
	}
	function toSqlQueryParameters(params) {
		return params.map(() => "?").join(",");
	}
	function getTags$1() {
		return all(`
    SELECT id, tag, color, description
    FROM tags
    WHERE tombstone = 0
  `);
	}
	function getAllTags() {
		return all(`
    SELECT id, tag, color, description
    FROM tags
  `);
	}
	function insertTag(tag) {
		return insertWithUUID("tags", tag);
	}
	async function deleteTag$1(tag) {
		return delete_("tags", tag.id);
	}
	function updateTag$1(tag) {
		return update("tags", tag);
	}
	function findTags() {
		return all(`
      SELECT notes
      FROM transactions
      WHERE tombstone = 0 AND notes LIKE ?
    `, ["%#%"]);
	}
	//#endregion
	//#region ../loot-core/src/shared/environment.ts
	init_dist$1();
	function isPreviewEnvironment() {
		return String({}.REACT_APP_NETLIFY) === "true";
	}
	function isDevelopmentEnvironment() {
		return process$1.env.NODE_ENV === "development";
	}
	function isNonProductionEnvironment() {
		return isPreviewEnvironment() || isDevelopmentEnvironment();
	}
	//#endregion
	//#region ../loot-core/src/server/accounts/link.ts
	async function findOrCreateBank(institution, requisitionId) {
		const bank = await first$2("SELECT id, bank_id FROM banks WHERE bank_id = ?", [requisitionId]);
		if (bank) return bank;
		const bankData = {
			id: v4(),
			bank_id: requisitionId,
			name: institution.name
		};
		await insertWithUUID("banks", bankData);
		return bankData;
	}
	//#endregion
	//#region ../loot-core/src/server/accounts/payees.ts
	async function createPayee$1(description) {
		const row = await first$2(`SELECT id FROM payees WHERE UNICODE_LOWER(name) = ? AND tombstone = 0`, [description.toLowerCase()]);
		if (row) return row.id;
		else return await insertPayee({ name: description });
	}
	async function getStartingBalancePayee() {
		let category = await first$2(`
    SELECT * FROM categories
      WHERE is_income = 1 AND
      LOWER(name) = 'starting balances' AND
      tombstone = 0
  `);
		if (category === null) category = await first$2("SELECT * FROM categories WHERE is_income = 1 AND tombstone = 0");
		return {
			id: await createPayee$1("Starting Balance"),
			category: category ? category.id : null
		};
	}
	//#endregion
	//#region ../loot-core/src/server/db/mappings.ts
	var allMappings;
	var unlistenSync$1;
	async function loadMappings() {
		const categories = (await all("SELECT * FROM category_mapping")).map((r) => [r.id, r.transferId]);
		const payees = (await all("SELECT * FROM payee_mapping")).map((r) => [r.id, r.targetId]);
		allMappings = new Map(categories.concat(payees));
		if (unlistenSync$1) unlistenSync$1();
		unlistenSync$1 = addSyncListener(onApplySync$2);
	}
	function onApplySync$2(oldValues, newValues) {
		newValues.forEach((items, table) => {
			if (table.indexOf("mapping") !== -1) {
				const field = table === "category_mapping" ? "transferId" : "targetId";
				items.forEach((newValue) => {
					allMappings.set(newValue.id, newValue[field]);
				});
			}
		});
	}
	function getMappings() {
		return allMappings;
	}
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/utils.js
	var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.extend = extend;
		exports.indexOf = indexOf;
		exports.escapeExpression = escapeExpression;
		exports.isEmpty = isEmpty;
		exports.createFrame = createFrame;
		exports.blockParams = blockParams;
		exports.appendContextPath = appendContextPath;
		var escape = {
			"&": "&amp;",
			"<": "&lt;",
			">": "&gt;",
			"\"": "&quot;",
			"'": "&#x27;",
			"`": "&#x60;",
			"=": "&#x3D;"
		};
		var badChars = /[&<>"'`=]/g, possible = /[&<>"'`=]/;
		function escapeChar(chr) {
			return escape[chr];
		}
		function extend(obj) {
			for (var i = 1; i < arguments.length; i++) for (var key in arguments[i]) if (Object.prototype.hasOwnProperty.call(arguments[i], key)) obj[key] = arguments[i][key];
			return obj;
		}
		var toString = Object.prototype.toString;
		exports.toString = toString;
		var isFunction = function isFunction(value) {
			return typeof value === "function";
		};
		/* istanbul ignore next */
		if (isFunction(/x/)) exports.isFunction = isFunction = function(value) {
			return typeof value === "function" && toString.call(value) === "[object Function]";
		};
		exports.isFunction = isFunction;
		/* istanbul ignore next */
		var isArray = Array.isArray || function(value) {
			return value && typeof value === "object" ? toString.call(value) === "[object Array]" : false;
		};
		exports.isArray = isArray;
		function indexOf(array, value) {
			for (var i = 0, len = array.length; i < len; i++) if (array[i] === value) return i;
			return -1;
		}
		function escapeExpression(string) {
			if (typeof string !== "string") {
				if (string && string.toHTML) return string.toHTML();
				else if (string == null) return "";
				else if (!string) return string + "";
				string = "" + string;
			}
			if (!possible.test(string)) return string;
			return string.replace(badChars, escapeChar);
		}
		function isEmpty(value) {
			if (!value && value !== 0) return true;
			else if (isArray(value) && value.length === 0) return true;
			else return false;
		}
		function createFrame(object) {
			var frame = extend({}, object);
			frame._parent = object;
			return frame;
		}
		function blockParams(params, ids) {
			params.path = ids;
			return params;
		}
		function appendContextPath(contextPath, id) {
			return (contextPath ? contextPath + "." : "") + id;
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/exception.js
	var require_exception = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		var errorProps = [
			"description",
			"fileName",
			"lineNumber",
			"endLineNumber",
			"message",
			"name",
			"number",
			"stack"
		];
		function Exception(message, node) {
			var loc = node && node.loc, line = void 0, endLineNumber = void 0, column = void 0, endColumn = void 0;
			if (loc) {
				line = loc.start.line;
				endLineNumber = loc.end.line;
				column = loc.start.column;
				endColumn = loc.end.column;
				message += " - " + line + ":" + column;
			}
			var tmp = Error.prototype.constructor.call(this, message);
			for (var idx = 0; idx < errorProps.length; idx++) this[errorProps[idx]] = tmp[errorProps[idx]];
			/* istanbul ignore else */
			if (Error.captureStackTrace) Error.captureStackTrace(this, Exception);
			try {
				if (loc) {
					this.lineNumber = line;
					this.endLineNumber = endLineNumber;
					/* istanbul ignore next */
					if (Object.defineProperty) {
						Object.defineProperty(this, "column", {
							value: column,
							enumerable: true
						});
						Object.defineProperty(this, "endColumn", {
							value: endColumn,
							enumerable: true
						});
					} else {
						this.column = column;
						this.endColumn = endColumn;
					}
				}
			} catch (nop) {}
		}
		Exception.prototype = /* @__PURE__ */ new Error();
		exports["default"] = Exception;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js
	var require_block_helper_missing = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		var _utils = require_utils();
		exports["default"] = function(instance) {
			instance.registerHelper("blockHelperMissing", function(context, options) {
				var inverse = options.inverse, fn = options.fn;
				if (context === true) return fn(this);
				else if (context === false || context == null) return inverse(this);
				else if (_utils.isArray(context)) if (context.length > 0) {
					if (options.ids) options.ids = [options.name];
					return instance.helpers.each(context, options);
				} else return inverse(this);
				else {
					if (options.data && options.ids) {
						var data = _utils.createFrame(options.data);
						data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
						options = { data };
					}
					return fn(context, options);
				}
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/each.js
	var require_each = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _utils = require_utils();
		var _exception2 = _interopRequireDefault(require_exception());
		exports["default"] = function(instance) {
			instance.registerHelper("each", function(context, options) {
				if (!options) throw new _exception2["default"]("Must pass iterator to #each");
				var fn = options.fn, inverse = options.inverse, i = 0, ret = "", data = void 0, contextPath = void 0;
				if (options.data && options.ids) contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + ".";
				if (_utils.isFunction(context)) context = context.call(this);
				if (options.data) data = _utils.createFrame(options.data);
				function execIteration(field, index, last) {
					if (data) {
						data.key = field;
						data.index = index;
						data.first = index === 0;
						data.last = !!last;
						if (contextPath) data.contextPath = contextPath + field;
					}
					ret = ret + fn(context[field], {
						data,
						blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
					});
				}
				if (context && typeof context === "object") if (_utils.isArray(context)) {
					for (var j = context.length; i < j; i++) if (i in context) execIteration(i, i, i === context.length - 1);
				} else if (typeof Symbol === "function" && context[Symbol.iterator]) {
					var newContext = [];
					var iterator = context[Symbol.iterator]();
					for (var it = iterator.next(); !it.done; it = iterator.next()) newContext.push(it.value);
					context = newContext;
					for (var j = context.length; i < j; i++) execIteration(i, i, i === context.length - 1);
				} else (function() {
					var priorKey = void 0;
					Object.keys(context).forEach(function(key) {
						if (priorKey !== void 0) execIteration(priorKey, i - 1);
						priorKey = key;
						i++;
					});
					if (priorKey !== void 0) execIteration(priorKey, i - 1, true);
				})();
				if (i === 0) ret = inverse(this);
				return ret;
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js
	var require_helper_missing = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _exception2 = _interopRequireDefault(require_exception());
		exports["default"] = function(instance) {
			instance.registerHelper("helperMissing", function() {
				if (arguments.length === 1) return;
				else throw new _exception2["default"]("Missing helper: \"" + arguments[arguments.length - 1].name + "\"");
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/if.js
	var require_if = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _utils = require_utils();
		var _exception2 = _interopRequireDefault(require_exception());
		exports["default"] = function(instance) {
			instance.registerHelper("if", function(conditional, options) {
				if (arguments.length != 2) throw new _exception2["default"]("#if requires exactly one argument");
				if (_utils.isFunction(conditional)) conditional = conditional.call(this);
				if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) return options.inverse(this);
				else return options.fn(this);
			});
			instance.registerHelper("unless", function(conditional, options) {
				if (arguments.length != 2) throw new _exception2["default"]("#unless requires exactly one argument");
				return instance.helpers["if"].call(this, conditional, {
					fn: options.inverse,
					inverse: options.fn,
					hash: options.hash
				});
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/log.js
	var require_log = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		exports["default"] = function(instance) {
			instance.registerHelper("log", function() {
				var args = [void 0], options = arguments[arguments.length - 1];
				for (var i = 0; i < arguments.length - 1; i++) args.push(arguments[i]);
				var level = 1;
				if (options.hash.level != null) level = options.hash.level;
				else if (options.data && options.data.level != null) level = options.data.level;
				args[0] = level;
				instance.log.apply(instance, args);
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js
	var require_lookup = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		exports["default"] = function(instance) {
			instance.registerHelper("lookup", function(obj, field, options) {
				if (!obj) return obj;
				return options.lookupProperty(obj, field);
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers/with.js
	var require_with = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _utils = require_utils();
		var _exception2 = _interopRequireDefault(require_exception());
		exports["default"] = function(instance) {
			instance.registerHelper("with", function(context, options) {
				if (arguments.length != 2) throw new _exception2["default"]("#with requires exactly one argument");
				if (_utils.isFunction(context)) context = context.call(this);
				var fn = options.fn;
				if (!_utils.isEmpty(context)) {
					var data = options.data;
					if (options.data && options.ids) {
						data = _utils.createFrame(options.data);
						data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
					}
					return fn(context, {
						data,
						blockParams: _utils.blockParams([context], [data && data.contextPath])
					});
				} else return options.inverse(this);
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/helpers.js
	var require_helpers$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.registerDefaultHelpers = registerDefaultHelpers;
		exports.moveHelperToHooks = moveHelperToHooks;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _helpersBlockHelperMissing2 = _interopRequireDefault(require_block_helper_missing());
		var _helpersEach2 = _interopRequireDefault(require_each());
		var _helpersHelperMissing2 = _interopRequireDefault(require_helper_missing());
		var _helpersIf2 = _interopRequireDefault(require_if());
		var _helpersLog2 = _interopRequireDefault(require_log());
		var _helpersLookup2 = _interopRequireDefault(require_lookup());
		var _helpersWith2 = _interopRequireDefault(require_with());
		function registerDefaultHelpers(instance) {
			_helpersBlockHelperMissing2["default"](instance);
			_helpersEach2["default"](instance);
			_helpersHelperMissing2["default"](instance);
			_helpersIf2["default"](instance);
			_helpersLog2["default"](instance);
			_helpersLookup2["default"](instance);
			_helpersWith2["default"](instance);
		}
		function moveHelperToHooks(instance, helperName, keepHelper) {
			if (instance.helpers[helperName]) {
				instance.hooks[helperName] = instance.helpers[helperName];
				if (!keepHelper) instance.helpers[helperName] = void 0;
			}
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js
	var require_inline = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		var _utils = require_utils();
		exports["default"] = function(instance) {
			instance.registerDecorator("inline", function(fn, props, container, options) {
				var ret = fn;
				if (!props.partials) {
					props.partials = {};
					ret = function(context, options) {
						var original = container.partials;
						container.partials = _utils.extend({}, original, props.partials);
						var ret = fn(context, options);
						container.partials = original;
						return ret;
					};
				}
				props.partials[options.args[0]] = options.fn;
				return ret;
			});
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/decorators.js
	var require_decorators = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.registerDefaultDecorators = registerDefaultDecorators;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _decoratorsInline2 = _interopRequireDefault(require_inline());
		function registerDefaultDecorators(instance) {
			_decoratorsInline2["default"](instance);
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/logger.js
	var require_logger = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		var _utils = require_utils();
		var logger = {
			methodMap: [
				"debug",
				"info",
				"warn",
				"error"
			],
			level: "info",
			lookupLevel: function lookupLevel(level) {
				if (typeof level === "string") {
					var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
					if (levelMap >= 0) level = levelMap;
					else level = parseInt(level, 10);
				}
				return level;
			},
			log: function log(level) {
				level = logger.lookupLevel(level);
				if (typeof console !== "undefined" && logger.lookupLevel(logger.level) <= level) {
					var method = logger.methodMap[level];
					if (!console[method]) method = "log";
					for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) message[_key - 1] = arguments[_key];
					console[method].apply(console, message);
				}
			}
		};
		exports["default"] = logger;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js
	var require_proto_access = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.createProtoAccessControl = createProtoAccessControl;
		exports.resultIsAllowed = resultIsAllowed;
		exports.resetLoggedProperties = resetLoggedProperties;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _utils = require_utils();
		var _logger2 = _interopRequireDefault(require_logger());
		var loggedProperties = Object.create(null);
		function createProtoAccessControl(runtimeOptions) {
			var propertyWhiteList = Object.create(null);
			propertyWhiteList["__proto__"] = false;
			_utils.extend(propertyWhiteList, runtimeOptions.allowedProtoProperties);
			var methodWhiteList = Object.create(null);
			methodWhiteList["constructor"] = false;
			methodWhiteList["__defineGetter__"] = false;
			methodWhiteList["__defineSetter__"] = false;
			methodWhiteList["__lookupGetter__"] = false;
			methodWhiteList["__lookupSetter__"] = false;
			_utils.extend(methodWhiteList, runtimeOptions.allowedProtoMethods);
			return {
				properties: {
					whitelist: propertyWhiteList,
					defaultValue: runtimeOptions.allowProtoPropertiesByDefault
				},
				methods: {
					whitelist: methodWhiteList,
					defaultValue: runtimeOptions.allowProtoMethodsByDefault
				}
			};
		}
		function resultIsAllowed(result, protoAccessControl, propertyName) {
			if (typeof result === "function") return checkWhiteList(protoAccessControl.methods, propertyName);
			else return checkWhiteList(protoAccessControl.properties, propertyName);
		}
		function checkWhiteList(protoAccessControlForType, propertyName) {
			if (protoAccessControlForType.whitelist[propertyName] !== void 0) return protoAccessControlForType.whitelist[propertyName] === true;
			if (protoAccessControlForType.defaultValue !== void 0) return protoAccessControlForType.defaultValue;
			logUnexpecedPropertyAccessOnce(propertyName);
			return false;
		}
		function logUnexpecedPropertyAccessOnce(propertyName) {
			if (loggedProperties[propertyName] !== true) {
				loggedProperties[propertyName] = true;
				_logger2["default"].log("error", "Handlebars: Access has been denied to resolve the property \"" + propertyName + "\" because it is not an \"own property\" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details");
			}
		}
		function resetLoggedProperties() {
			Object.keys(loggedProperties).forEach(function(propertyName) {
				delete loggedProperties[propertyName];
			});
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/base.js
	var require_base$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.HandlebarsEnvironment = HandlebarsEnvironment;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _utils = require_utils();
		var _exception2 = _interopRequireDefault(require_exception());
		var _helpers = require_helpers$1();
		var _decorators = require_decorators();
		var _logger2 = _interopRequireDefault(require_logger());
		var _internalProtoAccess = require_proto_access();
		exports.VERSION = "4.7.9";
		exports.COMPILER_REVISION = 8;
		exports.LAST_COMPATIBLE_COMPILER_REVISION = 7;
		exports.REVISION_CHANGES = {
			1: "<= 1.0.rc.2",
			2: "== 1.0.0-rc.3",
			3: "== 1.0.0-rc.4",
			4: "== 1.x.x",
			5: "== 2.0.0-alpha.x",
			6: ">= 2.0.0-beta.1",
			7: ">= 4.0.0 <4.3.0",
			8: ">= 4.3.0"
		};
		var objectType = "[object Object]";
		function HandlebarsEnvironment(helpers, partials, decorators) {
			this.helpers = helpers || {};
			this.partials = partials || {};
			this.decorators = decorators || {};
			_helpers.registerDefaultHelpers(this);
			_decorators.registerDefaultDecorators(this);
		}
		HandlebarsEnvironment.prototype = {
			constructor: HandlebarsEnvironment,
			logger: _logger2["default"],
			log: _logger2["default"].log,
			registerHelper: function registerHelper(name, fn) {
				if (_utils.toString.call(name) === objectType) {
					if (fn) throw new _exception2["default"]("Arg not supported with multiple helpers");
					_utils.extend(this.helpers, name);
				} else this.helpers[name] = fn;
			},
			unregisterHelper: function unregisterHelper(name) {
				delete this.helpers[name];
			},
			registerPartial: function registerPartial(name, partial) {
				if (_utils.toString.call(name) === objectType) _utils.extend(this.partials, name);
				else {
					if (typeof partial === "undefined") throw new _exception2["default"]("Attempting to register a partial called \"" + name + "\" as undefined");
					this.partials[name] = partial;
				}
			},
			unregisterPartial: function unregisterPartial(name) {
				delete this.partials[name];
			},
			registerDecorator: function registerDecorator(name, fn) {
				if (_utils.toString.call(name) === objectType) {
					if (fn) throw new _exception2["default"]("Arg not supported with multiple decorators");
					_utils.extend(this.decorators, name);
				} else this.decorators[name] = fn;
			},
			unregisterDecorator: function unregisterDecorator(name) {
				delete this.decorators[name];
			},
			resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
				_internalProtoAccess.resetLoggedProperties();
			}
		};
		exports.log = _logger2["default"].log;
		exports.createFrame = _utils.createFrame;
		exports.logger = _logger2["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/safe-string.js
	var require_safe_string = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		function SafeString(string) {
			this.string = string;
		}
		SafeString.prototype.toString = SafeString.prototype.toHTML = function() {
			return "" + this.string;
		};
		exports["default"] = SafeString;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js
	var require_wrapHelper = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.wrapHelper = wrapHelper;
		function wrapHelper(helper, transformOptionsFn) {
			if (typeof helper !== "function") return helper;
			return function wrapper() {
				var options = arguments[arguments.length - 1];
				arguments[arguments.length - 1] = transformOptionsFn(options);
				return helper.apply(this, arguments);
			};
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/runtime.js
	var require_runtime = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.checkRevision = checkRevision;
		exports.template = template;
		exports.wrapProgram = wrapProgram;
		exports.resolvePartial = resolvePartial;
		exports.invokePartial = invokePartial;
		exports.noop = noop;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		// istanbul ignore next
		function _interopRequireWildcard(obj) {
			if (obj && obj.__esModule) return obj;
			else {
				var newObj = {};
				if (obj != null) {
					for (var key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
				}
				newObj["default"] = obj;
				return newObj;
			}
		}
		var Utils = _interopRequireWildcard(require_utils());
		var _exception2 = _interopRequireDefault(require_exception());
		var _base = require_base$1();
		var _helpers = require_helpers$1();
		var _internalWrapHelper = require_wrapHelper();
		var _internalProtoAccess = require_proto_access();
		function checkRevision(compilerInfo) {
			var compilerRevision = compilerInfo && compilerInfo[0] || 1, currentRevision = _base.COMPILER_REVISION;
			if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) return;
			if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
				var runtimeVersions = _base.REVISION_CHANGES[currentRevision], compilerVersions = _base.REVISION_CHANGES[compilerRevision];
				throw new _exception2["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + runtimeVersions + ") or downgrade your runtime to an older version (" + compilerVersions + ").");
			} else throw new _exception2["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + compilerInfo[1] + ").");
		}
		function template(templateSpec, env) {
			/* istanbul ignore next */
			if (!env) throw new _exception2["default"]("No environment passed to template");
			if (!templateSpec || !templateSpec.main) throw new _exception2["default"]("Unknown template object: " + typeof templateSpec);
			templateSpec.main.decorator = templateSpec.main_d;
			env.VM.checkRevision(templateSpec.compiler);
			var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
			function invokePartialWrapper(partial, context, options) {
				if (options.hash) {
					context = Utils.extend({}, context, options.hash);
					if (options.ids) options.ids[0] = true;
				}
				partial = env.VM.resolvePartial.call(this, partial, context, options);
				options.hooks = this.hooks;
				options.protoAccessControl = this.protoAccessControl;
				var result = env.VM.invokePartial.call(this, partial, context, options);
				if (result == null && env.compile) {
					options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
					result = options.partials[options.name](context, options);
				}
				if (result != null) {
					if (options.indent) {
						var lines = result.split("\n");
						for (var i = 0, l = lines.length; i < l; i++) {
							if (!lines[i] && i + 1 === l) break;
							lines[i] = options.indent + lines[i];
						}
						result = lines.join("\n");
					}
					return result;
				} else throw new _exception2["default"]("The partial " + options.name + " could not be compiled when running in runtime-only mode");
			}
			var container = {
				strict: function strict(obj, name, loc) {
					if (!obj || !(name in obj)) throw new _exception2["default"]("\"" + name + "\" not defined in " + obj, { loc });
					return container.lookupProperty(obj, name);
				},
				lookupProperty: function lookupProperty(parent, propertyName) {
					var result = parent[propertyName];
					if (result == null) return result;
					if (Object.prototype.hasOwnProperty.call(parent, propertyName)) return result;
					if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) return result;
				},
				lookup: function lookup(depths, name) {
					var len = depths.length;
					for (var i = 0; i < len; i++) {
						var result = depths[i] && container.lookupProperty(depths[i], name);
						if (result != null) return result;
					}
				},
				lambda: function lambda(current, context) {
					return typeof current === "function" ? current.call(context) : current;
				},
				escapeExpression: Utils.escapeExpression,
				invokePartial: invokePartialWrapper,
				fn: function fn(i) {
					var ret = templateSpec[i];
					ret.decorator = templateSpec[i + "_d"];
					return ret;
				},
				programs: [],
				program: function program(i, data, declaredBlockParams, blockParams, depths) {
					var programWrapper = this.programs[i], fn = this.fn(i);
					if (data || depths || blockParams || declaredBlockParams) programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
					else if (!programWrapper) programWrapper = this.programs[i] = wrapProgram(this, i, fn);
					return programWrapper;
				},
				data: function data(value, depth) {
					while (value && depth--) value = value._parent;
					return value;
				},
				mergeIfNeeded: function mergeIfNeeded(param, common) {
					var obj = param || common;
					if (param && common && param !== common) obj = Utils.extend({}, common, param);
					return obj;
				},
				nullContext: Object.seal({}),
				noop: env.VM.noop,
				compilerInfo: templateSpec.compiler
			};
			function ret(context) {
				var options = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
				var data = options.data;
				ret._setup(options);
				if (!options.partial && templateSpec.useData) data = initData(context, data);
				var depths = void 0, blockParams = templateSpec.useBlockParams ? [] : void 0;
				if (templateSpec.useDepths) if (options.depths) depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
				else depths = [context];
				function main(context) {
					return "" + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
				}
				main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
				return main(context, options);
			}
			ret.isTop = true;
			ret._setup = function(options) {
				if (!options.partial) {
					var mergedHelpers = {};
					addHelpers(mergedHelpers, env.helpers, container);
					addHelpers(mergedHelpers, options.helpers, container);
					container.helpers = mergedHelpers;
					if (templateSpec.usePartial) container.partials = container.mergeIfNeeded(options.partials, env.partials);
					if (templateSpec.usePartial || templateSpec.useDecorators) container.decorators = Utils.extend({}, env.decorators, options.decorators);
					container.hooks = {};
					container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
					var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
					_helpers.moveHelperToHooks(container, "helperMissing", keepHelperInHelpers);
					_helpers.moveHelperToHooks(container, "blockHelperMissing", keepHelperInHelpers);
				} else {
					container.protoAccessControl = options.protoAccessControl;
					container.helpers = options.helpers;
					container.partials = options.partials;
					container.decorators = options.decorators;
					container.hooks = options.hooks;
				}
			};
			ret._child = function(i, data, blockParams, depths) {
				if (templateSpec.useBlockParams && !blockParams) throw new _exception2["default"]("must pass block params");
				if (templateSpec.useDepths && !depths) throw new _exception2["default"]("must pass parent depths");
				return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
			};
			return ret;
		}
		function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
			function prog(context) {
				var options = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
				var currentDepths = depths;
				if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) currentDepths = [context].concat(depths);
				return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
			}
			prog = executeDecorators(fn, prog, container, depths, data, blockParams);
			prog.program = i;
			prog.depth = depths ? depths.length : 0;
			prog.blockParams = declaredBlockParams || 0;
			return prog;
		}
		/**
		* This is currently part of the official API, therefore implementation details should not be changed.
		*/
		function resolvePartial(partial, context, options) {
			if (!partial) if (options.name === "@partial-block") partial = lookupOwnProperty(options.data, "partial-block");
			else partial = lookupOwnProperty(options.partials, options.name);
			else if (!partial.call && !options.name) {
				options.name = partial;
				partial = lookupOwnProperty(options.partials, partial);
			}
			return partial;
		}
		function invokePartial(partial, context, options) {
			var currentPartialBlock = lookupOwnProperty(options.data, "partial-block");
			options.partial = true;
			if (options.ids) options.data.contextPath = options.ids[0] || options.data.contextPath;
			var partialBlock = void 0;
			if (options.fn && options.fn !== noop) (function() {
				options.data = _base.createFrame(options.data);
				var fn = options.fn;
				partialBlock = options.data["partial-block"] = function partialBlockWrapper(context) {
					var options = arguments.length <= 1 || arguments[1] === void 0 ? {} : arguments[1];
					options.data = _base.createFrame(options.data);
					options.data["partial-block"] = currentPartialBlock;
					return fn(context, options);
				};
				if (fn.partials) options.partials = Utils.extend({}, options.partials, fn.partials);
			})();
			if (partial === void 0 && partialBlock) partial = partialBlock;
			if (partial === void 0) throw new _exception2["default"]("The partial " + options.name + " could not be found");
			else if (partial instanceof Function) return partial(context, options);
		}
		function noop() {
			return "";
		}
		function lookupOwnProperty(obj, name) {
			if (obj && Object.prototype.hasOwnProperty.call(obj, name)) return obj[name];
		}
		function initData(context, data) {
			if (!data || !("root" in data)) {
				data = data ? _base.createFrame(data) : {};
				data.root = context;
			}
			return data;
		}
		function executeDecorators(fn, prog, container, depths, data, blockParams) {
			if (fn.decorator) {
				var props = {};
				prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
				Utils.extend(prog, props);
			}
			return prog;
		}
		function addHelpers(mergedHelpers, helpers, container) {
			if (!helpers) return;
			Object.keys(helpers).forEach(function(helperName) {
				var helper = helpers[helperName];
				mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
			});
		}
		function passLookupPropertyOption(helper, container) {
			var lookupProperty = container.lookupProperty;
			return _internalWrapHelper.wrapHelper(helper, function(options) {
				options.lookupProperty = lookupProperty;
				return options;
			});
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/no-conflict.js
	var require_no_conflict = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		exports["default"] = function(Handlebars) {
			/* istanbul ignore next */
			(function() {
				if (typeof globalThis === "object") return;
				Object.prototype.__defineGetter__("__magic__", function() {
					return this;
				});
				__magic__.globalThis = __magic__;
				delete Object.prototype.__magic__;
			})();
			var $Handlebars = globalThis.Handlebars;
			/* istanbul ignore next */
			Handlebars.noConflict = function() {
				if (globalThis.Handlebars === Handlebars) globalThis.Handlebars = $Handlebars;
				return Handlebars;
			};
		};
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars.runtime.js
	var require_handlebars_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		// istanbul ignore next
		function _interopRequireWildcard(obj) {
			if (obj && obj.__esModule) return obj;
			else {
				var newObj = {};
				if (obj != null) {
					for (var key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
				}
				newObj["default"] = obj;
				return newObj;
			}
		}
		var base = _interopRequireWildcard(require_base$1());
		var _handlebarsSafeString2 = _interopRequireDefault(require_safe_string());
		var _handlebarsException2 = _interopRequireDefault(require_exception());
		var Utils = _interopRequireWildcard(require_utils());
		var runtime = _interopRequireWildcard(require_runtime());
		var _handlebarsNoConflict2 = _interopRequireDefault(require_no_conflict());
		function create() {
			var hb = new base.HandlebarsEnvironment();
			Utils.extend(hb, base);
			hb.SafeString = _handlebarsSafeString2["default"];
			hb.Exception = _handlebarsException2["default"];
			hb.Utils = Utils;
			hb.escapeExpression = Utils.escapeExpression;
			hb.VM = runtime;
			hb.template = function(spec) {
				return runtime.template(spec, hb);
			};
			return hb;
		}
		var inst = create();
		inst.create = create;
		_handlebarsNoConflict2["default"](inst);
		inst["default"] = inst;
		exports["default"] = inst;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js
	var require_ast = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		var AST = { helpers: {
			helperExpression: function helperExpression(node) {
				return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash);
			},
			scopedId: function scopedId(path) {
				return /^\.|this\b/.test(path.original);
			},
			simpleId: function simpleId(path) {
				return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
			}
		} };
		exports["default"] = AST;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js
	var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		exports["default"] = (function() {
			var parser = {
				trace: function trace() {},
				yy: {},
				symbols_: {
					"error": 2,
					"root": 3,
					"program": 4,
					"EOF": 5,
					"program_repetition0": 6,
					"statement": 7,
					"mustache": 8,
					"block": 9,
					"rawBlock": 10,
					"partial": 11,
					"partialBlock": 12,
					"content": 13,
					"COMMENT": 14,
					"CONTENT": 15,
					"openRawBlock": 16,
					"rawBlock_repetition0": 17,
					"END_RAW_BLOCK": 18,
					"OPEN_RAW_BLOCK": 19,
					"helperName": 20,
					"openRawBlock_repetition0": 21,
					"openRawBlock_option0": 22,
					"CLOSE_RAW_BLOCK": 23,
					"openBlock": 24,
					"block_option0": 25,
					"closeBlock": 26,
					"openInverse": 27,
					"block_option1": 28,
					"OPEN_BLOCK": 29,
					"openBlock_repetition0": 30,
					"openBlock_option0": 31,
					"openBlock_option1": 32,
					"CLOSE": 33,
					"OPEN_INVERSE": 34,
					"openInverse_repetition0": 35,
					"openInverse_option0": 36,
					"openInverse_option1": 37,
					"openInverseChain": 38,
					"OPEN_INVERSE_CHAIN": 39,
					"openInverseChain_repetition0": 40,
					"openInverseChain_option0": 41,
					"openInverseChain_option1": 42,
					"inverseAndProgram": 43,
					"INVERSE": 44,
					"inverseChain": 45,
					"inverseChain_option0": 46,
					"OPEN_ENDBLOCK": 47,
					"OPEN": 48,
					"mustache_repetition0": 49,
					"mustache_option0": 50,
					"OPEN_UNESCAPED": 51,
					"mustache_repetition1": 52,
					"mustache_option1": 53,
					"CLOSE_UNESCAPED": 54,
					"OPEN_PARTIAL": 55,
					"partialName": 56,
					"partial_repetition0": 57,
					"partial_option0": 58,
					"openPartialBlock": 59,
					"OPEN_PARTIAL_BLOCK": 60,
					"openPartialBlock_repetition0": 61,
					"openPartialBlock_option0": 62,
					"param": 63,
					"sexpr": 64,
					"OPEN_SEXPR": 65,
					"sexpr_repetition0": 66,
					"sexpr_option0": 67,
					"CLOSE_SEXPR": 68,
					"hash": 69,
					"hash_repetition_plus0": 70,
					"hashSegment": 71,
					"ID": 72,
					"EQUALS": 73,
					"blockParams": 74,
					"OPEN_BLOCK_PARAMS": 75,
					"blockParams_repetition_plus0": 76,
					"CLOSE_BLOCK_PARAMS": 77,
					"path": 78,
					"dataName": 79,
					"STRING": 80,
					"NUMBER": 81,
					"BOOLEAN": 82,
					"UNDEFINED": 83,
					"NULL": 84,
					"DATA": 85,
					"pathSegments": 86,
					"SEP": 87,
					"$accept": 0,
					"$end": 1
				},
				terminals_: {
					2: "error",
					5: "EOF",
					14: "COMMENT",
					15: "CONTENT",
					18: "END_RAW_BLOCK",
					19: "OPEN_RAW_BLOCK",
					23: "CLOSE_RAW_BLOCK",
					29: "OPEN_BLOCK",
					33: "CLOSE",
					34: "OPEN_INVERSE",
					39: "OPEN_INVERSE_CHAIN",
					44: "INVERSE",
					47: "OPEN_ENDBLOCK",
					48: "OPEN",
					51: "OPEN_UNESCAPED",
					54: "CLOSE_UNESCAPED",
					55: "OPEN_PARTIAL",
					60: "OPEN_PARTIAL_BLOCK",
					65: "OPEN_SEXPR",
					68: "CLOSE_SEXPR",
					72: "ID",
					73: "EQUALS",
					75: "OPEN_BLOCK_PARAMS",
					77: "CLOSE_BLOCK_PARAMS",
					80: "STRING",
					81: "NUMBER",
					82: "BOOLEAN",
					83: "UNDEFINED",
					84: "NULL",
					85: "DATA",
					87: "SEP"
				},
				productions_: [
					0,
					[3, 2],
					[4, 1],
					[7, 1],
					[7, 1],
					[7, 1],
					[7, 1],
					[7, 1],
					[7, 1],
					[7, 1],
					[13, 1],
					[10, 3],
					[16, 5],
					[9, 4],
					[9, 4],
					[24, 6],
					[27, 6],
					[38, 6],
					[43, 2],
					[45, 3],
					[45, 1],
					[26, 3],
					[8, 5],
					[8, 5],
					[11, 5],
					[12, 3],
					[59, 5],
					[63, 1],
					[63, 1],
					[64, 5],
					[69, 1],
					[71, 3],
					[74, 3],
					[20, 1],
					[20, 1],
					[20, 1],
					[20, 1],
					[20, 1],
					[20, 1],
					[20, 1],
					[56, 1],
					[56, 1],
					[79, 2],
					[78, 1],
					[86, 3],
					[86, 1],
					[6, 0],
					[6, 2],
					[17, 0],
					[17, 2],
					[21, 0],
					[21, 2],
					[22, 0],
					[22, 1],
					[25, 0],
					[25, 1],
					[28, 0],
					[28, 1],
					[30, 0],
					[30, 2],
					[31, 0],
					[31, 1],
					[32, 0],
					[32, 1],
					[35, 0],
					[35, 2],
					[36, 0],
					[36, 1],
					[37, 0],
					[37, 1],
					[40, 0],
					[40, 2],
					[41, 0],
					[41, 1],
					[42, 0],
					[42, 1],
					[46, 0],
					[46, 1],
					[49, 0],
					[49, 2],
					[50, 0],
					[50, 1],
					[52, 0],
					[52, 2],
					[53, 0],
					[53, 1],
					[57, 0],
					[57, 2],
					[58, 0],
					[58, 1],
					[61, 0],
					[61, 2],
					[62, 0],
					[62, 1],
					[66, 0],
					[66, 2],
					[67, 0],
					[67, 1],
					[70, 1],
					[70, 2],
					[76, 1],
					[76, 2]
				],
				performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
					var $0 = $$.length - 1;
					switch (yystate) {
						case 1: return $$[$0 - 1];
						case 2:
							this.$ = yy.prepareProgram($$[$0]);
							break;
						case 3:
							this.$ = $$[$0];
							break;
						case 4:
							this.$ = $$[$0];
							break;
						case 5:
							this.$ = $$[$0];
							break;
						case 6:
							this.$ = $$[$0];
							break;
						case 7:
							this.$ = $$[$0];
							break;
						case 8:
							this.$ = $$[$0];
							break;
						case 9:
							this.$ = {
								type: "CommentStatement",
								value: yy.stripComment($$[$0]),
								strip: yy.stripFlags($$[$0], $$[$0]),
								loc: yy.locInfo(this._$)
							};
							break;
						case 10:
							this.$ = {
								type: "ContentStatement",
								original: $$[$0],
								value: $$[$0],
								loc: yy.locInfo(this._$)
							};
							break;
						case 11:
							this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
							break;
						case 12:
							this.$ = {
								path: $$[$0 - 3],
								params: $$[$0 - 2],
								hash: $$[$0 - 1]
							};
							break;
						case 13:
							this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
							break;
						case 14:
							this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
							break;
						case 15:
							this.$ = {
								open: $$[$0 - 5],
								path: $$[$0 - 4],
								params: $$[$0 - 3],
								hash: $$[$0 - 2],
								blockParams: $$[$0 - 1],
								strip: yy.stripFlags($$[$0 - 5], $$[$0])
							};
							break;
						case 16:
							this.$ = {
								path: $$[$0 - 4],
								params: $$[$0 - 3],
								hash: $$[$0 - 2],
								blockParams: $$[$0 - 1],
								strip: yy.stripFlags($$[$0 - 5], $$[$0])
							};
							break;
						case 17:
							this.$ = {
								path: $$[$0 - 4],
								params: $$[$0 - 3],
								hash: $$[$0 - 2],
								blockParams: $$[$0 - 1],
								strip: yy.stripFlags($$[$0 - 5], $$[$0])
							};
							break;
						case 18:
							this.$ = {
								strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]),
								program: $$[$0]
							};
							break;
						case 19:
							var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
							program.chained = true;
							this.$ = {
								strip: $$[$0 - 2].strip,
								program,
								chain: true
							};
							break;
						case 20:
							this.$ = $$[$0];
							break;
						case 21:
							this.$ = {
								path: $$[$0 - 1],
								strip: yy.stripFlags($$[$0 - 2], $$[$0])
							};
							break;
						case 22:
							this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
							break;
						case 23:
							this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
							break;
						case 24:
							this.$ = {
								type: "PartialStatement",
								name: $$[$0 - 3],
								params: $$[$0 - 2],
								hash: $$[$0 - 1],
								indent: "",
								strip: yy.stripFlags($$[$0 - 4], $$[$0]),
								loc: yy.locInfo(this._$)
							};
							break;
						case 25:
							this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
							break;
						case 26:
							this.$ = {
								path: $$[$0 - 3],
								params: $$[$0 - 2],
								hash: $$[$0 - 1],
								strip: yy.stripFlags($$[$0 - 4], $$[$0])
							};
							break;
						case 27:
							this.$ = $$[$0];
							break;
						case 28:
							this.$ = $$[$0];
							break;
						case 29:
							this.$ = {
								type: "SubExpression",
								path: $$[$0 - 3],
								params: $$[$0 - 2],
								hash: $$[$0 - 1],
								loc: yy.locInfo(this._$)
							};
							break;
						case 30:
							this.$ = {
								type: "Hash",
								pairs: $$[$0],
								loc: yy.locInfo(this._$)
							};
							break;
						case 31:
							this.$ = {
								type: "HashPair",
								key: yy.id($$[$0 - 2]),
								value: $$[$0],
								loc: yy.locInfo(this._$)
							};
							break;
						case 32:
							this.$ = yy.id($$[$0 - 1]);
							break;
						case 33:
							this.$ = $$[$0];
							break;
						case 34:
							this.$ = $$[$0];
							break;
						case 35:
							this.$ = {
								type: "StringLiteral",
								value: $$[$0],
								original: $$[$0],
								loc: yy.locInfo(this._$)
							};
							break;
						case 36:
							this.$ = {
								type: "NumberLiteral",
								value: Number($$[$0]),
								original: Number($$[$0]),
								loc: yy.locInfo(this._$)
							};
							break;
						case 37:
							this.$ = {
								type: "BooleanLiteral",
								value: $$[$0] === "true",
								original: $$[$0] === "true",
								loc: yy.locInfo(this._$)
							};
							break;
						case 38:
							this.$ = {
								type: "UndefinedLiteral",
								original: void 0,
								value: void 0,
								loc: yy.locInfo(this._$)
							};
							break;
						case 39:
							this.$ = {
								type: "NullLiteral",
								original: null,
								value: null,
								loc: yy.locInfo(this._$)
							};
							break;
						case 40:
							this.$ = $$[$0];
							break;
						case 41:
							this.$ = $$[$0];
							break;
						case 42:
							this.$ = yy.preparePath(true, $$[$0], this._$);
							break;
						case 43:
							this.$ = yy.preparePath(false, $$[$0], this._$);
							break;
						case 44:
							$$[$0 - 2].push({
								part: yy.id($$[$0]),
								original: $$[$0],
								separator: $$[$0 - 1]
							});
							this.$ = $$[$0 - 2];
							break;
						case 45:
							this.$ = [{
								part: yy.id($$[$0]),
								original: $$[$0]
							}];
							break;
						case 46:
							this.$ = [];
							break;
						case 47:
							$$[$0 - 1].push($$[$0]);
							break;
						case 48:
							this.$ = [];
							break;
						case 49:
							$$[$0 - 1].push($$[$0]);
							break;
						case 50:
							this.$ = [];
							break;
						case 51:
							$$[$0 - 1].push($$[$0]);
							break;
						case 58:
							this.$ = [];
							break;
						case 59:
							$$[$0 - 1].push($$[$0]);
							break;
						case 64:
							this.$ = [];
							break;
						case 65:
							$$[$0 - 1].push($$[$0]);
							break;
						case 70:
							this.$ = [];
							break;
						case 71:
							$$[$0 - 1].push($$[$0]);
							break;
						case 78:
							this.$ = [];
							break;
						case 79:
							$$[$0 - 1].push($$[$0]);
							break;
						case 82:
							this.$ = [];
							break;
						case 83:
							$$[$0 - 1].push($$[$0]);
							break;
						case 86:
							this.$ = [];
							break;
						case 87:
							$$[$0 - 1].push($$[$0]);
							break;
						case 90:
							this.$ = [];
							break;
						case 91:
							$$[$0 - 1].push($$[$0]);
							break;
						case 94:
							this.$ = [];
							break;
						case 95:
							$$[$0 - 1].push($$[$0]);
							break;
						case 98:
							this.$ = [$$[$0]];
							break;
						case 99:
							$$[$0 - 1].push($$[$0]);
							break;
						case 100:
							this.$ = [$$[$0]];
							break;
						case 101:
							$$[$0 - 1].push($$[$0]);
							break;
					}
				},
				table: [
					{
						3: 1,
						4: 2,
						5: [2, 46],
						6: 3,
						14: [2, 46],
						15: [2, 46],
						19: [2, 46],
						29: [2, 46],
						34: [2, 46],
						48: [2, 46],
						51: [2, 46],
						55: [2, 46],
						60: [2, 46]
					},
					{ 1: [3] },
					{ 5: [1, 4] },
					{
						5: [2, 2],
						7: 5,
						8: 6,
						9: 7,
						10: 8,
						11: 9,
						12: 10,
						13: 11,
						14: [1, 12],
						15: [1, 20],
						16: 17,
						19: [1, 23],
						24: 15,
						27: 16,
						29: [1, 21],
						34: [1, 22],
						39: [2, 2],
						44: [2, 2],
						47: [2, 2],
						48: [1, 13],
						51: [1, 14],
						55: [1, 18],
						59: 19,
						60: [1, 24]
					},
					{ 1: [2, 1] },
					{
						5: [2, 47],
						14: [2, 47],
						15: [2, 47],
						19: [2, 47],
						29: [2, 47],
						34: [2, 47],
						39: [2, 47],
						44: [2, 47],
						47: [2, 47],
						48: [2, 47],
						51: [2, 47],
						55: [2, 47],
						60: [2, 47]
					},
					{
						5: [2, 3],
						14: [2, 3],
						15: [2, 3],
						19: [2, 3],
						29: [2, 3],
						34: [2, 3],
						39: [2, 3],
						44: [2, 3],
						47: [2, 3],
						48: [2, 3],
						51: [2, 3],
						55: [2, 3],
						60: [2, 3]
					},
					{
						5: [2, 4],
						14: [2, 4],
						15: [2, 4],
						19: [2, 4],
						29: [2, 4],
						34: [2, 4],
						39: [2, 4],
						44: [2, 4],
						47: [2, 4],
						48: [2, 4],
						51: [2, 4],
						55: [2, 4],
						60: [2, 4]
					},
					{
						5: [2, 5],
						14: [2, 5],
						15: [2, 5],
						19: [2, 5],
						29: [2, 5],
						34: [2, 5],
						39: [2, 5],
						44: [2, 5],
						47: [2, 5],
						48: [2, 5],
						51: [2, 5],
						55: [2, 5],
						60: [2, 5]
					},
					{
						5: [2, 6],
						14: [2, 6],
						15: [2, 6],
						19: [2, 6],
						29: [2, 6],
						34: [2, 6],
						39: [2, 6],
						44: [2, 6],
						47: [2, 6],
						48: [2, 6],
						51: [2, 6],
						55: [2, 6],
						60: [2, 6]
					},
					{
						5: [2, 7],
						14: [2, 7],
						15: [2, 7],
						19: [2, 7],
						29: [2, 7],
						34: [2, 7],
						39: [2, 7],
						44: [2, 7],
						47: [2, 7],
						48: [2, 7],
						51: [2, 7],
						55: [2, 7],
						60: [2, 7]
					},
					{
						5: [2, 8],
						14: [2, 8],
						15: [2, 8],
						19: [2, 8],
						29: [2, 8],
						34: [2, 8],
						39: [2, 8],
						44: [2, 8],
						47: [2, 8],
						48: [2, 8],
						51: [2, 8],
						55: [2, 8],
						60: [2, 8]
					},
					{
						5: [2, 9],
						14: [2, 9],
						15: [2, 9],
						19: [2, 9],
						29: [2, 9],
						34: [2, 9],
						39: [2, 9],
						44: [2, 9],
						47: [2, 9],
						48: [2, 9],
						51: [2, 9],
						55: [2, 9],
						60: [2, 9]
					},
					{
						20: 25,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 36,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						4: 37,
						6: 3,
						14: [2, 46],
						15: [2, 46],
						19: [2, 46],
						29: [2, 46],
						34: [2, 46],
						39: [2, 46],
						44: [2, 46],
						47: [2, 46],
						48: [2, 46],
						51: [2, 46],
						55: [2, 46],
						60: [2, 46]
					},
					{
						4: 38,
						6: 3,
						14: [2, 46],
						15: [2, 46],
						19: [2, 46],
						29: [2, 46],
						34: [2, 46],
						44: [2, 46],
						47: [2, 46],
						48: [2, 46],
						51: [2, 46],
						55: [2, 46],
						60: [2, 46]
					},
					{
						15: [2, 48],
						17: 39,
						18: [2, 48]
					},
					{
						20: 41,
						56: 40,
						64: 42,
						65: [1, 43],
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						4: 44,
						6: 3,
						14: [2, 46],
						15: [2, 46],
						19: [2, 46],
						29: [2, 46],
						34: [2, 46],
						47: [2, 46],
						48: [2, 46],
						51: [2, 46],
						55: [2, 46],
						60: [2, 46]
					},
					{
						5: [2, 10],
						14: [2, 10],
						15: [2, 10],
						18: [2, 10],
						19: [2, 10],
						29: [2, 10],
						34: [2, 10],
						39: [2, 10],
						44: [2, 10],
						47: [2, 10],
						48: [2, 10],
						51: [2, 10],
						55: [2, 10],
						60: [2, 10]
					},
					{
						20: 45,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 46,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 47,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 41,
						56: 48,
						64: 42,
						65: [1, 43],
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						33: [2, 78],
						49: 49,
						65: [2, 78],
						72: [2, 78],
						80: [2, 78],
						81: [2, 78],
						82: [2, 78],
						83: [2, 78],
						84: [2, 78],
						85: [2, 78]
					},
					{
						23: [2, 33],
						33: [2, 33],
						54: [2, 33],
						65: [2, 33],
						68: [2, 33],
						72: [2, 33],
						75: [2, 33],
						80: [2, 33],
						81: [2, 33],
						82: [2, 33],
						83: [2, 33],
						84: [2, 33],
						85: [2, 33]
					},
					{
						23: [2, 34],
						33: [2, 34],
						54: [2, 34],
						65: [2, 34],
						68: [2, 34],
						72: [2, 34],
						75: [2, 34],
						80: [2, 34],
						81: [2, 34],
						82: [2, 34],
						83: [2, 34],
						84: [2, 34],
						85: [2, 34]
					},
					{
						23: [2, 35],
						33: [2, 35],
						54: [2, 35],
						65: [2, 35],
						68: [2, 35],
						72: [2, 35],
						75: [2, 35],
						80: [2, 35],
						81: [2, 35],
						82: [2, 35],
						83: [2, 35],
						84: [2, 35],
						85: [2, 35]
					},
					{
						23: [2, 36],
						33: [2, 36],
						54: [2, 36],
						65: [2, 36],
						68: [2, 36],
						72: [2, 36],
						75: [2, 36],
						80: [2, 36],
						81: [2, 36],
						82: [2, 36],
						83: [2, 36],
						84: [2, 36],
						85: [2, 36]
					},
					{
						23: [2, 37],
						33: [2, 37],
						54: [2, 37],
						65: [2, 37],
						68: [2, 37],
						72: [2, 37],
						75: [2, 37],
						80: [2, 37],
						81: [2, 37],
						82: [2, 37],
						83: [2, 37],
						84: [2, 37],
						85: [2, 37]
					},
					{
						23: [2, 38],
						33: [2, 38],
						54: [2, 38],
						65: [2, 38],
						68: [2, 38],
						72: [2, 38],
						75: [2, 38],
						80: [2, 38],
						81: [2, 38],
						82: [2, 38],
						83: [2, 38],
						84: [2, 38],
						85: [2, 38]
					},
					{
						23: [2, 39],
						33: [2, 39],
						54: [2, 39],
						65: [2, 39],
						68: [2, 39],
						72: [2, 39],
						75: [2, 39],
						80: [2, 39],
						81: [2, 39],
						82: [2, 39],
						83: [2, 39],
						84: [2, 39],
						85: [2, 39]
					},
					{
						23: [2, 43],
						33: [2, 43],
						54: [2, 43],
						65: [2, 43],
						68: [2, 43],
						72: [2, 43],
						75: [2, 43],
						80: [2, 43],
						81: [2, 43],
						82: [2, 43],
						83: [2, 43],
						84: [2, 43],
						85: [2, 43],
						87: [1, 50]
					},
					{
						72: [1, 35],
						86: 51
					},
					{
						23: [2, 45],
						33: [2, 45],
						54: [2, 45],
						65: [2, 45],
						68: [2, 45],
						72: [2, 45],
						75: [2, 45],
						80: [2, 45],
						81: [2, 45],
						82: [2, 45],
						83: [2, 45],
						84: [2, 45],
						85: [2, 45],
						87: [2, 45]
					},
					{
						52: 52,
						54: [2, 82],
						65: [2, 82],
						72: [2, 82],
						80: [2, 82],
						81: [2, 82],
						82: [2, 82],
						83: [2, 82],
						84: [2, 82],
						85: [2, 82]
					},
					{
						25: 53,
						38: 55,
						39: [1, 57],
						43: 56,
						44: [1, 58],
						45: 54,
						47: [2, 54]
					},
					{
						28: 59,
						43: 60,
						44: [1, 58],
						47: [2, 56]
					},
					{
						13: 62,
						15: [1, 20],
						18: [1, 61]
					},
					{
						33: [2, 86],
						57: 63,
						65: [2, 86],
						72: [2, 86],
						80: [2, 86],
						81: [2, 86],
						82: [2, 86],
						83: [2, 86],
						84: [2, 86],
						85: [2, 86]
					},
					{
						33: [2, 40],
						65: [2, 40],
						72: [2, 40],
						80: [2, 40],
						81: [2, 40],
						82: [2, 40],
						83: [2, 40],
						84: [2, 40],
						85: [2, 40]
					},
					{
						33: [2, 41],
						65: [2, 41],
						72: [2, 41],
						80: [2, 41],
						81: [2, 41],
						82: [2, 41],
						83: [2, 41],
						84: [2, 41],
						85: [2, 41]
					},
					{
						20: 64,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						26: 65,
						47: [1, 66]
					},
					{
						30: 67,
						33: [2, 58],
						65: [2, 58],
						72: [2, 58],
						75: [2, 58],
						80: [2, 58],
						81: [2, 58],
						82: [2, 58],
						83: [2, 58],
						84: [2, 58],
						85: [2, 58]
					},
					{
						33: [2, 64],
						35: 68,
						65: [2, 64],
						72: [2, 64],
						75: [2, 64],
						80: [2, 64],
						81: [2, 64],
						82: [2, 64],
						83: [2, 64],
						84: [2, 64],
						85: [2, 64]
					},
					{
						21: 69,
						23: [2, 50],
						65: [2, 50],
						72: [2, 50],
						80: [2, 50],
						81: [2, 50],
						82: [2, 50],
						83: [2, 50],
						84: [2, 50],
						85: [2, 50]
					},
					{
						33: [2, 90],
						61: 70,
						65: [2, 90],
						72: [2, 90],
						80: [2, 90],
						81: [2, 90],
						82: [2, 90],
						83: [2, 90],
						84: [2, 90],
						85: [2, 90]
					},
					{
						20: 74,
						33: [2, 80],
						50: 71,
						63: 72,
						64: 75,
						65: [1, 43],
						69: 73,
						70: 76,
						71: 77,
						72: [1, 78],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{ 72: [1, 79] },
					{
						23: [2, 42],
						33: [2, 42],
						54: [2, 42],
						65: [2, 42],
						68: [2, 42],
						72: [2, 42],
						75: [2, 42],
						80: [2, 42],
						81: [2, 42],
						82: [2, 42],
						83: [2, 42],
						84: [2, 42],
						85: [2, 42],
						87: [1, 50]
					},
					{
						20: 74,
						53: 80,
						54: [2, 84],
						63: 81,
						64: 75,
						65: [1, 43],
						69: 82,
						70: 76,
						71: 77,
						72: [1, 78],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						26: 83,
						47: [1, 66]
					},
					{ 47: [2, 55] },
					{
						4: 84,
						6: 3,
						14: [2, 46],
						15: [2, 46],
						19: [2, 46],
						29: [2, 46],
						34: [2, 46],
						39: [2, 46],
						44: [2, 46],
						47: [2, 46],
						48: [2, 46],
						51: [2, 46],
						55: [2, 46],
						60: [2, 46]
					},
					{ 47: [2, 20] },
					{
						20: 85,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						4: 86,
						6: 3,
						14: [2, 46],
						15: [2, 46],
						19: [2, 46],
						29: [2, 46],
						34: [2, 46],
						47: [2, 46],
						48: [2, 46],
						51: [2, 46],
						55: [2, 46],
						60: [2, 46]
					},
					{
						26: 87,
						47: [1, 66]
					},
					{ 47: [2, 57] },
					{
						5: [2, 11],
						14: [2, 11],
						15: [2, 11],
						19: [2, 11],
						29: [2, 11],
						34: [2, 11],
						39: [2, 11],
						44: [2, 11],
						47: [2, 11],
						48: [2, 11],
						51: [2, 11],
						55: [2, 11],
						60: [2, 11]
					},
					{
						15: [2, 49],
						18: [2, 49]
					},
					{
						20: 74,
						33: [2, 88],
						58: 88,
						63: 89,
						64: 75,
						65: [1, 43],
						69: 90,
						70: 76,
						71: 77,
						72: [1, 78],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						65: [2, 94],
						66: 91,
						68: [2, 94],
						72: [2, 94],
						80: [2, 94],
						81: [2, 94],
						82: [2, 94],
						83: [2, 94],
						84: [2, 94],
						85: [2, 94]
					},
					{
						5: [2, 25],
						14: [2, 25],
						15: [2, 25],
						19: [2, 25],
						29: [2, 25],
						34: [2, 25],
						39: [2, 25],
						44: [2, 25],
						47: [2, 25],
						48: [2, 25],
						51: [2, 25],
						55: [2, 25],
						60: [2, 25]
					},
					{
						20: 92,
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 74,
						31: 93,
						33: [2, 60],
						63: 94,
						64: 75,
						65: [1, 43],
						69: 95,
						70: 76,
						71: 77,
						72: [1, 78],
						75: [2, 60],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 74,
						33: [2, 66],
						36: 96,
						63: 97,
						64: 75,
						65: [1, 43],
						69: 98,
						70: 76,
						71: 77,
						72: [1, 78],
						75: [2, 66],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 74,
						22: 99,
						23: [2, 52],
						63: 100,
						64: 75,
						65: [1, 43],
						69: 101,
						70: 76,
						71: 77,
						72: [1, 78],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						20: 74,
						33: [2, 92],
						62: 102,
						63: 103,
						64: 75,
						65: [1, 43],
						69: 104,
						70: 76,
						71: 77,
						72: [1, 78],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{ 33: [1, 105] },
					{
						33: [2, 79],
						65: [2, 79],
						72: [2, 79],
						80: [2, 79],
						81: [2, 79],
						82: [2, 79],
						83: [2, 79],
						84: [2, 79],
						85: [2, 79]
					},
					{ 33: [2, 81] },
					{
						23: [2, 27],
						33: [2, 27],
						54: [2, 27],
						65: [2, 27],
						68: [2, 27],
						72: [2, 27],
						75: [2, 27],
						80: [2, 27],
						81: [2, 27],
						82: [2, 27],
						83: [2, 27],
						84: [2, 27],
						85: [2, 27]
					},
					{
						23: [2, 28],
						33: [2, 28],
						54: [2, 28],
						65: [2, 28],
						68: [2, 28],
						72: [2, 28],
						75: [2, 28],
						80: [2, 28],
						81: [2, 28],
						82: [2, 28],
						83: [2, 28],
						84: [2, 28],
						85: [2, 28]
					},
					{
						23: [2, 30],
						33: [2, 30],
						54: [2, 30],
						68: [2, 30],
						71: 106,
						72: [1, 107],
						75: [2, 30]
					},
					{
						23: [2, 98],
						33: [2, 98],
						54: [2, 98],
						68: [2, 98],
						72: [2, 98],
						75: [2, 98]
					},
					{
						23: [2, 45],
						33: [2, 45],
						54: [2, 45],
						65: [2, 45],
						68: [2, 45],
						72: [2, 45],
						73: [1, 108],
						75: [2, 45],
						80: [2, 45],
						81: [2, 45],
						82: [2, 45],
						83: [2, 45],
						84: [2, 45],
						85: [2, 45],
						87: [2, 45]
					},
					{
						23: [2, 44],
						33: [2, 44],
						54: [2, 44],
						65: [2, 44],
						68: [2, 44],
						72: [2, 44],
						75: [2, 44],
						80: [2, 44],
						81: [2, 44],
						82: [2, 44],
						83: [2, 44],
						84: [2, 44],
						85: [2, 44],
						87: [2, 44]
					},
					{ 54: [1, 109] },
					{
						54: [2, 83],
						65: [2, 83],
						72: [2, 83],
						80: [2, 83],
						81: [2, 83],
						82: [2, 83],
						83: [2, 83],
						84: [2, 83],
						85: [2, 83]
					},
					{ 54: [2, 85] },
					{
						5: [2, 13],
						14: [2, 13],
						15: [2, 13],
						19: [2, 13],
						29: [2, 13],
						34: [2, 13],
						39: [2, 13],
						44: [2, 13],
						47: [2, 13],
						48: [2, 13],
						51: [2, 13],
						55: [2, 13],
						60: [2, 13]
					},
					{
						38: 55,
						39: [1, 57],
						43: 56,
						44: [1, 58],
						45: 111,
						46: 110,
						47: [2, 76]
					},
					{
						33: [2, 70],
						40: 112,
						65: [2, 70],
						72: [2, 70],
						75: [2, 70],
						80: [2, 70],
						81: [2, 70],
						82: [2, 70],
						83: [2, 70],
						84: [2, 70],
						85: [2, 70]
					},
					{ 47: [2, 18] },
					{
						5: [2, 14],
						14: [2, 14],
						15: [2, 14],
						19: [2, 14],
						29: [2, 14],
						34: [2, 14],
						39: [2, 14],
						44: [2, 14],
						47: [2, 14],
						48: [2, 14],
						51: [2, 14],
						55: [2, 14],
						60: [2, 14]
					},
					{ 33: [1, 113] },
					{
						33: [2, 87],
						65: [2, 87],
						72: [2, 87],
						80: [2, 87],
						81: [2, 87],
						82: [2, 87],
						83: [2, 87],
						84: [2, 87],
						85: [2, 87]
					},
					{ 33: [2, 89] },
					{
						20: 74,
						63: 115,
						64: 75,
						65: [1, 43],
						67: 114,
						68: [2, 96],
						69: 116,
						70: 76,
						71: 77,
						72: [1, 78],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{ 33: [1, 117] },
					{
						32: 118,
						33: [2, 62],
						74: 119,
						75: [1, 120]
					},
					{
						33: [2, 59],
						65: [2, 59],
						72: [2, 59],
						75: [2, 59],
						80: [2, 59],
						81: [2, 59],
						82: [2, 59],
						83: [2, 59],
						84: [2, 59],
						85: [2, 59]
					},
					{
						33: [2, 61],
						75: [2, 61]
					},
					{
						33: [2, 68],
						37: 121,
						74: 122,
						75: [1, 120]
					},
					{
						33: [2, 65],
						65: [2, 65],
						72: [2, 65],
						75: [2, 65],
						80: [2, 65],
						81: [2, 65],
						82: [2, 65],
						83: [2, 65],
						84: [2, 65],
						85: [2, 65]
					},
					{
						33: [2, 67],
						75: [2, 67]
					},
					{ 23: [1, 123] },
					{
						23: [2, 51],
						65: [2, 51],
						72: [2, 51],
						80: [2, 51],
						81: [2, 51],
						82: [2, 51],
						83: [2, 51],
						84: [2, 51],
						85: [2, 51]
					},
					{ 23: [2, 53] },
					{ 33: [1, 124] },
					{
						33: [2, 91],
						65: [2, 91],
						72: [2, 91],
						80: [2, 91],
						81: [2, 91],
						82: [2, 91],
						83: [2, 91],
						84: [2, 91],
						85: [2, 91]
					},
					{ 33: [2, 93] },
					{
						5: [2, 22],
						14: [2, 22],
						15: [2, 22],
						19: [2, 22],
						29: [2, 22],
						34: [2, 22],
						39: [2, 22],
						44: [2, 22],
						47: [2, 22],
						48: [2, 22],
						51: [2, 22],
						55: [2, 22],
						60: [2, 22]
					},
					{
						23: [2, 99],
						33: [2, 99],
						54: [2, 99],
						68: [2, 99],
						72: [2, 99],
						75: [2, 99]
					},
					{ 73: [1, 108] },
					{
						20: 74,
						63: 125,
						64: 75,
						65: [1, 43],
						72: [1, 35],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						5: [2, 23],
						14: [2, 23],
						15: [2, 23],
						19: [2, 23],
						29: [2, 23],
						34: [2, 23],
						39: [2, 23],
						44: [2, 23],
						47: [2, 23],
						48: [2, 23],
						51: [2, 23],
						55: [2, 23],
						60: [2, 23]
					},
					{ 47: [2, 19] },
					{ 47: [2, 77] },
					{
						20: 74,
						33: [2, 72],
						41: 126,
						63: 127,
						64: 75,
						65: [1, 43],
						69: 128,
						70: 76,
						71: 77,
						72: [1, 78],
						75: [2, 72],
						78: 26,
						79: 27,
						80: [1, 28],
						81: [1, 29],
						82: [1, 30],
						83: [1, 31],
						84: [1, 32],
						85: [1, 34],
						86: 33
					},
					{
						5: [2, 24],
						14: [2, 24],
						15: [2, 24],
						19: [2, 24],
						29: [2, 24],
						34: [2, 24],
						39: [2, 24],
						44: [2, 24],
						47: [2, 24],
						48: [2, 24],
						51: [2, 24],
						55: [2, 24],
						60: [2, 24]
					},
					{ 68: [1, 129] },
					{
						65: [2, 95],
						68: [2, 95],
						72: [2, 95],
						80: [2, 95],
						81: [2, 95],
						82: [2, 95],
						83: [2, 95],
						84: [2, 95],
						85: [2, 95]
					},
					{ 68: [2, 97] },
					{
						5: [2, 21],
						14: [2, 21],
						15: [2, 21],
						19: [2, 21],
						29: [2, 21],
						34: [2, 21],
						39: [2, 21],
						44: [2, 21],
						47: [2, 21],
						48: [2, 21],
						51: [2, 21],
						55: [2, 21],
						60: [2, 21]
					},
					{ 33: [1, 130] },
					{ 33: [2, 63] },
					{
						72: [1, 132],
						76: 131
					},
					{ 33: [1, 133] },
					{ 33: [2, 69] },
					{
						15: [2, 12],
						18: [2, 12]
					},
					{
						14: [2, 26],
						15: [2, 26],
						19: [2, 26],
						29: [2, 26],
						34: [2, 26],
						47: [2, 26],
						48: [2, 26],
						51: [2, 26],
						55: [2, 26],
						60: [2, 26]
					},
					{
						23: [2, 31],
						33: [2, 31],
						54: [2, 31],
						68: [2, 31],
						72: [2, 31],
						75: [2, 31]
					},
					{
						33: [2, 74],
						42: 134,
						74: 135,
						75: [1, 120]
					},
					{
						33: [2, 71],
						65: [2, 71],
						72: [2, 71],
						75: [2, 71],
						80: [2, 71],
						81: [2, 71],
						82: [2, 71],
						83: [2, 71],
						84: [2, 71],
						85: [2, 71]
					},
					{
						33: [2, 73],
						75: [2, 73]
					},
					{
						23: [2, 29],
						33: [2, 29],
						54: [2, 29],
						65: [2, 29],
						68: [2, 29],
						72: [2, 29],
						75: [2, 29],
						80: [2, 29],
						81: [2, 29],
						82: [2, 29],
						83: [2, 29],
						84: [2, 29],
						85: [2, 29]
					},
					{
						14: [2, 15],
						15: [2, 15],
						19: [2, 15],
						29: [2, 15],
						34: [2, 15],
						39: [2, 15],
						44: [2, 15],
						47: [2, 15],
						48: [2, 15],
						51: [2, 15],
						55: [2, 15],
						60: [2, 15]
					},
					{
						72: [1, 137],
						77: [1, 136]
					},
					{
						72: [2, 100],
						77: [2, 100]
					},
					{
						14: [2, 16],
						15: [2, 16],
						19: [2, 16],
						29: [2, 16],
						34: [2, 16],
						44: [2, 16],
						47: [2, 16],
						48: [2, 16],
						51: [2, 16],
						55: [2, 16],
						60: [2, 16]
					},
					{ 33: [1, 138] },
					{ 33: [2, 75] },
					{ 33: [2, 32] },
					{
						72: [2, 101],
						77: [2, 101]
					},
					{
						14: [2, 17],
						15: [2, 17],
						19: [2, 17],
						29: [2, 17],
						34: [2, 17],
						39: [2, 17],
						44: [2, 17],
						47: [2, 17],
						48: [2, 17],
						51: [2, 17],
						55: [2, 17],
						60: [2, 17]
					}
				],
				defaultActions: {
					4: [2, 1],
					54: [2, 55],
					56: [2, 20],
					60: [2, 57],
					73: [2, 81],
					82: [2, 85],
					86: [2, 18],
					90: [2, 89],
					101: [2, 53],
					104: [2, 93],
					110: [2, 19],
					111: [2, 77],
					116: [2, 97],
					119: [2, 63],
					122: [2, 69],
					135: [2, 75],
					136: [2, 32]
				},
				parseError: function parseError(str, hash) {
					throw new Error(str);
				},
				parse: function parse(input) {
					var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0;
					this.lexer.setInput(input);
					this.lexer.yy = this.yy;
					this.yy.lexer = this.lexer;
					this.yy.parser = this;
					if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
					var yyloc = this.lexer.yylloc;
					lstack.push(yyloc);
					var ranges = this.lexer.options && this.lexer.options.ranges;
					if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
					function lex() {
						var token = self.lexer.lex() || 1;
						if (typeof token !== "number") token = self.symbols_[token] || token;
						return token;
					}
					var symbol, preErrorSymbol, state, action, r, yyval = {}, p, len, newState, expected;
					while (true) {
						state = stack[stack.length - 1];
						if (this.defaultActions[state]) action = this.defaultActions[state];
						else {
							if (symbol === null || typeof symbol == "undefined") symbol = lex();
							action = table[state] && table[state][symbol];
						}
						if (typeof action === "undefined" || !action.length || !action[0]) {
							var errStr = "";
							if (!recovering) {
								expected = [];
								for (p in table[state]) if (this.terminals_[p] && p > 2) expected.push("'" + this.terminals_[p] + "'");
								if (this.lexer.showPosition) errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
								else errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
								this.parseError(errStr, {
									text: this.lexer.match,
									token: this.terminals_[symbol] || symbol,
									line: this.lexer.yylineno,
									loc: yyloc,
									expected
								});
							}
						}
						if (action[0] instanceof Array && action.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
						switch (action[0]) {
							case 1:
								stack.push(symbol);
								vstack.push(this.lexer.yytext);
								lstack.push(this.lexer.yylloc);
								stack.push(action[1]);
								symbol = null;
								if (!preErrorSymbol) {
									yyleng = this.lexer.yyleng;
									yytext = this.lexer.yytext;
									yylineno = this.lexer.yylineno;
									yyloc = this.lexer.yylloc;
									if (recovering > 0) recovering--;
								} else {
									symbol = preErrorSymbol;
									preErrorSymbol = null;
								}
								break;
							case 2:
								len = this.productions_[action[1]][1];
								yyval.$ = vstack[vstack.length - len];
								yyval._$ = {
									first_line: lstack[lstack.length - (len || 1)].first_line,
									last_line: lstack[lstack.length - 1].last_line,
									first_column: lstack[lstack.length - (len || 1)].first_column,
									last_column: lstack[lstack.length - 1].last_column
								};
								if (ranges) yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
								r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
								if (typeof r !== "undefined") return r;
								if (len) {
									stack = stack.slice(0, -1 * len * 2);
									vstack = vstack.slice(0, -1 * len);
									lstack = lstack.slice(0, -1 * len);
								}
								stack.push(this.productions_[action[1]][0]);
								vstack.push(yyval.$);
								lstack.push(yyval._$);
								newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
								stack.push(newState);
								break;
							case 3: return true;
						}
					}
					return true;
				}
			};
			parser.lexer = (function() {
				var lexer = {
					EOF: 1,
					parseError: function parseError(str, hash) {
						if (this.yy.parser) this.yy.parser.parseError(str, hash);
						else throw new Error(str);
					},
					setInput: function setInput(input) {
						this._input = input;
						this._more = this._less = this.done = false;
						this.yylineno = this.yyleng = 0;
						this.yytext = this.matched = this.match = "";
						this.conditionStack = ["INITIAL"];
						this.yylloc = {
							first_line: 1,
							first_column: 0,
							last_line: 1,
							last_column: 0
						};
						if (this.options.ranges) this.yylloc.range = [0, 0];
						this.offset = 0;
						return this;
					},
					input: function input() {
						var ch = this._input[0];
						this.yytext += ch;
						this.yyleng++;
						this.offset++;
						this.match += ch;
						this.matched += ch;
						if (ch.match(/(?:\r\n?|\n).*/g)) {
							this.yylineno++;
							this.yylloc.last_line++;
						} else this.yylloc.last_column++;
						if (this.options.ranges) this.yylloc.range[1]++;
						this._input = this._input.slice(1);
						return ch;
					},
					unput: function unput(ch) {
						var len = ch.length;
						var lines = ch.split(/(?:\r\n?|\n)/g);
						this._input = ch + this._input;
						this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
						this.offset -= len;
						var oldLines = this.match.split(/(?:\r\n?|\n)/g);
						this.match = this.match.substr(0, this.match.length - 1);
						this.matched = this.matched.substr(0, this.matched.length - 1);
						if (lines.length - 1) this.yylineno -= lines.length - 1;
						var r = this.yylloc.range;
						this.yylloc = {
							first_line: this.yylloc.first_line,
							last_line: this.yylineno + 1,
							first_column: this.yylloc.first_column,
							last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
						};
						if (this.options.ranges) this.yylloc.range = [r[0], r[0] + this.yyleng - len];
						return this;
					},
					more: function more() {
						this._more = true;
						return this;
					},
					less: function less(n) {
						this.unput(this.match.slice(n));
					},
					pastInput: function pastInput() {
						var past = this.matched.substr(0, this.matched.length - this.match.length);
						return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
					},
					upcomingInput: function upcomingInput() {
						var next = this.match;
						if (next.length < 20) next += this._input.substr(0, 20 - next.length);
						return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
					},
					showPosition: function showPosition() {
						var pre = this.pastInput();
						var c = new Array(pre.length + 1).join("-");
						return pre + this.upcomingInput() + "\n" + c + "^";
					},
					next: function next() {
						if (this.done) return this.EOF;
						if (!this._input) this.done = true;
						var token, match, tempMatch, index, lines;
						if (!this._more) {
							this.yytext = "";
							this.match = "";
						}
						var rules = this._currentRules();
						for (var i = 0; i < rules.length; i++) {
							tempMatch = this._input.match(this.rules[rules[i]]);
							if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
								match = tempMatch;
								index = i;
								if (!this.options.flex) break;
							}
						}
						if (match) {
							lines = match[0].match(/(?:\r\n?|\n).*/g);
							if (lines) this.yylineno += lines.length;
							this.yylloc = {
								first_line: this.yylloc.last_line,
								last_line: this.yylineno + 1,
								first_column: this.yylloc.last_column,
								last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
							};
							this.yytext += match[0];
							this.match += match[0];
							this.matches = match;
							this.yyleng = this.yytext.length;
							if (this.options.ranges) this.yylloc.range = [this.offset, this.offset += this.yyleng];
							this._more = false;
							this._input = this._input.slice(match[0].length);
							this.matched += match[0];
							token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
							if (this.done && this._input) this.done = false;
							if (token) return token;
							else return;
						}
						if (this._input === "") return this.EOF;
						else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
							text: "",
							token: null,
							line: this.yylineno
						});
					},
					lex: function lex() {
						var r = this.next();
						if (typeof r !== "undefined") return r;
						else return this.lex();
					},
					begin: function begin(condition) {
						this.conditionStack.push(condition);
					},
					popState: function popState() {
						return this.conditionStack.pop();
					},
					_currentRules: function _currentRules() {
						return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
					},
					topState: function topState() {
						return this.conditionStack[this.conditionStack.length - 2];
					},
					pushState: function begin(condition) {
						this.begin(condition);
					}
				};
				lexer.options = {};
				lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
					function strip(start, end) {
						return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);
					}
					switch ($avoiding_name_collisions) {
						case 0:
							if (yy_.yytext.slice(-2) === "\\\\") {
								strip(0, 1);
								this.begin("mu");
							} else if (yy_.yytext.slice(-1) === "\\") {
								strip(0, 1);
								this.begin("emu");
							} else this.begin("mu");
							if (yy_.yytext) return 15;
							break;
						case 1: return 15;
						case 2:
							this.popState();
							return 15;
						case 3:
							this.begin("raw");
							return 15;
						case 4:
							this.popState();
							if (this.conditionStack[this.conditionStack.length - 1] === "raw") return 15;
							else {
								strip(5, 9);
								return "END_RAW_BLOCK";
							}
							break;
						case 5: return 15;
						case 6:
							this.popState();
							return 14;
						case 7: return 65;
						case 8: return 68;
						case 9: return 19;
						case 10:
							this.popState();
							this.begin("raw");
							return 23;
						case 11: return 55;
						case 12: return 60;
						case 13: return 29;
						case 14: return 47;
						case 15:
							this.popState();
							return 44;
						case 16:
							this.popState();
							return 44;
						case 17: return 34;
						case 18: return 39;
						case 19: return 51;
						case 20: return 48;
						case 21:
							this.unput(yy_.yytext);
							this.popState();
							this.begin("com");
							break;
						case 22:
							this.popState();
							return 14;
						case 23: return 48;
						case 24: return 73;
						case 25: return 72;
						case 26: return 72;
						case 27: return 87;
						case 28: break;
						case 29:
							this.popState();
							return 54;
						case 30:
							this.popState();
							return 33;
						case 31:
							yy_.yytext = strip(1, 2).replace(/\\"/g, "\"");
							return 80;
						case 32:
							yy_.yytext = strip(1, 2).replace(/\\'/g, "'");
							return 80;
						case 33: return 85;
						case 34: return 82;
						case 35: return 82;
						case 36: return 83;
						case 37: return 84;
						case 38: return 81;
						case 39: return 75;
						case 40: return 77;
						case 41: return 72;
						case 42:
							yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, "$1");
							return 72;
						case 43: return "INVALID";
						case 44: return 5;
					}
				};
				lexer.rules = [
					/^(?:[^\x00]*?(?=(\{\{)))/,
					/^(?:[^\x00]+)/,
					/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,
					/^(?:\{\{\{\{(?=[^\/]))/,
					/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,
					/^(?:[^\x00]+?(?=(\{\{\{\{)))/,
					/^(?:[\s\S]*?--(~)?\}\})/,
					/^(?:\()/,
					/^(?:\))/,
					/^(?:\{\{\{\{)/,
					/^(?:\}\}\}\})/,
					/^(?:\{\{(~)?>)/,
					/^(?:\{\{(~)?#>)/,
					/^(?:\{\{(~)?#\*?)/,
					/^(?:\{\{(~)?\/)/,
					/^(?:\{\{(~)?\^\s*(~)?\}\})/,
					/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,
					/^(?:\{\{(~)?\^)/,
					/^(?:\{\{(~)?\s*else\b)/,
					/^(?:\{\{(~)?\{)/,
					/^(?:\{\{(~)?&)/,
					/^(?:\{\{(~)?!--)/,
					/^(?:\{\{(~)?![\s\S]*?\}\})/,
					/^(?:\{\{(~)?\*?)/,
					/^(?:=)/,
					/^(?:\.\.)/,
					/^(?:\.(?=([=~}\s\/.)|])))/,
					/^(?:[\/.])/,
					/^(?:\s+)/,
					/^(?:\}(~)?\}\})/,
					/^(?:(~)?\}\})/,
					/^(?:"(\\["]|[^"])*")/,
					/^(?:'(\\[']|[^'])*')/,
					/^(?:@)/,
					/^(?:true(?=([~}\s)])))/,
					/^(?:false(?=([~}\s)])))/,
					/^(?:undefined(?=([~}\s)])))/,
					/^(?:null(?=([~}\s)])))/,
					/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,
					/^(?:as\s+\|)/,
					/^(?:\|)/,
					/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,
					/^(?:\[(\\\]|[^\]])*\])/,
					/^(?:.)/,
					/^(?:$)/
				];
				lexer.conditions = {
					"mu": {
						"rules": [
							7,
							8,
							9,
							10,
							11,
							12,
							13,
							14,
							15,
							16,
							17,
							18,
							19,
							20,
							21,
							22,
							23,
							24,
							25,
							26,
							27,
							28,
							29,
							30,
							31,
							32,
							33,
							34,
							35,
							36,
							37,
							38,
							39,
							40,
							41,
							42,
							43,
							44
						],
						"inclusive": false
					},
					"emu": {
						"rules": [2],
						"inclusive": false
					},
					"com": {
						"rules": [6],
						"inclusive": false
					},
					"raw": {
						"rules": [
							3,
							4,
							5
						],
						"inclusive": false
					},
					"INITIAL": {
						"rules": [
							0,
							1,
							44
						],
						"inclusive": true
					}
				};
				return lexer;
			})();
			function Parser() {
				this.yy = {};
			}
			Parser.prototype = parser;
			parser.Parser = Parser;
			return new Parser();
		})();
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js
	var require_visitor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _exception2 = _interopRequireDefault(require_exception());
		function Visitor() {
			this.parents = [];
		}
		Visitor.prototype = {
			constructor: Visitor,
			mutating: false,
			acceptKey: function acceptKey(node, name) {
				var value = this.accept(node[name]);
				if (this.mutating) {
					if (value && !Visitor.prototype[value.type]) throw new _exception2["default"]("Unexpected node type \"" + value.type + "\" found when accepting " + name + " on " + node.type);
					node[name] = value;
				}
			},
			acceptRequired: function acceptRequired(node, name) {
				this.acceptKey(node, name);
				if (!node[name]) throw new _exception2["default"](node.type + " requires " + name);
			},
			acceptArray: function acceptArray(array) {
				for (var i = 0, l = array.length; i < l; i++) {
					this.acceptKey(array, i);
					if (!array[i]) {
						array.splice(i, 1);
						i--;
						l--;
					}
				}
			},
			accept: function accept(object) {
				if (!object) return;
				/* istanbul ignore next: Sanity code */
				if (!this[object.type]) throw new _exception2["default"]("Unknown type: " + object.type, object);
				if (this.current) this.parents.unshift(this.current);
				this.current = object;
				var ret = this[object.type](object);
				this.current = this.parents.shift();
				if (!this.mutating || ret) return ret;
				else if (ret !== false) return object;
			},
			Program: function Program(program) {
				this.acceptArray(program.body);
			},
			MustacheStatement: visitSubExpression,
			Decorator: visitSubExpression,
			BlockStatement: visitBlock,
			DecoratorBlock: visitBlock,
			PartialStatement: visitPartial,
			PartialBlockStatement: function PartialBlockStatement(partial) {
				visitPartial.call(this, partial);
				this.acceptKey(partial, "program");
			},
			ContentStatement: function ContentStatement() {},
			CommentStatement: function CommentStatement() {},
			SubExpression: visitSubExpression,
			PathExpression: function PathExpression() {},
			StringLiteral: function StringLiteral() {},
			NumberLiteral: function NumberLiteral() {},
			BooleanLiteral: function BooleanLiteral() {},
			UndefinedLiteral: function UndefinedLiteral() {},
			NullLiteral: function NullLiteral() {},
			Hash: function Hash(hash) {
				this.acceptArray(hash.pairs);
			},
			HashPair: function HashPair(pair) {
				this.acceptRequired(pair, "value");
			}
		};
		function visitSubExpression(mustache) {
			this.acceptRequired(mustache, "path");
			this.acceptArray(mustache.params);
			this.acceptKey(mustache, "hash");
		}
		function visitBlock(block) {
			visitSubExpression.call(this, block);
			this.acceptKey(block, "program");
			this.acceptKey(block, "inverse");
		}
		function visitPartial(partial) {
			this.acceptRequired(partial, "name");
			this.acceptArray(partial.params);
			this.acceptKey(partial, "hash");
		}
		exports["default"] = Visitor;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js
	var require_whitespace_control = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _visitor2 = _interopRequireDefault(require_visitor());
		function WhitespaceControl() {
			this.options = arguments.length <= 0 || arguments[0] === void 0 ? {} : arguments[0];
		}
		WhitespaceControl.prototype = new _visitor2["default"]();
		WhitespaceControl.prototype.Program = function(program) {
			var doStandalone = !this.options.ignoreStandalone;
			var isRoot = !this.isRootSeen;
			this.isRootSeen = true;
			var body = program.body;
			for (var i = 0, l = body.length; i < l; i++) {
				var current = body[i], strip = this.accept(current);
				if (!strip) continue;
				var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), _isNextWhitespace = isNextWhitespace(body, i, isRoot), openStandalone = strip.openStandalone && _isPrevWhitespace, closeStandalone = strip.closeStandalone && _isNextWhitespace, inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
				if (strip.close) omitRight(body, i, true);
				if (strip.open) omitLeft(body, i, true);
				if (doStandalone && inlineStandalone) {
					omitRight(body, i);
					if (omitLeft(body, i)) {
						if (current.type === "PartialStatement") current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
					}
				}
				if (doStandalone && openStandalone) {
					omitRight((current.program || current.inverse).body);
					omitLeft(body, i);
				}
				if (doStandalone && closeStandalone) {
					omitRight(body, i);
					omitLeft((current.inverse || current.program).body);
				}
			}
			return program;
		};
		WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function(block) {
			this.accept(block.program);
			this.accept(block.inverse);
			var program = block.program || block.inverse, inverse = block.program && block.inverse, firstInverse = inverse, lastInverse = inverse;
			if (inverse && inverse.chained) {
				firstInverse = inverse.body[0].program;
				while (lastInverse.chained) lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
			}
			var strip = {
				open: block.openStrip.open,
				close: block.closeStrip.close,
				openStandalone: isNextWhitespace(program.body),
				closeStandalone: isPrevWhitespace((firstInverse || program).body)
			};
			if (block.openStrip.close) omitRight(program.body, null, true);
			if (inverse) {
				var inverseStrip = block.inverseStrip;
				if (inverseStrip.open) omitLeft(program.body, null, true);
				if (inverseStrip.close) omitRight(firstInverse.body, null, true);
				if (block.closeStrip.open) omitLeft(lastInverse.body, null, true);
				if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
					omitLeft(program.body);
					omitRight(firstInverse.body);
				}
			} else if (block.closeStrip.open) omitLeft(program.body, null, true);
			return strip;
		};
		WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function(mustache) {
			return mustache.strip;
		};
		WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function(node) {
			/* istanbul ignore next */
			var strip = node.strip || {};
			return {
				inlineStandalone: true,
				open: strip.open,
				close: strip.close
			};
		};
		function isPrevWhitespace(body, i, isRoot) {
			if (i === void 0) i = body.length;
			var prev = body[i - 1], sibling = body[i - 2];
			if (!prev) return isRoot;
			if (prev.type === "ContentStatement") return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
		}
		function isNextWhitespace(body, i, isRoot) {
			if (i === void 0) i = -1;
			var next = body[i + 1], sibling = body[i + 2];
			if (!next) return isRoot;
			if (next.type === "ContentStatement") return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
		}
		function omitRight(body, i, multiple) {
			var current = body[i == null ? 0 : i + 1];
			if (!current || current.type !== "ContentStatement" || !multiple && current.rightStripped) return;
			var original = current.value;
			current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, "");
			current.rightStripped = current.value !== original;
		}
		function omitLeft(body, i, multiple) {
			var current = body[i == null ? body.length - 1 : i - 1];
			if (!current || current.type !== "ContentStatement" || !multiple && current.leftStripped) return;
			var original = current.value;
			current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, "");
			current.leftStripped = current.value !== original;
			return current.leftStripped;
		}
		exports["default"] = WhitespaceControl;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js
	var require_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.SourceLocation = SourceLocation;
		exports.id = id;
		exports.stripFlags = stripFlags;
		exports.stripComment = stripComment;
		exports.preparePath = preparePath;
		exports.prepareMustache = prepareMustache;
		exports.prepareRawBlock = prepareRawBlock;
		exports.prepareBlock = prepareBlock;
		exports.prepareProgram = prepareProgram;
		exports.preparePartialBlock = preparePartialBlock;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _exception2 = _interopRequireDefault(require_exception());
		function validateClose(open, close) {
			close = close.path ? close.path.original : close;
			if (open.path.original !== close) {
				var errorNode = { loc: open.path.loc };
				throw new _exception2["default"](open.path.original + " doesn't match " + close, errorNode);
			}
		}
		function SourceLocation(source, locInfo) {
			this.source = source;
			this.start = {
				line: locInfo.first_line,
				column: locInfo.first_column
			};
			this.end = {
				line: locInfo.last_line,
				column: locInfo.last_column
			};
		}
		function id(token) {
			if (/^\[.*\]$/.test(token)) return token.substring(1, token.length - 1);
			else return token;
		}
		function stripFlags(open, close) {
			return {
				open: open.charAt(2) === "~",
				close: close.charAt(close.length - 3) === "~"
			};
		}
		function stripComment(comment) {
			return comment.replace(/^\{\{~?!-?-?/, "").replace(/-?-?~?\}\}$/, "");
		}
		function preparePath(data, parts, loc) {
			loc = this.locInfo(loc);
			var original = data ? "@" : "", dig = [], depth = 0;
			for (var i = 0, l = parts.length; i < l; i++) {
				var part = parts[i].part, isLiteral = parts[i].original !== part;
				original += (parts[i].separator || "") + part;
				if (!isLiteral && (part === ".." || part === "." || part === "this")) {
					if (dig.length > 0) throw new _exception2["default"]("Invalid path: " + original, { loc });
					else if (part === "..") depth++;
				} else dig.push(part);
			}
			return {
				type: "PathExpression",
				data,
				depth,
				parts: dig,
				original,
				loc
			};
		}
		function prepareMustache(path, params, hash, open, strip, locInfo) {
			var escapeFlag = open.charAt(3) || open.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&";
			return {
				type: /\*/.test(open) ? "Decorator" : "MustacheStatement",
				path,
				params,
				hash,
				escaped,
				strip,
				loc: this.locInfo(locInfo)
			};
		}
		function prepareRawBlock(openRawBlock, contents, close, locInfo) {
			validateClose(openRawBlock, close);
			locInfo = this.locInfo(locInfo);
			var program = {
				type: "Program",
				body: contents,
				strip: {},
				loc: locInfo
			};
			return {
				type: "BlockStatement",
				path: openRawBlock.path,
				params: openRawBlock.params,
				hash: openRawBlock.hash,
				program,
				openStrip: {},
				inverseStrip: {},
				closeStrip: {},
				loc: locInfo
			};
		}
		function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
			if (close && close.path) validateClose(openBlock, close);
			var decorator = /\*/.test(openBlock.open);
			program.blockParams = openBlock.blockParams;
			var inverse = void 0, inverseStrip = void 0;
			if (inverseAndProgram) {
				if (decorator) throw new _exception2["default"]("Unexpected inverse block on decorator", inverseAndProgram);
				if (inverseAndProgram.chain) inverseAndProgram.program.body[0].closeStrip = close.strip;
				inverseStrip = inverseAndProgram.strip;
				inverse = inverseAndProgram.program;
			}
			if (inverted) {
				inverted = inverse;
				inverse = program;
				program = inverted;
			}
			return {
				type: decorator ? "DecoratorBlock" : "BlockStatement",
				path: openBlock.path,
				params: openBlock.params,
				hash: openBlock.hash,
				program,
				inverse,
				openStrip: openBlock.strip,
				inverseStrip,
				closeStrip: close && close.strip,
				loc: this.locInfo(locInfo)
			};
		}
		function prepareProgram(statements, loc) {
			if (!loc && statements.length) {
				var firstLoc = statements[0].loc, lastLoc = statements[statements.length - 1].loc;
				/* istanbul ignore else */
				if (firstLoc && lastLoc) loc = {
					source: firstLoc.source,
					start: {
						line: firstLoc.start.line,
						column: firstLoc.start.column
					},
					end: {
						line: lastLoc.end.line,
						column: lastLoc.end.column
					}
				};
			}
			return {
				type: "Program",
				body: statements,
				strip: {},
				loc
			};
		}
		function preparePartialBlock(open, program, close, locInfo) {
			validateClose(open, close);
			return {
				type: "PartialBlockStatement",
				name: open.path,
				params: open.params,
				hash: open.hash,
				program,
				openStrip: open.strip,
				closeStrip: close && close.strip,
				loc: this.locInfo(locInfo)
			};
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/base.js
	var require_base = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.parseWithoutProcessing = parseWithoutProcessing;
		exports.parse = parse;
		// istanbul ignore next
		function _interopRequireWildcard(obj) {
			if (obj && obj.__esModule) return obj;
			else {
				var newObj = {};
				if (obj != null) {
					for (var key in obj) if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
				}
				newObj["default"] = obj;
				return newObj;
			}
		}
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _parser2 = _interopRequireDefault(require_parser$1());
		var _whitespaceControl2 = _interopRequireDefault(require_whitespace_control());
		var Helpers = _interopRequireWildcard(require_helpers());
		var _exception2 = _interopRequireDefault(require_exception());
		var _utils = require_utils();
		exports.parser = _parser2["default"];
		var yy = {};
		_utils.extend(yy, Helpers);
		function parseWithoutProcessing(input, options) {
			if (input.type === "Program") {
				validateInputAst(input);
				return input;
			}
			_parser2["default"].yy = yy;
			yy.locInfo = function(locInfo) {
				return new yy.SourceLocation(options && options.srcName, locInfo);
			};
			return _parser2["default"].parse(input);
		}
		function parse(input, options) {
			var ast = parseWithoutProcessing(input, options);
			return new _whitespaceControl2["default"](options).accept(ast);
		}
		function validateInputAst(ast) {
			validateAstNode(ast);
		}
		function validateAstNode(node) {
			if (node == null) return;
			if (Array.isArray(node)) {
				node.forEach(validateAstNode);
				return;
			}
			if (typeof node !== "object") return;
			if (node.type === "PathExpression") {
				if (!isValidDepth(node.depth)) throw new _exception2["default"]("Invalid AST: PathExpression.depth must be an integer");
				if (!Array.isArray(node.parts)) throw new _exception2["default"]("Invalid AST: PathExpression.parts must be an array");
				for (var i = 0; i < node.parts.length; i++) if (typeof node.parts[i] !== "string") throw new _exception2["default"]("Invalid AST: PathExpression.parts must only contain strings");
			} else if (node.type === "NumberLiteral") {
				if (typeof node.value !== "number" || !isFinite(node.value)) throw new _exception2["default"]("Invalid AST: NumberLiteral.value must be a number");
			} else if (node.type === "BooleanLiteral") {
				if (typeof node.value !== "boolean") throw new _exception2["default"]("Invalid AST: BooleanLiteral.value must be a boolean");
			}
			Object.keys(node).forEach(function(propertyName) {
				if (propertyName === "loc") return;
				validateAstNode(node[propertyName]);
			});
		}
		function isValidDepth(depth) {
			return typeof depth === "number" && isFinite(depth) && Math.floor(depth) === depth && depth >= 0;
		}
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js
	var require_compiler = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.__esModule = true;
		exports.Compiler = Compiler;
		exports.precompile = precompile;
		exports.compile = compile;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _exception2 = _interopRequireDefault(require_exception());
		var _utils = require_utils();
		var _ast2 = _interopRequireDefault(require_ast());
		var slice = [].slice;
		function Compiler() {}
		Compiler.prototype = {
			compiler: Compiler,
			equals: function equals(other) {
				var len = this.opcodes.length;
				if (other.opcodes.length !== len) return false;
				for (var i = 0; i < len; i++) {
					var opcode = this.opcodes[i], otherOpcode = other.opcodes[i];
					if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) return false;
				}
				len = this.children.length;
				for (var i = 0; i < len; i++) if (!this.children[i].equals(other.children[i])) return false;
				return true;
			},
			guid: 0,
			compile: function compile(program, options) {
				this.sourceNode = [];
				this.opcodes = [];
				this.children = [];
				this.options = options;
				this.stringParams = options.stringParams;
				this.trackIds = options.trackIds;
				options.blockParams = options.blockParams || [];
				options.knownHelpers = _utils.extend(Object.create(null), {
					helperMissing: true,
					blockHelperMissing: true,
					each: true,
					"if": true,
					unless: true,
					"with": true,
					log: true,
					lookup: true
				}, options.knownHelpers);
				return this.accept(program);
			},
			compileProgram: function compileProgram(program) {
				var result = new this.compiler().compile(program, this.options), guid = this.guid++;
				this.usePartial = this.usePartial || result.usePartial;
				this.children[guid] = result;
				this.useDepths = this.useDepths || result.useDepths;
				return guid;
			},
			accept: function accept(node) {
				/* istanbul ignore next: Sanity code */
				if (!this[node.type]) throw new _exception2["default"]("Unknown type: " + node.type, node);
				this.sourceNode.unshift(node);
				var ret = this[node.type](node);
				this.sourceNode.shift();
				return ret;
			},
			Program: function Program(program) {
				this.options.blockParams.unshift(program.blockParams);
				var body = program.body, bodyLength = body.length;
				for (var i = 0; i < bodyLength; i++) this.accept(body[i]);
				this.options.blockParams.shift();
				this.isSimple = bodyLength === 1;
				this.blockParams = program.blockParams ? program.blockParams.length : 0;
				return this;
			},
			BlockStatement: function BlockStatement(block) {
				transformLiteralToPath(block);
				var program = block.program, inverse = block.inverse;
				program = program && this.compileProgram(program);
				inverse = inverse && this.compileProgram(inverse);
				var type = this.classifySexpr(block);
				if (type === "helper") this.helperSexpr(block, program, inverse);
				else if (type === "simple") {
					this.simpleSexpr(block);
					this.opcode("pushProgram", program);
					this.opcode("pushProgram", inverse);
					this.opcode("emptyHash");
					this.opcode("blockValue", block.path.original);
				} else {
					this.ambiguousSexpr(block, program, inverse);
					this.opcode("pushProgram", program);
					this.opcode("pushProgram", inverse);
					this.opcode("emptyHash");
					this.opcode("ambiguousBlockValue");
				}
				this.opcode("append");
			},
			DecoratorBlock: function DecoratorBlock(decorator) {
				var program = decorator.program && this.compileProgram(decorator.program);
				var params = this.setupFullMustacheParams(decorator, program, void 0), path = decorator.path;
				this.useDecorators = true;
				this.opcode("registerDecorator", params.length, path.original);
			},
			PartialStatement: function PartialStatement(partial) {
				this.usePartial = true;
				var program = partial.program;
				if (program) program = this.compileProgram(partial.program);
				var params = partial.params;
				if (params.length > 1) throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial);
				else if (!params.length) if (this.options.explicitPartialContext) this.opcode("pushLiteral", "undefined");
				else params.push({
					type: "PathExpression",
					parts: [],
					depth: 0
				});
				var partialName = partial.name.original, isDynamic = partial.name.type === "SubExpression";
				if (isDynamic) this.accept(partial.name);
				this.setupFullMustacheParams(partial, program, void 0, true);
				var indent = partial.indent || "";
				if (this.options.preventIndent && indent) {
					this.opcode("appendContent", indent);
					indent = "";
				}
				this.opcode("invokePartial", isDynamic, partialName, indent);
				this.opcode("append");
			},
			PartialBlockStatement: function PartialBlockStatement(partialBlock) {
				this.PartialStatement(partialBlock);
			},
			MustacheStatement: function MustacheStatement(mustache) {
				this.SubExpression(mustache);
				if (mustache.escaped && !this.options.noEscape) this.opcode("appendEscaped");
				else this.opcode("append");
			},
			Decorator: function Decorator(decorator) {
				this.DecoratorBlock(decorator);
			},
			ContentStatement: function ContentStatement(content) {
				if (content.value) this.opcode("appendContent", content.value);
			},
			CommentStatement: function CommentStatement() {},
			SubExpression: function SubExpression(sexpr) {
				transformLiteralToPath(sexpr);
				var type = this.classifySexpr(sexpr);
				if (type === "simple") this.simpleSexpr(sexpr);
				else if (type === "helper") this.helperSexpr(sexpr);
				else this.ambiguousSexpr(sexpr);
			},
			ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
				var path = sexpr.path, name = path.parts[0], isBlock = program != null || inverse != null;
				this.opcode("getContext", path.depth);
				this.opcode("pushProgram", program);
				this.opcode("pushProgram", inverse);
				path.strict = true;
				this.accept(path);
				this.opcode("invokeAmbiguous", name, isBlock);
			},
			simpleSexpr: function simpleSexpr(sexpr) {
				var path = sexpr.path;
				path.strict = true;
				this.accept(path);
				this.opcode("resolvePossibleLambda");
			},
			helperSexpr: function helperSexpr(sexpr, program, inverse) {
				var params = this.setupFullMustacheParams(sexpr, program, inverse), path = sexpr.path, name = path.parts[0];
				if (this.options.knownHelpers[name]) this.opcode("invokeKnownHelper", params.length, name);
				else if (this.options.knownHelpersOnly) throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
				else {
					path.strict = true;
					path.falsy = true;
					this.accept(path);
					this.opcode("invokeHelper", params.length, path.original, _ast2["default"].helpers.simpleId(path));
				}
			},
			PathExpression: function PathExpression(path) {
				this.addDepth(path.depth);
				this.opcode("getContext", path.depth);
				var name = path.parts[0], scoped = _ast2["default"].helpers.scopedId(path), blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
				if (blockParamId) this.opcode("lookupBlockParam", blockParamId, path.parts);
				else if (!name) this.opcode("pushContext");
				else if (path.data) {
					this.options.data = true;
					this.opcode("lookupData", path.depth, path.parts, path.strict);
				} else this.opcode("lookupOnContext", path.parts, path.falsy, path.strict, scoped);
			},
			StringLiteral: function StringLiteral(string) {
				this.opcode("pushString", string.value);
			},
			NumberLiteral: function NumberLiteral(number) {
				this.opcode("pushLiteral", number.value);
			},
			BooleanLiteral: function BooleanLiteral(bool) {
				this.opcode("pushLiteral", bool.value);
			},
			UndefinedLiteral: function UndefinedLiteral() {
				this.opcode("pushLiteral", "undefined");
			},
			NullLiteral: function NullLiteral() {
				this.opcode("pushLiteral", "null");
			},
			Hash: function Hash(hash) {
				var pairs = hash.pairs, i = 0, l = pairs.length;
				this.opcode("pushHash");
				for (; i < l; i++) this.pushParam(pairs[i].value);
				while (i--) this.opcode("assignToHash", pairs[i].key);
				this.opcode("popHash");
			},
			opcode: function opcode(name) {
				this.opcodes.push({
					opcode: name,
					args: slice.call(arguments, 1),
					loc: this.sourceNode[0].loc
				});
			},
			addDepth: function addDepth(depth) {
				if (!depth) return;
				this.useDepths = true;
			},
			classifySexpr: function classifySexpr(sexpr) {
				var isSimple = _ast2["default"].helpers.simpleId(sexpr.path);
				var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
				var isHelper = !isBlockParam && _ast2["default"].helpers.helperExpression(sexpr);
				var isEligible = !isBlockParam && (isHelper || isSimple);
				if (isEligible && !isHelper) {
					var _name = sexpr.path.parts[0], options = this.options;
					if (options.knownHelpers[_name]) isHelper = true;
					else if (options.knownHelpersOnly) isEligible = false;
				}
				if (isHelper) return "helper";
				else if (isEligible) return "ambiguous";
				else return "simple";
			},
			pushParams: function pushParams(params) {
				for (var i = 0, l = params.length; i < l; i++) this.pushParam(params[i]);
			},
			pushParam: function pushParam(val) {
				var value = val.value != null ? val.value : val.original || "";
				if (this.stringParams) {
					if (value.replace) value = value.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".");
					if (val.depth) this.addDepth(val.depth);
					this.opcode("getContext", val.depth || 0);
					this.opcode("pushStringParam", value, val.type);
					if (val.type === "SubExpression") this.accept(val);
				} else {
					if (this.trackIds) {
						var blockParamIndex = void 0;
						if (val.parts && !_ast2["default"].helpers.scopedId(val) && !val.depth) blockParamIndex = this.blockParamIndex(val.parts[0]);
						if (blockParamIndex) {
							var blockParamChild = val.parts.slice(1).join(".");
							this.opcode("pushId", "BlockParam", blockParamIndex, blockParamChild);
						} else {
							value = val.original || value;
							if (value.replace) value = value.replace(/^this(?:\.|$)/, "").replace(/^\.\//, "").replace(/^\.$/, "");
							this.opcode("pushId", val.type, value);
						}
					}
					this.accept(val);
				}
			},
			setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
				var params = sexpr.params;
				this.pushParams(params);
				this.opcode("pushProgram", program);
				this.opcode("pushProgram", inverse);
				if (sexpr.hash) this.accept(sexpr.hash);
				else this.opcode("emptyHash", omitEmpty);
				return params;
			},
			blockParamIndex: function blockParamIndex(name) {
				for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
					var blockParams = this.options.blockParams[depth], param = blockParams && _utils.indexOf(blockParams, name);
					if (blockParams && param >= 0) return [depth, param];
				}
			}
		};
		function precompile(input, options, env) {
			if (input == null || typeof input !== "string" && input.type !== "Program") throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input);
			options = options || {};
			if (!("data" in options)) options.data = true;
			if (options.compat) options.useDepths = true;
			var ast = env.parse(input, options), environment = new env.Compiler().compile(ast, options);
			return new env.JavaScriptCompiler().compile(environment, options);
		}
		function compile(input, options, env) {
			if (options === void 0) options = {};
			if (input == null || typeof input !== "string" && input.type !== "Program") throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input);
			options = _utils.extend({}, options);
			if (!("data" in options)) options.data = true;
			if (options.compat) options.useDepths = true;
			var compiled = void 0;
			function compileInput() {
				var ast = env.parse(input, options), environment = new env.Compiler().compile(ast, options), templateSpec = new env.JavaScriptCompiler().compile(environment, options, void 0, true);
				return env.template(templateSpec);
			}
			function ret(context, execOptions) {
				if (!compiled) compiled = compileInput();
				return compiled.call(this, context, execOptions);
			}
			ret._setup = function(setupOptions) {
				if (!compiled) compiled = compileInput();
				return compiled._setup(setupOptions);
			};
			ret._child = function(i, data, blockParams, depths) {
				if (!compiled) compiled = compileInput();
				return compiled._child(i, data, blockParams, depths);
			};
			return ret;
		}
		function argEquals(a, b) {
			if (a === b) return true;
			if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
				for (var i = 0; i < a.length; i++) if (!argEquals(a[i], b[i])) return false;
				return true;
			}
		}
		function transformLiteralToPath(sexpr) {
			if (!sexpr.path.parts) {
				var literal = sexpr.path;
				sexpr.path = {
					type: "PathExpression",
					data: false,
					depth: 0,
					parts: [literal.original + ""],
					original: literal.original + "",
					loc: literal.loc
				};
			}
		}
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/base64.js
	var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
		var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
		/**
		* Encode an integer in the range of 0 to 63 to a single base 64 digit.
		*/
		exports.encode = function(number) {
			if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
			throw new TypeError("Must be between 0 and 63: " + number);
		};
		/**
		* Decode a single base 64 character code digit to an integer. Returns -1 on
		* failure.
		*/
		exports.decode = function(charCode) {
			var bigA = 65;
			var bigZ = 90;
			var littleA = 97;
			var littleZ = 122;
			var zero = 48;
			var nine = 57;
			var plus = 43;
			var slash = 47;
			var littleOffset = 26;
			var numberOffset = 52;
			if (bigA <= charCode && charCode <= bigZ) return charCode - bigA;
			if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset;
			if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset;
			if (charCode == plus) return 62;
			if (charCode == slash) return 63;
			return -1;
		};
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/base64-vlq.js
	var require_base64_vlq = /* @__PURE__ */ __commonJSMin(((exports) => {
		var base64 = require_base64();
		var VLQ_BASE_SHIFT = 5;
		var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
		var VLQ_BASE_MASK = VLQ_BASE - 1;
		var VLQ_CONTINUATION_BIT = VLQ_BASE;
		/**
		* Converts from a two-complement value to a value where the sign bit is
		* placed in the least significant bit.  For example, as decimals:
		*   1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
		*   2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
		*/
		function toVLQSigned(aValue) {
			return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
		}
		/**
		* Converts to a two-complement value from a value where the sign bit is
		* placed in the least significant bit.  For example, as decimals:
		*   2 (10 binary) becomes 1, 3 (11 binary) becomes -1
		*   4 (100 binary) becomes 2, 5 (101 binary) becomes -2
		*/
		function fromVLQSigned(aValue) {
			var isNegative = (aValue & 1) === 1;
			var shifted = aValue >> 1;
			return isNegative ? -shifted : shifted;
		}
		/**
		* Returns the base 64 VLQ encoded value.
		*/
		exports.encode = function base64VLQ_encode(aValue) {
			var encoded = "";
			var digit;
			var vlq = toVLQSigned(aValue);
			do {
				digit = vlq & VLQ_BASE_MASK;
				vlq >>>= VLQ_BASE_SHIFT;
				if (vlq > 0) digit |= VLQ_CONTINUATION_BIT;
				encoded += base64.encode(digit);
			} while (vlq > 0);
			return encoded;
		};
		/**
		* Decodes the next base 64 VLQ value from the given string and returns the
		* value and the rest of the string via the out parameter.
		*/
		exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
			var strLen = aStr.length;
			var result = 0;
			var shift = 0;
			var continuation, digit;
			do {
				if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value.");
				digit = base64.decode(aStr.charCodeAt(aIndex++));
				if (digit === -1) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
				continuation = !!(digit & VLQ_CONTINUATION_BIT);
				digit &= VLQ_BASE_MASK;
				result = result + (digit << shift);
				shift += VLQ_BASE_SHIFT;
			} while (continuation);
			aOutParam.value = fromVLQSigned(result);
			aOutParam.rest = aIndex;
		};
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/util.js
	var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
		/**
		* This is a helper function for getting values from parameter/options
		* objects.
		*
		* @param args The object we are extracting values from
		* @param name The name of the property we are getting.
		* @param defaultValue An optional value to return if the property is missing
		* from the object. If this is not specified and the property is missing, an
		* error will be thrown.
		*/
		function getArg(aArgs, aName, aDefaultValue) {
			if (aName in aArgs) return aArgs[aName];
			else if (arguments.length === 3) return aDefaultValue;
			else throw new Error("\"" + aName + "\" is a required argument.");
		}
		exports.getArg = getArg;
		var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
		var dataUrlRegexp = /^data:.+\,.+$/;
		function urlParse(aUrl) {
			var match = aUrl.match(urlRegexp);
			if (!match) return null;
			return {
				scheme: match[1],
				auth: match[2],
				host: match[3],
				port: match[4],
				path: match[5]
			};
		}
		exports.urlParse = urlParse;
		function urlGenerate(aParsedUrl) {
			var url = "";
			if (aParsedUrl.scheme) url += aParsedUrl.scheme + ":";
			url += "//";
			if (aParsedUrl.auth) url += aParsedUrl.auth + "@";
			if (aParsedUrl.host) url += aParsedUrl.host;
			if (aParsedUrl.port) url += ":" + aParsedUrl.port;
			if (aParsedUrl.path) url += aParsedUrl.path;
			return url;
		}
		exports.urlGenerate = urlGenerate;
		/**
		* Normalizes a path, or the path portion of a URL:
		*
		* - Replaces consecutive slashes with one slash.
		* - Removes unnecessary '.' parts.
		* - Removes unnecessary '<dir>/..' parts.
		*
		* Based on code in the Node.js 'path' core module.
		*
		* @param aPath The path or url to normalize.
		*/
		function normalize(aPath) {
			var path = aPath;
			var url = urlParse(aPath);
			if (url) {
				if (!url.path) return aPath;
				path = url.path;
			}
			var isAbsolute = exports.isAbsolute(path);
			var parts = path.split(/\/+/);
			for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
				part = parts[i];
				if (part === ".") parts.splice(i, 1);
				else if (part === "..") up++;
				else if (up > 0) if (part === "") {
					parts.splice(i + 1, up);
					up = 0;
				} else {
					parts.splice(i, 2);
					up--;
				}
			}
			path = parts.join("/");
			if (path === "") path = isAbsolute ? "/" : ".";
			if (url) {
				url.path = path;
				return urlGenerate(url);
			}
			return path;
		}
		exports.normalize = normalize;
		/**
		* Joins two paths/URLs.
		*
		* @param aRoot The root path or URL.
		* @param aPath The path or URL to be joined with the root.
		*
		* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
		*   scheme-relative URL: Then the scheme of aRoot, if any, is prepended
		*   first.
		* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
		*   is updated with the result and aRoot is returned. Otherwise the result
		*   is returned.
		*   - If aPath is absolute, the result is aPath.
		*   - Otherwise the two paths are joined with a slash.
		* - Joining for example 'http://' and 'www.example.com' is also supported.
		*/
		function join(aRoot, aPath) {
			if (aRoot === "") aRoot = ".";
			if (aPath === "") aPath = ".";
			var aPathUrl = urlParse(aPath);
			var aRootUrl = urlParse(aRoot);
			if (aRootUrl) aRoot = aRootUrl.path || "/";
			if (aPathUrl && !aPathUrl.scheme) {
				if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme;
				return urlGenerate(aPathUrl);
			}
			if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath;
			if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
				aRootUrl.host = aPath;
				return urlGenerate(aRootUrl);
			}
			var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
			if (aRootUrl) {
				aRootUrl.path = joined;
				return urlGenerate(aRootUrl);
			}
			return joined;
		}
		exports.join = join;
		exports.isAbsolute = function(aPath) {
			return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
		};
		/**
		* Make a path relative to a URL or another path.
		*
		* @param aRoot The root path or URL.
		* @param aPath The path or URL to be made relative to aRoot.
		*/
		function relative(aRoot, aPath) {
			if (aRoot === "") aRoot = ".";
			aRoot = aRoot.replace(/\/$/, "");
			var level = 0;
			while (aPath.indexOf(aRoot + "/") !== 0) {
				var index = aRoot.lastIndexOf("/");
				if (index < 0) return aPath;
				aRoot = aRoot.slice(0, index);
				if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath;
				++level;
			}
			return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
		}
		exports.relative = relative;
		var supportsNullProto = function() {
			return !("__proto__" in Object.create(null));
		}();
		function identity(s) {
			return s;
		}
		/**
		* Because behavior goes wacky when you set `__proto__` on objects, we
		* have to prefix all the strings in our set with an arbitrary character.
		*
		* See https://github.com/mozilla/source-map/pull/31 and
		* https://github.com/mozilla/source-map/issues/30
		*
		* @param String aStr
		*/
		function toSetString(aStr) {
			if (isProtoString(aStr)) return "$" + aStr;
			return aStr;
		}
		exports.toSetString = supportsNullProto ? identity : toSetString;
		function fromSetString(aStr) {
			if (isProtoString(aStr)) return aStr.slice(1);
			return aStr;
		}
		exports.fromSetString = supportsNullProto ? identity : fromSetString;
		function isProtoString(s) {
			if (!s) return false;
			var length = s.length;
			if (length < 9) return false;
			if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) return false;
			for (var i = length - 10; i >= 0; i--) if (s.charCodeAt(i) !== 36) return false;
			return true;
		}
		/**
		* Comparator between two mappings where the original positions are compared.
		*
		* Optionally pass in `true` as `onlyCompareGenerated` to consider two
		* mappings with the same original source/line/column, but different generated
		* line and column the same. Useful when searching for a mapping with a
		* stubbed out mapping.
		*/
		function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
			var cmp = strcmp(mappingA.source, mappingB.source);
			if (cmp !== 0) return cmp;
			cmp = mappingA.originalLine - mappingB.originalLine;
			if (cmp !== 0) return cmp;
			cmp = mappingA.originalColumn - mappingB.originalColumn;
			if (cmp !== 0 || onlyCompareOriginal) return cmp;
			cmp = mappingA.generatedColumn - mappingB.generatedColumn;
			if (cmp !== 0) return cmp;
			cmp = mappingA.generatedLine - mappingB.generatedLine;
			if (cmp !== 0) return cmp;
			return strcmp(mappingA.name, mappingB.name);
		}
		exports.compareByOriginalPositions = compareByOriginalPositions;
		/**
		* Comparator between two mappings with deflated source and name indices where
		* the generated positions are compared.
		*
		* Optionally pass in `true` as `onlyCompareGenerated` to consider two
		* mappings with the same generated line and column, but different
		* source/name/original line and column the same. Useful when searching for a
		* mapping with a stubbed out mapping.
		*/
		function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
			var cmp = mappingA.generatedLine - mappingB.generatedLine;
			if (cmp !== 0) return cmp;
			cmp = mappingA.generatedColumn - mappingB.generatedColumn;
			if (cmp !== 0 || onlyCompareGenerated) return cmp;
			cmp = strcmp(mappingA.source, mappingB.source);
			if (cmp !== 0) return cmp;
			cmp = mappingA.originalLine - mappingB.originalLine;
			if (cmp !== 0) return cmp;
			cmp = mappingA.originalColumn - mappingB.originalColumn;
			if (cmp !== 0) return cmp;
			return strcmp(mappingA.name, mappingB.name);
		}
		exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
		function strcmp(aStr1, aStr2) {
			if (aStr1 === aStr2) return 0;
			if (aStr1 === null) return 1;
			if (aStr2 === null) return -1;
			if (aStr1 > aStr2) return 1;
			return -1;
		}
		/**
		* Comparator between two mappings with inflated source and name strings where
		* the generated positions are compared.
		*/
		function compareByGeneratedPositionsInflated(mappingA, mappingB) {
			var cmp = mappingA.generatedLine - mappingB.generatedLine;
			if (cmp !== 0) return cmp;
			cmp = mappingA.generatedColumn - mappingB.generatedColumn;
			if (cmp !== 0) return cmp;
			cmp = strcmp(mappingA.source, mappingB.source);
			if (cmp !== 0) return cmp;
			cmp = mappingA.originalLine - mappingB.originalLine;
			if (cmp !== 0) return cmp;
			cmp = mappingA.originalColumn - mappingB.originalColumn;
			if (cmp !== 0) return cmp;
			return strcmp(mappingA.name, mappingB.name);
		}
		exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
		/**
		* Strip any JSON XSSI avoidance prefix from the string (as documented
		* in the source maps specification), and then parse the string as
		* JSON.
		*/
		function parseSourceMapInput(str) {
			return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
		}
		exports.parseSourceMapInput = parseSourceMapInput;
		/**
		* Compute the URL of a source given the the source root, the source's
		* URL, and the source map's URL.
		*/
		function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
			sourceURL = sourceURL || "";
			if (sourceRoot) {
				if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") sourceRoot += "/";
				sourceURL = sourceRoot + sourceURL;
			}
			if (sourceMapURL) {
				var parsed = urlParse(sourceMapURL);
				if (!parsed) throw new Error("sourceMapURL could not be parsed");
				if (parsed.path) {
					var index = parsed.path.lastIndexOf("/");
					if (index >= 0) parsed.path = parsed.path.substring(0, index + 1);
				}
				sourceURL = join(urlGenerate(parsed), sourceURL);
			}
			return normalize(sourceURL);
		}
		exports.computeSourceURL = computeSourceURL;
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/array-set.js
	var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => {
		var util = require_util();
		var has = Object.prototype.hasOwnProperty;
		var hasNativeMap = typeof Map !== "undefined";
		/**
		* A data structure which is a combination of an array and a set. Adding a new
		* member is O(1), testing for membership is O(1), and finding the index of an
		* element is O(1). Removing elements from the set is not supported. Only
		* strings are supported for membership.
		*/
		function ArraySet() {
			this._array = [];
			this._set = hasNativeMap ? /* @__PURE__ */ new Map() : Object.create(null);
		}
		/**
		* Static method for creating ArraySet instances from an existing array.
		*/
		ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
			var set = new ArraySet();
			for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates);
			return set;
		};
		/**
		* Return how many unique items are in this ArraySet. If duplicates have been
		* added, than those do not count towards the size.
		*
		* @returns Number
		*/
		ArraySet.prototype.size = function ArraySet_size() {
			return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
		};
		/**
		* Add the given string to this set.
		*
		* @param String aStr
		*/
		ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
			var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
			var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
			var idx = this._array.length;
			if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
			if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx);
			else this._set[sStr] = idx;
		};
		/**
		* Is the given string a member of this set?
		*
		* @param String aStr
		*/
		ArraySet.prototype.has = function ArraySet_has(aStr) {
			if (hasNativeMap) return this._set.has(aStr);
			else {
				var sStr = util.toSetString(aStr);
				return has.call(this._set, sStr);
			}
		};
		/**
		* What is the index of the given string in the array?
		*
		* @param String aStr
		*/
		ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
			if (hasNativeMap) {
				var idx = this._set.get(aStr);
				if (idx >= 0) return idx;
			} else {
				var sStr = util.toSetString(aStr);
				if (has.call(this._set, sStr)) return this._set[sStr];
			}
			throw new Error("\"" + aStr + "\" is not in the set.");
		};
		/**
		* What is the element at the given index?
		*
		* @param Number aIdx
		*/
		ArraySet.prototype.at = function ArraySet_at(aIdx) {
			if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx];
			throw new Error("No element indexed by " + aIdx);
		};
		/**
		* Returns the array representation of this set (which has the proper indices
		* indicated by indexOf). Note that this is a copy of the internal array used
		* for storing the members so that no one can mess with internal state.
		*/
		ArraySet.prototype.toArray = function ArraySet_toArray() {
			return this._array.slice();
		};
		exports.ArraySet = ArraySet;
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/mapping-list.js
	var require_mapping_list = /* @__PURE__ */ __commonJSMin(((exports) => {
		var util = require_util();
		/**
		* Determine whether mappingB is after mappingA with respect to generated
		* position.
		*/
		function generatedPositionAfter(mappingA, mappingB) {
			var lineA = mappingA.generatedLine;
			var lineB = mappingB.generatedLine;
			var columnA = mappingA.generatedColumn;
			var columnB = mappingB.generatedColumn;
			return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
		}
		/**
		* A data structure to provide a sorted view of accumulated mappings in a
		* performance conscious manner. It trades a neglibable overhead in general
		* case for a large speedup in case of mappings being added in order.
		*/
		function MappingList() {
			this._array = [];
			this._sorted = true;
			this._last = {
				generatedLine: -1,
				generatedColumn: 0
			};
		}
		/**
		* Iterate through internal items. This method takes the same arguments that
		* `Array.prototype.forEach` takes.
		*
		* NOTE: The order of the mappings is NOT guaranteed.
		*/
		MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
			this._array.forEach(aCallback, aThisArg);
		};
		/**
		* Add the given source mapping.
		*
		* @param Object aMapping
		*/
		MappingList.prototype.add = function MappingList_add(aMapping) {
			if (generatedPositionAfter(this._last, aMapping)) {
				this._last = aMapping;
				this._array.push(aMapping);
			} else {
				this._sorted = false;
				this._array.push(aMapping);
			}
		};
		/**
		* Returns the flat, sorted array of mappings. The mappings are sorted by
		* generated position.
		*
		* WARNING: This method returns internal data without copying, for
		* performance. The return value must NOT be mutated, and should be treated as
		* an immutable borrow. If you want to take ownership, you must make your own
		* copy.
		*/
		MappingList.prototype.toArray = function MappingList_toArray() {
			if (!this._sorted) {
				this._array.sort(util.compareByGeneratedPositionsInflated);
				this._sorted = true;
			}
			return this._array;
		};
		exports.MappingList = MappingList;
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/source-map-generator.js
	var require_source_map_generator = /* @__PURE__ */ __commonJSMin(((exports) => {
		var base64VLQ = require_base64_vlq();
		var util = require_util();
		var ArraySet = require_array_set().ArraySet;
		var MappingList = require_mapping_list().MappingList;
		/**
		* An instance of the SourceMapGenerator represents a source map which is
		* being built incrementally. You may pass an object with the following
		* properties:
		*
		*   - file: The filename of the generated source.
		*   - sourceRoot: A root for all relative URLs in this source map.
		*/
		function SourceMapGenerator(aArgs) {
			if (!aArgs) aArgs = {};
			this._file = util.getArg(aArgs, "file", null);
			this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
			this._skipValidation = util.getArg(aArgs, "skipValidation", false);
			this._sources = new ArraySet();
			this._names = new ArraySet();
			this._mappings = new MappingList();
			this._sourcesContents = null;
		}
		SourceMapGenerator.prototype._version = 3;
		/**
		* Creates a new SourceMapGenerator based on a SourceMapConsumer
		*
		* @param aSourceMapConsumer The SourceMap.
		*/
		SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
			var sourceRoot = aSourceMapConsumer.sourceRoot;
			var generator = new SourceMapGenerator({
				file: aSourceMapConsumer.file,
				sourceRoot
			});
			aSourceMapConsumer.eachMapping(function(mapping) {
				var newMapping = { generated: {
					line: mapping.generatedLine,
					column: mapping.generatedColumn
				} };
				if (mapping.source != null) {
					newMapping.source = mapping.source;
					if (sourceRoot != null) newMapping.source = util.relative(sourceRoot, newMapping.source);
					newMapping.original = {
						line: mapping.originalLine,
						column: mapping.originalColumn
					};
					if (mapping.name != null) newMapping.name = mapping.name;
				}
				generator.addMapping(newMapping);
			});
			aSourceMapConsumer.sources.forEach(function(sourceFile) {
				var sourceRelative = sourceFile;
				if (sourceRoot !== null) sourceRelative = util.relative(sourceRoot, sourceFile);
				if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative);
				var content = aSourceMapConsumer.sourceContentFor(sourceFile);
				if (content != null) generator.setSourceContent(sourceFile, content);
			});
			return generator;
		};
		/**
		* Add a single mapping from original source line and column to the generated
		* source's line and column for this source map being created. The mapping
		* object should have the following properties:
		*
		*   - generated: An object with the generated line and column positions.
		*   - original: An object with the original line and column positions.
		*   - source: The original source file (relative to the sourceRoot).
		*   - name: An optional original token name for this mapping.
		*/
		SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
			var generated = util.getArg(aArgs, "generated");
			var original = util.getArg(aArgs, "original", null);
			var source = util.getArg(aArgs, "source", null);
			var name = util.getArg(aArgs, "name", null);
			if (!this._skipValidation) this._validateMapping(generated, original, source, name);
			if (source != null) {
				source = String(source);
				if (!this._sources.has(source)) this._sources.add(source);
			}
			if (name != null) {
				name = String(name);
				if (!this._names.has(name)) this._names.add(name);
			}
			this._mappings.add({
				generatedLine: generated.line,
				generatedColumn: generated.column,
				originalLine: original != null && original.line,
				originalColumn: original != null && original.column,
				source,
				name
			});
		};
		/**
		* Set the source content for a source file.
		*/
		SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
			var source = aSourceFile;
			if (this._sourceRoot != null) source = util.relative(this._sourceRoot, source);
			if (aSourceContent != null) {
				if (!this._sourcesContents) this._sourcesContents = Object.create(null);
				this._sourcesContents[util.toSetString(source)] = aSourceContent;
			} else if (this._sourcesContents) {
				delete this._sourcesContents[util.toSetString(source)];
				if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null;
			}
		};
		/**
		* Applies the mappings of a sub-source-map for a specific source file to the
		* source map being generated. Each mapping to the supplied source file is
		* rewritten using the supplied source map. Note: The resolution for the
		* resulting mappings is the minimium of this map and the supplied map.
		*
		* @param aSourceMapConsumer The source map to be applied.
		* @param aSourceFile Optional. The filename of the source file.
		*        If omitted, SourceMapConsumer's file property will be used.
		* @param aSourceMapPath Optional. The dirname of the path to the source map
		*        to be applied. If relative, it is relative to the SourceMapConsumer.
		*        This parameter is needed when the two source maps aren't in the same
		*        directory, and the source map to be applied contains relative source
		*        paths. If so, those relative source paths need to be rewritten
		*        relative to the SourceMapGenerator.
		*/
		SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
			var sourceFile = aSourceFile;
			if (aSourceFile == null) {
				if (aSourceMapConsumer.file == null) throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted.");
				sourceFile = aSourceMapConsumer.file;
			}
			var sourceRoot = this._sourceRoot;
			if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile);
			var newSources = new ArraySet();
			var newNames = new ArraySet();
			this._mappings.unsortedForEach(function(mapping) {
				if (mapping.source === sourceFile && mapping.originalLine != null) {
					var original = aSourceMapConsumer.originalPositionFor({
						line: mapping.originalLine,
						column: mapping.originalColumn
					});
					if (original.source != null) {
						mapping.source = original.source;
						if (aSourceMapPath != null) mapping.source = util.join(aSourceMapPath, mapping.source);
						if (sourceRoot != null) mapping.source = util.relative(sourceRoot, mapping.source);
						mapping.originalLine = original.line;
						mapping.originalColumn = original.column;
						if (original.name != null) mapping.name = original.name;
					}
				}
				var source = mapping.source;
				if (source != null && !newSources.has(source)) newSources.add(source);
				var name = mapping.name;
				if (name != null && !newNames.has(name)) newNames.add(name);
			}, this);
			this._sources = newSources;
			this._names = newNames;
			aSourceMapConsumer.sources.forEach(function(sourceFile) {
				var content = aSourceMapConsumer.sourceContentFor(sourceFile);
				if (content != null) {
					if (aSourceMapPath != null) sourceFile = util.join(aSourceMapPath, sourceFile);
					if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile);
					this.setSourceContent(sourceFile, content);
				}
			}, this);
		};
		/**
		* A mapping can have one of the three levels of data:
		*
		*   1. Just the generated position.
		*   2. The Generated position, original position, and original source.
		*   3. Generated and original position, original source, as well as a name
		*      token.
		*
		* To maintain consistency, we validate that any new mapping being added falls
		* in to one of these categories.
		*/
		SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
			if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");
			if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return;
			else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) return;
			else throw new Error("Invalid mapping: " + JSON.stringify({
				generated: aGenerated,
				source: aSource,
				original: aOriginal,
				name: aName
			}));
		};
		/**
		* Serialize the accumulated mappings in to the stream of base 64 VLQs
		* specified by the source map format.
		*/
		SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
			var previousGeneratedColumn = 0;
			var previousGeneratedLine = 1;
			var previousOriginalColumn = 0;
			var previousOriginalLine = 0;
			var previousName = 0;
			var previousSource = 0;
			var result = "";
			var next;
			var mapping;
			var nameIdx;
			var sourceIdx;
			var mappings = this._mappings.toArray();
			for (var i = 0, len = mappings.length; i < len; i++) {
				mapping = mappings[i];
				next = "";
				if (mapping.generatedLine !== previousGeneratedLine) {
					previousGeneratedColumn = 0;
					while (mapping.generatedLine !== previousGeneratedLine) {
						next += ";";
						previousGeneratedLine++;
					}
				} else if (i > 0) {
					if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
					next += ",";
				}
				next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
				previousGeneratedColumn = mapping.generatedColumn;
				if (mapping.source != null) {
					sourceIdx = this._sources.indexOf(mapping.source);
					next += base64VLQ.encode(sourceIdx - previousSource);
					previousSource = sourceIdx;
					next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
					previousOriginalLine = mapping.originalLine - 1;
					next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
					previousOriginalColumn = mapping.originalColumn;
					if (mapping.name != null) {
						nameIdx = this._names.indexOf(mapping.name);
						next += base64VLQ.encode(nameIdx - previousName);
						previousName = nameIdx;
					}
				}
				result += next;
			}
			return result;
		};
		SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
			return aSources.map(function(source) {
				if (!this._sourcesContents) return null;
				if (aSourceRoot != null) source = util.relative(aSourceRoot, source);
				var key = util.toSetString(source);
				return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
			}, this);
		};
		/**
		* Externalize the source map.
		*/
		SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
			var map = {
				version: this._version,
				sources: this._sources.toArray(),
				names: this._names.toArray(),
				mappings: this._serializeMappings()
			};
			if (this._file != null) map.file = this._file;
			if (this._sourceRoot != null) map.sourceRoot = this._sourceRoot;
			if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
			return map;
		};
		/**
		* Render the source map being generated to a string.
		*/
		SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
			return JSON.stringify(this.toJSON());
		};
		exports.SourceMapGenerator = SourceMapGenerator;
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/binary-search.js
	var require_binary_search = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.GREATEST_LOWER_BOUND = 1;
		exports.LEAST_UPPER_BOUND = 2;
		/**
		* Recursive implementation of binary search.
		*
		* @param aLow Indices here and lower do not contain the needle.
		* @param aHigh Indices here and higher do not contain the needle.
		* @param aNeedle The element being searched for.
		* @param aHaystack The non-empty array being searched.
		* @param aCompare Function which takes two elements and returns -1, 0, or 1.
		* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
		*     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
		*     closest element that is smaller than or greater than the one we are
		*     searching for, respectively, if the exact element cannot be found.
		*/
		function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
			var mid = Math.floor((aHigh - aLow) / 2) + aLow;
			var cmp = aCompare(aNeedle, aHaystack[mid], true);
			if (cmp === 0) return mid;
			else if (cmp > 0) {
				if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
				if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1;
				else return mid;
			} else {
				if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
				if (aBias == exports.LEAST_UPPER_BOUND) return mid;
				else return aLow < 0 ? -1 : aLow;
			}
		}
		/**
		* This is an implementation of binary search which will always try and return
		* the index of the closest element if there is no exact hit. This is because
		* mappings between original and generated line/col pairs are single points,
		* and there is an implicit region between each of them, so a miss just means
		* that you aren't on the very start of a region.
		*
		* @param aNeedle The element you are looking for.
		* @param aHaystack The array that is being searched.
		* @param aCompare A function which takes the needle and an element in the
		*     array and returns -1, 0, or 1 depending on whether the needle is less
		*     than, equal to, or greater than the element, respectively.
		* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
		*     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
		*     closest element that is smaller than or greater than the one we are
		*     searching for, respectively, if the exact element cannot be found.
		*     Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
		*/
		exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
			if (aHaystack.length === 0) return -1;
			var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
			if (index < 0) return -1;
			while (index - 1 >= 0) {
				if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) break;
				--index;
			}
			return index;
		};
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/quick-sort.js
	var require_quick_sort = /* @__PURE__ */ __commonJSMin(((exports) => {
		/**
		* Swap the elements indexed by `x` and `y` in the array `ary`.
		*
		* @param {Array} ary
		*        The array.
		* @param {Number} x
		*        The index of the first item.
		* @param {Number} y
		*        The index of the second item.
		*/
		function swap(ary, x, y) {
			var temp = ary[x];
			ary[x] = ary[y];
			ary[y] = temp;
		}
		/**
		* Returns a random integer within the range `low .. high` inclusive.
		*
		* @param {Number} low
		*        The lower bound on the range.
		* @param {Number} high
		*        The upper bound on the range.
		*/
		function randomIntInRange(low, high) {
			return Math.round(low + Math.random() * (high - low));
		}
		/**
		* The Quick Sort algorithm.
		*
		* @param {Array} ary
		*        An array to sort.
		* @param {function} comparator
		*        Function to use to compare two items.
		* @param {Number} p
		*        Start index of the array
		* @param {Number} r
		*        End index of the array
		*/
		function doQuickSort(ary, comparator, p, r) {
			if (p < r) {
				var pivotIndex = randomIntInRange(p, r);
				var i = p - 1;
				swap(ary, pivotIndex, r);
				var pivot = ary[r];
				for (var j = p; j < r; j++) if (comparator(ary[j], pivot) <= 0) {
					i += 1;
					swap(ary, i, j);
				}
				swap(ary, i + 1, j);
				var q = i + 1;
				doQuickSort(ary, comparator, p, q - 1);
				doQuickSort(ary, comparator, q + 1, r);
			}
		}
		/**
		* Sort the given array in-place with the given comparator function.
		*
		* @param {Array} ary
		*        An array to sort.
		* @param {function} comparator
		*        Function to use to compare two items.
		*/
		exports.quickSort = function(ary, comparator) {
			doQuickSort(ary, comparator, 0, ary.length - 1);
		};
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/source-map-consumer.js
	var require_source_map_consumer = /* @__PURE__ */ __commonJSMin(((exports) => {
		var util = require_util();
		var binarySearch = require_binary_search();
		var ArraySet = require_array_set().ArraySet;
		var base64VLQ = require_base64_vlq();
		var quickSort = require_quick_sort().quickSort;
		function SourceMapConsumer(aSourceMap, aSourceMapURL) {
			var sourceMap = aSourceMap;
			if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
			return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
		}
		SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
			return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
		};
		/**
		* The version of the source mapping spec that we are consuming.
		*/
		SourceMapConsumer.prototype._version = 3;
		SourceMapConsumer.prototype.__generatedMappings = null;
		Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
			configurable: true,
			enumerable: true,
			get: function() {
				if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot);
				return this.__generatedMappings;
			}
		});
		SourceMapConsumer.prototype.__originalMappings = null;
		Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
			configurable: true,
			enumerable: true,
			get: function() {
				if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot);
				return this.__originalMappings;
			}
		});
		SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
			var c = aStr.charAt(index);
			return c === ";" || c === ",";
		};
		/**
		* Parse the mappings in a string in to a data structure which we can easily
		* query (the ordered arrays in the `this.__generatedMappings` and
		* `this.__originalMappings` properties).
		*/
		SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
			throw new Error("Subclasses must implement _parseMappings");
		};
		SourceMapConsumer.GENERATED_ORDER = 1;
		SourceMapConsumer.ORIGINAL_ORDER = 2;
		SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
		SourceMapConsumer.LEAST_UPPER_BOUND = 2;
		/**
		* Iterate over each mapping between an original source/line/column and a
		* generated line/column in this source map.
		*
		* @param Function aCallback
		*        The function that is called with each mapping.
		* @param Object aContext
		*        Optional. If specified, this object will be the value of `this` every
		*        time that `aCallback` is called.
		* @param aOrder
		*        Either `SourceMapConsumer.GENERATED_ORDER` or
		*        `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
		*        iterate over the mappings sorted by the generated file's line/column
		*        order or the original's source/line/column order, respectively. Defaults to
		*        `SourceMapConsumer.GENERATED_ORDER`.
		*/
		SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
			var context = aContext || null;
			var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
			var mappings;
			switch (order) {
				case SourceMapConsumer.GENERATED_ORDER:
					mappings = this._generatedMappings;
					break;
				case SourceMapConsumer.ORIGINAL_ORDER:
					mappings = this._originalMappings;
					break;
				default: throw new Error("Unknown order of iteration.");
			}
			var sourceRoot = this.sourceRoot;
			mappings.map(function(mapping) {
				var source = mapping.source === null ? null : this._sources.at(mapping.source);
				source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
				return {
					source,
					generatedLine: mapping.generatedLine,
					generatedColumn: mapping.generatedColumn,
					originalLine: mapping.originalLine,
					originalColumn: mapping.originalColumn,
					name: mapping.name === null ? null : this._names.at(mapping.name)
				};
			}, this).forEach(aCallback, context);
		};
		/**
		* Returns all generated line and column information for the original source,
		* line, and column provided. If no column is provided, returns all mappings
		* corresponding to a either the line we are searching for or the next
		* closest line that has any mappings. Otherwise, returns all mappings
		* corresponding to the given line and either the column we are searching for
		* or the next closest column that has any offsets.
		*
		* The only argument is an object with the following properties:
		*
		*   - source: The filename of the original source.
		*   - line: The line number in the original source.  The line number is 1-based.
		*   - column: Optional. the column number in the original source.
		*    The column number is 0-based.
		*
		* and an array of objects is returned, each with the following properties:
		*
		*   - line: The line number in the generated source, or null.  The
		*    line number is 1-based.
		*   - column: The column number in the generated source, or null.
		*    The column number is 0-based.
		*/
		SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
			var line = util.getArg(aArgs, "line");
			var needle = {
				source: util.getArg(aArgs, "source"),
				originalLine: line,
				originalColumn: util.getArg(aArgs, "column", 0)
			};
			needle.source = this._findSourceIndex(needle.source);
			if (needle.source < 0) return [];
			var mappings = [];
			var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
			if (index >= 0) {
				var mapping = this._originalMappings[index];
				if (aArgs.column === void 0) {
					var originalLine = mapping.originalLine;
					while (mapping && mapping.originalLine === originalLine) {
						mappings.push({
							line: util.getArg(mapping, "generatedLine", null),
							column: util.getArg(mapping, "generatedColumn", null),
							lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
						});
						mapping = this._originalMappings[++index];
					}
				} else {
					var originalColumn = mapping.originalColumn;
					while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
						mappings.push({
							line: util.getArg(mapping, "generatedLine", null),
							column: util.getArg(mapping, "generatedColumn", null),
							lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
						});
						mapping = this._originalMappings[++index];
					}
				}
			}
			return mappings;
		};
		exports.SourceMapConsumer = SourceMapConsumer;
		/**
		* A BasicSourceMapConsumer instance represents a parsed source map which we can
		* query for information about the original file positions by giving it a file
		* position in the generated source.
		*
		* The first parameter is the raw source map (either as a JSON string, or
		* already parsed to an object). According to the spec, source maps have the
		* following attributes:
		*
		*   - version: Which version of the source map spec this map is following.
		*   - sources: An array of URLs to the original source files.
		*   - names: An array of identifiers which can be referrenced by individual mappings.
		*   - sourceRoot: Optional. The URL root from which all sources are relative.
		*   - sourcesContent: Optional. An array of contents of the original source files.
		*   - mappings: A string of base64 VLQs which contain the actual mappings.
		*   - file: Optional. The generated file this source map is associated with.
		*
		* Here is an example source map, taken from the source map spec[0]:
		*
		*     {
		*       version : 3,
		*       file: "out.js",
		*       sourceRoot : "",
		*       sources: ["foo.js", "bar.js"],
		*       names: ["src", "maps", "are", "fun"],
		*       mappings: "AA,AB;;ABCDE;"
		*     }
		*
		* The second parameter, if given, is a string whose value is the URL
		* at which the source map was found.  This URL is used to compute the
		* sources array.
		*
		* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
		*/
		function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
			var sourceMap = aSourceMap;
			if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
			var version = util.getArg(sourceMap, "version");
			var sources = util.getArg(sourceMap, "sources");
			var names = util.getArg(sourceMap, "names", []);
			var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
			var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
			var mappings = util.getArg(sourceMap, "mappings");
			var file = util.getArg(sourceMap, "file", null);
			if (version != this._version) throw new Error("Unsupported version: " + version);
			if (sourceRoot) sourceRoot = util.normalize(sourceRoot);
			sources = sources.map(String).map(util.normalize).map(function(source) {
				return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
			});
			this._names = ArraySet.fromArray(names.map(String), true);
			this._sources = ArraySet.fromArray(sources, true);
			this._absoluteSources = this._sources.toArray().map(function(s) {
				return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
			});
			this.sourceRoot = sourceRoot;
			this.sourcesContent = sourcesContent;
			this._mappings = mappings;
			this._sourceMapURL = aSourceMapURL;
			this.file = file;
		}
		BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
		BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
		/**
		* Utility function to find the index of a source.  Returns -1 if not
		* found.
		*/
		BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
			var relativeSource = aSource;
			if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource);
			if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource);
			var i;
			for (i = 0; i < this._absoluteSources.length; ++i) if (this._absoluteSources[i] == aSource) return i;
			return -1;
		};
		/**
		* Create a BasicSourceMapConsumer from a SourceMapGenerator.
		*
		* @param SourceMapGenerator aSourceMap
		*        The source map that will be consumed.
		* @param String aSourceMapURL
		*        The URL at which the source map can be found (optional)
		* @returns BasicSourceMapConsumer
		*/
		BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
			var smc = Object.create(BasicSourceMapConsumer.prototype);
			var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
			var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
			smc.sourceRoot = aSourceMap._sourceRoot;
			smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
			smc.file = aSourceMap._file;
			smc._sourceMapURL = aSourceMapURL;
			smc._absoluteSources = smc._sources.toArray().map(function(s) {
				return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
			});
			var generatedMappings = aSourceMap._mappings.toArray().slice();
			var destGeneratedMappings = smc.__generatedMappings = [];
			var destOriginalMappings = smc.__originalMappings = [];
			for (var i = 0, length = generatedMappings.length; i < length; i++) {
				var srcMapping = generatedMappings[i];
				var destMapping = new Mapping();
				destMapping.generatedLine = srcMapping.generatedLine;
				destMapping.generatedColumn = srcMapping.generatedColumn;
				if (srcMapping.source) {
					destMapping.source = sources.indexOf(srcMapping.source);
					destMapping.originalLine = srcMapping.originalLine;
					destMapping.originalColumn = srcMapping.originalColumn;
					if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name);
					destOriginalMappings.push(destMapping);
				}
				destGeneratedMappings.push(destMapping);
			}
			quickSort(smc.__originalMappings, util.compareByOriginalPositions);
			return smc;
		};
		/**
		* The version of the source mapping spec that we are consuming.
		*/
		BasicSourceMapConsumer.prototype._version = 3;
		/**
		* The list of original sources.
		*/
		Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() {
			return this._absoluteSources.slice();
		} });
		/**
		* Provide the JIT with a nice shape / hidden class.
		*/
		function Mapping() {
			this.generatedLine = 0;
			this.generatedColumn = 0;
			this.source = null;
			this.originalLine = null;
			this.originalColumn = null;
			this.name = null;
		}
		/**
		* Parse the mappings in a string in to a data structure which we can easily
		* query (the ordered arrays in the `this.__generatedMappings` and
		* `this.__originalMappings` properties).
		*/
		BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
			var generatedLine = 1;
			var previousGeneratedColumn = 0;
			var previousOriginalLine = 0;
			var previousOriginalColumn = 0;
			var previousSource = 0;
			var previousName = 0;
			var length = aStr.length;
			var index = 0;
			var cachedSegments = {};
			var temp = {};
			var originalMappings = [];
			var generatedMappings = [];
			var mapping, str, segment, end, value;
			while (index < length) if (aStr.charAt(index) === ";") {
				generatedLine++;
				index++;
				previousGeneratedColumn = 0;
			} else if (aStr.charAt(index) === ",") index++;
			else {
				mapping = new Mapping();
				mapping.generatedLine = generatedLine;
				for (end = index; end < length; end++) if (this._charIsMappingSeparator(aStr, end)) break;
				str = aStr.slice(index, end);
				segment = cachedSegments[str];
				if (segment) index += str.length;
				else {
					segment = [];
					while (index < end) {
						base64VLQ.decode(aStr, index, temp);
						value = temp.value;
						index = temp.rest;
						segment.push(value);
					}
					if (segment.length === 2) throw new Error("Found a source, but no line and column");
					if (segment.length === 3) throw new Error("Found a source and line, but no column");
					cachedSegments[str] = segment;
				}
				mapping.generatedColumn = previousGeneratedColumn + segment[0];
				previousGeneratedColumn = mapping.generatedColumn;
				if (segment.length > 1) {
					mapping.source = previousSource + segment[1];
					previousSource += segment[1];
					mapping.originalLine = previousOriginalLine + segment[2];
					previousOriginalLine = mapping.originalLine;
					mapping.originalLine += 1;
					mapping.originalColumn = previousOriginalColumn + segment[3];
					previousOriginalColumn = mapping.originalColumn;
					if (segment.length > 4) {
						mapping.name = previousName + segment[4];
						previousName += segment[4];
					}
				}
				generatedMappings.push(mapping);
				if (typeof mapping.originalLine === "number") originalMappings.push(mapping);
			}
			quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
			this.__generatedMappings = generatedMappings;
			quickSort(originalMappings, util.compareByOriginalPositions);
			this.__originalMappings = originalMappings;
		};
		/**
		* Find the mapping that best matches the hypothetical "needle" mapping that
		* we are searching for in the given "haystack" of mappings.
		*/
		BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
			if (aNeedle[aLineName] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
			if (aNeedle[aColumnName] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
			return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
		};
		/**
		* Compute the last column for each generated mapping. The last column is
		* inclusive.
		*/
		BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
			for (var index = 0; index < this._generatedMappings.length; ++index) {
				var mapping = this._generatedMappings[index];
				if (index + 1 < this._generatedMappings.length) {
					var nextMapping = this._generatedMappings[index + 1];
					if (mapping.generatedLine === nextMapping.generatedLine) {
						mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
						continue;
					}
				}
				mapping.lastGeneratedColumn = Infinity;
			}
		};
		/**
		* Returns the original source, line, and column information for the generated
		* source's line and column positions provided. The only argument is an object
		* with the following properties:
		*
		*   - line: The line number in the generated source.  The line number
		*     is 1-based.
		*   - column: The column number in the generated source.  The column
		*     number is 0-based.
		*   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
		*     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
		*     closest element that is smaller than or greater than the one we are
		*     searching for, respectively, if the exact element cannot be found.
		*     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
		*
		* and an object is returned with the following properties:
		*
		*   - source: The original source file, or null.
		*   - line: The line number in the original source, or null.  The
		*     line number is 1-based.
		*   - column: The column number in the original source, or null.  The
		*     column number is 0-based.
		*   - name: The original identifier, or null.
		*/
		BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
			var needle = {
				generatedLine: util.getArg(aArgs, "line"),
				generatedColumn: util.getArg(aArgs, "column")
			};
			var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
			if (index >= 0) {
				var mapping = this._generatedMappings[index];
				if (mapping.generatedLine === needle.generatedLine) {
					var source = util.getArg(mapping, "source", null);
					if (source !== null) {
						source = this._sources.at(source);
						source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
					}
					var name = util.getArg(mapping, "name", null);
					if (name !== null) name = this._names.at(name);
					return {
						source,
						line: util.getArg(mapping, "originalLine", null),
						column: util.getArg(mapping, "originalColumn", null),
						name
					};
				}
			}
			return {
				source: null,
				line: null,
				column: null,
				name: null
			};
		};
		/**
		* Return true if we have the source content for every source in the source
		* map, false otherwise.
		*/
		BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
			if (!this.sourcesContent) return false;
			return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
				return sc == null;
			});
		};
		/**
		* Returns the original source content. The only argument is the url of the
		* original source file. Returns null if no original source content is
		* available.
		*/
		BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
			if (!this.sourcesContent) return null;
			var index = this._findSourceIndex(aSource);
			if (index >= 0) return this.sourcesContent[index];
			var relativeSource = aSource;
			if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource);
			var url;
			if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
				var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
				if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
				if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
			}
			if (nullOnMissing) return null;
			else throw new Error("\"" + relativeSource + "\" is not in the SourceMap.");
		};
		/**
		* Returns the generated line and column information for the original source,
		* line, and column positions provided. The only argument is an object with
		* the following properties:
		*
		*   - source: The filename of the original source.
		*   - line: The line number in the original source.  The line number
		*     is 1-based.
		*   - column: The column number in the original source.  The column
		*     number is 0-based.
		*   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
		*     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
		*     closest element that is smaller than or greater than the one we are
		*     searching for, respectively, if the exact element cannot be found.
		*     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
		*
		* and an object is returned with the following properties:
		*
		*   - line: The line number in the generated source, or null.  The
		*     line number is 1-based.
		*   - column: The column number in the generated source, or null.
		*     The column number is 0-based.
		*/
		BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
			var source = util.getArg(aArgs, "source");
			source = this._findSourceIndex(source);
			if (source < 0) return {
				line: null,
				column: null,
				lastColumn: null
			};
			var needle = {
				source,
				originalLine: util.getArg(aArgs, "line"),
				originalColumn: util.getArg(aArgs, "column")
			};
			var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
			if (index >= 0) {
				var mapping = this._originalMappings[index];
				if (mapping.source === needle.source) return {
					line: util.getArg(mapping, "generatedLine", null),
					column: util.getArg(mapping, "generatedColumn", null),
					lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
				};
			}
			return {
				line: null,
				column: null,
				lastColumn: null
			};
		};
		exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
		/**
		* An IndexedSourceMapConsumer instance represents a parsed source map which
		* we can query for information. It differs from BasicSourceMapConsumer in
		* that it takes "indexed" source maps (i.e. ones with a "sections" field) as
		* input.
		*
		* The first parameter is a raw source map (either as a JSON string, or already
		* parsed to an object). According to the spec for indexed source maps, they
		* have the following attributes:
		*
		*   - version: Which version of the source map spec this map is following.
		*   - file: Optional. The generated file this source map is associated with.
		*   - sections: A list of section definitions.
		*
		* Each value under the "sections" field has two fields:
		*   - offset: The offset into the original specified at which this section
		*       begins to apply, defined as an object with a "line" and "column"
		*       field.
		*   - map: A source map definition. This source map could also be indexed,
		*       but doesn't have to be.
		*
		* Instead of the "map" field, it's also possible to have a "url" field
		* specifying a URL to retrieve a source map from, but that's currently
		* unsupported.
		*
		* Here's an example source map, taken from the source map spec[0], but
		* modified to omit a section which uses the "url" field.
		*
		*  {
		*    version : 3,
		*    file: "app.js",
		*    sections: [{
		*      offset: {line:100, column:10},
		*      map: {
		*        version : 3,
		*        file: "section.js",
		*        sources: ["foo.js", "bar.js"],
		*        names: ["src", "maps", "are", "fun"],
		*        mappings: "AAAA,E;;ABCDE;"
		*      }
		*    }],
		*  }
		*
		* The second parameter, if given, is a string whose value is the URL
		* at which the source map was found.  This URL is used to compute the
		* sources array.
		*
		* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
		*/
		function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
			var sourceMap = aSourceMap;
			if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
			var version = util.getArg(sourceMap, "version");
			var sections = util.getArg(sourceMap, "sections");
			if (version != this._version) throw new Error("Unsupported version: " + version);
			this._sources = new ArraySet();
			this._names = new ArraySet();
			var lastOffset = {
				line: -1,
				column: 0
			};
			this._sections = sections.map(function(s) {
				if (s.url) throw new Error("Support for url field in sections not implemented.");
				var offset = util.getArg(s, "offset");
				var offsetLine = util.getArg(offset, "line");
				var offsetColumn = util.getArg(offset, "column");
				if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping.");
				lastOffset = offset;
				return {
					generatedOffset: {
						generatedLine: offsetLine + 1,
						generatedColumn: offsetColumn + 1
					},
					consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
				};
			});
		}
		IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
		IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
		/**
		* The version of the source mapping spec that we are consuming.
		*/
		IndexedSourceMapConsumer.prototype._version = 3;
		/**
		* The list of original sources.
		*/
		Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() {
			var sources = [];
			for (var i = 0; i < this._sections.length; i++) for (var j = 0; j < this._sections[i].consumer.sources.length; j++) sources.push(this._sections[i].consumer.sources[j]);
			return sources;
		} });
		/**
		* Returns the original source, line, and column information for the generated
		* source's line and column positions provided. The only argument is an object
		* with the following properties:
		*
		*   - line: The line number in the generated source.  The line number
		*     is 1-based.
		*   - column: The column number in the generated source.  The column
		*     number is 0-based.
		*
		* and an object is returned with the following properties:
		*
		*   - source: The original source file, or null.
		*   - line: The line number in the original source, or null.  The
		*     line number is 1-based.
		*   - column: The column number in the original source, or null.  The
		*     column number is 0-based.
		*   - name: The original identifier, or null.
		*/
		IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
			var needle = {
				generatedLine: util.getArg(aArgs, "line"),
				generatedColumn: util.getArg(aArgs, "column")
			};
			var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) {
				var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
				if (cmp) return cmp;
				return needle.generatedColumn - section.generatedOffset.generatedColumn;
			});
			var section = this._sections[sectionIndex];
			if (!section) return {
				source: null,
				line: null,
				column: null,
				name: null
			};
			return section.consumer.originalPositionFor({
				line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
				column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
				bias: aArgs.bias
			});
		};
		/**
		* Return true if we have the source content for every source in the source
		* map, false otherwise.
		*/
		IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
			return this._sections.every(function(s) {
				return s.consumer.hasContentsOfAllSources();
			});
		};
		/**
		* Returns the original source content. The only argument is the url of the
		* original source file. Returns null if no original source content is
		* available.
		*/
		IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
			for (var i = 0; i < this._sections.length; i++) {
				var content = this._sections[i].consumer.sourceContentFor(aSource, true);
				if (content) return content;
			}
			if (nullOnMissing) return null;
			else throw new Error("\"" + aSource + "\" is not in the SourceMap.");
		};
		/**
		* Returns the generated line and column information for the original source,
		* line, and column positions provided. The only argument is an object with
		* the following properties:
		*
		*   - source: The filename of the original source.
		*   - line: The line number in the original source.  The line number
		*     is 1-based.
		*   - column: The column number in the original source.  The column
		*     number is 0-based.
		*
		* and an object is returned with the following properties:
		*
		*   - line: The line number in the generated source, or null.  The
		*     line number is 1-based. 
		*   - column: The column number in the generated source, or null.
		*     The column number is 0-based.
		*/
		IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
			for (var i = 0; i < this._sections.length; i++) {
				var section = this._sections[i];
				if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) continue;
				var generatedPosition = section.consumer.generatedPositionFor(aArgs);
				if (generatedPosition) return {
					line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
					column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
				};
			}
			return {
				line: null,
				column: null
			};
		};
		/**
		* Parse the mappings in a string in to a data structure which we can easily
		* query (the ordered arrays in the `this.__generatedMappings` and
		* `this.__originalMappings` properties).
		*/
		IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
			this.__generatedMappings = [];
			this.__originalMappings = [];
			for (var i = 0; i < this._sections.length; i++) {
				var section = this._sections[i];
				var sectionMappings = section.consumer._generatedMappings;
				for (var j = 0; j < sectionMappings.length; j++) {
					var mapping = sectionMappings[j];
					var source = section.consumer._sources.at(mapping.source);
					source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
					this._sources.add(source);
					source = this._sources.indexOf(source);
					var name = null;
					if (mapping.name) {
						name = section.consumer._names.at(mapping.name);
						this._names.add(name);
						name = this._names.indexOf(name);
					}
					var adjustedMapping = {
						source,
						generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
						generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
						originalLine: mapping.originalLine,
						originalColumn: mapping.originalColumn,
						name
					};
					this.__generatedMappings.push(adjustedMapping);
					if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping);
				}
			}
			quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
			quickSort(this.__originalMappings, util.compareByOriginalPositions);
		};
		exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
	}));
	//#endregion
	//#region ../../node_modules/source-map/lib/source-node.js
	var require_source_node = /* @__PURE__ */ __commonJSMin(((exports) => {
		var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
		var util = require_util();
		var REGEX_NEWLINE = /(\r?\n)/;
		var NEWLINE_CODE = 10;
		var isSourceNode = "$$$isSourceNode$$$";
		/**
		* SourceNodes provide a way to abstract over interpolating/concatenating
		* snippets of generated JavaScript source code while maintaining the line and
		* column information associated with the original source code.
		*
		* @param aLine The original line number.
		* @param aColumn The original column number.
		* @param aSource The original source's filename.
		* @param aChunks Optional. An array of strings which are snippets of
		*        generated JS, or other SourceNodes.
		* @param aName The original identifier.
		*/
		function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
			this.children = [];
			this.sourceContents = {};
			this.line = aLine == null ? null : aLine;
			this.column = aColumn == null ? null : aColumn;
			this.source = aSource == null ? null : aSource;
			this.name = aName == null ? null : aName;
			this[isSourceNode] = true;
			if (aChunks != null) this.add(aChunks);
		}
		/**
		* Creates a SourceNode from generated code and a SourceMapConsumer.
		*
		* @param aGeneratedCode The generated code
		* @param aSourceMapConsumer The SourceMap for the generated code
		* @param aRelativePath Optional. The path that relative sources in the
		*        SourceMapConsumer should be relative to.
		*/
		SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
			var node = new SourceNode();
			var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
			var remainingLinesIndex = 0;
			var shiftNextLine = function() {
				return getNextLine() + (getNextLine() || "");
				function getNextLine() {
					return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
				}
			};
			var lastGeneratedLine = 1, lastGeneratedColumn = 0;
			var lastMapping = null;
			aSourceMapConsumer.eachMapping(function(mapping) {
				if (lastMapping !== null) if (lastGeneratedLine < mapping.generatedLine) {
					addMappingWithCode(lastMapping, shiftNextLine());
					lastGeneratedLine++;
					lastGeneratedColumn = 0;
				} else {
					var nextLine = remainingLines[remainingLinesIndex] || "";
					var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
					remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
					lastGeneratedColumn = mapping.generatedColumn;
					addMappingWithCode(lastMapping, code);
					lastMapping = mapping;
					return;
				}
				while (lastGeneratedLine < mapping.generatedLine) {
					node.add(shiftNextLine());
					lastGeneratedLine++;
				}
				if (lastGeneratedColumn < mapping.generatedColumn) {
					var nextLine = remainingLines[remainingLinesIndex] || "";
					node.add(nextLine.substr(0, mapping.generatedColumn));
					remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
					lastGeneratedColumn = mapping.generatedColumn;
				}
				lastMapping = mapping;
			}, this);
			if (remainingLinesIndex < remainingLines.length) {
				if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine());
				node.add(remainingLines.splice(remainingLinesIndex).join(""));
			}
			aSourceMapConsumer.sources.forEach(function(sourceFile) {
				var content = aSourceMapConsumer.sourceContentFor(sourceFile);
				if (content != null) {
					if (aRelativePath != null) sourceFile = util.join(aRelativePath, sourceFile);
					node.setSourceContent(sourceFile, content);
				}
			});
			return node;
			function addMappingWithCode(mapping, code) {
				if (mapping === null || mapping.source === void 0) node.add(code);
				else {
					var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
					node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
				}
			}
		};
		/**
		* Add a chunk of generated JS to this source node.
		*
		* @param aChunk A string snippet of generated JS code, another instance of
		*        SourceNode, or an array where each member is one of those things.
		*/
		SourceNode.prototype.add = function SourceNode_add(aChunk) {
			if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) {
				this.add(chunk);
			}, this);
			else if (aChunk[isSourceNode] || typeof aChunk === "string") {
				if (aChunk) this.children.push(aChunk);
			} else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
			return this;
		};
		/**
		* Add a chunk of generated JS to the beginning of this source node.
		*
		* @param aChunk A string snippet of generated JS code, another instance of
		*        SourceNode, or an array where each member is one of those things.
		*/
		SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
			if (Array.isArray(aChunk)) for (var i = aChunk.length - 1; i >= 0; i--) this.prepend(aChunk[i]);
			else if (aChunk[isSourceNode] || typeof aChunk === "string") this.children.unshift(aChunk);
			else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
			return this;
		};
		/**
		* Walk over the tree of JS snippets in this node and its children. The
		* walking function is called once for each snippet of JS and is passed that
		* snippet and the its original associated source's line/column location.
		*
		* @param aFn The traversal function.
		*/
		SourceNode.prototype.walk = function SourceNode_walk(aFn) {
			var chunk;
			for (var i = 0, len = this.children.length; i < len; i++) {
				chunk = this.children[i];
				if (chunk[isSourceNode]) chunk.walk(aFn);
				else if (chunk !== "") aFn(chunk, {
					source: this.source,
					line: this.line,
					column: this.column,
					name: this.name
				});
			}
		};
		/**
		* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
		* each of `this.children`.
		*
		* @param aSep The separator.
		*/
		SourceNode.prototype.join = function SourceNode_join(aSep) {
			var newChildren;
			var i;
			var len = this.children.length;
			if (len > 0) {
				newChildren = [];
				for (i = 0; i < len - 1; i++) {
					newChildren.push(this.children[i]);
					newChildren.push(aSep);
				}
				newChildren.push(this.children[i]);
				this.children = newChildren;
			}
			return this;
		};
		/**
		* Call String.prototype.replace on the very right-most source snippet. Useful
		* for trimming whitespace from the end of a source node, etc.
		*
		* @param aPattern The pattern to replace.
		* @param aReplacement The thing to replace the pattern with.
		*/
		SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
			var lastChild = this.children[this.children.length - 1];
			if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement);
			else if (typeof lastChild === "string") this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
			else this.children.push("".replace(aPattern, aReplacement));
			return this;
		};
		/**
		* Set the source content for a source file. This will be added to the SourceMapGenerator
		* in the sourcesContent field.
		*
		* @param aSourceFile The filename of the source file
		* @param aSourceContent The content of the source file
		*/
		SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
			this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
		};
		/**
		* Walk over the tree of SourceNodes. The walking function is called for each
		* source file content and is passed the filename and source content.
		*
		* @param aFn The traversal function.
		*/
		SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
			for (var i = 0, len = this.children.length; i < len; i++) if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn);
			var sources = Object.keys(this.sourceContents);
			for (var i = 0, len = sources.length; i < len; i++) aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
		};
		/**
		* Return the string representation of this source node. Walks over the tree
		* and concatenates all the various snippets together to one string.
		*/
		SourceNode.prototype.toString = function SourceNode_toString() {
			var str = "";
			this.walk(function(chunk) {
				str += chunk;
			});
			return str;
		};
		/**
		* Returns the string representation of this source node along with a source
		* map.
		*/
		SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
			var generated = {
				code: "",
				line: 1,
				column: 0
			};
			var map = new SourceMapGenerator(aArgs);
			var sourceMappingActive = false;
			var lastOriginalSource = null;
			var lastOriginalLine = null;
			var lastOriginalColumn = null;
			var lastOriginalName = null;
			this.walk(function(chunk, original) {
				generated.code += chunk;
				if (original.source !== null && original.line !== null && original.column !== null) {
					if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({
						source: original.source,
						original: {
							line: original.line,
							column: original.column
						},
						generated: {
							line: generated.line,
							column: generated.column
						},
						name: original.name
					});
					lastOriginalSource = original.source;
					lastOriginalLine = original.line;
					lastOriginalColumn = original.column;
					lastOriginalName = original.name;
					sourceMappingActive = true;
				} else if (sourceMappingActive) {
					map.addMapping({ generated: {
						line: generated.line,
						column: generated.column
					} });
					lastOriginalSource = null;
					sourceMappingActive = false;
				}
				for (var idx = 0, length = chunk.length; idx < length; idx++) if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
					generated.line++;
					generated.column = 0;
					if (idx + 1 === length) {
						lastOriginalSource = null;
						sourceMappingActive = false;
					} else if (sourceMappingActive) map.addMapping({
						source: original.source,
						original: {
							line: original.line,
							column: original.column
						},
						generated: {
							line: generated.line,
							column: generated.column
						},
						name: original.name
					});
				} else generated.column++;
			});
			this.walkSourceContents(function(sourceFile, sourceContent) {
				map.setSourceContent(sourceFile, sourceContent);
			});
			return {
				code: generated.code,
				map
			};
		};
		exports.SourceNode = SourceNode;
	}));
	//#endregion
	//#region ../../node_modules/source-map/source-map.js
	var require_source_map = /* @__PURE__ */ __commonJSMin(((exports) => {
		exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
		exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
		exports.SourceNode = require_source_node().SourceNode;
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
	var require_code_gen = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		var _utils = require_utils();
		var SourceNode = void 0;
		try {
			/* istanbul ignore next */
			if (typeof define !== "function" || !define.amd) SourceNode = require_source_map().SourceNode;
		} catch (err) {}
		/* istanbul ignore if: tested but not covered in istanbul due to dist build  */
		if (!SourceNode) {
			SourceNode = function(line, column, srcFile, chunks) {
				this.src = "";
				if (chunks) this.add(chunks);
			};
			/* istanbul ignore next */
			SourceNode.prototype = {
				add: function add(chunks) {
					if (_utils.isArray(chunks)) chunks = chunks.join("");
					this.src += chunks;
				},
				prepend: function prepend(chunks) {
					if (_utils.isArray(chunks)) chunks = chunks.join("");
					this.src = chunks + this.src;
				},
				toStringWithSourceMap: function toStringWithSourceMap() {
					return { code: this.toString() };
				},
				toString: function toString() {
					return this.src;
				}
			};
		}
		function castChunk(chunk, codeGen, loc) {
			if (_utils.isArray(chunk)) {
				var ret = [];
				for (var i = 0, len = chunk.length; i < len; i++) ret.push(codeGen.wrap(chunk[i], loc));
				return ret;
			} else if (typeof chunk === "boolean" || typeof chunk === "number") return chunk + "";
			return chunk;
		}
		function CodeGen(srcFile) {
			this.srcFile = srcFile;
			this.source = [];
		}
		CodeGen.prototype = {
			isEmpty: function isEmpty() {
				return !this.source.length;
			},
			prepend: function prepend(source, loc) {
				this.source.unshift(this.wrap(source, loc));
			},
			push: function push(source, loc) {
				this.source.push(this.wrap(source, loc));
			},
			merge: function merge() {
				var source = this.empty();
				this.each(function(line) {
					source.add([
						"  ",
						line,
						"\n"
					]);
				});
				return source;
			},
			each: function each(iter) {
				for (var i = 0, len = this.source.length; i < len; i++) iter(this.source[i]);
			},
			empty: function empty() {
				var loc = this.currentLocation || { start: {} };
				return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
			},
			wrap: function wrap(chunk) {
				var loc = arguments.length <= 1 || arguments[1] === void 0 ? this.currentLocation || { start: {} } : arguments[1];
				if (chunk instanceof SourceNode) return chunk;
				chunk = castChunk(chunk, this, loc);
				return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
			},
			functionCall: function functionCall(fn, type, params) {
				params = this.generateList(params);
				return this.wrap([
					fn,
					type ? "." + type + "(" : "(",
					params,
					")"
				]);
			},
			quotedString: function quotedString(str) {
				return "\"" + (str + "").replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + "\"";
			},
			objectLiteral: function objectLiteral(obj) {
				// istanbul ignore next
				var _this = this;
				var pairs = [];
				Object.keys(obj).forEach(function(key) {
					var value = castChunk(obj[key], _this);
					if (value !== "undefined") pairs.push([
						_this.quotedString(key),
						":",
						value
					]);
				});
				var ret = this.generateList(pairs);
				ret.prepend("{");
				ret.add("}");
				return ret;
			},
			generateList: function generateList(entries) {
				var ret = this.empty();
				for (var i = 0, len = entries.length; i < len; i++) {
					if (i) ret.add(",");
					ret.add(castChunk(entries[i], this));
				}
				return ret;
			},
			generateArray: function generateArray(entries) {
				var ret = this.generateList(entries);
				ret.prepend("[");
				ret.add("]");
				return ret;
			}
		};
		exports["default"] = CodeGen;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
	var require_javascript_compiler = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _base = require_base$1();
		var _exception2 = _interopRequireDefault(require_exception());
		var _utils = require_utils();
		var _codeGen2 = _interopRequireDefault(require_code_gen());
		function Literal(value) {
			this.value = value;
		}
		function JavaScriptCompiler() {}
		JavaScriptCompiler.prototype = {
			nameLookup: function nameLookup(parent, name) {
				return this.internalNameLookup(parent, name);
			},
			depthedLookup: function depthedLookup(name) {
				return [
					this.aliasable("container.lookup"),
					"(depths, ",
					JSON.stringify(name),
					")"
				];
			},
			compilerInfo: function compilerInfo() {
				var revision = _base.COMPILER_REVISION;
				return [revision, _base.REVISION_CHANGES[revision]];
			},
			appendToBuffer: function appendToBuffer(source, location, explicit) {
				if (!_utils.isArray(source)) source = [source];
				source = this.source.wrap(source, location);
				if (this.environment.isSimple) return [
					"return ",
					source,
					";"
				];
				else if (explicit) return [
					"buffer += ",
					source,
					";"
				];
				else {
					source.appendToBuffer = true;
					return source;
				}
			},
			initializeBuffer: function initializeBuffer() {
				return this.quotedString("");
			},
			internalNameLookup: function internalNameLookup(parent, name) {
				this.lookupPropertyFunctionIsUsed = true;
				return [
					"lookupProperty(",
					parent,
					",",
					JSON.stringify(name),
					")"
				];
			},
			lookupPropertyFunctionIsUsed: false,
			compile: function compile(environment, options, context, asObject) {
				this.environment = environment;
				this.options = options;
				this.stringParams = this.options.stringParams;
				this.trackIds = this.options.trackIds;
				this.precompile = !asObject;
				this.name = this.environment.name;
				this.isChild = !!context;
				this.context = context || {
					decorators: [],
					programs: [],
					environments: []
				};
				this.preamble();
				this.stackSlot = 0;
				this.stackVars = [];
				this.aliases = {};
				this.registers = { list: [] };
				this.hashes = [];
				this.compileStack = [];
				this.inlineStack = [];
				this.blockParams = [];
				this.compileChildren(environment, options);
				this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
				this.useBlockParams = this.useBlockParams || environment.useBlockParams;
				var opcodes = environment.opcodes, opcode = void 0, firstLoc = void 0, i = void 0, l = void 0;
				for (i = 0, l = opcodes.length; i < l; i++) {
					opcode = opcodes[i];
					this.source.currentLocation = opcode.loc;
					firstLoc = firstLoc || opcode.loc;
					this[opcode.opcode].apply(this, opcode.args);
				}
				this.source.currentLocation = firstLoc;
				this.pushSource("");
				/* istanbul ignore next */
				if (this.stackSlot || this.inlineStack.length || this.compileStack.length) throw new _exception2["default"]("Compile completed with content left on stack");
				if (!this.decorators.isEmpty()) {
					this.useDecorators = true;
					this.decorators.prepend([
						"var decorators = container.decorators, ",
						this.lookupPropertyFunctionVarDeclaration(),
						";\n"
					]);
					this.decorators.push("return fn;");
					if (asObject) this.decorators = Function.apply(this, [
						"fn",
						"props",
						"container",
						"depth0",
						"data",
						"blockParams",
						"depths",
						this.decorators.merge()
					]);
					else {
						this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n");
						this.decorators.push("}\n");
						this.decorators = this.decorators.merge();
					}
				} else this.decorators = void 0;
				var fn = this.createFunctionContext(asObject);
				if (!this.isChild) {
					var ret = {
						compiler: this.compilerInfo(),
						main: fn
					};
					if (this.decorators) {
						ret.main_d = this.decorators;
						ret.useDecorators = true;
					}
					var _context = this.context;
					var programs = _context.programs;
					var decorators = _context.decorators;
					for (i = 0, l = programs.length; i < l; i++) {
						ret[i] = programs[i];
						if (decorators[i]) {
							ret[i + "_d"] = decorators[i];
							ret.useDecorators = true;
						}
					}
					if (this.environment.usePartial) ret.usePartial = true;
					if (this.options.data) ret.useData = true;
					if (this.useDepths) ret.useDepths = true;
					if (this.useBlockParams) ret.useBlockParams = true;
					if (this.options.compat) ret.compat = true;
					if (!asObject) {
						ret.compiler = JSON.stringify(ret.compiler);
						this.source.currentLocation = { start: {
							line: 1,
							column: 0
						} };
						ret = this.objectLiteral(ret);
						if (options.srcName) {
							ret = ret.toStringWithSourceMap({ file: options.destName });
							ret.map = ret.map && ret.map.toString();
						} else ret = ret.toString();
					} else ret.compilerOptions = this.options;
					return ret;
				} else return fn;
			},
			preamble: function preamble() {
				this.lastContext = 0;
				this.source = new _codeGen2["default"](this.options.srcName);
				this.decorators = new _codeGen2["default"](this.options.srcName);
			},
			createFunctionContext: function createFunctionContext(asObject) {
				// istanbul ignore next
				var _this = this;
				var varDeclarations = "";
				var locals = this.stackVars.concat(this.registers.list);
				if (locals.length > 0) varDeclarations += ", " + locals.join(", ");
				var aliasCount = 0;
				Object.keys(this.aliases).forEach(function(alias) {
					var node = _this.aliases[alias];
					if (node.children && node.referenceCount > 1) {
						varDeclarations += ", alias" + ++aliasCount + "=" + alias;
						node.children[0] = "alias" + aliasCount;
					}
				});
				if (this.lookupPropertyFunctionIsUsed) varDeclarations += ", " + this.lookupPropertyFunctionVarDeclaration();
				var params = [
					"container",
					"depth0",
					"helpers",
					"partials",
					"data"
				];
				if (this.useBlockParams || this.useDepths) params.push("blockParams");
				if (this.useDepths) params.push("depths");
				var source = this.mergeSource(varDeclarations);
				if (asObject) {
					params.push(source);
					return Function.apply(this, params);
				} else return this.source.wrap([
					"function(",
					params.join(","),
					") {\n  ",
					source,
					"}"
				]);
			},
			mergeSource: function mergeSource(varDeclarations) {
				var isSimple = this.environment.isSimple, appendOnly = !this.forceBuffer, appendFirst = void 0, sourceSeen = void 0, bufferStart = void 0, bufferEnd = void 0;
				this.source.each(function(line) {
					if (line.appendToBuffer) {
						if (bufferStart) line.prepend("  + ");
						else bufferStart = line;
						bufferEnd = line;
					} else {
						if (bufferStart) {
							if (!sourceSeen) appendFirst = true;
							else bufferStart.prepend("buffer += ");
							bufferEnd.add(";");
							bufferStart = bufferEnd = void 0;
						}
						sourceSeen = true;
						if (!isSimple) appendOnly = false;
					}
				});
				if (appendOnly) {
					if (bufferStart) {
						bufferStart.prepend("return ");
						bufferEnd.add(";");
					} else if (!sourceSeen) this.source.push("return \"\";");
				} else {
					varDeclarations += ", buffer = " + (appendFirst ? "" : this.initializeBuffer());
					if (bufferStart) {
						bufferStart.prepend("return buffer + ");
						bufferEnd.add(";");
					} else this.source.push("return buffer;");
				}
				if (varDeclarations) this.source.prepend("var " + varDeclarations.substring(2) + (appendFirst ? "" : ";\n"));
				return this.source.merge();
			},
			lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
				return "\n      lookupProperty = container.lookupProperty || function(parent, propertyName) {\n        if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n          return parent[propertyName];\n        }\n        return undefined\n    }\n    ".trim();
			},
			blockValue: function blockValue(name) {
				var blockHelperMissing = this.aliasable("container.hooks.blockHelperMissing"), params = [this.contextName(0)];
				this.setupHelperArgs(name, 0, params);
				var blockName = this.popStack();
				params.splice(1, 0, blockName);
				this.push(this.source.functionCall(blockHelperMissing, "call", params));
			},
			ambiguousBlockValue: function ambiguousBlockValue() {
				var blockHelperMissing = this.aliasable("container.hooks.blockHelperMissing"), params = [this.contextName(0)];
				this.setupHelperArgs("", 0, params, true);
				this.flushInline();
				var current = this.topStack();
				params.splice(1, 0, current);
				this.pushSource([
					"if (!",
					this.lastHelper,
					") { ",
					current,
					" = ",
					this.source.functionCall(blockHelperMissing, "call", params),
					"}"
				]);
			},
			appendContent: function appendContent(content) {
				if (this.pendingContent) content = this.pendingContent + content;
				else this.pendingLocation = this.source.currentLocation;
				this.pendingContent = content;
			},
			append: function append() {
				if (this.isInline()) {
					this.replaceStack(function(current) {
						return [
							" != null ? ",
							current,
							" : \"\""
						];
					});
					this.pushSource(this.appendToBuffer(this.popStack()));
				} else {
					var local = this.popStack();
					this.pushSource([
						"if (",
						local,
						" != null) { ",
						this.appendToBuffer(local, void 0, true),
						" }"
					]);
					if (this.environment.isSimple) this.pushSource([
						"else { ",
						this.appendToBuffer("''", void 0, true),
						" }"
					]);
				}
			},
			appendEscaped: function appendEscaped() {
				this.pushSource(this.appendToBuffer([
					this.aliasable("container.escapeExpression"),
					"(",
					this.popStack(),
					")"
				]));
			},
			getContext: function getContext(depth) {
				this.lastContext = depth;
			},
			pushContext: function pushContext() {
				this.pushStackLiteral(this.contextName(this.lastContext));
			},
			lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
				var i = 0;
				if (!scoped && this.options.compat && !this.lastContext) this.push(this.depthedLookup(parts[i++]));
				else this.pushContext();
				this.resolvePath("context", parts, i, falsy, strict);
			},
			lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
				this.useBlockParams = true;
				this.push([
					"blockParams[",
					blockParamId[0],
					"][",
					blockParamId[1],
					"]"
				]);
				this.resolvePath("context", parts, 1);
			},
			lookupData: function lookupData(depth, parts, strict) {
				if (!depth) this.pushStackLiteral("data");
				else this.pushStackLiteral("container.data(data, " + depth + ")");
				this.resolvePath("data", parts, 0, true, strict);
			},
			resolvePath: function resolvePath(type, parts, startPartIndex, falsy, strict) {
				// istanbul ignore next
				var _this2 = this;
				if (this.options.strict || this.options.assumeObjects) {
					this.push(strictLookup(this.options.strict && strict, this, parts, startPartIndex, type));
					return;
				}
				var len = parts.length;
				var _loop = function(i) {
					_this2.replaceStack(function(current) {
						var lookup = _this2.nameLookup(current, parts[i], type);
						if (!falsy) return [
							" != null ? ",
							lookup,
							" : ",
							current
						];
						else return [" && ", lookup];
					});
				};
				for (var i = startPartIndex; i < len; i++) _loop(i);
			},
			resolvePossibleLambda: function resolvePossibleLambda() {
				this.push([
					this.aliasable("container.lambda"),
					"(",
					this.popStack(),
					", ",
					this.contextName(0),
					")"
				]);
			},
			pushStringParam: function pushStringParam(string, type) {
				this.pushContext();
				this.pushString(type);
				if (type !== "SubExpression") if (typeof string === "string") this.pushString(string);
				else this.pushStackLiteral(string);
			},
			emptyHash: function emptyHash(omitEmpty) {
				if (this.trackIds) this.push("{}");
				if (this.stringParams) {
					this.push("{}");
					this.push("{}");
				}
				this.pushStackLiteral(omitEmpty ? "undefined" : "{}");
			},
			pushHash: function pushHash() {
				if (this.hash) this.hashes.push(this.hash);
				this.hash = {
					values: {},
					types: [],
					contexts: [],
					ids: []
				};
			},
			popHash: function popHash() {
				var hash = this.hash;
				this.hash = this.hashes.pop();
				if (this.trackIds) this.push(this.objectLiteral(hash.ids));
				if (this.stringParams) {
					this.push(this.objectLiteral(hash.contexts));
					this.push(this.objectLiteral(hash.types));
				}
				this.push(this.objectLiteral(hash.values));
			},
			pushString: function pushString(string) {
				this.pushStackLiteral(this.quotedString(string));
			},
			pushLiteral: function pushLiteral(value) {
				this.pushStackLiteral(value);
			},
			pushProgram: function pushProgram(guid) {
				if (guid != null) this.pushStackLiteral(this.programExpression(guid));
				else this.pushStackLiteral(null);
			},
			registerDecorator: function registerDecorator(paramSize, name) {
				var foundDecorator = this.nameLookup("decorators", name, "decorator"), options = this.setupHelperArgs(name, paramSize);
				this.decorators.push([
					"var decorator = ",
					foundDecorator,
					";"
				]);
				this.decorators.push([
					"if (typeof decorator !== \"function\") { throw new Error(",
					this.quotedString("Missing decorator: \"" + name + "\""),
					"); }"
				]);
				this.decorators.push([
					"fn = ",
					this.decorators.functionCall("decorator", "", [
						"fn",
						"props",
						"container",
						options
					]),
					" || fn;"
				]);
			},
			invokeHelper: function invokeHelper(paramSize, name, isSimple) {
				var nonHelper = this.popStack(), helper = this.setupHelper(paramSize, name);
				var possibleFunctionCalls = [];
				if (isSimple) possibleFunctionCalls.push(helper.name);
				possibleFunctionCalls.push(nonHelper);
				if (!this.options.strict) possibleFunctionCalls.push(this.aliasable("container.hooks.helperMissing"));
				var functionLookupCode = [
					"(",
					this.itemsSeparatedBy(possibleFunctionCalls, "||"),
					")"
				];
				var functionCall = this.source.functionCall(functionLookupCode, "call", helper.callParams);
				this.push(functionCall);
			},
			itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
				var result = [];
				result.push(items[0]);
				for (var i = 1; i < items.length; i++) result.push(separator, items[i]);
				return result;
			},
			invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
				var helper = this.setupHelper(paramSize, name);
				this.push(this.source.functionCall(helper.name, "call", helper.callParams));
			},
			invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
				this.useRegister("helper");
				var nonHelper = this.popStack();
				this.emptyHash();
				var helper = this.setupHelper(0, name, helperCall);
				var lookup = [
					"(",
					"(helper = ",
					this.lastHelper = this.nameLookup("helpers", name, "helper"),
					" || ",
					nonHelper,
					")"
				];
				if (!this.options.strict) {
					lookup[0] = "(helper = ";
					lookup.push(" != null ? helper : ", this.aliasable("container.hooks.helperMissing"));
				}
				this.push([
					"(",
					lookup,
					helper.paramsInit ? ["),(", helper.paramsInit] : [],
					"),",
					"(typeof helper === ",
					this.aliasable("\"function\""),
					" ? ",
					this.source.functionCall("helper", "call", helper.callParams),
					" : helper))"
				]);
			},
			invokePartial: function invokePartial(isDynamic, name, indent) {
				var params = [], options = this.setupParams(name, 1, params);
				if (isDynamic) {
					name = this.popStack();
					delete options.name;
				}
				if (indent) options.indent = JSON.stringify(indent);
				options.helpers = "helpers";
				options.partials = "partials";
				options.decorators = "container.decorators";
				if (!isDynamic) params.unshift(this.nameLookup("partials", name, "partial"));
				else params.unshift(name);
				if (this.options.compat) options.depths = "depths";
				options = this.objectLiteral(options);
				params.push(options);
				this.push(this.source.functionCall("container.invokePartial", "", params));
			},
			assignToHash: function assignToHash(key) {
				var value = this.popStack(), context = void 0, type = void 0, id = void 0;
				if (this.trackIds) id = this.popStack();
				if (this.stringParams) {
					type = this.popStack();
					context = this.popStack();
				}
				var hash = this.hash;
				if (context) hash.contexts[key] = context;
				if (type) hash.types[key] = type;
				if (id) hash.ids[key] = id;
				hash.values[key] = value;
			},
			pushId: function pushId(type, name, child) {
				if (type === "BlockParam") this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + JSON.stringify("." + child) : ""));
				else if (type === "PathExpression") this.pushString(name);
				else if (type === "SubExpression") this.pushStackLiteral("true");
				else this.pushStackLiteral("null");
			},
			compiler: JavaScriptCompiler,
			compileChildren: function compileChildren(environment, options) {
				var children = environment.children, child = void 0, compiler = void 0;
				for (var i = 0, l = children.length; i < l; i++) {
					child = children[i];
					compiler = new this.compiler();
					var existing = this.matchExistingProgram(child);
					if (existing == null) {
						var index = this.context.programs.push("") - 1;
						child.index = index;
						child.name = "program" + index;
						this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
						this.context.decorators[index] = compiler.decorators;
						this.context.environments[index] = child;
						this.useDepths = this.useDepths || compiler.useDepths;
						this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
						child.useDepths = this.useDepths;
						child.useBlockParams = this.useBlockParams;
					} else {
						child.index = existing.index;
						child.name = "program" + existing.index;
						this.useDepths = this.useDepths || existing.useDepths;
						this.useBlockParams = this.useBlockParams || existing.useBlockParams;
					}
				}
			},
			matchExistingProgram: function matchExistingProgram(child) {
				for (var i = 0, len = this.context.environments.length; i < len; i++) {
					var environment = this.context.environments[i];
					if (environment && environment.equals(child)) return environment;
				}
			},
			programExpression: function programExpression(guid) {
				var child = this.environment.children[guid], programParams = [
					child.index,
					"data",
					child.blockParams
				];
				if (this.useBlockParams || this.useDepths) programParams.push("blockParams");
				if (this.useDepths) programParams.push("depths");
				return "container.program(" + programParams.join(", ") + ")";
			},
			useRegister: function useRegister(name) {
				if (!this.registers[name]) {
					this.registers[name] = true;
					this.registers.list.push(name);
				}
			},
			push: function push(expr) {
				if (!(expr instanceof Literal)) expr = this.source.wrap(expr);
				this.inlineStack.push(expr);
				return expr;
			},
			pushStackLiteral: function pushStackLiteral(item) {
				this.push(new Literal(item));
			},
			pushSource: function pushSource(source) {
				if (this.pendingContent) {
					this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
					this.pendingContent = void 0;
				}
				if (source) this.source.push(source);
			},
			replaceStack: function replaceStack(callback) {
				var prefix = ["("], stack = void 0, createdStack = void 0, usedLiteral = void 0;
				/* istanbul ignore next */
				if (!this.isInline()) throw new _exception2["default"]("replaceStack on non-inline");
				var top = this.popStack(true);
				if (top instanceof Literal) {
					stack = [top.value];
					prefix = ["(", stack];
					usedLiteral = true;
				} else {
					createdStack = true;
					var _name = this.incrStack();
					prefix = [
						"((",
						this.push(_name),
						" = ",
						top,
						")"
					];
					stack = this.topStack();
				}
				var item = callback.call(this, stack);
				if (!usedLiteral) this.popStack();
				if (createdStack) this.stackSlot--;
				this.push(prefix.concat(item, ")"));
			},
			incrStack: function incrStack() {
				this.stackSlot++;
				if (this.stackSlot > this.stackVars.length) this.stackVars.push("stack" + this.stackSlot);
				return this.topStackName();
			},
			topStackName: function topStackName() {
				return "stack" + this.stackSlot;
			},
			flushInline: function flushInline() {
				var inlineStack = this.inlineStack;
				this.inlineStack = [];
				for (var i = 0, len = inlineStack.length; i < len; i++) {
					var entry = inlineStack[i];
					/* istanbul ignore if */
					if (entry instanceof Literal) this.compileStack.push(entry);
					else {
						var stack = this.incrStack();
						this.pushSource([
							stack,
							" = ",
							entry,
							";"
						]);
						this.compileStack.push(stack);
					}
				}
			},
			isInline: function isInline() {
				return this.inlineStack.length;
			},
			popStack: function popStack(wrapped) {
				var inline = this.isInline(), item = (inline ? this.inlineStack : this.compileStack).pop();
				if (!wrapped && item instanceof Literal) return item.value;
				else {
					if (!inline) {
						/* istanbul ignore next */
						if (!this.stackSlot) throw new _exception2["default"]("Invalid stack pop");
						this.stackSlot--;
					}
					return item;
				}
			},
			topStack: function topStack() {
				var stack = this.isInline() ? this.inlineStack : this.compileStack, item = stack[stack.length - 1];
				/* istanbul ignore if */
				if (item instanceof Literal) return item.value;
				else return item;
			},
			contextName: function contextName(context) {
				if (this.useDepths && context) return "depths[" + context + "]";
				else return "depth" + context;
			},
			quotedString: function quotedString(str) {
				return this.source.quotedString(str);
			},
			objectLiteral: function objectLiteral(obj) {
				return this.source.objectLiteral(obj);
			},
			aliasable: function aliasable(name) {
				var ret = this.aliases[name];
				if (ret) {
					ret.referenceCount++;
					return ret;
				}
				ret = this.aliases[name] = this.source.wrap(name);
				ret.aliasable = true;
				ret.referenceCount = 1;
				return ret;
			},
			setupHelper: function setupHelper(paramSize, name, blockHelper) {
				var params = [];
				return {
					params,
					paramsInit: this.setupHelperArgs(name, paramSize, params, blockHelper),
					name: this.nameLookup("helpers", name, "helper"),
					callParams: [this.aliasable(this.contextName(0) + " != null ? " + this.contextName(0) + " : (container.nullContext || {})")].concat(params)
				};
			},
			setupParams: function setupParams(helper, paramSize, params) {
				var options = {}, contexts = [], types = [], ids = [], objectArgs = !params, param = void 0;
				if (objectArgs) params = [];
				options.name = this.quotedString(helper);
				options.hash = this.popStack();
				if (this.trackIds) options.hashIds = this.popStack();
				if (this.stringParams) {
					options.hashTypes = this.popStack();
					options.hashContexts = this.popStack();
				}
				var inverse = this.popStack(), program = this.popStack();
				if (program || inverse) {
					options.fn = program || "container.noop";
					options.inverse = inverse || "container.noop";
				}
				var i = paramSize;
				while (i--) {
					param = this.popStack();
					params[i] = param;
					if (this.trackIds) ids[i] = this.popStack();
					if (this.stringParams) {
						types[i] = this.popStack();
						contexts[i] = this.popStack();
					}
				}
				if (objectArgs) options.args = this.source.generateArray(params);
				if (this.trackIds) options.ids = this.source.generateArray(ids);
				if (this.stringParams) {
					options.types = this.source.generateArray(types);
					options.contexts = this.source.generateArray(contexts);
				}
				if (this.options.data) options.data = "data";
				if (this.useBlockParams) options.blockParams = "blockParams";
				return options;
			},
			setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
				var options = this.setupParams(helper, paramSize, params);
				options.loc = JSON.stringify(this.source.currentLocation);
				options = this.objectLiteral(options);
				if (useRegister) {
					this.useRegister("options");
					params.push("options");
					return ["options=", options];
				} else if (params) {
					params.push(options);
					return "";
				} else return options;
			}
		};
		(function() {
			var reservedWords = "break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" ");
			var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
			for (var i = 0, l = reservedWords.length; i < l; i++) compilerWords[reservedWords[i]] = true;
		})();
		/**
		* @deprecated May be removed in the next major version
		*/
		JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
			return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
		};
		function strictLookup(requireTerminal, compiler, parts, startPartIndex, type) {
			var stack = compiler.popStack(), len = parts.length;
			if (requireTerminal) len--;
			for (var i = startPartIndex; i < len; i++) stack = compiler.nameLookup(stack, parts[i], type);
			if (requireTerminal) return [
				compiler.aliasable("container.strict"),
				"(",
				stack,
				", ",
				compiler.quotedString(parts[len]),
				", ",
				JSON.stringify(compiler.source.currentLocation),
				" )"
			];
			else return stack;
		}
		exports["default"] = JavaScriptCompiler;
		module.exports = exports["default"];
	}));
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/ColumnAddress.mjs
	var import_handlebars = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
		exports.__esModule = true;
		// istanbul ignore next
		function _interopRequireDefault(obj) {
			return obj && obj.__esModule ? obj : { "default": obj };
		}
		var _handlebarsRuntime2 = _interopRequireDefault(require_handlebars_runtime());
		var _handlebarsCompilerAst2 = _interopRequireDefault(require_ast());
		var _handlebarsCompilerBase = require_base();
		var _handlebarsCompilerCompiler = require_compiler();
		var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(require_javascript_compiler());
		var _handlebarsCompilerVisitor2 = _interopRequireDefault(require_visitor());
		var _handlebarsNoConflict2 = _interopRequireDefault(require_no_conflict());
		var _create = _handlebarsRuntime2["default"].create;
		function create() {
			var hb = _create();
			hb.compile = function(input, options) {
				return _handlebarsCompilerCompiler.compile(input, options, hb);
			};
			hb.precompile = function(input, options) {
				return _handlebarsCompilerCompiler.precompile(input, options, hb);
			};
			hb.AST = _handlebarsCompilerAst2["default"];
			hb.Compiler = _handlebarsCompilerCompiler.Compiler;
			hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2["default"];
			hb.Parser = _handlebarsCompilerBase.parser;
			hb.parse = _handlebarsCompilerBase.parse;
			hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
			return hb;
		}
		var inst = create();
		inst.create = create;
		_handlebarsNoConflict2["default"](inst);
		inst.Visitor = _handlebarsCompilerVisitor2["default"];
		inst["default"] = inst;
		exports["default"] = inst;
		module.exports = exports["default"];
	})))());
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ReferenceType;
	(function(ReferenceType) {
		ReferenceType["RELATIVE"] = "RELATIVE";
		ReferenceType["ABSOLUTE"] = "ABSOLUTE";
	})(ReferenceType || (ReferenceType = {}));
	var ColumnAddress = class ColumnAddress {
		constructor(type, col, sheet) {
			this.type = type;
			this.col = col;
			this.sheet = sheet;
		}
		static absolute(column, sheet) {
			return new ColumnAddress(ReferenceType.ABSOLUTE, column, sheet);
		}
		static relative(column, sheet) {
			return new ColumnAddress(ReferenceType.RELATIVE, column, sheet);
		}
		static compareByAbsoluteAddress(baseAddress) {
			return (colA, colB) => colA.toSimpleColumnAddress(baseAddress).col - colB.toSimpleColumnAddress(baseAddress).col;
		}
		isColumnAbsolute() {
			return this.type === ReferenceType.ABSOLUTE;
		}
		isColumnRelative() {
			return this.type === ReferenceType.RELATIVE;
		}
		isAbsolute() {
			return this.type === ReferenceType.ABSOLUTE && this.sheet !== void 0;
		}
		moved(toSheet, toRight, _toBottom) {
			const newSheet = this.sheet === void 0 ? void 0 : toSheet;
			return new ColumnAddress(this.type, this.col + toRight, newSheet);
		}
		shiftedByColumns(numberOfColumns) {
			return new ColumnAddress(this.type, this.col + numberOfColumns, this.sheet);
		}
		toSimpleColumnAddress(baseAddress) {
			const sheet = absoluteSheetReference(this, baseAddress);
			let column = this.col;
			if (this.isColumnRelative()) column = baseAddress.col + this.col;
			return simpleColumnAddress(sheet, column);
		}
		shiftRelativeDimensions(toRight, _toBottom) {
			const col = this.isColumnRelative() ? this.col + toRight : this.col;
			return new ColumnAddress(this.type, col, this.sheet);
		}
		shiftAbsoluteDimensions(toRight, _toBottom) {
			const col = this.isColumnAbsolute() ? this.col + toRight : this.col;
			return new ColumnAddress(this.type, col, this.sheet);
		}
		withSheet(sheet) {
			return new ColumnAddress(this.type, this.col, sheet);
		}
		isInvalid(baseAddress) {
			return this.toSimpleColumnAddress(baseAddress).col < 0;
		}
		hash(withSheet) {
			const sheetPart = withSheet && this.sheet !== void 0 ? `#${this.sheet}` : "";
			switch (this.type) {
				case ReferenceType.RELATIVE: return `${sheetPart}#COLR${this.col}`;
				case ReferenceType.ABSOLUTE: return `${sheetPart}#COLA${this.col}`;
			}
		}
		unparse(baseAddress) {
			const simpleAddress = this.toSimpleColumnAddress(baseAddress);
			if (invalidSimpleColumnAddress(simpleAddress)) return;
			const column = columnIndexToLabel(simpleAddress.col);
			return `${this.type === ReferenceType.ABSOLUTE ? "$" : ""}${column}`;
		}
		exceedsSheetSizeLimits(maxColumns) {
			return this.col >= maxColumns;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/RowAddress.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RowAddress = class RowAddress {
		constructor(type, row, sheet) {
			this.type = type;
			this.row = row;
			this.sheet = sheet;
		}
		static absolute(row, sheet) {
			return new RowAddress(ReferenceType.ABSOLUTE, row, sheet);
		}
		static relative(row, sheet) {
			return new RowAddress(ReferenceType.RELATIVE, row, sheet);
		}
		static compareByAbsoluteAddress(baseAddress) {
			return (rowA, rowB) => rowA.toSimpleRowAddress(baseAddress).row - rowB.toSimpleRowAddress(baseAddress).row;
		}
		isRowAbsolute() {
			return this.type === ReferenceType.ABSOLUTE;
		}
		isRowRelative() {
			return this.type === ReferenceType.RELATIVE;
		}
		isAbsolute() {
			return this.type === ReferenceType.ABSOLUTE && this.sheet !== void 0;
		}
		moved(toSheet, toRight, toBottom) {
			const newSheet = this.sheet === void 0 ? void 0 : toSheet;
			return new RowAddress(this.type, this.row + toBottom, newSheet);
		}
		shiftedByRows(numberOfColumns) {
			return new RowAddress(this.type, this.row + numberOfColumns, this.sheet);
		}
		toSimpleRowAddress(baseAddress) {
			const sheet = absoluteSheetReference(this, baseAddress);
			let row = this.row;
			if (this.isRowRelative()) row = baseAddress.row + this.row;
			return simpleRowAddress(sheet, row);
		}
		shiftRelativeDimensions(toRight, toBottom) {
			const row = this.isRowRelative() ? this.row + toBottom : this.row;
			return new RowAddress(this.type, row, this.sheet);
		}
		shiftAbsoluteDimensions(toRight, toBottom) {
			const row = this.isRowAbsolute() ? this.row + toBottom : this.row;
			return new RowAddress(this.type, row, this.sheet);
		}
		withSheet(sheet) {
			return new RowAddress(this.type, this.row, sheet);
		}
		isInvalid(baseAddress) {
			return this.toSimpleRowAddress(baseAddress).row < 0;
		}
		hash(withSheet) {
			const sheetPart = withSheet && this.sheet !== void 0 ? `#${this.sheet}` : "";
			switch (this.type) {
				case ReferenceType.RELATIVE: return `${sheetPart}#ROWR${this.row}`;
				case ReferenceType.ABSOLUTE: return `${sheetPart}#ROWA${this.row}`;
			}
		}
		unparse(baseAddress) {
			const simpleAddress = this.toSimpleRowAddress(baseAddress);
			if (invalidSimpleRowAddress(simpleAddress)) return;
			return `${this.type === ReferenceType.ABSOLUTE ? "$" : ""}${simpleAddress.row + 1}`;
		}
		exceedsSheetSizeLimits(maxRows) {
			return this.row >= maxRows;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/CellAddress.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/** Possible kinds of cell references */
	var CellReferenceType;
	(function(CellReferenceType) {
		/** Cell reference with both row and column relative. */
		CellReferenceType["CELL_REFERENCE_RELATIVE"] = "CELL_REFERENCE";
		/** Cell reference with both row and column absolute. */
		CellReferenceType["CELL_REFERENCE_ABSOLUTE"] = "CELL_REFERENCE_ABSOLUTE";
		/** Cell reference with absolute column and relative row. */
		CellReferenceType["CELL_REFERENCE_ABSOLUTE_COL"] = "CELL_REFERENCE_ABSOLUTE_COL";
		/** Cell reference with relative column and absolute row. */
		CellReferenceType["CELL_REFERENCE_ABSOLUTE_ROW"] = "CELL_REFERENCE_ABSOLUTE_ROW";
	})(CellReferenceType || (CellReferenceType = {}));
	var CellAddress = class CellAddress {
		constructor(col, row, type, sheet) {
			this.col = col;
			this.row = row;
			this.type = type;
			this.sheet = sheet;
		}
		static fromColAndRow(col, row, sheet) {
			return (col.isColumnAbsolute() && row.isRowAbsolute() ? CellAddress.absolute.bind(this) : col.isColumnAbsolute() ? CellAddress.absoluteCol.bind(this) : row.isRowAbsolute() ? CellAddress.absoluteRow.bind(this) : CellAddress.relative.bind(this))(col.col, row.row, sheet);
		}
		static relative(col, row, sheet) {
			return new CellAddress(col, row, CellReferenceType.CELL_REFERENCE_RELATIVE, sheet);
		}
		static absolute(col, row, sheet) {
			return new CellAddress(col, row, CellReferenceType.CELL_REFERENCE_ABSOLUTE, sheet);
		}
		static absoluteCol(col, row, sheet) {
			return new CellAddress(col, row, CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL, sheet);
		}
		static absoluteRow(col, row, sheet) {
			return new CellAddress(col, row, CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW, sheet);
		}
		/**
		* Converts R0C0 representation of cell address to simple object representation.
		*
		* @param baseAddress - base address for R0C0 shifts
		*/
		toSimpleCellAddress(baseAddress) {
			const sheet = absoluteSheetReference(this, baseAddress);
			if (this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE) return simpleCellAddress(sheet, this.col, this.row);
			else if (this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW) return simpleCellAddress(sheet, baseAddress.col + this.col, this.row);
			else if (this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL) return simpleCellAddress(sheet, this.col, baseAddress.row + this.row);
			else return simpleCellAddress(sheet, baseAddress.col + this.col, baseAddress.row + this.row);
		}
		toColumnAddress() {
			return new ColumnAddress(this.isColumnRelative() ? ReferenceType.RELATIVE : ReferenceType.ABSOLUTE, this.col, this.sheet);
		}
		toRowAddress() {
			return new RowAddress(this.isRowRelative() ? ReferenceType.RELATIVE : ReferenceType.ABSOLUTE, this.row, this.sheet);
		}
		toSimpleColumnAddress(baseAddress) {
			const sheet = absoluteSheetReference(this, baseAddress);
			let column = this.col;
			if (this.isColumnRelative()) column += baseAddress.col;
			return simpleColumnAddress(sheet, column);
		}
		toSimpleRowAddress(baseAddress) {
			const sheet = absoluteSheetReference(this, baseAddress);
			let row = this.row;
			if (this.isRowRelative()) row += baseAddress.row;
			return simpleRowAddress(sheet, row);
		}
		isRowAbsolute() {
			return this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE || this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW;
		}
		isColumnAbsolute() {
			return this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE || this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL;
		}
		isColumnRelative() {
			return this.type === CellReferenceType.CELL_REFERENCE_RELATIVE || this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW;
		}
		isRowRelative() {
			return this.type === CellReferenceType.CELL_REFERENCE_RELATIVE || this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL;
		}
		isAbsolute() {
			return this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE && this.sheet !== void 0;
		}
		shiftedByRows(numberOfRows) {
			return new CellAddress(this.col, this.row + numberOfRows, this.type, this.sheet);
		}
		shiftedByColumns(numberOfColumns) {
			return new CellAddress(this.col + numberOfColumns, this.row, this.type, this.sheet);
		}
		moved(toSheet, toRight, toBottom) {
			const newSheet = this.sheet === void 0 ? void 0 : toSheet;
			return new CellAddress(this.col + toRight, this.row + toBottom, this.type, newSheet);
		}
		withSheet(sheet) {
			return new CellAddress(this.col, this.row, this.type, sheet);
		}
		isInvalid(baseAddress) {
			return isColOrRowInvalid(this.toSimpleCellAddress(baseAddress));
		}
		shiftRelativeDimensions(toRight, toBottom) {
			return new CellAddress(this.isColumnAbsolute() ? this.col : this.col + toRight, this.isRowAbsolute() ? this.row : this.row + toBottom, this.type, this.sheet);
		}
		shiftAbsoluteDimensions(toRight, toBottom) {
			return new CellAddress(this.isColumnRelative() ? this.col : this.col + toRight, this.isRowRelative() ? this.row : this.row + toBottom, this.type, this.sheet);
		}
		hash(withSheet) {
			const sheetPart = withSheet && this.sheet !== void 0 ? `#${this.sheet}` : "";
			switch (this.type) {
				case CellReferenceType.CELL_REFERENCE_RELATIVE: return `${sheetPart}#${this.row}R${this.col}`;
				case CellReferenceType.CELL_REFERENCE_ABSOLUTE: return `${sheetPart}#${this.row}A${this.col}`;
				case CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL: return `${sheetPart}#${this.row}AC${this.col}`;
				case CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW: return `${sheetPart}#${this.row}AR${this.col}`;
			}
		}
		unparse(baseAddress) {
			const simpleAddress = this.toSimpleCellAddress(baseAddress);
			if (isColOrRowInvalid(simpleAddress)) return;
			const column = columnIndexToLabel(simpleAddress.col);
			const rowDollar = this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE || this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW ? "$" : "";
			return `${this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE || this.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL ? "$" : ""}${column}${rowDollar}${simpleAddress.row + 1}`;
		}
		exceedsSheetSizeLimits(maxColumns, maxRows) {
			return this.row >= maxRows || this.col >= maxColumns;
		}
	};
	var ODFF_WHITESPACE_PATTERN = "[ \\t\\n\\r]+";
	var UNICODE_LETTER_PATTERN = "A-Za-zÀ-ʯ";
	var NON_RESERVED_CHARACTER_PATTERN = `${UNICODE_LETTER_PATTERN}0-9_.`;
	var UNQUOTED_SHEET_NAME_PATTERN = `[${UNICODE_LETTER_PATTERN}0-9_]+`;
	var SHEET_NAME_PATTERN = `(${UNQUOTED_SHEET_NAME_PATTERN}|'(((?!').|'')*)')!`;
	var CELL_REFERENCE_PATTERN = `(${SHEET_NAME_PATTERN})?\\\$?[A-Za-z]+\\\$?[0-9]+`;
	var COLUMN_REFERENCE_PATTERN = `(${SHEET_NAME_PATTERN})?\\\$?[A-Za-z]+`;
	var ROW_REFERENCE_PATTERN = `(${SHEET_NAME_PATTERN})?\\\$?[0-9]+`;
	var R1C1_CELL_REFERENCE_PATTERN = "[rR][0-9]*[cC][0-9]*";
	var CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN = `(${CELL_REFERENCE_PATTERN})[^${NON_RESERVED_CHARACTER_PATTERN}]`;
	var NAMED_EXPRESSION_PATTERN = `[${UNICODE_LETTER_PATTERN}_][${NON_RESERVED_CHARACTER_PATTERN}]*`;
	var ALL_DIGITS_ARRAY = [
		"0",
		"1",
		"2",
		"3",
		"4",
		"5",
		"6",
		"7",
		"8",
		"9"
	];
	var ALL_UNICODE_LETTERS_ARRAY = [
		...Array.from(Array(26)).map((_, i) => i + "A".charCodeAt(0)),
		...Array.from(Array(26)).map((_, i) => i + "a".charCodeAt(0)),
		...Array.from(Array(496)).map((_, i) => i + 192)
	].map((code) => String.fromCharCode(code));
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/addressRepresentationConverters.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var addressRegex = new RegExp(`^(${SHEET_NAME_PATTERN})?(\\\$?)([A-Za-z]+)(\\\$?)([0-9]+)$`);
	var columnRegex = new RegExp(`^(${SHEET_NAME_PATTERN})?(\\\$?)([A-Za-z]+)$`);
	var rowRegex = new RegExp(`^(${SHEET_NAME_PATTERN})?(\\\$?)([0-9]+)$`);
	var simpleSheetNameRegex = new RegExp(`^${UNQUOTED_SHEET_NAME_PATTERN}$`);
	/**
	* Computes R0C0 representation of cell address based on it's string representation and base address.
	*
	* @param {string} stringAddress - string representation of cell address, e.g., 'C64'
	* @param {SimpleCellAddress} baseAddress - base address for R0C0 conversion
	* @param {ResolveSheetReferenceFn} resolveSheetReference - mapping function needed to change name of a sheet to index
	* @returns {Maybe<CellAddress>} object representation of address or `undefined` if the sheet cannot be resolved
	*/
	var cellAddressFromString = (stringAddress, baseAddress, resolveSheetReference) => {
		const result = addressRegex.exec(stringAddress);
		if (!result) return;
		const col = columnLabelToIndex(result[6]);
		const row = Number(result[8]) - 1;
		const sheet = sheetNameToId(extractSheetName(result), resolveSheetReference);
		if (sheet === null) return;
		if (result[5] === "$" && result[7] === "$") return CellAddress.absolute(col, row, sheet);
		else if (result[5] === "$") return CellAddress.absoluteCol(col, row - baseAddress.row, sheet);
		else if (result[7] === "$") return CellAddress.absoluteRow(col - baseAddress.col, row, sheet);
		else return CellAddress.relative(col - baseAddress.col, row - baseAddress.row, sheet);
	};
	var columnAddressFromString = (stringAddress, baseAddress, resolveSheetReference) => {
		const result = columnRegex.exec(stringAddress);
		if (!result) return;
		const col = columnLabelToIndex(result[6]);
		const sheet = sheetNameToId(extractSheetName(result), resolveSheetReference);
		if (sheet === null) return;
		if (result[5] === "$") return ColumnAddress.absolute(col, sheet);
		else return ColumnAddress.relative(col - baseAddress.col, sheet);
	};
	var rowAddressFromString = (stringAddress, baseAddress, resolveSheetReference) => {
		const result = rowRegex.exec(stringAddress);
		if (!result) return;
		const row = Number(result[6]) - 1;
		const sheet = sheetNameToId(extractSheetName(result), resolveSheetReference);
		if (sheet === null) return;
		if (result[5] === "$") return RowAddress.absolute(row, sheet);
		else return RowAddress.relative(row - baseAddress.row, sheet);
	};
	/**
	* Computes simple (absolute) address of a cell address based on its string representation.
	* - If sheet name is present in the string representation but is not present in sheet mapping, returns `undefined`.
	* - If sheet name is not present in the string representation, returns {@param contextSheetId} as sheet number.
	*
	* @param {ResolveSheetReferenceFn} resolveSheetReference - mapping function needed to change name of a sheet to index
	* @param {string} stringAddress - string representation of cell address, e.g., 'C64'
	* @param {number} contextSheetId - sheet in context of which we should parse the address
	* @returns {Maybe<SimpleCellAddress>} absolute representation of address, e.g., { sheet: 0, col: 1, row: 1 }
	*/
	var simpleCellAddressFromString = (resolveSheetReference, stringAddress, contextSheetId) => {
		const regExpExecArray = addressRegex.exec(stringAddress);
		if (!regExpExecArray) return;
		const col = columnLabelToIndex(regExpExecArray[6]);
		const row = Number(regExpExecArray[8]) - 1;
		const sheet = sheetNameToId(extractSheetName(regExpExecArray), resolveSheetReference);
		if (sheet === null) return;
		return simpleCellAddress(sheet === void 0 ? contextSheetId : sheet, col, row);
	};
	var simpleCellRangeFromString = (resolveSheetReference, stringAddress, contextSheetId) => {
		const split = stringAddress.split(":");
		if (split.length !== 2) return;
		const [startString, endString] = split;
		const start = simpleCellAddressFromString(resolveSheetReference, startString, contextSheetId);
		if (start === void 0) return;
		const end = simpleCellAddressFromString(resolveSheetReference, endString, start.sheet);
		if (end === void 0) return;
		if (start.sheet !== end.sheet) return;
		return simpleCellRange(start, end);
	};
	/**
	* Returns string representation of absolute address
	* If sheet index is not present in sheet mapping, returns undefined
	*/
	var simpleCellAddressToString = (sheetIndexMapping, address, sheetIndex) => {
		const column = columnIndexToLabel(address.col);
		const sheetName = sheetIndexToString(address.sheet, sheetIndexMapping);
		if (sheetName === void 0) return;
		if (sheetIndex !== address.sheet) return `${sheetName}!${column}${address.row + 1}`;
		else return `${column}${address.row + 1}`;
	};
	var simpleCellRangeToString = (sheetIndexMapping, address, sheetIndex) => {
		const startString = simpleCellAddressToString(sheetIndexMapping, address.start, sheetIndex);
		const endString = simpleCellAddressToString(sheetIndexMapping, address.end, address.start.sheet);
		if (startString === void 0 || endString === void 0) return;
		else return `${startString}:${endString}`;
	};
	/**
	* Convert column label to index
	*
	* @param columnStringRepresentation - column label (e.g., 'AAB')
	* @returns column index
	*/
	function columnLabelToIndex(columnStringRepresentation) {
		if (columnStringRepresentation.length === 1) return columnStringRepresentation.toUpperCase().charCodeAt(0) - 65;
		else return columnStringRepresentation.split("").reduce((currentColumn, nextLetter) => {
			return currentColumn * 26 + (nextLetter.toUpperCase().charCodeAt(0) - 64);
		}, 0) - 1;
	}
	/**
	* Converts column index to label
	*
	* @param column - address to convert
	* @returns string representation, e.g., 'AAB'
	*/
	function columnIndexToLabel(column) {
		let result = "";
		while (column >= 0) {
			result = String.fromCharCode(column % 26 + 97) + result;
			column = Math.floor(column / 26) - 1;
		}
		return result.toUpperCase();
	}
	function sheetIndexToString(sheetId, sheetMappingFn) {
		let sheetName = sheetMappingFn(sheetId);
		if (sheetName === void 0) return;
		if (simpleSheetNameRegex.test(sheetName)) return sheetName;
		else {
			sheetName = sheetName.replace(/'/g, "''");
			return `'${sheetName}'`;
		}
	}
	function extractSheetName(regexResult) {
		var _a;
		const maybeSheetName = (_a = regexResult[3]) !== null && _a !== void 0 ? _a : regexResult[2];
		return maybeSheetName ? maybeSheetName.replace(/''/g, "'") : null;
	}
	/**
	* Resolves sheet name to sheet id.
	*
	* @param sheetName - extracted sheet name or null when not provided.
	* @param resolveSheetReference - mapping function resolving sheet name to id.
	* @returns sheet id, undefined when sheet name absent, null when resolution fails.
	*/
	function sheetNameToId(sheetName, resolveSheetReference) {
		if (!sheetName) return;
		const sheetId = resolveSheetReference(sheetName);
		return sheetId === void 0 ? null : sheetId;
	}
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/utils/utils.js
	function isEmpty(arr) {
		return arr && arr.length === 0;
	}
	function keys(obj) {
		if (obj === void 0 || obj === null) return [];
		return Object.keys(obj);
	}
	function values(obj) {
		var vals = [];
		var keys = Object.keys(obj);
		for (var i = 0; i < keys.length; i++) vals.push(obj[keys[i]]);
		return vals;
	}
	function mapValues(obj, callback) {
		var result = [];
		var objKeys = keys(obj);
		for (var idx = 0; idx < objKeys.length; idx++) {
			var currKey = objKeys[idx];
			result.push(callback.call(null, obj[currKey], currKey));
		}
		return result;
	}
	function map(arr, callback) {
		var result = [];
		for (var idx = 0; idx < arr.length; idx++) result.push(callback.call(null, arr[idx], idx));
		return result;
	}
	function flatten(arr) {
		var result = [];
		for (var idx = 0; idx < arr.length; idx++) {
			var currItem = arr[idx];
			if (Array.isArray(currItem)) result = result.concat(flatten(currItem));
			else result.push(currItem);
		}
		return result;
	}
	function first$1(arr) {
		return isEmpty(arr) ? void 0 : arr[0];
	}
	function last(arr) {
		var len = arr && arr.length;
		return len ? arr[len - 1] : void 0;
	}
	function forEach(collection, iteratorCallback) {
		/* istanbul ignore else */
		if (Array.isArray(collection)) for (var i = 0; i < collection.length; i++) iteratorCallback.call(null, collection[i], i);
		else if (isObject(collection)) {
			var colKeys = keys(collection);
			for (var i = 0; i < colKeys.length; i++) {
				var key = colKeys[i];
				var value = collection[key];
				iteratorCallback.call(null, value, key);
			}
		} else throw Error("non exhaustive match");
	}
	function isString(item) {
		return typeof item === "string";
	}
	function isUndefined(item) {
		return item === void 0;
	}
	function isFunction(item) {
		return item instanceof Function;
	}
	function drop(arr, howMuch) {
		if (howMuch === void 0) howMuch = 1;
		return arr.slice(howMuch, arr.length);
	}
	function dropRight(arr, howMuch) {
		if (howMuch === void 0) howMuch = 1;
		return arr.slice(0, arr.length - howMuch);
	}
	function filter(arr, predicate) {
		var result = [];
		if (Array.isArray(arr)) for (var i = 0; i < arr.length; i++) {
			var item = arr[i];
			if (predicate.call(null, item)) result.push(item);
		}
		return result;
	}
	function reject(arr, predicate) {
		return filter(arr, function(item) {
			return !predicate(item);
		});
	}
	function pick(obj, predicate) {
		var keys = Object.keys(obj);
		var result = {};
		for (var i = 0; i < keys.length; i++) {
			var currKey = keys[i];
			var currItem = obj[currKey];
			if (predicate(currItem)) result[currKey] = currItem;
		}
		return result;
	}
	function has(obj, prop) {
		if (isObject(obj)) return obj.hasOwnProperty(prop);
		return false;
	}
	function contains(arr, item) {
		return find(arr, function(currItem) {
			return currItem === item;
		}) !== void 0 ? true : false;
	}
	/**
	* shallow clone
	*/
	function cloneArr(arr) {
		var newArr = [];
		for (var i = 0; i < arr.length; i++) newArr.push(arr[i]);
		return newArr;
	}
	/**
	* shallow clone
	*/
	function cloneObj(obj) {
		var clonedObj = {};
		for (var key in obj)
 /* istanbul ignore else */
		if (Object.prototype.hasOwnProperty.call(obj, key)) clonedObj[key] = obj[key];
		return clonedObj;
	}
	function find(arr, predicate) {
		for (var i = 0; i < arr.length; i++) {
			var item = arr[i];
			if (predicate.call(null, item)) return item;
		}
	}
	function findAll(arr, predicate) {
		var found = [];
		for (var i = 0; i < arr.length; i++) {
			var item = arr[i];
			if (predicate.call(null, item)) found.push(item);
		}
		return found;
	}
	function reduce(arrOrObj, iterator, initial) {
		var isArr = Array.isArray(arrOrObj);
		var vals = isArr ? arrOrObj : values(arrOrObj);
		var objKeys = isArr ? [] : keys(arrOrObj);
		var accumulator = initial;
		for (var i = 0; i < vals.length; i++) accumulator = iterator.call(null, accumulator, vals[i], isArr ? i : objKeys[i]);
		return accumulator;
	}
	function compact(arr) {
		return reject(arr, function(item) {
			return item === null || item === void 0;
		});
	}
	function uniq(arr, identity) {
		if (identity === void 0) identity = function(item) {
			return item;
		};
		var identities = [];
		return reduce(arr, function(result, currItem) {
			var currIdentity = identity(currItem);
			if (contains(identities, currIdentity)) return result;
			else {
				identities.push(currIdentity);
				return result.concat(currItem);
			}
		}, []);
	}
	function isArray(obj) {
		return Array.isArray(obj);
	}
	function isRegExp(obj) {
		return obj instanceof RegExp;
	}
	function isObject(obj) {
		return obj instanceof Object;
	}
	function every(arr, predicate) {
		for (var i = 0; i < arr.length; i++) if (!predicate(arr[i], i)) return false;
		return true;
	}
	function difference(arr, values) {
		return reject(arr, function(item) {
			return contains(values, item);
		});
	}
	function some(arr, predicate) {
		for (var i = 0; i < arr.length; i++) if (predicate(arr[i])) return true;
		return false;
	}
	function indexOf(arr, value) {
		for (var i = 0; i < arr.length; i++) if (arr[i] === value) return i;
		return -1;
	}
	/**
	* mutates! (and returns) target
	*/
	function assign(target) {
		var sources = [];
		for (var _i = 1; _i < arguments.length; _i++) sources[_i - 1] = arguments[_i];
		for (var i = 0; i < sources.length; i++) {
			var curSource = sources[i];
			var currSourceKeys = keys(curSource);
			for (var j = 0; j < currSourceKeys.length; j++) {
				var currKey = currSourceKeys[j];
				target[currKey] = curSource[currKey];
			}
		}
		return target;
	}
	/**
	* mutates! (and returns) target
	*/
	function assignNoOverwrite(target) {
		var sources = [];
		for (var _i = 1; _i < arguments.length; _i++) sources[_i - 1] = arguments[_i];
		for (var i = 0; i < sources.length; i++) {
			var curSource = sources[i];
			if (isUndefined(curSource)) continue;
			var currSourceKeys = keys(curSource);
			for (var j = 0; j < currSourceKeys.length; j++) {
				var currKey = currSourceKeys[j];
				if (!has(target, currKey)) target[currKey] = curSource[currKey];
			}
		}
		return target;
	}
	function defaults() {
		var sources = [];
		for (var _i = 0; _i < arguments.length; _i++) sources[_i] = arguments[_i];
		return assignNoOverwrite.apply(null, [{}].concat(sources));
	}
	function groupBy(arr, groupKeyFunc) {
		var result = {};
		forEach(arr, function(item) {
			var currGroupKey = groupKeyFunc(item);
			var currGroupArr = result[currGroupKey];
			if (currGroupArr) currGroupArr.push(item);
			else result[currGroupKey] = [item];
		});
		return result;
	}
	/**
	* Merge obj2 into obj1.
	* Will overwrite existing properties with the same name
	*/
	function merge(obj1, obj2) {
		var result = cloneObj(obj1);
		var keys2 = keys(obj2);
		for (var i = 0; i < keys2.length; i++) {
			var key = keys2[i];
			result[key] = obj2[key];
		}
		return result;
	}
	function NOOP() {}
	function IDENTITY(item) {
		return item;
	}
	/**
	* Will return a new packed array with same values.
	*/
	function packArray(holeyArr) {
		var result = [];
		for (var i = 0; i < holeyArr.length; i++) {
			var orgValue = holeyArr[i];
			result.push(orgValue !== void 0 ? orgValue : void 0);
		}
		return result;
	}
	function PRINT_ERROR(msg) {
		/* istanbul ignore else - can't override global.console in node.js */
		if (console && console.error) console.error("Error: " + msg);
	}
	function PRINT_WARNING(msg) {
		/* istanbul ignore else - can't override global.console in node.js*/
		if (console && console.warn) console.warn("Warning: " + msg);
	}
	function isES2015MapSupported() {
		return typeof Map === "function";
	}
	function applyMixins(derivedCtor, baseCtors) {
		baseCtors.forEach(function(baseCtor) {
			var baseProto = baseCtor.prototype;
			Object.getOwnPropertyNames(baseProto).forEach(function(propName) {
				if (propName === "constructor") return;
				var basePropDescriptor = Object.getOwnPropertyDescriptor(baseProto, propName);
				if (basePropDescriptor && (basePropDescriptor.get || basePropDescriptor.set)) Object.defineProperty(derivedCtor.prototype, propName, basePropDescriptor);
				else derivedCtor.prototype[propName] = baseCtor.prototype[propName];
			});
		});
	}
	function toFastProperties(toBecomeFast) {
		function FakeConstructor() {}
		FakeConstructor.prototype = toBecomeFast;
		var fakeInstance = new FakeConstructor();
		function fakeAccess() {
			return typeof fakeInstance.bar;
		}
		fakeAccess();
		fakeAccess();
		return toBecomeFast;
	}
	function peek(arr) {
		return arr[arr.length - 1];
	}
	/* istanbul ignore next - for performance tracing*/
	function timer(func) {
		var start = (/* @__PURE__ */ new Date()).getTime();
		var val = func();
		return {
			time: (/* @__PURE__ */ new Date()).getTime() - start,
			value: val
		};
	}
	var init_utils = __esmMin((() => {}));
	//#endregion
	//#region ../../node_modules/regexp-to-ast/lib/regexp-to-ast.js
	var require_regexp_to_ast = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function(root, factory) {
			// istanbul ignore next
			if (typeof define === "function" && define.amd)
 // istanbul ignore next
			define([], factory);
			else if (typeof module === "object" && module.exports) module.exports = factory();
			else
 // istanbul ignore next
			root.regexpToAst = factory();
		})(typeof self !== "undefined" ? self : exports, function() {
			function RegExpParser() {}
			RegExpParser.prototype.saveState = function() {
				return {
					idx: this.idx,
					input: this.input,
					groupIdx: this.groupIdx
				};
			};
			RegExpParser.prototype.restoreState = function(newState) {
				this.idx = newState.idx;
				this.input = newState.input;
				this.groupIdx = newState.groupIdx;
			};
			RegExpParser.prototype.pattern = function(input) {
				this.idx = 0;
				this.input = input;
				this.groupIdx = 0;
				this.consumeChar("/");
				var value = this.disjunction();
				this.consumeChar("/");
				var flags = {
					type: "Flags",
					global: false,
					ignoreCase: false,
					multiLine: false,
					unicode: false,
					sticky: false
				};
				while (this.isRegExpFlag()) switch (this.popChar()) {
					case "g":
						addFlag(flags, "global");
						break;
					case "i":
						addFlag(flags, "ignoreCase");
						break;
					case "m":
						addFlag(flags, "multiLine");
						break;
					case "u":
						addFlag(flags, "unicode");
						break;
					case "y":
						addFlag(flags, "sticky");
						break;
				}
				if (this.idx !== this.input.length) throw Error("Redundant input: " + this.input.substring(this.idx));
				return {
					type: "Pattern",
					flags,
					value
				};
			};
			RegExpParser.prototype.disjunction = function() {
				var alts = [];
				alts.push(this.alternative());
				while (this.peekChar() === "|") {
					this.consumeChar("|");
					alts.push(this.alternative());
				}
				return {
					type: "Disjunction",
					value: alts
				};
			};
			RegExpParser.prototype.alternative = function() {
				var terms = [];
				while (this.isTerm()) terms.push(this.term());
				return {
					type: "Alternative",
					value: terms
				};
			};
			RegExpParser.prototype.term = function() {
				if (this.isAssertion()) return this.assertion();
				else return this.atom();
			};
			RegExpParser.prototype.assertion = function() {
				switch (this.popChar()) {
					case "^": return { type: "StartAnchor" };
					case "$": return { type: "EndAnchor" };
					case "\\":
						switch (this.popChar()) {
							case "b": return { type: "WordBoundary" };
							case "B": return { type: "NonWordBoundary" };
						}
						// istanbul ignore next
						throw Error("Invalid Assertion Escape");
					case "(":
						this.consumeChar("?");
						var type;
						switch (this.popChar()) {
							case "=":
								type = "Lookahead";
								break;
							case "!":
								type = "NegativeLookahead";
								break;
						}
						ASSERT_EXISTS(type);
						var disjunction = this.disjunction();
						this.consumeChar(")");
						return {
							type,
							value: disjunction
						};
				}
				// istanbul ignore next
				ASSERT_NEVER_REACH_HERE();
			};
			RegExpParser.prototype.quantifier = function(isBacktracking) {
				var range;
				switch (this.popChar()) {
					case "*":
						range = {
							atLeast: 0,
							atMost: Infinity
						};
						break;
					case "+":
						range = {
							atLeast: 1,
							atMost: Infinity
						};
						break;
					case "?":
						range = {
							atLeast: 0,
							atMost: 1
						};
						break;
					case "{":
						var atLeast = this.integerIncludingZero();
						switch (this.popChar()) {
							case "}":
								range = {
									atLeast,
									atMost: atLeast
								};
								break;
							case ",":
								var atMost;
								if (this.isDigit()) {
									atMost = this.integerIncludingZero();
									range = {
										atLeast,
										atMost
									};
								} else range = {
									atLeast,
									atMost: Infinity
								};
								this.consumeChar("}");
								break;
						}
						if (isBacktracking === true && range === void 0) return;
						ASSERT_EXISTS(range);
						break;
				}
				if (isBacktracking === true && range === void 0) return;
				ASSERT_EXISTS(range);
				if (this.peekChar(0) === "?") {
					this.consumeChar("?");
					range.greedy = false;
				} else range.greedy = true;
				range.type = "Quantifier";
				return range;
			};
			RegExpParser.prototype.atom = function() {
				var atom;
				switch (this.peekChar()) {
					case ".":
						atom = this.dotAll();
						break;
					case "\\":
						atom = this.atomEscape();
						break;
					case "[":
						atom = this.characterClass();
						break;
					case "(":
						atom = this.group();
						break;
				}
				if (atom === void 0 && this.isPatternCharacter()) atom = this.patternCharacter();
				ASSERT_EXISTS(atom);
				if (this.isQuantifier()) atom.quantifier = this.quantifier();
				return atom;
			};
			RegExpParser.prototype.dotAll = function() {
				this.consumeChar(".");
				return {
					type: "Set",
					complement: true,
					value: [
						cc("\n"),
						cc("\r"),
						cc("\u2028"),
						cc("\u2029")
					]
				};
			};
			RegExpParser.prototype.atomEscape = function() {
				this.consumeChar("\\");
				switch (this.peekChar()) {
					case "1":
					case "2":
					case "3":
					case "4":
					case "5":
					case "6":
					case "7":
					case "8":
					case "9": return this.decimalEscapeAtom();
					case "d":
					case "D":
					case "s":
					case "S":
					case "w":
					case "W": return this.characterClassEscape();
					case "f":
					case "n":
					case "r":
					case "t":
					case "v": return this.controlEscapeAtom();
					case "c": return this.controlLetterEscapeAtom();
					case "0": return this.nulCharacterAtom();
					case "x": return this.hexEscapeSequenceAtom();
					case "u": return this.regExpUnicodeEscapeSequenceAtom();
					default: return this.identityEscapeAtom();
				}
			};
			RegExpParser.prototype.decimalEscapeAtom = function() {
				return {
					type: "GroupBackReference",
					value: this.positiveInteger()
				};
			};
			RegExpParser.prototype.characterClassEscape = function() {
				var set;
				var complement = false;
				switch (this.popChar()) {
					case "d":
						set = digitsCharCodes;
						break;
					case "D":
						set = digitsCharCodes;
						complement = true;
						break;
					case "s":
						set = whitespaceCodes;
						break;
					case "S":
						set = whitespaceCodes;
						complement = true;
						break;
					case "w":
						set = wordCharCodes;
						break;
					case "W":
						set = wordCharCodes;
						complement = true;
						break;
				}
				ASSERT_EXISTS(set);
				return {
					type: "Set",
					value: set,
					complement
				};
			};
			RegExpParser.prototype.controlEscapeAtom = function() {
				var escapeCode;
				switch (this.popChar()) {
					case "f":
						escapeCode = cc("\f");
						break;
					case "n":
						escapeCode = cc("\n");
						break;
					case "r":
						escapeCode = cc("\r");
						break;
					case "t":
						escapeCode = cc("	");
						break;
					case "v":
						escapeCode = cc("\v");
						break;
				}
				ASSERT_EXISTS(escapeCode);
				return {
					type: "Character",
					value: escapeCode
				};
			};
			RegExpParser.prototype.controlLetterEscapeAtom = function() {
				this.consumeChar("c");
				var letter = this.popChar();
				if (/[a-zA-Z]/.test(letter) === false) throw Error("Invalid ");
				return {
					type: "Character",
					value: letter.toUpperCase().charCodeAt(0) - 64
				};
			};
			RegExpParser.prototype.nulCharacterAtom = function() {
				this.consumeChar("0");
				return {
					type: "Character",
					value: cc("\0")
				};
			};
			RegExpParser.prototype.hexEscapeSequenceAtom = function() {
				this.consumeChar("x");
				return this.parseHexDigits(2);
			};
			RegExpParser.prototype.regExpUnicodeEscapeSequenceAtom = function() {
				this.consumeChar("u");
				return this.parseHexDigits(4);
			};
			RegExpParser.prototype.identityEscapeAtom = function() {
				return {
					type: "Character",
					value: cc(this.popChar())
				};
			};
			RegExpParser.prototype.classPatternCharacterAtom = function() {
				switch (this.peekChar()) {
					// istanbul ignore next
					case "\n":
					// istanbul ignore next
					case "\r":
					// istanbul ignore next
					case "\u2028":
					// istanbul ignore next
					case "\u2029":
					// istanbul ignore next
					case "\\":
					// istanbul ignore next
					case "]": throw Error("TBD");
					default: return {
						type: "Character",
						value: cc(this.popChar())
					};
				}
			};
			RegExpParser.prototype.characterClass = function() {
				var set = [];
				var complement = false;
				this.consumeChar("[");
				if (this.peekChar(0) === "^") {
					this.consumeChar("^");
					complement = true;
				}
				while (this.isClassAtom()) {
					var from = this.classAtom();
					if (from.type === "Character" && this.isRangeDash()) {
						this.consumeChar("-");
						var to = this.classAtom();
						if (to.type === "Character") {
							if (to.value < from.value) throw Error("Range out of order in character class");
							set.push({
								from: from.value,
								to: to.value
							});
						} else {
							insertToSet(from.value, set);
							set.push(cc("-"));
							insertToSet(to.value, set);
						}
					} else insertToSet(from.value, set);
				}
				this.consumeChar("]");
				return {
					type: "Set",
					complement,
					value: set
				};
			};
			RegExpParser.prototype.classAtom = function() {
				switch (this.peekChar()) {
					// istanbul ignore next
					case "]":
					// istanbul ignore next
					case "\n":
					// istanbul ignore next
					case "\r":
					// istanbul ignore next
					case "\u2028":
					// istanbul ignore next
					case "\u2029": throw Error("TBD");
					case "\\": return this.classEscape();
					default: return this.classPatternCharacterAtom();
				}
			};
			RegExpParser.prototype.classEscape = function() {
				this.consumeChar("\\");
				switch (this.peekChar()) {
					case "b":
						this.consumeChar("b");
						return {
							type: "Character",
							value: cc("\b")
						};
					case "d":
					case "D":
					case "s":
					case "S":
					case "w":
					case "W": return this.characterClassEscape();
					case "f":
					case "n":
					case "r":
					case "t":
					case "v": return this.controlEscapeAtom();
					case "c": return this.controlLetterEscapeAtom();
					case "0": return this.nulCharacterAtom();
					case "x": return this.hexEscapeSequenceAtom();
					case "u": return this.regExpUnicodeEscapeSequenceAtom();
					default: return this.identityEscapeAtom();
				}
			};
			RegExpParser.prototype.group = function() {
				var capturing = true;
				this.consumeChar("(");
				switch (this.peekChar(0)) {
					case "?":
						this.consumeChar("?");
						this.consumeChar(":");
						capturing = false;
						break;
					default:
						this.groupIdx++;
						break;
				}
				var value = this.disjunction();
				this.consumeChar(")");
				var groupAst = {
					type: "Group",
					capturing,
					value
				};
				if (capturing) groupAst.idx = this.groupIdx;
				return groupAst;
			};
			RegExpParser.prototype.positiveInteger = function() {
				var number = this.popChar();
				// istanbul ignore next - can't ever get here due to previous lookahead checks
				if (decimalPatternNoZero.test(number) === false) throw Error("Expecting a positive integer");
				while (decimalPattern.test(this.peekChar(0))) number += this.popChar();
				return parseInt(number, 10);
			};
			RegExpParser.prototype.integerIncludingZero = function() {
				var number = this.popChar();
				if (decimalPattern.test(number) === false) throw Error("Expecting an integer");
				while (decimalPattern.test(this.peekChar(0))) number += this.popChar();
				return parseInt(number, 10);
			};
			RegExpParser.prototype.patternCharacter = function() {
				var nextChar = this.popChar();
				switch (nextChar) {
					// istanbul ignore next
					case "\n":
					// istanbul ignore next
					case "\r":
					// istanbul ignore next
					case "\u2028":
					// istanbul ignore next
					case "\u2029":
					// istanbul ignore next
					case "^":
					// istanbul ignore next
					case "$":
					// istanbul ignore next
					case "\\":
					// istanbul ignore next
					case ".":
					// istanbul ignore next
					case "*":
					// istanbul ignore next
					case "+":
					// istanbul ignore next
					case "?":
					// istanbul ignore next
					case "(":
					// istanbul ignore next
					case ")":
					// istanbul ignore next
					case "[":
					// istanbul ignore next
					case "|":
 // istanbul ignore next
					throw Error("TBD");
					default: return {
						type: "Character",
						value: cc(nextChar)
					};
				}
			};
			RegExpParser.prototype.isRegExpFlag = function() {
				switch (this.peekChar(0)) {
					case "g":
					case "i":
					case "m":
					case "u":
					case "y": return true;
					default: return false;
				}
			};
			RegExpParser.prototype.isRangeDash = function() {
				return this.peekChar() === "-" && this.isClassAtom(1);
			};
			RegExpParser.prototype.isDigit = function() {
				return decimalPattern.test(this.peekChar(0));
			};
			RegExpParser.prototype.isClassAtom = function(howMuch) {
				if (howMuch === void 0) howMuch = 0;
				switch (this.peekChar(howMuch)) {
					case "]":
					case "\n":
					case "\r":
					case "\u2028":
					case "\u2029": return false;
					default: return true;
				}
			};
			RegExpParser.prototype.isTerm = function() {
				return this.isAtom() || this.isAssertion();
			};
			RegExpParser.prototype.isAtom = function() {
				if (this.isPatternCharacter()) return true;
				switch (this.peekChar(0)) {
					case ".":
					case "\\":
					case "[":
					case "(": return true;
					default: return false;
				}
			};
			RegExpParser.prototype.isAssertion = function() {
				switch (this.peekChar(0)) {
					case "^":
					case "$": return true;
					case "\\": switch (this.peekChar(1)) {
						case "b":
						case "B": return true;
						default: return false;
					}
					case "(": return this.peekChar(1) === "?" && (this.peekChar(2) === "=" || this.peekChar(2) === "!");
					default: return false;
				}
			};
			RegExpParser.prototype.isQuantifier = function() {
				var prevState = this.saveState();
				try {
					return this.quantifier(true) !== void 0;
				} catch (e) {
					return false;
				} finally {
					this.restoreState(prevState);
				}
			};
			RegExpParser.prototype.isPatternCharacter = function() {
				switch (this.peekChar()) {
					case "^":
					case "$":
					case "\\":
					case ".":
					case "*":
					case "+":
					case "?":
					case "(":
					case ")":
					case "[":
					case "|":
					case "/":
					case "\n":
					case "\r":
					case "\u2028":
					case "\u2029": return false;
					default: return true;
				}
			};
			RegExpParser.prototype.parseHexDigits = function(howMany) {
				var hexString = "";
				for (var i = 0; i < howMany; i++) {
					var hexChar = this.popChar();
					if (hexDigitPattern.test(hexChar) === false) throw Error("Expecting a HexDecimal digits");
					hexString += hexChar;
				}
				return {
					type: "Character",
					value: parseInt(hexString, 16)
				};
			};
			RegExpParser.prototype.peekChar = function(howMuch) {
				if (howMuch === void 0) howMuch = 0;
				return this.input[this.idx + howMuch];
			};
			RegExpParser.prototype.popChar = function() {
				var nextChar = this.peekChar(0);
				this.consumeChar();
				return nextChar;
			};
			RegExpParser.prototype.consumeChar = function(char) {
				if (char !== void 0 && this.input[this.idx] !== char) throw Error("Expected: '" + char + "' but found: '" + this.input[this.idx] + "' at offset: " + this.idx);
				if (this.idx >= this.input.length) throw Error("Unexpected end of input");
				this.idx++;
			};
			var hexDigitPattern = /[0-9a-fA-F]/;
			var decimalPattern = /[0-9]/;
			var decimalPatternNoZero = /[1-9]/;
			function cc(char) {
				return char.charCodeAt(0);
			}
			function insertToSet(item, set) {
				if (item.length !== void 0) item.forEach(function(subItem) {
					set.push(subItem);
				});
				else set.push(item);
			}
			function addFlag(flagObj, flagKey) {
				if (flagObj[flagKey] === true) throw "duplicate flag " + flagKey;
				flagObj[flagKey] = true;
			}
			function ASSERT_EXISTS(obj) {
				// istanbul ignore next
				if (obj === void 0) throw Error("Internal Error - Should never get here!");
			}
			// istanbul ignore next
			function ASSERT_NEVER_REACH_HERE() {
				throw Error("Internal Error - Should never get here!");
			}
			var i;
			var digitsCharCodes = [];
			for (i = cc("0"); i <= cc("9"); i++) digitsCharCodes.push(i);
			var wordCharCodes = [cc("_")].concat(digitsCharCodes);
			for (i = cc("a"); i <= cc("z"); i++) wordCharCodes.push(i);
			for (i = cc("A"); i <= cc("Z"); i++) wordCharCodes.push(i);
			var whitespaceCodes = [
				cc(" "),
				cc("\f"),
				cc("\n"),
				cc("\r"),
				cc("	"),
				cc("\v"),
				cc("	"),
				cc("\xA0"),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc(" "),
				cc("\u2028"),
				cc("\u2029"),
				cc(" "),
				cc(" "),
				cc("　"),
				cc("﻿")
			];
			function BaseRegExpVisitor() {}
			BaseRegExpVisitor.prototype.visitChildren = function(node) {
				for (var key in node) {
					var child = node[key];
					/* istanbul ignore else */
					if (node.hasOwnProperty(key)) {
						if (child.type !== void 0) this.visit(child);
						else if (Array.isArray(child)) child.forEach(function(subChild) {
							this.visit(subChild);
						}, this);
					}
				}
			};
			BaseRegExpVisitor.prototype.visit = function(node) {
				switch (node.type) {
					case "Pattern":
						this.visitPattern(node);
						break;
					case "Flags":
						this.visitFlags(node);
						break;
					case "Disjunction":
						this.visitDisjunction(node);
						break;
					case "Alternative":
						this.visitAlternative(node);
						break;
					case "StartAnchor":
						this.visitStartAnchor(node);
						break;
					case "EndAnchor":
						this.visitEndAnchor(node);
						break;
					case "WordBoundary":
						this.visitWordBoundary(node);
						break;
					case "NonWordBoundary":
						this.visitNonWordBoundary(node);
						break;
					case "Lookahead":
						this.visitLookahead(node);
						break;
					case "NegativeLookahead":
						this.visitNegativeLookahead(node);
						break;
					case "Character":
						this.visitCharacter(node);
						break;
					case "Set":
						this.visitSet(node);
						break;
					case "Group":
						this.visitGroup(node);
						break;
					case "GroupBackReference":
						this.visitGroupBackReference(node);
						break;
					case "Quantifier":
						this.visitQuantifier(node);
						break;
				}
				this.visitChildren(node);
			};
			BaseRegExpVisitor.prototype.visitPattern = function(node) {};
			BaseRegExpVisitor.prototype.visitFlags = function(node) {};
			BaseRegExpVisitor.prototype.visitDisjunction = function(node) {};
			BaseRegExpVisitor.prototype.visitAlternative = function(node) {};
			BaseRegExpVisitor.prototype.visitStartAnchor = function(node) {};
			BaseRegExpVisitor.prototype.visitEndAnchor = function(node) {};
			BaseRegExpVisitor.prototype.visitWordBoundary = function(node) {};
			BaseRegExpVisitor.prototype.visitNonWordBoundary = function(node) {};
			BaseRegExpVisitor.prototype.visitLookahead = function(node) {};
			BaseRegExpVisitor.prototype.visitNegativeLookahead = function(node) {};
			BaseRegExpVisitor.prototype.visitCharacter = function(node) {};
			BaseRegExpVisitor.prototype.visitSet = function(node) {};
			BaseRegExpVisitor.prototype.visitGroup = function(node) {};
			BaseRegExpVisitor.prototype.visitGroupBackReference = function(node) {};
			BaseRegExpVisitor.prototype.visitQuantifier = function(node) {};
			return {
				RegExpParser,
				BaseRegExpVisitor,
				VERSION: "0.4.0"
			};
		});
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/reg_exp_parser.js
	function getRegExpAst(regExp) {
		var regExpStr = regExp.toString();
		if (regExpAstCache.hasOwnProperty(regExpStr)) return regExpAstCache[regExpStr];
		else {
			var regExpAst = regExpParser.pattern(regExpStr);
			regExpAstCache[regExpStr] = regExpAst;
			return regExpAst;
		}
	}
	function clearRegExpParserCache() {
		regExpAstCache = {};
	}
	var import_regexp_to_ast$2, regExpAstCache, regExpParser;
	var init_reg_exp_parser = __esmMin((() => {
		import_regexp_to_ast$2 = require_regexp_to_ast();
		regExpAstCache = {};
		regExpParser = new import_regexp_to_ast$2.RegExpParser();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/reg_exp.js
	function getOptimizedStartCodesIndices(regExp, ensureOptimizations) {
		if (ensureOptimizations === void 0) ensureOptimizations = false;
		try {
			var ast = getRegExpAst(regExp);
			return firstCharOptimizedIndices(ast.value, {}, ast.flags.ignoreCase);
		} catch (e) {
			/* istanbul ignore next */
			if (e.message === complementErrorMessage) {
				if (ensureOptimizations) PRINT_WARNING("" + failedOptimizationPrefixMsg + ("	Unable to optimize: < " + regExp.toString() + " >\n") + "	Complement Sets cannot be automatically optimized.\n	This will disable the lexer's first char optimizations.\n	See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");
			} else {
				var msgSuffix = "";
				if (ensureOptimizations) msgSuffix = "\n	This will disable the lexer's first char optimizations.\n	See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.";
				PRINT_ERROR(failedOptimizationPrefixMsg + "\n" + ("	Failed parsing: < " + regExp.toString() + " >\n") + ("	Using the regexp-to-ast library version: " + import_regexp_to_ast$1.VERSION + "\n") + "	Please open an issue at: https://github.com/bd82/regexp-to-ast/issues" + msgSuffix);
			}
		}
		return [];
	}
	function firstCharOptimizedIndices(ast, result, ignoreCase) {
		switch (ast.type) {
			case "Disjunction":
				for (var i = 0; i < ast.value.length; i++) firstCharOptimizedIndices(ast.value[i], result, ignoreCase);
				break;
			case "Alternative":
				var terms = ast.value;
				for (var i = 0; i < terms.length; i++) {
					var term = terms[i];
					switch (term.type) {
						case "EndAnchor":
						case "GroupBackReference":
						case "Lookahead":
						case "NegativeLookahead":
						case "StartAnchor":
						case "WordBoundary":
						case "NonWordBoundary": continue;
					}
					var atom = term;
					switch (atom.type) {
						case "Character":
							addOptimizedIdxToResult(atom.value, result, ignoreCase);
							break;
						case "Set":
							if (atom.complement === true) throw Error(complementErrorMessage);
							forEach(atom.value, function(code) {
								if (typeof code === "number") addOptimizedIdxToResult(code, result, ignoreCase);
								else {
									var range = code;
									if (ignoreCase === true) for (var rangeCode = range.from; rangeCode <= range.to; rangeCode++) addOptimizedIdxToResult(rangeCode, result, ignoreCase);
									else {
										for (var rangeCode = range.from; rangeCode <= range.to && rangeCode < 256; rangeCode++) addOptimizedIdxToResult(rangeCode, result, ignoreCase);
										if (range.to >= 256) {
											var minUnOptVal = range.from >= 256 ? range.from : 256;
											var maxUnOptVal = range.to;
											var minOptIdx = charCodeToOptimizedIndex(minUnOptVal);
											var maxOptIdx = charCodeToOptimizedIndex(maxUnOptVal);
											for (var currOptIdx = minOptIdx; currOptIdx <= maxOptIdx; currOptIdx++) result[currOptIdx] = currOptIdx;
										}
									}
								}
							});
							break;
						case "Group":
							firstCharOptimizedIndices(atom.value, result, ignoreCase);
							break;
						/* istanbul ignore next */
						default: throw Error("Non Exhaustive Match");
					}
					var isOptionalQuantifier = atom.quantifier !== void 0 && atom.quantifier.atLeast === 0;
					if (atom.type === "Group" && isWholeOptional(atom) === false || atom.type !== "Group" && isOptionalQuantifier === false) break;
				}
				break;
			/* istanbul ignore next */
			default: throw Error("non exhaustive match!");
		}
		return values(result);
	}
	function addOptimizedIdxToResult(code, result, ignoreCase) {
		var optimizedCharIdx = charCodeToOptimizedIndex(code);
		result[optimizedCharIdx] = optimizedCharIdx;
		if (ignoreCase === true) handleIgnoreCase(code, result);
	}
	function handleIgnoreCase(code, result) {
		var char = String.fromCharCode(code);
		var upperChar = char.toUpperCase();
		/* istanbul ignore else */
		if (upperChar !== char) {
			var optimizedCharIdx = charCodeToOptimizedIndex(upperChar.charCodeAt(0));
			result[optimizedCharIdx] = optimizedCharIdx;
		} else {
			var lowerChar = char.toLowerCase();
			if (lowerChar !== char) {
				var optimizedCharIdx = charCodeToOptimizedIndex(lowerChar.charCodeAt(0));
				result[optimizedCharIdx] = optimizedCharIdx;
			}
		}
	}
	function findCode(setNode, targetCharCodes) {
		return find(setNode.value, function(codeOrRange) {
			if (typeof codeOrRange === "number") return contains(targetCharCodes, codeOrRange);
			else {
				var range_1 = codeOrRange;
				return find(targetCharCodes, function(targetCode) {
					return range_1.from <= targetCode && targetCode <= range_1.to;
				}) !== void 0;
			}
		});
	}
	function isWholeOptional(ast) {
		if (ast.quantifier && ast.quantifier.atLeast === 0) return true;
		if (!ast.value) return false;
		return isArray(ast.value) ? every(ast.value, isWholeOptional) : isWholeOptional(ast.value);
	}
	function canMatchCharCode(charCodes, pattern) {
		if (pattern instanceof RegExp) {
			var ast = getRegExpAst(pattern);
			var charCodeFinder = new CharCodeFinder(charCodes);
			charCodeFinder.visit(ast);
			return charCodeFinder.found;
		} else return find(pattern, function(char) {
			return contains(charCodes, char.charCodeAt(0));
		}) !== void 0;
	}
	var import_regexp_to_ast$1, __extends$10, complementErrorMessage, failedOptimizationPrefixMsg, CharCodeFinder;
	var init_reg_exp = __esmMin((() => {
		import_regexp_to_ast$1 = require_regexp_to_ast();
		init_utils();
		init_reg_exp_parser();
		init_lexer();
		__extends$10 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		complementErrorMessage = "Complement Sets are not supported for first char optimization";
		failedOptimizationPrefixMsg = "Unable to use \"first char\" lexer optimizations:\n";
		CharCodeFinder = function(_super) {
			__extends$10(CharCodeFinder, _super);
			function CharCodeFinder(targetCharCodes) {
				var _this = _super.call(this) || this;
				_this.targetCharCodes = targetCharCodes;
				_this.found = false;
				return _this;
			}
			CharCodeFinder.prototype.visitChildren = function(node) {
				if (this.found === true) return;
				switch (node.type) {
					case "Lookahead":
						this.visitLookahead(node);
						return;
					case "NegativeLookahead":
						this.visitNegativeLookahead(node);
						return;
				}
				_super.prototype.visitChildren.call(this, node);
			};
			CharCodeFinder.prototype.visitCharacter = function(node) {
				if (contains(this.targetCharCodes, node.value)) this.found = true;
			};
			CharCodeFinder.prototype.visitSet = function(node) {
				if (node.complement) {
					if (findCode(node, this.targetCharCodes) === void 0) this.found = true;
				} else if (findCode(node, this.targetCharCodes) !== void 0) this.found = true;
			};
			return CharCodeFinder;
		}(import_regexp_to_ast$1.BaseRegExpVisitor);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/lexer.js
	function analyzeTokenTypes(tokenTypes, options) {
		options = defaults(options, {
			useSticky: SUPPORT_STICKY,
			debug: false,
			safeMode: false,
			positionTracking: "full",
			lineTerminatorCharacters: ["\r", "\n"],
			tracer: function(msg, action) {
				return action();
			}
		});
		var tracer = options.tracer;
		tracer("initCharCodeToOptimizedIndexMap", function() {
			initCharCodeToOptimizedIndexMap();
		});
		var onlyRelevantTypes;
		tracer("Reject Lexer.NA", function() {
			onlyRelevantTypes = reject(tokenTypes, function(currType) {
				return currType[PATTERN] === Lexer.NA;
			});
		});
		var hasCustom = false;
		var allTransformedPatterns;
		tracer("Transform Patterns", function() {
			hasCustom = false;
			allTransformedPatterns = map(onlyRelevantTypes, function(currType) {
				var currPattern = currType[PATTERN];
				/* istanbul ignore else */
				if (isRegExp(currPattern)) {
					var regExpSource = currPattern.source;
					if (regExpSource.length === 1 && regExpSource !== "^" && regExpSource !== "$" && regExpSource !== ".") return regExpSource;
					else if (regExpSource.length === 2 && regExpSource[0] === "\\" && !contains([
						"d",
						"D",
						"s",
						"S",
						"t",
						"r",
						"n",
						"t",
						"0",
						"c",
						"b",
						"B",
						"f",
						"v",
						"w",
						"W"
					], regExpSource[1])) return regExpSource[1];
					else return options.useSticky ? addStickyFlag(currPattern) : addStartOfInput(currPattern);
				} else if (isFunction(currPattern)) {
					hasCustom = true;
					return { exec: currPattern };
				} else if (has(currPattern, "exec")) {
					hasCustom = true;
					return currPattern;
				} else if (typeof currPattern === "string") if (currPattern.length === 1) return currPattern;
				else {
					var escapedRegExpString = currPattern.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
					var wrappedRegExp = new RegExp(escapedRegExpString);
					return options.useSticky ? addStickyFlag(wrappedRegExp) : addStartOfInput(wrappedRegExp);
				}
				else throw Error("non exhaustive match");
			});
		});
		var patternIdxToType;
		var patternIdxToGroup;
		var patternIdxToLongerAltIdx;
		var patternIdxToPushMode;
		var patternIdxToPopMode;
		tracer("misc mapping", function() {
			patternIdxToType = map(onlyRelevantTypes, function(currType) {
				return currType.tokenTypeIdx;
			});
			patternIdxToGroup = map(onlyRelevantTypes, function(clazz) {
				var groupName = clazz.GROUP;
				/* istanbul ignore next */
				if (groupName === Lexer.SKIPPED) return;
				else if (isString(groupName)) return groupName;
				else if (isUndefined(groupName)) return false;
				else throw Error("non exhaustive match");
			});
			patternIdxToLongerAltIdx = map(onlyRelevantTypes, function(clazz) {
				var longerAltType = clazz.LONGER_ALT;
				if (longerAltType) return indexOf(onlyRelevantTypes, longerAltType);
			});
			patternIdxToPushMode = map(onlyRelevantTypes, function(clazz) {
				return clazz.PUSH_MODE;
			});
			patternIdxToPopMode = map(onlyRelevantTypes, function(clazz) {
				return has(clazz, "POP_MODE");
			});
		});
		var patternIdxToCanLineTerminator;
		tracer("Line Terminator Handling", function() {
			var lineTerminatorCharCodes = getCharCodes(options.lineTerminatorCharacters);
			patternIdxToCanLineTerminator = map(onlyRelevantTypes, function(tokType) {
				return false;
			});
			if (options.positionTracking !== "onlyOffset") patternIdxToCanLineTerminator = map(onlyRelevantTypes, function(tokType) {
				if (has(tokType, "LINE_BREAKS")) return tokType.LINE_BREAKS;
				else if (checkLineBreaksIssues(tokType, lineTerminatorCharCodes) === false) return canMatchCharCode(lineTerminatorCharCodes, tokType.PATTERN);
			});
		});
		var patternIdxToIsCustom;
		var patternIdxToShort;
		var emptyGroups;
		var patternIdxToConfig;
		tracer("Misc Mapping #2", function() {
			patternIdxToIsCustom = map(onlyRelevantTypes, isCustomPattern);
			patternIdxToShort = map(allTransformedPatterns, isShortPattern);
			emptyGroups = reduce(onlyRelevantTypes, function(acc, clazz) {
				var groupName = clazz.GROUP;
				if (isString(groupName) && !(groupName === Lexer.SKIPPED)) acc[groupName] = [];
				return acc;
			}, {});
			patternIdxToConfig = map(allTransformedPatterns, function(x, idx) {
				return {
					pattern: allTransformedPatterns[idx],
					longerAlt: patternIdxToLongerAltIdx[idx],
					canLineTerminator: patternIdxToCanLineTerminator[idx],
					isCustom: patternIdxToIsCustom[idx],
					short: patternIdxToShort[idx],
					group: patternIdxToGroup[idx],
					push: patternIdxToPushMode[idx],
					pop: patternIdxToPopMode[idx],
					tokenTypeIdx: patternIdxToType[idx],
					tokenType: onlyRelevantTypes[idx]
				};
			});
		});
		var canBeOptimized = true;
		var charCodeToPatternIdxToConfig = [];
		if (!options.safeMode) tracer("First Char Optimization", function() {
			charCodeToPatternIdxToConfig = reduce(onlyRelevantTypes, function(result, currTokType, idx) {
				if (typeof currTokType.PATTERN === "string") addToMapOfArrays(result, charCodeToOptimizedIndex(currTokType.PATTERN.charCodeAt(0)), patternIdxToConfig[idx]);
				else if (isArray(currTokType.START_CHARS_HINT)) {
					var lastOptimizedIdx_1;
					forEach(currTokType.START_CHARS_HINT, function(charOrInt) {
						var currOptimizedIdx = charCodeToOptimizedIndex(typeof charOrInt === "string" ? charOrInt.charCodeAt(0) : charOrInt);
						if (lastOptimizedIdx_1 !== currOptimizedIdx) {
							lastOptimizedIdx_1 = currOptimizedIdx;
							addToMapOfArrays(result, currOptimizedIdx, patternIdxToConfig[idx]);
						}
					});
				} else if (isRegExp(currTokType.PATTERN)) if (currTokType.PATTERN.unicode) {
					canBeOptimized = false;
					if (options.ensureOptimizations) PRINT_ERROR("" + failedOptimizationPrefixMsg + ("	Unable to analyze < " + currTokType.PATTERN.toString() + " > pattern.\n") + "	The regexp unicode flag is not currently supported by the regexp-to-ast library.\n	This will disable the lexer's first char optimizations.\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");
				} else {
					var optimizedCodes = getOptimizedStartCodesIndices(currTokType.PATTERN, options.ensureOptimizations);
					/* istanbul ignore if */
					if (isEmpty(optimizedCodes)) canBeOptimized = false;
					forEach(optimizedCodes, function(code) {
						addToMapOfArrays(result, code, patternIdxToConfig[idx]);
					});
				}
				else {
					if (options.ensureOptimizations) PRINT_ERROR("" + failedOptimizationPrefixMsg + ("	TokenType: <" + currTokType.name + "> is using a custom token pattern without providing <start_chars_hint> parameter.\n") + "	This will disable the lexer's first char optimizations.\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE");
					canBeOptimized = false;
				}
				return result;
			}, []);
		});
		tracer("ArrayPacking", function() {
			charCodeToPatternIdxToConfig = packArray(charCodeToPatternIdxToConfig);
		});
		return {
			emptyGroups,
			patternIdxToConfig,
			charCodeToPatternIdxToConfig,
			hasCustom,
			canBeOptimized
		};
	}
	function validatePatterns(tokenTypes, validModesNames) {
		var errors = [];
		var missingResult = findMissingPatterns(tokenTypes);
		errors = errors.concat(missingResult.errors);
		var invalidResult = findInvalidPatterns(missingResult.valid);
		var validTokenTypes = invalidResult.valid;
		errors = errors.concat(invalidResult.errors);
		errors = errors.concat(validateRegExpPattern(validTokenTypes));
		errors = errors.concat(findInvalidGroupType(validTokenTypes));
		errors = errors.concat(findModesThatDoNotExist(validTokenTypes, validModesNames));
		errors = errors.concat(findUnreachablePatterns(validTokenTypes));
		return errors;
	}
	function validateRegExpPattern(tokenTypes) {
		var errors = [];
		var withRegExpPatterns = filter(tokenTypes, function(currTokType) {
			return isRegExp(currTokType[PATTERN]);
		});
		errors = errors.concat(findEndOfInputAnchor(withRegExpPatterns));
		errors = errors.concat(findStartOfInputAnchor(withRegExpPatterns));
		errors = errors.concat(findUnsupportedFlags(withRegExpPatterns));
		errors = errors.concat(findDuplicatePatterns(withRegExpPatterns));
		errors = errors.concat(findEmptyMatchRegExps(withRegExpPatterns));
		return errors;
	}
	function findMissingPatterns(tokenTypes) {
		var tokenTypesWithMissingPattern = filter(tokenTypes, function(currType) {
			return !has(currType, PATTERN);
		});
		return {
			errors: map(tokenTypesWithMissingPattern, function(currType) {
				return {
					message: "Token Type: ->" + currType.name + "<- missing static 'PATTERN' property",
					type: LexerDefinitionErrorType.MISSING_PATTERN,
					tokenTypes: [currType]
				};
			}),
			valid: difference(tokenTypes, tokenTypesWithMissingPattern)
		};
	}
	function findInvalidPatterns(tokenTypes) {
		var tokenTypesWithInvalidPattern = filter(tokenTypes, function(currType) {
			var pattern = currType[PATTERN];
			return !isRegExp(pattern) && !isFunction(pattern) && !has(pattern, "exec") && !isString(pattern);
		});
		return {
			errors: map(tokenTypesWithInvalidPattern, function(currType) {
				return {
					message: "Token Type: ->" + currType.name + "<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",
					type: LexerDefinitionErrorType.INVALID_PATTERN,
					tokenTypes: [currType]
				};
			}),
			valid: difference(tokenTypes, tokenTypesWithInvalidPattern)
		};
	}
	function findEndOfInputAnchor(tokenTypes) {
		var EndAnchorFinder = function(_super) {
			__extends$9(EndAnchorFinder, _super);
			function EndAnchorFinder() {
				var _this = _super !== null && _super.apply(this, arguments) || this;
				_this.found = false;
				return _this;
			}
			EndAnchorFinder.prototype.visitEndAnchor = function(node) {
				this.found = true;
			};
			return EndAnchorFinder;
		}(import_regexp_to_ast.BaseRegExpVisitor);
		return map(filter(tokenTypes, function(currType) {
			var pattern = currType[PATTERN];
			try {
				var regexpAst = getRegExpAst(pattern);
				var endAnchorVisitor = new EndAnchorFinder();
				endAnchorVisitor.visit(regexpAst);
				return endAnchorVisitor.found;
			} catch (e) {
				/* istanbul ignore next - cannot ensure an error in regexp-to-ast*/
				return end_of_input.test(pattern.source);
			}
		}), function(currType) {
			return {
				message: "Unexpected RegExp Anchor Error:\n	Token Type: ->" + currType.name + "<- static 'PATTERN' cannot contain end of input anchor '$'\n	See sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.",
				type: LexerDefinitionErrorType.EOI_ANCHOR_FOUND,
				tokenTypes: [currType]
			};
		});
	}
	function findEmptyMatchRegExps(tokenTypes) {
		return map(filter(tokenTypes, function(currType) {
			return currType[PATTERN].test("");
		}), function(currType) {
			return {
				message: "Token Type: ->" + currType.name + "<- static 'PATTERN' must not match an empty string",
				type: LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,
				tokenTypes: [currType]
			};
		});
	}
	function findStartOfInputAnchor(tokenTypes) {
		var StartAnchorFinder = function(_super) {
			__extends$9(StartAnchorFinder, _super);
			function StartAnchorFinder() {
				var _this = _super !== null && _super.apply(this, arguments) || this;
				_this.found = false;
				return _this;
			}
			StartAnchorFinder.prototype.visitStartAnchor = function(node) {
				this.found = true;
			};
			return StartAnchorFinder;
		}(import_regexp_to_ast.BaseRegExpVisitor);
		return map(filter(tokenTypes, function(currType) {
			var pattern = currType[PATTERN];
			try {
				var regexpAst = getRegExpAst(pattern);
				var startAnchorVisitor = new StartAnchorFinder();
				startAnchorVisitor.visit(regexpAst);
				return startAnchorVisitor.found;
			} catch (e) {
				/* istanbul ignore next - cannot ensure an error in regexp-to-ast*/
				return start_of_input.test(pattern.source);
			}
		}), function(currType) {
			return {
				message: "Unexpected RegExp Anchor Error:\n	Token Type: ->" + currType.name + "<- static 'PATTERN' cannot contain start of input anchor '^'\n	See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS	for details.",
				type: LexerDefinitionErrorType.SOI_ANCHOR_FOUND,
				tokenTypes: [currType]
			};
		});
	}
	function findUnsupportedFlags(tokenTypes) {
		return map(filter(tokenTypes, function(currType) {
			var pattern = currType[PATTERN];
			return pattern instanceof RegExp && (pattern.multiline || pattern.global);
		}), function(currType) {
			return {
				message: "Token Type: ->" + currType.name + "<- static 'PATTERN' may NOT contain global('g') or multiline('m')",
				type: LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,
				tokenTypes: [currType]
			};
		});
	}
	function findDuplicatePatterns(tokenTypes) {
		var found = [];
		var identicalPatterns = map(tokenTypes, function(outerType) {
			return reduce(tokenTypes, function(result, innerType) {
				if (outerType.PATTERN.source === innerType.PATTERN.source && !contains(found, innerType) && innerType.PATTERN !== Lexer.NA) {
					found.push(innerType);
					result.push(innerType);
					return result;
				}
				return result;
			}, []);
		});
		identicalPatterns = compact(identicalPatterns);
		return map(filter(identicalPatterns, function(currIdenticalSet) {
			return currIdenticalSet.length > 1;
		}), function(setOfIdentical) {
			var tokenTypeNames = map(setOfIdentical, function(currType) {
				return currType.name;
			});
			return {
				message: "The same RegExp pattern ->" + first$1(setOfIdentical).PATTERN + "<-" + ("has been used in all of the following Token Types: " + tokenTypeNames.join(", ") + " <-"),
				type: LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,
				tokenTypes: setOfIdentical
			};
		});
	}
	function findInvalidGroupType(tokenTypes) {
		return map(filter(tokenTypes, function(clazz) {
			if (!has(clazz, "GROUP")) return false;
			var group = clazz.GROUP;
			return group !== Lexer.SKIPPED && group !== Lexer.NA && !isString(group);
		}), function(currType) {
			return {
				message: "Token Type: ->" + currType.name + "<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",
				type: LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,
				tokenTypes: [currType]
			};
		});
	}
	function findModesThatDoNotExist(tokenTypes, validModes) {
		return map(filter(tokenTypes, function(clazz) {
			return clazz.PUSH_MODE !== void 0 && !contains(validModes, clazz.PUSH_MODE);
		}), function(tokType) {
			return {
				message: "Token Type: ->" + tokType.name + "<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->" + tokType.PUSH_MODE + "<-which does not exist",
				type: LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,
				tokenTypes: [tokType]
			};
		});
	}
	function findUnreachablePatterns(tokenTypes) {
		var errors = [];
		var canBeTested = reduce(tokenTypes, function(result, tokType, idx) {
			var pattern = tokType.PATTERN;
			if (pattern === Lexer.NA) return result;
			if (isString(pattern)) result.push({
				str: pattern,
				idx,
				tokenType: tokType
			});
			else if (isRegExp(pattern) && noMetaChar(pattern)) result.push({
				str: pattern.source,
				idx,
				tokenType: tokType
			});
			return result;
		}, []);
		forEach(tokenTypes, function(tokType, testIdx) {
			forEach(canBeTested, function(_a) {
				var str = _a.str, idx = _a.idx, tokenType = _a.tokenType;
				if (testIdx < idx && testTokenType(str, tokType.PATTERN)) {
					var msg = "Token: ->" + tokenType.name + "<- can never be matched.\n" + ("Because it appears AFTER the Token Type ->" + tokType.name + "<-") + "in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";
					errors.push({
						message: msg,
						type: LexerDefinitionErrorType.UNREACHABLE_PATTERN,
						tokenTypes: [tokType, tokenType]
					});
				}
			});
		});
		return errors;
	}
	function testTokenType(str, pattern) {
		/* istanbul ignore else */
		if (isRegExp(pattern)) {
			var regExpArray = pattern.exec(str);
			return regExpArray !== null && regExpArray.index === 0;
		} else if (isFunction(pattern)) return pattern(str, 0, [], {});
		else if (has(pattern, "exec")) return pattern.exec(str, 0, [], {});
		else if (typeof pattern === "string") return pattern === str;
		else throw Error("non exhaustive match");
	}
	function noMetaChar(regExp) {
		return find([
			".",
			"\\",
			"[",
			"]",
			"|",
			"^",
			"$",
			"(",
			")",
			"?",
			"*",
			"+",
			"{"
		], function(char) {
			return regExp.source.indexOf(char) !== -1;
		}) === void 0;
	}
	function addStartOfInput(pattern) {
		var flags = pattern.ignoreCase ? "i" : "";
		return new RegExp("^(?:" + pattern.source + ")", flags);
	}
	function addStickyFlag(pattern) {
		var flags = pattern.ignoreCase ? "iy" : "y";
		return new RegExp("" + pattern.source, flags);
	}
	function performRuntimeChecks(lexerDefinition, trackLines, lineTerminatorCharacters) {
		var errors = [];
		if (!has(lexerDefinition, "defaultMode")) errors.push({
			message: "A MultiMode Lexer cannot be initialized without a <" + DEFAULT_MODE + "> property in its definition\n",
			type: LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE
		});
		if (!has(lexerDefinition, "modes")) errors.push({
			message: "A MultiMode Lexer cannot be initialized without a <" + MODES + "> property in its definition\n",
			type: LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY
		});
		if (has(lexerDefinition, "modes") && has(lexerDefinition, "defaultMode") && !has(lexerDefinition.modes, lexerDefinition.defaultMode)) errors.push({
			message: "A MultiMode Lexer cannot be initialized with a " + DEFAULT_MODE + ": <" + lexerDefinition.defaultMode + ">which does not exist\n",
			type: LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST
		});
		if (has(lexerDefinition, "modes")) forEach(lexerDefinition.modes, function(currModeValue, currModeName) {
			forEach(currModeValue, function(currTokType, currIdx) {
				if (isUndefined(currTokType)) errors.push({
					message: "A Lexer cannot be initialized using an undefined Token Type. Mode:" + ("<" + currModeName + "> at index: <" + currIdx + ">\n"),
					type: LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED
				});
			});
		});
		return errors;
	}
	function performWarningRuntimeChecks(lexerDefinition, trackLines, lineTerminatorCharacters) {
		var warnings = [];
		var hasAnyLineBreak = false;
		var concreteTokenTypes = reject(compact(flatten(mapValues(lexerDefinition.modes, function(tokTypes) {
			return tokTypes;
		}))), function(currType) {
			return currType[PATTERN] === Lexer.NA;
		});
		var terminatorCharCodes = getCharCodes(lineTerminatorCharacters);
		if (trackLines) forEach(concreteTokenTypes, function(tokType) {
			var currIssue = checkLineBreaksIssues(tokType, terminatorCharCodes);
			if (currIssue !== false) {
				var warningDescriptor = {
					message: buildLineBreakIssueMessage(tokType, currIssue),
					type: currIssue.issue,
					tokenType: tokType
				};
				warnings.push(warningDescriptor);
			} else if (has(tokType, "LINE_BREAKS")) {
				if (tokType.LINE_BREAKS === true) hasAnyLineBreak = true;
			} else if (canMatchCharCode(terminatorCharCodes, tokType.PATTERN)) hasAnyLineBreak = true;
		});
		if (trackLines && !hasAnyLineBreak) warnings.push({
			message: "Warning: No LINE_BREAKS Found.\n	This Lexer has been defined to track line and column information,\n	But none of the Token Types can be identified as matching a line terminator.\n	See https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n	for details.",
			type: LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS
		});
		return warnings;
	}
	function cloneEmptyGroups(emptyGroups) {
		var clonedResult = {};
		forEach(keys(emptyGroups), function(currKey) {
			var currGroupValue = emptyGroups[currKey];
			/* istanbul ignore else */
			if (isArray(currGroupValue)) clonedResult[currKey] = [];
			else throw Error("non exhaustive match");
		});
		return clonedResult;
	}
	function isCustomPattern(tokenType) {
		var pattern = tokenType.PATTERN;
		/* istanbul ignore else */
		if (isRegExp(pattern)) return false;
		else if (isFunction(pattern)) return true;
		else if (has(pattern, "exec")) return true;
		else if (isString(pattern)) return false;
		else throw Error("non exhaustive match");
	}
	function isShortPattern(pattern) {
		if (isString(pattern) && pattern.length === 1) return pattern.charCodeAt(0);
		else return false;
	}
	function checkLineBreaksIssues(tokType, lineTerminatorCharCodes) {
		if (has(tokType, "LINE_BREAKS")) return false;
		else if (isRegExp(tokType.PATTERN)) {
			try {
				canMatchCharCode(lineTerminatorCharCodes, tokType.PATTERN);
			} catch (e) {
				/* istanbul ignore next - to test this we would have to mock <canMatchCharCode> to throw an error */
				return {
					issue: LexerDefinitionErrorType.IDENTIFY_TERMINATOR,
					errMsg: e.message
				};
			}
			return false;
		} else if (isString(tokType.PATTERN)) return false;
		else if (isCustomPattern(tokType)) return { issue: LexerDefinitionErrorType.CUSTOM_LINE_BREAK };
		else throw Error("non exhaustive match");
	}
	function buildLineBreakIssueMessage(tokType, details) {
		/* istanbul ignore else */
		if (details.issue === LexerDefinitionErrorType.IDENTIFY_TERMINATOR) return "Warning: unable to identify line terminator usage in pattern.\n" + ("	The problem is in the <" + tokType.name + "> Token Type\n") + ("	 Root cause: " + details.errMsg + ".\n") + "	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";
		else if (details.issue === LexerDefinitionErrorType.CUSTOM_LINE_BREAK) return "Warning: A Custom Token Pattern should specify the <line_breaks> option.\n" + ("	The problem is in the <" + tokType.name + "> Token Type\n") + "	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";
		else throw Error("non exhaustive match");
	}
	function getCharCodes(charsOrCodes) {
		return map(charsOrCodes, function(numOrString) {
			if (isString(numOrString) && numOrString.length > 0) return numOrString.charCodeAt(0);
			else return numOrString;
		});
	}
	function addToMapOfArrays(map, key, value) {
		if (map[key] === void 0) map[key] = [value];
		else map[key].push(value);
	}
	/**
	* We ae mapping charCode above ASCI (256) into buckets each in the size of 256.
	* This is because ASCI are the most common start chars so each one of those will get its own
	* possible token configs vector.
	*
	* Tokens starting with charCodes "above" ASCI are uncommon, so we can "afford"
	* to place these into buckets of possible token configs, What we gain from
	* this is avoiding the case of creating an optimization 'charCodeToPatternIdxToConfig'
	* which would contain 10,000+ arrays of small size (e.g unicode Identifiers scenario).
	* Our 'charCodeToPatternIdxToConfig' max size will now be:
	* 256 + (2^16 / 2^8) - 1 === 511
	*
	* note the hack for fast division integer part extraction
	* See: https://stackoverflow.com/a/4228528
	*/
	function charCodeToOptimizedIndex(charCode) {
		return charCode < 256 ? charCode : charCodeToOptimizedIdxMap[charCode];
	}
	function initCharCodeToOptimizedIndexMap() {
		if (isEmpty(charCodeToOptimizedIdxMap)) {
			charCodeToOptimizedIdxMap = new Array(65536);
			for (var i = 0; i < 65536; i++) charCodeToOptimizedIdxMap[i] = i > 255 ? 255 + ~~(i / 255) : i;
		}
	}
	var import_regexp_to_ast, __extends$9, PATTERN, DEFAULT_MODE, MODES, SUPPORT_STICKY, end_of_input, start_of_input, LineTerminatorOptimizedTester, charCodeToOptimizedIdxMap;
	var init_lexer = __esmMin((() => {
		import_regexp_to_ast = require_regexp_to_ast();
		init_lexer_public();
		init_utils();
		init_reg_exp();
		init_reg_exp_parser();
		__extends$9 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		PATTERN = "PATTERN";
		DEFAULT_MODE = "defaultMode";
		MODES = "modes";
		SUPPORT_STICKY = typeof (/* @__PURE__ */ new RegExp("(?:)")).sticky === "boolean";
		end_of_input = /[^\\][\$]/;
		start_of_input = /[^\\[][\^]|^\^/;
		LineTerminatorOptimizedTester = {
			test: function(text) {
				var len = text.length;
				for (var i = this.lastIndex; i < len; i++) {
					var c = text.charCodeAt(i);
					if (c === 10) {
						this.lastIndex = i + 1;
						return true;
					} else if (c === 13) {
						if (text.charCodeAt(i + 1) === 10) this.lastIndex = i + 2;
						else this.lastIndex = i + 1;
						return true;
					}
				}
				return false;
			},
			lastIndex: 0
		};
		charCodeToOptimizedIdxMap = [];
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/tokens.js
	function tokenStructuredMatcher(tokInstance, tokConstructor) {
		var instanceType = tokInstance.tokenTypeIdx;
		if (instanceType === tokConstructor.tokenTypeIdx) return true;
		else return tokConstructor.isParent === true && tokConstructor.categoryMatchesMap[instanceType] === true;
	}
	function tokenStructuredMatcherNoCategories(token, tokType) {
		return token.tokenTypeIdx === tokType.tokenTypeIdx;
	}
	function augmentTokenTypes(tokenTypes) {
		var tokenTypesAndParents = expandCategories(tokenTypes);
		assignTokenDefaultProps(tokenTypesAndParents);
		assignCategoriesMapProp(tokenTypesAndParents);
		assignCategoriesTokensProp(tokenTypesAndParents);
		forEach(tokenTypesAndParents, function(tokType) {
			tokType.isParent = tokType.categoryMatches.length > 0;
		});
	}
	function expandCategories(tokenTypes) {
		var result = cloneArr(tokenTypes);
		var categories = tokenTypes;
		var searching = true;
		while (searching) {
			categories = compact(flatten(map(categories, function(currTokType) {
				return currTokType.CATEGORIES;
			})));
			var newCategories = difference(categories, result);
			result = result.concat(newCategories);
			if (isEmpty(newCategories)) searching = false;
			else categories = newCategories;
		}
		return result;
	}
	function assignTokenDefaultProps(tokenTypes) {
		forEach(tokenTypes, function(currTokType) {
			if (!hasShortKeyProperty(currTokType)) {
				tokenIdxToClass[tokenShortNameIdx] = currTokType;
				currTokType.tokenTypeIdx = tokenShortNameIdx++;
			}
			if (hasCategoriesProperty(currTokType) && !isArray(currTokType.CATEGORIES)) currTokType.CATEGORIES = [currTokType.CATEGORIES];
			if (!hasCategoriesProperty(currTokType)) currTokType.CATEGORIES = [];
			if (!hasExtendingTokensTypesProperty(currTokType)) currTokType.categoryMatches = [];
			if (!hasExtendingTokensTypesMapProperty(currTokType)) currTokType.categoryMatchesMap = {};
		});
	}
	function assignCategoriesTokensProp(tokenTypes) {
		forEach(tokenTypes, function(currTokType) {
			currTokType.categoryMatches = [];
			forEach(currTokType.categoryMatchesMap, function(val, key) {
				currTokType.categoryMatches.push(tokenIdxToClass[key].tokenTypeIdx);
			});
		});
	}
	function assignCategoriesMapProp(tokenTypes) {
		forEach(tokenTypes, function(currTokType) {
			singleAssignCategoriesToksMap([], currTokType);
		});
	}
	function singleAssignCategoriesToksMap(path, nextNode) {
		forEach(path, function(pathNode) {
			nextNode.categoryMatchesMap[pathNode.tokenTypeIdx] = true;
		});
		forEach(nextNode.CATEGORIES, function(nextCategory) {
			var newPath = path.concat(nextNode);
			if (!contains(newPath, nextCategory)) singleAssignCategoriesToksMap(newPath, nextCategory);
		});
	}
	function hasShortKeyProperty(tokType) {
		return has(tokType, "tokenTypeIdx");
	}
	function hasCategoriesProperty(tokType) {
		return has(tokType, "CATEGORIES");
	}
	function hasExtendingTokensTypesProperty(tokType) {
		return has(tokType, "categoryMatches");
	}
	function hasExtendingTokensTypesMapProperty(tokType) {
		return has(tokType, "categoryMatchesMap");
	}
	function isTokenType(tokType) {
		return has(tokType, "tokenTypeIdx");
	}
	var tokenShortNameIdx, tokenIdxToClass;
	var init_tokens = __esmMin((() => {
		init_utils();
		tokenShortNameIdx = 1;
		tokenIdxToClass = {};
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/lexer_errors_public.js
	var defaultLexerErrorProvider;
	var init_lexer_errors_public = __esmMin((() => {
		defaultLexerErrorProvider = {
			buildUnableToPopLexerModeMessage: function(token) {
				return "Unable to pop Lexer Mode after encountering Token ->" + token.image + "<- The Mode Stack is empty";
			},
			buildUnexpectedCharactersMessage: function(fullText, startOffset, length, line, column) {
				return "unexpected character: ->" + fullText.charAt(startOffset) + "<- at offset: " + startOffset + "," + (" skipped " + length + " characters.");
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/lexer_public.js
	var LexerDefinitionErrorType, DEFAULT_LEXER_CONFIG, Lexer;
	var init_lexer_public = __esmMin((() => {
		init_lexer();
		init_utils();
		init_tokens();
		init_lexer_errors_public();
		init_reg_exp_parser();
		(function(LexerDefinitionErrorType) {
			LexerDefinitionErrorType[LexerDefinitionErrorType["MISSING_PATTERN"] = 0] = "MISSING_PATTERN";
			LexerDefinitionErrorType[LexerDefinitionErrorType["INVALID_PATTERN"] = 1] = "INVALID_PATTERN";
			LexerDefinitionErrorType[LexerDefinitionErrorType["EOI_ANCHOR_FOUND"] = 2] = "EOI_ANCHOR_FOUND";
			LexerDefinitionErrorType[LexerDefinitionErrorType["UNSUPPORTED_FLAGS_FOUND"] = 3] = "UNSUPPORTED_FLAGS_FOUND";
			LexerDefinitionErrorType[LexerDefinitionErrorType["DUPLICATE_PATTERNS_FOUND"] = 4] = "DUPLICATE_PATTERNS_FOUND";
			LexerDefinitionErrorType[LexerDefinitionErrorType["INVALID_GROUP_TYPE_FOUND"] = 5] = "INVALID_GROUP_TYPE_FOUND";
			LexerDefinitionErrorType[LexerDefinitionErrorType["PUSH_MODE_DOES_NOT_EXIST"] = 6] = "PUSH_MODE_DOES_NOT_EXIST";
			LexerDefinitionErrorType[LexerDefinitionErrorType["MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE"] = 7] = "MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE";
			LexerDefinitionErrorType[LexerDefinitionErrorType["MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY"] = 8] = "MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY";
			LexerDefinitionErrorType[LexerDefinitionErrorType["MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST"] = 9] = "MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST";
			LexerDefinitionErrorType[LexerDefinitionErrorType["LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED"] = 10] = "LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED";
			LexerDefinitionErrorType[LexerDefinitionErrorType["SOI_ANCHOR_FOUND"] = 11] = "SOI_ANCHOR_FOUND";
			LexerDefinitionErrorType[LexerDefinitionErrorType["EMPTY_MATCH_PATTERN"] = 12] = "EMPTY_MATCH_PATTERN";
			LexerDefinitionErrorType[LexerDefinitionErrorType["NO_LINE_BREAKS_FLAGS"] = 13] = "NO_LINE_BREAKS_FLAGS";
			LexerDefinitionErrorType[LexerDefinitionErrorType["UNREACHABLE_PATTERN"] = 14] = "UNREACHABLE_PATTERN";
			LexerDefinitionErrorType[LexerDefinitionErrorType["IDENTIFY_TERMINATOR"] = 15] = "IDENTIFY_TERMINATOR";
			LexerDefinitionErrorType[LexerDefinitionErrorType["CUSTOM_LINE_BREAK"] = 16] = "CUSTOM_LINE_BREAK";
		})(LexerDefinitionErrorType || (LexerDefinitionErrorType = {}));
		DEFAULT_LEXER_CONFIG = {
			deferDefinitionErrorsHandling: false,
			positionTracking: "full",
			lineTerminatorsPattern: /\n|\r\n?/g,
			lineTerminatorCharacters: ["\n", "\r"],
			ensureOptimizations: false,
			safeMode: false,
			errorMessageProvider: defaultLexerErrorProvider,
			traceInitPerf: false,
			skipValidations: false
		};
		Object.freeze(DEFAULT_LEXER_CONFIG);
		Lexer = function() {
			function Lexer(lexerDefinition, config) {
				var _this = this;
				if (config === void 0) config = DEFAULT_LEXER_CONFIG;
				this.lexerDefinition = lexerDefinition;
				this.lexerDefinitionErrors = [];
				this.lexerDefinitionWarning = [];
				this.patternIdxToConfig = {};
				this.charCodeToPatternIdxToConfig = {};
				this.modes = [];
				this.emptyGroups = {};
				this.config = void 0;
				this.trackStartLines = true;
				this.trackEndLines = true;
				this.hasCustom = false;
				this.canModeBeOptimized = {};
				if (typeof config === "boolean") throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");
				this.config = merge(DEFAULT_LEXER_CONFIG, config);
				var traceInitVal = this.config.traceInitPerf;
				if (traceInitVal === true) {
					this.traceInitMaxIdent = Infinity;
					this.traceInitPerf = true;
				} else if (typeof traceInitVal === "number") {
					this.traceInitMaxIdent = traceInitVal;
					this.traceInitPerf = true;
				}
				this.traceInitIndent = -1;
				this.TRACE_INIT("Lexer Constructor", function() {
					var actualDefinition;
					var hasOnlySingleMode = true;
					_this.TRACE_INIT("Lexer Config handling", function() {
						if (_this.config.lineTerminatorsPattern === DEFAULT_LEXER_CONFIG.lineTerminatorsPattern) _this.config.lineTerminatorsPattern = LineTerminatorOptimizedTester;
						else if (_this.config.lineTerminatorCharacters === DEFAULT_LEXER_CONFIG.lineTerminatorCharacters) throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n	For details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");
						if (config.safeMode && config.ensureOptimizations) throw Error("\"safeMode\" and \"ensureOptimizations\" flags are mutually exclusive.");
						_this.trackStartLines = /full|onlyStart/i.test(_this.config.positionTracking);
						_this.trackEndLines = /full/i.test(_this.config.positionTracking);
						if (isArray(lexerDefinition)) {
							actualDefinition = { modes: {} };
							actualDefinition.modes[DEFAULT_MODE] = cloneArr(lexerDefinition);
							actualDefinition[DEFAULT_MODE] = DEFAULT_MODE;
						} else {
							hasOnlySingleMode = false;
							actualDefinition = cloneObj(lexerDefinition);
						}
					});
					if (_this.config.skipValidations === false) {
						_this.TRACE_INIT("performRuntimeChecks", function() {
							_this.lexerDefinitionErrors = _this.lexerDefinitionErrors.concat(performRuntimeChecks(actualDefinition, _this.trackStartLines, _this.config.lineTerminatorCharacters));
						});
						_this.TRACE_INIT("performWarningRuntimeChecks", function() {
							_this.lexerDefinitionWarning = _this.lexerDefinitionWarning.concat(performWarningRuntimeChecks(actualDefinition, _this.trackStartLines, _this.config.lineTerminatorCharacters));
						});
					}
					actualDefinition.modes = actualDefinition.modes ? actualDefinition.modes : {};
					forEach(actualDefinition.modes, function(currModeValue, currModeName) {
						actualDefinition.modes[currModeName] = reject(currModeValue, function(currTokType) {
							return isUndefined(currTokType);
						});
					});
					var allModeNames = keys(actualDefinition.modes);
					forEach(actualDefinition.modes, function(currModDef, currModName) {
						_this.TRACE_INIT("Mode: <" + currModName + "> processing", function() {
							_this.modes.push(currModName);
							if (_this.config.skipValidations === false) _this.TRACE_INIT("validatePatterns", function() {
								_this.lexerDefinitionErrors = _this.lexerDefinitionErrors.concat(validatePatterns(currModDef, allModeNames));
							});
							if (isEmpty(_this.lexerDefinitionErrors)) {
								augmentTokenTypes(currModDef);
								var currAnalyzeResult_1;
								_this.TRACE_INIT("analyzeTokenTypes", function() {
									currAnalyzeResult_1 = analyzeTokenTypes(currModDef, {
										lineTerminatorCharacters: _this.config.lineTerminatorCharacters,
										positionTracking: config.positionTracking,
										ensureOptimizations: config.ensureOptimizations,
										safeMode: config.safeMode,
										tracer: _this.TRACE_INIT.bind(_this)
									});
								});
								_this.patternIdxToConfig[currModName] = currAnalyzeResult_1.patternIdxToConfig;
								_this.charCodeToPatternIdxToConfig[currModName] = currAnalyzeResult_1.charCodeToPatternIdxToConfig;
								_this.emptyGroups = merge(_this.emptyGroups, currAnalyzeResult_1.emptyGroups);
								_this.hasCustom = currAnalyzeResult_1.hasCustom || _this.hasCustom;
								_this.canModeBeOptimized[currModName] = currAnalyzeResult_1.canBeOptimized;
							}
						});
					});
					_this.defaultMode = actualDefinition.defaultMode;
					if (!isEmpty(_this.lexerDefinitionErrors) && !_this.config.deferDefinitionErrorsHandling) {
						var allErrMessagesString = map(_this.lexerDefinitionErrors, function(error) {
							return error.message;
						}).join("-----------------------\n");
						throw new Error("Errors detected in definition of Lexer:\n" + allErrMessagesString);
					}
					forEach(_this.lexerDefinitionWarning, function(warningDescriptor) {
						PRINT_WARNING(warningDescriptor.message);
					});
					_this.TRACE_INIT("Choosing sub-methods implementations", function() {
						if (SUPPORT_STICKY) {
							_this.chopInput = IDENTITY;
							_this.match = _this.matchWithTest;
						} else {
							_this.updateLastIndex = NOOP;
							_this.match = _this.matchWithExec;
						}
						if (hasOnlySingleMode) _this.handleModes = NOOP;
						if (_this.trackStartLines === false) _this.computeNewColumn = IDENTITY;
						if (_this.trackEndLines === false) _this.updateTokenEndLineColumnLocation = NOOP;
						if (/full/i.test(_this.config.positionTracking)) _this.createTokenInstance = _this.createFullToken;
						else if (/onlyStart/i.test(_this.config.positionTracking)) _this.createTokenInstance = _this.createStartOnlyToken;
						else if (/onlyOffset/i.test(_this.config.positionTracking)) _this.createTokenInstance = _this.createOffsetOnlyToken;
						else throw Error("Invalid <positionTracking> config option: \"" + _this.config.positionTracking + "\"");
						if (_this.hasCustom) {
							_this.addToken = _this.addTokenUsingPush;
							_this.handlePayload = _this.handlePayloadWithCustom;
						} else {
							_this.addToken = _this.addTokenUsingMemberAccess;
							_this.handlePayload = _this.handlePayloadNoCustom;
						}
					});
					_this.TRACE_INIT("Failed Optimization Warnings", function() {
						var unOptimizedModes = reduce(_this.canModeBeOptimized, function(cannotBeOptimized, canBeOptimized, modeName) {
							if (canBeOptimized === false) cannotBeOptimized.push(modeName);
							return cannotBeOptimized;
						}, []);
						if (config.ensureOptimizations && !isEmpty(unOptimizedModes)) throw Error("Lexer Modes: < " + unOptimizedModes.join(", ") + " > cannot be optimized.\n	 Disable the \"ensureOptimizations\" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n	 Or inspect the console log for details on how to resolve these issues.");
					});
					_this.TRACE_INIT("clearRegExpParserCache", function() {
						clearRegExpParserCache();
					});
					_this.TRACE_INIT("toFastProperties", function() {
						toFastProperties(_this);
					});
				});
			}
			Lexer.prototype.tokenize = function(text, initialMode) {
				if (initialMode === void 0) initialMode = this.defaultMode;
				if (!isEmpty(this.lexerDefinitionErrors)) {
					var allErrMessagesString = map(this.lexerDefinitionErrors, function(error) {
						return error.message;
					}).join("-----------------------\n");
					throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n" + allErrMessagesString);
				}
				return this.tokenizeInternal(text, initialMode);
			};
			Lexer.prototype.tokenizeInternal = function(text, initialMode) {
				var _this = this, i, j, matchAltImage, longerAltIdx, matchedImage, payload, altPayload, imageLength, group, tokType, newToken, errLength, msg, match;
				var orgText = text;
				var orgLength = orgText.length;
				var offset = 0;
				var matchedTokensIndex = 0;
				var guessedNumberOfTokens = this.hasCustom ? 0 : Math.floor(text.length / 10);
				var matchedTokens = new Array(guessedNumberOfTokens);
				var errors = [];
				var line = this.trackStartLines ? 1 : void 0;
				var column = this.trackStartLines ? 1 : void 0;
				var groups = cloneEmptyGroups(this.emptyGroups);
				var trackLines = this.trackStartLines;
				var lineTerminatorPattern = this.config.lineTerminatorsPattern;
				var currModePatternsLength = 0;
				var patternIdxToConfig = [];
				var currCharCodeToPatternIdxToConfig = [];
				var modeStack = [];
				var emptyArray = [];
				Object.freeze(emptyArray);
				var getPossiblePatterns = void 0;
				function getPossiblePatternsSlow() {
					return patternIdxToConfig;
				}
				function getPossiblePatternsOptimized(charCode) {
					var optimizedCharIdx = charCodeToOptimizedIndex(charCode);
					var possiblePatterns = currCharCodeToPatternIdxToConfig[optimizedCharIdx];
					if (possiblePatterns === void 0) return emptyArray;
					else return possiblePatterns;
				}
				var pop_mode = function(popToken) {
					if (modeStack.length === 1 && popToken.tokenType.PUSH_MODE === void 0) {
						var msg_1 = _this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(popToken);
						errors.push({
							offset: popToken.startOffset,
							line: popToken.startLine !== void 0 ? popToken.startLine : void 0,
							column: popToken.startColumn !== void 0 ? popToken.startColumn : void 0,
							length: popToken.image.length,
							message: msg_1
						});
					} else {
						modeStack.pop();
						var newMode = last(modeStack);
						patternIdxToConfig = _this.patternIdxToConfig[newMode];
						currCharCodeToPatternIdxToConfig = _this.charCodeToPatternIdxToConfig[newMode];
						currModePatternsLength = patternIdxToConfig.length;
						var modeCanBeOptimized = _this.canModeBeOptimized[newMode] && _this.config.safeMode === false;
						if (currCharCodeToPatternIdxToConfig && modeCanBeOptimized) getPossiblePatterns = getPossiblePatternsOptimized;
						else getPossiblePatterns = getPossiblePatternsSlow;
					}
				};
				function push_mode(newMode) {
					modeStack.push(newMode);
					currCharCodeToPatternIdxToConfig = this.charCodeToPatternIdxToConfig[newMode];
					patternIdxToConfig = this.patternIdxToConfig[newMode];
					currModePatternsLength = patternIdxToConfig.length;
					currModePatternsLength = patternIdxToConfig.length;
					var modeCanBeOptimized = this.canModeBeOptimized[newMode] && this.config.safeMode === false;
					if (currCharCodeToPatternIdxToConfig && modeCanBeOptimized) getPossiblePatterns = getPossiblePatternsOptimized;
					else getPossiblePatterns = getPossiblePatternsSlow;
				}
				push_mode.call(this, initialMode);
				var currConfig;
				while (offset < orgLength) {
					matchedImage = null;
					var nextCharCode = orgText.charCodeAt(offset);
					var chosenPatternIdxToConfig = getPossiblePatterns(nextCharCode);
					var chosenPatternsLength = chosenPatternIdxToConfig.length;
					for (i = 0; i < chosenPatternsLength; i++) {
						currConfig = chosenPatternIdxToConfig[i];
						var currPattern = currConfig.pattern;
						payload = null;
						var singleCharCode = currConfig.short;
						if (singleCharCode !== false) {
							if (nextCharCode === singleCharCode) matchedImage = currPattern;
						} else if (currConfig.isCustom === true) {
							match = currPattern.exec(orgText, offset, matchedTokens, groups);
							if (match !== null) {
								matchedImage = match[0];
								if (match.payload !== void 0) payload = match.payload;
							} else matchedImage = null;
						} else {
							this.updateLastIndex(currPattern, offset);
							matchedImage = this.match(currPattern, text, offset);
						}
						if (matchedImage !== null) {
							longerAltIdx = currConfig.longerAlt;
							if (longerAltIdx !== void 0) {
								var longerAltConfig = patternIdxToConfig[longerAltIdx];
								var longerAltPattern = longerAltConfig.pattern;
								altPayload = null;
								if (longerAltConfig.isCustom === true) {
									match = longerAltPattern.exec(orgText, offset, matchedTokens, groups);
									if (match !== null) {
										matchAltImage = match[0];
										if (match.payload !== void 0) altPayload = match.payload;
									} else matchAltImage = null;
								} else {
									this.updateLastIndex(longerAltPattern, offset);
									matchAltImage = this.match(longerAltPattern, text, offset);
								}
								if (matchAltImage && matchAltImage.length > matchedImage.length) {
									matchedImage = matchAltImage;
									payload = altPayload;
									currConfig = longerAltConfig;
								}
							}
							break;
						}
					}
					if (matchedImage !== null) {
						imageLength = matchedImage.length;
						group = currConfig.group;
						if (group !== void 0) {
							tokType = currConfig.tokenTypeIdx;
							newToken = this.createTokenInstance(matchedImage, offset, tokType, currConfig.tokenType, line, column, imageLength);
							this.handlePayload(newToken, payload);
							if (group === false) matchedTokensIndex = this.addToken(matchedTokens, matchedTokensIndex, newToken);
							else groups[group].push(newToken);
						}
						text = this.chopInput(text, imageLength);
						offset = offset + imageLength;
						column = this.computeNewColumn(column, imageLength);
						if (trackLines === true && currConfig.canLineTerminator === true) {
							var numOfLTsInMatch = 0;
							var foundTerminator = void 0;
							var lastLTEndOffset = void 0;
							lineTerminatorPattern.lastIndex = 0;
							do {
								foundTerminator = lineTerminatorPattern.test(matchedImage);
								if (foundTerminator === true) {
									lastLTEndOffset = lineTerminatorPattern.lastIndex - 1;
									numOfLTsInMatch++;
								}
							} while (foundTerminator === true);
							if (numOfLTsInMatch !== 0) {
								line = line + numOfLTsInMatch;
								column = imageLength - lastLTEndOffset;
								this.updateTokenEndLineColumnLocation(newToken, group, lastLTEndOffset, numOfLTsInMatch, line, column, imageLength);
							}
						}
						this.handleModes(currConfig, pop_mode, push_mode, newToken);
					} else {
						var errorStartOffset = offset;
						var errorLine = line;
						var errorColumn = column;
						var foundResyncPoint = false;
						while (!foundResyncPoint && offset < orgLength) {
							orgText.charCodeAt(offset);
							text = this.chopInput(text, 1);
							offset++;
							for (j = 0; j < currModePatternsLength; j++) {
								var currConfig_1 = patternIdxToConfig[j];
								var currPattern = currConfig_1.pattern;
								var singleCharCode = currConfig_1.short;
								if (singleCharCode !== false) {
									if (orgText.charCodeAt(offset) === singleCharCode) foundResyncPoint = true;
								} else if (currConfig_1.isCustom === true) foundResyncPoint = currPattern.exec(orgText, offset, matchedTokens, groups) !== null;
								else {
									this.updateLastIndex(currPattern, offset);
									foundResyncPoint = currPattern.exec(text) !== null;
								}
								if (foundResyncPoint === true) break;
							}
						}
						errLength = offset - errorStartOffset;
						msg = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(orgText, errorStartOffset, errLength, errorLine, errorColumn);
						errors.push({
							offset: errorStartOffset,
							line: errorLine,
							column: errorColumn,
							length: errLength,
							message: msg
						});
					}
				}
				if (!this.hasCustom) matchedTokens.length = matchedTokensIndex;
				return {
					tokens: matchedTokens,
					groups,
					errors
				};
			};
			Lexer.prototype.handleModes = function(config, pop_mode, push_mode, newToken) {
				if (config.pop === true) {
					var pushMode = config.push;
					pop_mode(newToken);
					if (pushMode !== void 0) push_mode.call(this, pushMode);
				} else if (config.push !== void 0) push_mode.call(this, config.push);
			};
			Lexer.prototype.chopInput = function(text, length) {
				return text.substring(length);
			};
			Lexer.prototype.updateLastIndex = function(regExp, newLastIndex) {
				regExp.lastIndex = newLastIndex;
			};
			Lexer.prototype.updateTokenEndLineColumnLocation = function(newToken, group, lastLTIdx, numOfLTsInMatch, line, column, imageLength) {
				var lastCharIsLT, fixForEndingInLT;
				if (group !== void 0) {
					lastCharIsLT = lastLTIdx === imageLength - 1;
					fixForEndingInLT = lastCharIsLT ? -1 : 0;
					if (!(numOfLTsInMatch === 1 && lastCharIsLT === true)) {
						newToken.endLine = line + fixForEndingInLT;
						newToken.endColumn = column - 1 + -fixForEndingInLT;
					}
				}
			};
			Lexer.prototype.computeNewColumn = function(oldColumn, imageLength) {
				return oldColumn + imageLength;
			};
			/* istanbul ignore next - place holder */
			Lexer.prototype.createTokenInstance = function() {
				var args = [];
				for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
				return null;
			};
			Lexer.prototype.createOffsetOnlyToken = function(image, startOffset, tokenTypeIdx, tokenType) {
				return {
					image,
					startOffset,
					tokenTypeIdx,
					tokenType
				};
			};
			Lexer.prototype.createStartOnlyToken = function(image, startOffset, tokenTypeIdx, tokenType, startLine, startColumn) {
				return {
					image,
					startOffset,
					startLine,
					startColumn,
					tokenTypeIdx,
					tokenType
				};
			};
			Lexer.prototype.createFullToken = function(image, startOffset, tokenTypeIdx, tokenType, startLine, startColumn, imageLength) {
				return {
					image,
					startOffset,
					endOffset: startOffset + imageLength - 1,
					startLine,
					endLine: startLine,
					startColumn,
					endColumn: startColumn + imageLength - 1,
					tokenTypeIdx,
					tokenType
				};
			};
			/* istanbul ignore next - place holder */
			Lexer.prototype.addToken = function(tokenVector, index, tokenToAdd) {
				return 666;
			};
			Lexer.prototype.addTokenUsingPush = function(tokenVector, index, tokenToAdd) {
				tokenVector.push(tokenToAdd);
				return index;
			};
			Lexer.prototype.addTokenUsingMemberAccess = function(tokenVector, index, tokenToAdd) {
				tokenVector[index] = tokenToAdd;
				index++;
				return index;
			};
			/* istanbul ignore next - place holder */
			Lexer.prototype.handlePayload = function(token, payload) {};
			Lexer.prototype.handlePayloadNoCustom = function(token, payload) {};
			Lexer.prototype.handlePayloadWithCustom = function(token, payload) {
				if (payload !== null) token.payload = payload;
			};
			/* istanbul ignore next - place holder to be replaced with chosen alternative at runtime */
			Lexer.prototype.match = function(pattern, text, offset) {
				return null;
			};
			Lexer.prototype.matchWithTest = function(pattern, text, offset) {
				if (pattern.test(text) === true) return text.substring(offset, pattern.lastIndex);
				return null;
			};
			Lexer.prototype.matchWithExec = function(pattern, text) {
				var regExpArray = pattern.exec(text);
				return regExpArray !== null ? regExpArray[0] : regExpArray;
			};
			Lexer.prototype.TRACE_INIT = function(phaseDesc, phaseImpl) {
				if (this.traceInitPerf === true) {
					this.traceInitIndent++;
					var indent = new Array(this.traceInitIndent + 1).join("	");
					if (this.traceInitIndent < this.traceInitMaxIdent) console.log(indent + "--> <" + phaseDesc + ">");
					var _a = timer(phaseImpl), time = _a.time, value = _a.value;
					/* istanbul ignore next - Difficult to reproduce specific performance behavior (>10ms) in tests */
					var traceMethod = time > 10 ? console.warn : console.log;
					if (this.traceInitIndent < this.traceInitMaxIdent) traceMethod(indent + "<-- <" + phaseDesc + "> time: " + time + "ms");
					this.traceInitIndent--;
					return value;
				} else return phaseImpl();
			};
			Lexer.SKIPPED = "This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";
			Lexer.NA = /NOT_APPLICABLE/;
			return Lexer;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/scan/tokens_public.js
	function tokenLabel(tokType) {
		if (hasTokenLabel(tokType)) return tokType.LABEL;
		else return tokType.name;
	}
	function hasTokenLabel(obj) {
		return isString(obj.LABEL) && obj.LABEL !== "";
	}
	function createToken(config) {
		return createTokenInternal(config);
	}
	function createTokenInternal(config) {
		var pattern = config.pattern;
		var tokenType = {};
		tokenType.name = config.name;
		if (!isUndefined(pattern)) tokenType.PATTERN = pattern;
		if (has(config, PARENT)) throw "The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";
		if (has(config, CATEGORIES)) tokenType.CATEGORIES = config[CATEGORIES];
		augmentTokenTypes([tokenType]);
		if (has(config, LABEL)) tokenType.LABEL = config[LABEL];
		if (has(config, GROUP)) tokenType.GROUP = config[GROUP];
		if (has(config, POP_MODE)) tokenType.POP_MODE = config[POP_MODE];
		if (has(config, PUSH_MODE)) tokenType.PUSH_MODE = config[PUSH_MODE];
		if (has(config, LONGER_ALT)) tokenType.LONGER_ALT = config[LONGER_ALT];
		if (has(config, LINE_BREAKS)) tokenType.LINE_BREAKS = config[LINE_BREAKS];
		if (has(config, START_CHARS_HINT)) tokenType.START_CHARS_HINT = config[START_CHARS_HINT];
		return tokenType;
	}
	function createTokenInstance(tokType, image, startOffset, endOffset, startLine, endLine, startColumn, endColumn) {
		return {
			image,
			startOffset,
			endOffset,
			startLine,
			endLine,
			startColumn,
			endColumn,
			tokenTypeIdx: tokType.tokenTypeIdx,
			tokenType: tokType
		};
	}
	function tokenMatcher(token, tokType) {
		return tokenStructuredMatcher(token, tokType);
	}
	var PARENT, CATEGORIES, LABEL, GROUP, PUSH_MODE, POP_MODE, LONGER_ALT, LINE_BREAKS, START_CHARS_HINT, EOF;
	var init_tokens_public = __esmMin((() => {
		init_utils();
		init_lexer_public();
		init_tokens();
		PARENT = "parent";
		CATEGORIES = "categories";
		LABEL = "label";
		GROUP = "group";
		PUSH_MODE = "push_mode";
		POP_MODE = "pop_mode";
		LONGER_ALT = "longer_alt";
		LINE_BREAKS = "line_breaks";
		START_CHARS_HINT = "start_chars_hint";
		EOF = createToken({
			name: "EOF",
			pattern: Lexer.NA
		});
		augmentTokenTypes([EOF]);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_public.js
	function serializeGrammar(topRules) {
		return map(topRules, serializeProduction);
	}
	function serializeProduction(node) {
		function convertDefinition(definition) {
			return map(definition, serializeProduction);
		}
		/* istanbul ignore else */
		if (node instanceof NonTerminal) return {
			type: "NonTerminal",
			name: node.nonTerminalName,
			idx: node.idx
		};
		else if (node instanceof Flat) return {
			type: "Flat",
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof Option) return {
			type: "Option",
			idx: node.idx,
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof RepetitionMandatory) return {
			type: "RepetitionMandatory",
			name: node.name,
			idx: node.idx,
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof RepetitionMandatoryWithSeparator) return {
			type: "RepetitionMandatoryWithSeparator",
			name: node.name,
			idx: node.idx,
			separator: serializeProduction(new Terminal({ terminalType: node.separator })),
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof RepetitionWithSeparator) return {
			type: "RepetitionWithSeparator",
			name: node.name,
			idx: node.idx,
			separator: serializeProduction(new Terminal({ terminalType: node.separator })),
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof Repetition) return {
			type: "Repetition",
			name: node.name,
			idx: node.idx,
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof Alternation) return {
			type: "Alternation",
			name: node.name,
			idx: node.idx,
			definition: convertDefinition(node.definition)
		};
		else if (node instanceof Terminal) {
			var serializedTerminal = {
				type: "Terminal",
				name: node.terminalType.name,
				label: tokenLabel(node.terminalType),
				idx: node.idx
			};
			var pattern = node.terminalType.PATTERN;
			if (node.terminalType.PATTERN) serializedTerminal.pattern = isRegExp(pattern) ? pattern.source : pattern;
			return serializedTerminal;
		} else if (node instanceof Rule$2) return {
			type: "Rule",
			name: node.name,
			orgText: node.orgText,
			definition: convertDefinition(node.definition)
		};
		else throw Error("non exhaustive match");
	}
	var __extends$8, AbstractProduction, NonTerminal, Rule$2, Flat, Option, RepetitionMandatory, RepetitionMandatoryWithSeparator, Repetition, RepetitionWithSeparator, Alternation, Terminal;
	var init_gast_public = __esmMin((() => {
		init_utils();
		init_tokens_public();
		__extends$8 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		AbstractProduction = function() {
			function AbstractProduction(definition) {
				this.definition = definition;
			}
			AbstractProduction.prototype.accept = function(visitor) {
				visitor.visit(this);
				forEach(this.definition, function(prod) {
					prod.accept(visitor);
				});
			};
			return AbstractProduction;
		}();
		NonTerminal = function(_super) {
			__extends$8(NonTerminal, _super);
			function NonTerminal(options) {
				var _this = _super.call(this, []) || this;
				_this.idx = 1;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			Object.defineProperty(NonTerminal.prototype, "definition", {
				get: function() {
					if (this.referencedRule !== void 0) return this.referencedRule.definition;
					return [];
				},
				set: function(definition) {},
				enumerable: true,
				configurable: true
			});
			NonTerminal.prototype.accept = function(visitor) {
				visitor.visit(this);
			};
			return NonTerminal;
		}(AbstractProduction);
		Rule$2 = function(_super) {
			__extends$8(Rule, _super);
			function Rule(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.orgText = "";
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return Rule;
		}(AbstractProduction);
		Flat = function(_super) {
			__extends$8(Flat, _super);
			function Flat(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.ignoreAmbiguities = false;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return Flat;
		}(AbstractProduction);
		Option = function(_super) {
			__extends$8(Option, _super);
			function Option(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.idx = 1;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return Option;
		}(AbstractProduction);
		RepetitionMandatory = function(_super) {
			__extends$8(RepetitionMandatory, _super);
			function RepetitionMandatory(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.idx = 1;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return RepetitionMandatory;
		}(AbstractProduction);
		RepetitionMandatoryWithSeparator = function(_super) {
			__extends$8(RepetitionMandatoryWithSeparator, _super);
			function RepetitionMandatoryWithSeparator(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.idx = 1;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return RepetitionMandatoryWithSeparator;
		}(AbstractProduction);
		Repetition = function(_super) {
			__extends$8(Repetition, _super);
			function Repetition(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.idx = 1;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return Repetition;
		}(AbstractProduction);
		RepetitionWithSeparator = function(_super) {
			__extends$8(RepetitionWithSeparator, _super);
			function RepetitionWithSeparator(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.idx = 1;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return RepetitionWithSeparator;
		}(AbstractProduction);
		Alternation = function(_super) {
			__extends$8(Alternation, _super);
			function Alternation(options) {
				var _this = _super.call(this, options.definition) || this;
				_this.idx = 1;
				_this.ignoreAmbiguities = false;
				_this.hasPredicates = false;
				assign(_this, pick(options, function(v) {
					return v !== void 0;
				}));
				return _this;
			}
			return Alternation;
		}(AbstractProduction);
		Terminal = function() {
			function Terminal(options) {
				this.idx = 1;
				assign(this, pick(options, function(v) {
					return v !== void 0;
				}));
			}
			Terminal.prototype.accept = function(visitor) {
				visitor.visit(this);
			};
			return Terminal;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/rest.js
	function restForRepetitionWithSeparator(repSepProd, currRest, prevRest) {
		return [new Option({ definition: [new Terminal({ terminalType: repSepProd.separator })].concat(repSepProd.definition) })].concat(currRest, prevRest);
	}
	var RestWalker;
	var init_rest = __esmMin((() => {
		init_utils();
		init_gast_public();
		RestWalker = function() {
			function RestWalker() {}
			RestWalker.prototype.walk = function(prod, prevRest) {
				var _this = this;
				if (prevRest === void 0) prevRest = [];
				forEach(prod.definition, function(subProd, index) {
					var currRest = drop(prod.definition, index + 1);
					/* istanbul ignore else */
					if (subProd instanceof NonTerminal) _this.walkProdRef(subProd, currRest, prevRest);
					else if (subProd instanceof Terminal) _this.walkTerminal(subProd, currRest, prevRest);
					else if (subProd instanceof Flat) _this.walkFlat(subProd, currRest, prevRest);
					else if (subProd instanceof Option) _this.walkOption(subProd, currRest, prevRest);
					else if (subProd instanceof RepetitionMandatory) _this.walkAtLeastOne(subProd, currRest, prevRest);
					else if (subProd instanceof RepetitionMandatoryWithSeparator) _this.walkAtLeastOneSep(subProd, currRest, prevRest);
					else if (subProd instanceof RepetitionWithSeparator) _this.walkManySep(subProd, currRest, prevRest);
					else if (subProd instanceof Repetition) _this.walkMany(subProd, currRest, prevRest);
					else if (subProd instanceof Alternation) _this.walkOr(subProd, currRest, prevRest);
					else throw Error("non exhaustive match");
				});
			};
			RestWalker.prototype.walkTerminal = function(terminal, currRest, prevRest) {};
			RestWalker.prototype.walkProdRef = function(refProd, currRest, prevRest) {};
			RestWalker.prototype.walkFlat = function(flatProd, currRest, prevRest) {
				var fullOrRest = currRest.concat(prevRest);
				this.walk(flatProd, fullOrRest);
			};
			RestWalker.prototype.walkOption = function(optionProd, currRest, prevRest) {
				var fullOrRest = currRest.concat(prevRest);
				this.walk(optionProd, fullOrRest);
			};
			RestWalker.prototype.walkAtLeastOne = function(atLeastOneProd, currRest, prevRest) {
				var fullAtLeastOneRest = [new Option({ definition: atLeastOneProd.definition })].concat(currRest, prevRest);
				this.walk(atLeastOneProd, fullAtLeastOneRest);
			};
			RestWalker.prototype.walkAtLeastOneSep = function(atLeastOneSepProd, currRest, prevRest) {
				var fullAtLeastOneSepRest = restForRepetitionWithSeparator(atLeastOneSepProd, currRest, prevRest);
				this.walk(atLeastOneSepProd, fullAtLeastOneSepRest);
			};
			RestWalker.prototype.walkMany = function(manyProd, currRest, prevRest) {
				var fullManyRest = [new Option({ definition: manyProd.definition })].concat(currRest, prevRest);
				this.walk(manyProd, fullManyRest);
			};
			RestWalker.prototype.walkManySep = function(manySepProd, currRest, prevRest) {
				var fullManySepRest = restForRepetitionWithSeparator(manySepProd, currRest, prevRest);
				this.walk(manySepProd, fullManySepRest);
			};
			RestWalker.prototype.walkOr = function(orProd, currRest, prevRest) {
				var _this = this;
				var fullOrRest = currRest.concat(prevRest);
				forEach(orProd.definition, function(alt) {
					var prodWrapper = new Flat({ definition: [alt] });
					_this.walk(prodWrapper, fullOrRest);
				});
			};
			return RestWalker;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_visitor_public.js
	var GAstVisitor;
	var init_gast_visitor_public = __esmMin((() => {
		init_gast_public();
		GAstVisitor = function() {
			function GAstVisitor() {}
			GAstVisitor.prototype.visit = function(node) {
				var nodeAny = node;
				switch (nodeAny.constructor) {
					case NonTerminal: return this.visitNonTerminal(nodeAny);
					case Flat: return this.visitFlat(nodeAny);
					case Option: return this.visitOption(nodeAny);
					case RepetitionMandatory: return this.visitRepetitionMandatory(nodeAny);
					case RepetitionMandatoryWithSeparator: return this.visitRepetitionMandatoryWithSeparator(nodeAny);
					case RepetitionWithSeparator: return this.visitRepetitionWithSeparator(nodeAny);
					case Repetition: return this.visitRepetition(nodeAny);
					case Alternation: return this.visitAlternation(nodeAny);
					case Terminal: return this.visitTerminal(nodeAny);
					case Rule$2: return this.visitRule(nodeAny);
					/* istanbul ignore next */
					default: throw Error("non exhaustive match");
				}
			};
			GAstVisitor.prototype.visitNonTerminal = function(node) {};
			GAstVisitor.prototype.visitFlat = function(node) {};
			GAstVisitor.prototype.visitOption = function(node) {};
			GAstVisitor.prototype.visitRepetition = function(node) {};
			GAstVisitor.prototype.visitRepetitionMandatory = function(node) {};
			GAstVisitor.prototype.visitRepetitionMandatoryWithSeparator = function(node) {};
			GAstVisitor.prototype.visitRepetitionWithSeparator = function(node) {};
			GAstVisitor.prototype.visitAlternation = function(node) {};
			GAstVisitor.prototype.visitTerminal = function(node) {};
			GAstVisitor.prototype.visitRule = function(node) {};
			return GAstVisitor;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast.js
	function isSequenceProd(prod) {
		return prod instanceof Flat || prod instanceof Option || prod instanceof Repetition || prod instanceof RepetitionMandatory || prod instanceof RepetitionMandatoryWithSeparator || prod instanceof RepetitionWithSeparator || prod instanceof Terminal || prod instanceof Rule$2;
	}
	function isOptionalProd(prod, alreadyVisited) {
		if (alreadyVisited === void 0) alreadyVisited = [];
		if (prod instanceof Option || prod instanceof Repetition || prod instanceof RepetitionWithSeparator) return true;
		if (prod instanceof Alternation) return some(prod.definition, function(subProd) {
			return isOptionalProd(subProd, alreadyVisited);
		});
		else if (prod instanceof NonTerminal && contains(alreadyVisited, prod)) return false;
		else if (prod instanceof AbstractProduction) {
			if (prod instanceof NonTerminal) alreadyVisited.push(prod);
			return every(prod.definition, function(subProd) {
				return isOptionalProd(subProd, alreadyVisited);
			});
		} else return false;
	}
	function isBranchingProd(prod) {
		return prod instanceof Alternation;
	}
	function getProductionDslName(prod) {
		/* istanbul ignore else */
		if (prod instanceof NonTerminal) return "SUBRULE";
		else if (prod instanceof Option) return "OPTION";
		else if (prod instanceof Alternation) return "OR";
		else if (prod instanceof RepetitionMandatory) return "AT_LEAST_ONE";
		else if (prod instanceof RepetitionMandatoryWithSeparator) return "AT_LEAST_ONE_SEP";
		else if (prod instanceof RepetitionWithSeparator) return "MANY_SEP";
		else if (prod instanceof Repetition) return "MANY";
		else if (prod instanceof Terminal) return "CONSUME";
		else throw Error("non exhaustive match");
	}
	function collectMethods(rule) {
		collectorVisitor.reset();
		rule.accept(collectorVisitor);
		var dslMethods = collectorVisitor.dslMethods;
		collectorVisitor.reset();
		return dslMethods;
	}
	var __extends$7, DslMethodsCollectorVisitor, collectorVisitor;
	var init_gast = __esmMin((() => {
		init_utils();
		init_gast_public();
		init_gast_visitor_public();
		__extends$7 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		DslMethodsCollectorVisitor = function(_super) {
			__extends$7(DslMethodsCollectorVisitor, _super);
			function DslMethodsCollectorVisitor() {
				var _this = _super !== null && _super.apply(this, arguments) || this;
				_this.separator = "-";
				_this.dslMethods = {
					option: [],
					alternation: [],
					repetition: [],
					repetitionWithSeparator: [],
					repetitionMandatory: [],
					repetitionMandatoryWithSeparator: []
				};
				return _this;
			}
			DslMethodsCollectorVisitor.prototype.reset = function() {
				this.dslMethods = {
					option: [],
					alternation: [],
					repetition: [],
					repetitionWithSeparator: [],
					repetitionMandatory: [],
					repetitionMandatoryWithSeparator: []
				};
			};
			DslMethodsCollectorVisitor.prototype.visitTerminal = function(terminal) {
				var key = terminal.terminalType.name + this.separator + "Terminal";
				if (!has(this.dslMethods, key)) this.dslMethods[key] = [];
				this.dslMethods[key].push(terminal);
			};
			DslMethodsCollectorVisitor.prototype.visitNonTerminal = function(subrule) {
				var key = subrule.nonTerminalName + this.separator + "Terminal";
				if (!has(this.dslMethods, key)) this.dslMethods[key] = [];
				this.dslMethods[key].push(subrule);
			};
			DslMethodsCollectorVisitor.prototype.visitOption = function(option) {
				this.dslMethods.option.push(option);
			};
			DslMethodsCollectorVisitor.prototype.visitRepetitionWithSeparator = function(manySep) {
				this.dslMethods.repetitionWithSeparator.push(manySep);
			};
			DslMethodsCollectorVisitor.prototype.visitRepetitionMandatory = function(atLeastOne) {
				this.dslMethods.repetitionMandatory.push(atLeastOne);
			};
			DslMethodsCollectorVisitor.prototype.visitRepetitionMandatoryWithSeparator = function(atLeastOneSep) {
				this.dslMethods.repetitionMandatoryWithSeparator.push(atLeastOneSep);
			};
			DslMethodsCollectorVisitor.prototype.visitRepetition = function(many) {
				this.dslMethods.repetition.push(many);
			};
			DslMethodsCollectorVisitor.prototype.visitAlternation = function(or) {
				this.dslMethods.alternation.push(or);
			};
			return DslMethodsCollectorVisitor;
		}(GAstVisitor);
		collectorVisitor = new DslMethodsCollectorVisitor();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/first.js
	function first(prod) {
		/* istanbul ignore else */
		if (prod instanceof NonTerminal) return first(prod.referencedRule);
		else if (prod instanceof Terminal) return firstForTerminal(prod);
		else if (isSequenceProd(prod)) return firstForSequence(prod);
		else if (isBranchingProd(prod)) return firstForBranching(prod);
		else throw Error("non exhaustive match");
	}
	function firstForSequence(prod) {
		var firstSet = [];
		var seq = prod.definition;
		var nextSubProdIdx = 0;
		var hasInnerProdsRemaining = seq.length > nextSubProdIdx;
		var currSubProd;
		var isLastInnerProdOptional = true;
		while (hasInnerProdsRemaining && isLastInnerProdOptional) {
			currSubProd = seq[nextSubProdIdx];
			isLastInnerProdOptional = isOptionalProd(currSubProd);
			firstSet = firstSet.concat(first(currSubProd));
			nextSubProdIdx = nextSubProdIdx + 1;
			hasInnerProdsRemaining = seq.length > nextSubProdIdx;
		}
		return uniq(firstSet);
	}
	function firstForBranching(prod) {
		return uniq(flatten(map(prod.definition, function(innerProd) {
			return first(innerProd);
		})));
	}
	function firstForTerminal(terminal) {
		return [terminal.terminalType];
	}
	var init_first = __esmMin((() => {
		init_utils();
		init_gast_public();
		init_gast();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/constants.js
	var IN;
	var init_constants = __esmMin((() => {
		IN = "_~IN~_";
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/follow.js
	function computeAllProdsFollows(topProductions) {
		var reSyncFollows = {};
		forEach(topProductions, function(topProd) {
			assign(reSyncFollows, new ResyncFollowsWalker(topProd).startWalking());
		});
		return reSyncFollows;
	}
	function buildBetweenProdsFollowPrefix(inner, occurenceInParent) {
		return inner.name + occurenceInParent + IN;
	}
	var __extends$6, ResyncFollowsWalker;
	var init_follow = __esmMin((() => {
		init_rest();
		init_first();
		init_utils();
		init_constants();
		init_gast_public();
		__extends$6 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		ResyncFollowsWalker = function(_super) {
			__extends$6(ResyncFollowsWalker, _super);
			function ResyncFollowsWalker(topProd) {
				var _this = _super.call(this) || this;
				_this.topProd = topProd;
				_this.follows = {};
				return _this;
			}
			ResyncFollowsWalker.prototype.startWalking = function() {
				this.walk(this.topProd);
				return this.follows;
			};
			ResyncFollowsWalker.prototype.walkTerminal = function(terminal, currRest, prevRest) {};
			ResyncFollowsWalker.prototype.walkProdRef = function(refProd, currRest, prevRest) {
				var followName = buildBetweenProdsFollowPrefix(refProd.referencedRule, refProd.idx) + this.topProd.name;
				var t_in_topProd_follows = first(new Flat({ definition: currRest.concat(prevRest) }));
				this.follows[followName] = t_in_topProd_follows;
			};
			return ResyncFollowsWalker;
		}(RestWalker);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/keys.js
	function getKeyForAutomaticLookahead(ruleIdx, dslMethodIdx, occurrence) {
		return occurrence | dslMethodIdx | ruleIdx;
	}
	function getKeyForAltIndex(ruleIdx, dslMethodIdx, occurrence, altIdx) {
		var altIdxBitMap = altIdx + 1 << BITS_START_FOR_ALT_IDX;
		return getKeyForAutomaticLookahead(ruleIdx, dslMethodIdx, occurrence) | altIdxBitMap;
	}
	var AT_LEAST_ONE_IDX, MANY_SEP_IDX, AT_LEAST_ONE_SEP_IDX, BITS_START_FOR_ALT_IDX;
	var init_keys = __esmMin((() => {
		AT_LEAST_ONE_IDX = 1024;
		MANY_SEP_IDX = 1280;
		AT_LEAST_ONE_SEP_IDX = 1536;
		BITS_START_FOR_ALT_IDX = 24;
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/cst/cst.js
	/**
	* This nodeLocation tracking is not efficient and should only be used
	* when error recovery is enabled or the Token Vector contains virtual Tokens
	* (e.g, Python Indent/Outdent)
	* As it executes the calculation for every single terminal/nonTerminal
	* and does not rely on the fact the token vector is **sorted**
	*/
	function setNodeLocationOnlyOffset(currNodeLocation, newLocationInfo) {
		if (isNaN(currNodeLocation.startOffset) === true) {
			currNodeLocation.startOffset = newLocationInfo.startOffset;
			currNodeLocation.endOffset = newLocationInfo.endOffset;
		} else if (currNodeLocation.endOffset < newLocationInfo.endOffset === true) currNodeLocation.endOffset = newLocationInfo.endOffset;
	}
	/**
	* This nodeLocation tracking is not efficient and should only be used
	* when error recovery is enabled or the Token Vector contains virtual Tokens
	* (e.g, Python Indent/Outdent)
	* As it executes the calculation for every single terminal/nonTerminal
	* and does not rely on the fact the token vector is **sorted**
	*/
	function setNodeLocationFull(currNodeLocation, newLocationInfo) {
		if (isNaN(currNodeLocation.startOffset) === true) {
			currNodeLocation.startOffset = newLocationInfo.startOffset;
			currNodeLocation.startColumn = newLocationInfo.startColumn;
			currNodeLocation.startLine = newLocationInfo.startLine;
			currNodeLocation.endOffset = newLocationInfo.endOffset;
			currNodeLocation.endColumn = newLocationInfo.endColumn;
			currNodeLocation.endLine = newLocationInfo.endLine;
		} else if (currNodeLocation.endOffset < newLocationInfo.endOffset === true) {
			currNodeLocation.endOffset = newLocationInfo.endOffset;
			currNodeLocation.endColumn = newLocationInfo.endColumn;
			currNodeLocation.endLine = newLocationInfo.endLine;
		}
	}
	function addTerminalToCst(node, token, tokenTypeName) {
		if (node.children[tokenTypeName] === void 0) node.children[tokenTypeName] = [token];
		else node.children[tokenTypeName].push(token);
	}
	function addNoneTerminalToCst(node, ruleName, ruleResult) {
		if (node.children[ruleName] === void 0) node.children[ruleName] = [ruleResult];
		else node.children[ruleName].push(ruleResult);
	}
	function expandAllNestedRuleNames(topRules, fullToShortName) {
		var result = { allRuleNames: [] };
		forEach(topRules, function(currTopRule) {
			var currTopRuleShortName = fullToShortName[currTopRule.name];
			result.allRuleNames.push(currTopRule.name);
			var namedCollectorVisitor = new NamedDSLMethodsCollectorVisitor(currTopRuleShortName);
			currTopRule.accept(namedCollectorVisitor);
			forEach(namedCollectorVisitor.result, function(_a) {
				_a.def;
				_a.key;
				var name = _a.name;
				result.allRuleNames.push(currTopRule.name + name);
			});
		});
		return result;
	}
	var __extends$5, NamedDSLMethodsCollectorVisitor;
	var init_cst = __esmMin((() => {
		init_utils();
		init_keys();
		init_gast_public();
		init_gast_visitor_public();
		__extends$5 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		NamedDSLMethodsCollectorVisitor = function(_super) {
			__extends$5(NamedDSLMethodsCollectorVisitor, _super);
			function NamedDSLMethodsCollectorVisitor(ruleIdx) {
				var _this = _super.call(this) || this;
				_this.result = [];
				_this.ruleIdx = ruleIdx;
				return _this;
			}
			NamedDSLMethodsCollectorVisitor.prototype.collectNamedDSLMethod = function(node, newNodeConstructor, methodIdx) {
				if (!isUndefined(node.name)) {
					var nameLessNode = void 0;
					/* istanbul ignore else */
					if (node instanceof Option || node instanceof Repetition || node instanceof RepetitionMandatory || node instanceof Alternation) nameLessNode = new newNodeConstructor({
						definition: node.definition,
						idx: node.idx
					});
					else if (node instanceof RepetitionMandatoryWithSeparator || node instanceof RepetitionWithSeparator) nameLessNode = new newNodeConstructor({
						definition: node.definition,
						idx: node.idx,
						separator: node.separator
					});
					else throw Error("non exhaustive match");
					var def = [nameLessNode];
					var key = getKeyForAutomaticLookahead(this.ruleIdx, methodIdx, node.idx);
					this.result.push({
						def,
						key,
						name: node.name,
						orgProd: node
					});
				}
			};
			NamedDSLMethodsCollectorVisitor.prototype.visitOption = function(node) {
				this.collectNamedDSLMethod(node, Option, 512);
			};
			NamedDSLMethodsCollectorVisitor.prototype.visitRepetition = function(node) {
				this.collectNamedDSLMethod(node, Repetition, 768);
			};
			NamedDSLMethodsCollectorVisitor.prototype.visitRepetitionMandatory = function(node) {
				this.collectNamedDSLMethod(node, RepetitionMandatory, AT_LEAST_ONE_IDX);
			};
			NamedDSLMethodsCollectorVisitor.prototype.visitRepetitionMandatoryWithSeparator = function(node) {
				this.collectNamedDSLMethod(node, RepetitionMandatoryWithSeparator, AT_LEAST_ONE_SEP_IDX);
			};
			NamedDSLMethodsCollectorVisitor.prototype.visitRepetitionWithSeparator = function(node) {
				this.collectNamedDSLMethod(node, RepetitionWithSeparator, MANY_SEP_IDX);
			};
			NamedDSLMethodsCollectorVisitor.prototype.visitAlternation = function(node) {
				var _this = this;
				this.collectNamedDSLMethod(node, Alternation, 256);
				var hasMoreThanOneAlternative = node.definition.length > 1;
				forEach(node.definition, function(currFlatAlt, altIdx) {
					if (!isUndefined(currFlatAlt.name)) {
						var def = currFlatAlt.definition;
						if (hasMoreThanOneAlternative) def = [new Option({ definition: currFlatAlt.definition })];
						else def = currFlatAlt.definition;
						var key = getKeyForAltIndex(_this.ruleIdx, 256, node.idx, altIdx);
						_this.result.push({
							def,
							key,
							name: currFlatAlt.name,
							orgProd: currFlatAlt
						});
					}
				});
			};
			return NamedDSLMethodsCollectorVisitor;
		}(GAstVisitor);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/interpreter.js
	function possiblePathsFrom(targetDef, maxLength, currPath) {
		if (currPath === void 0) currPath = [];
		currPath = cloneArr(currPath);
		var result = [];
		var i = 0;
		function remainingPathWith(nextDef) {
			return nextDef.concat(drop(targetDef, i + 1));
		}
		function getAlternativesForProd(definition) {
			var alternatives = possiblePathsFrom(remainingPathWith(definition), maxLength, currPath);
			return result.concat(alternatives);
		}
		/**
		* Mandatory productions will halt the loop as the paths computed from their recursive calls will already contain the
		* following (rest) of the targetDef.
		*
		* For optional productions (Option/Repetition/...) the loop will continue to represent the paths that do not include the
		* the optional production.
		*/
		while (currPath.length < maxLength && i < targetDef.length) {
			var prod = targetDef[i];
			/* istanbul ignore else */
			if (prod instanceof Flat) return getAlternativesForProd(prod.definition);
			else if (prod instanceof NonTerminal) return getAlternativesForProd(prod.definition);
			else if (prod instanceof Option) result = getAlternativesForProd(prod.definition);
			else if (prod instanceof RepetitionMandatory) {
				var newDef = prod.definition.concat([new Repetition({ definition: prod.definition })]);
				return getAlternativesForProd(newDef);
			} else if (prod instanceof RepetitionMandatoryWithSeparator) {
				var newDef = [new Flat({ definition: prod.definition }), new Repetition({ definition: [new Terminal({ terminalType: prod.separator })].concat(prod.definition) })];
				return getAlternativesForProd(newDef);
			} else if (prod instanceof RepetitionWithSeparator) {
				var newDef = prod.definition.concat([new Repetition({ definition: [new Terminal({ terminalType: prod.separator })].concat(prod.definition) })]);
				result = getAlternativesForProd(newDef);
			} else if (prod instanceof Repetition) {
				var newDef = prod.definition.concat([new Repetition({ definition: prod.definition })]);
				result = getAlternativesForProd(newDef);
			} else if (prod instanceof Alternation) {
				forEach(prod.definition, function(currAlt) {
					result = getAlternativesForProd(currAlt.definition);
				});
				return result;
			} else if (prod instanceof Terminal) currPath.push(prod.terminalType);
			else throw Error("non exhaustive match");
			i++;
		}
		result.push({
			partialPath: currPath,
			suffixDef: drop(targetDef, i)
		});
		return result;
	}
	function nextPossibleTokensAfter(initialDef, tokenVector, tokMatcher, maxLookAhead) {
		var EXIT_NON_TERMINAL = "EXIT_NONE_TERMINAL";
		var EXIT_NON_TERMINAL_ARR = [EXIT_NON_TERMINAL];
		var EXIT_ALTERNATIVE = "EXIT_ALTERNATIVE";
		var foundCompletePath = false;
		var tokenVectorLength = tokenVector.length;
		var minimalAlternativesIndex = tokenVectorLength - maxLookAhead - 1;
		var result = [];
		var possiblePaths = [];
		possiblePaths.push({
			idx: -1,
			def: initialDef,
			ruleStack: [],
			occurrenceStack: []
		});
		while (!isEmpty(possiblePaths)) {
			var currPath = possiblePaths.pop();
			if (currPath === EXIT_ALTERNATIVE) {
				if (foundCompletePath && last(possiblePaths).idx <= minimalAlternativesIndex) possiblePaths.pop();
				continue;
			}
			var currDef = currPath.def;
			var currIdx = currPath.idx;
			var currRuleStack = currPath.ruleStack;
			var currOccurrenceStack = currPath.occurrenceStack;
			if (isEmpty(currDef)) continue;
			var prod = currDef[0];
			/* istanbul ignore else */
			if (prod === EXIT_NON_TERMINAL) {
				var nextPath = {
					idx: currIdx,
					def: drop(currDef),
					ruleStack: dropRight(currRuleStack),
					occurrenceStack: dropRight(currOccurrenceStack)
				};
				possiblePaths.push(nextPath);
			} else if (prod instanceof Terminal)
 /* istanbul ignore else */
			if (currIdx < tokenVectorLength - 1) {
				var nextIdx = currIdx + 1;
				var actualToken = tokenVector[nextIdx];
				if (tokMatcher(actualToken, prod.terminalType)) {
					var nextPath = {
						idx: nextIdx,
						def: drop(currDef),
						ruleStack: currRuleStack,
						occurrenceStack: currOccurrenceStack
					};
					possiblePaths.push(nextPath);
				}
			} else if (currIdx === tokenVectorLength - 1) {
				result.push({
					nextTokenType: prod.terminalType,
					nextTokenOccurrence: prod.idx,
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				});
				foundCompletePath = true;
			} else throw Error("non exhaustive match");
			else if (prod instanceof NonTerminal) {
				var newRuleStack = cloneArr(currRuleStack);
				newRuleStack.push(prod.nonTerminalName);
				var newOccurrenceStack = cloneArr(currOccurrenceStack);
				newOccurrenceStack.push(prod.idx);
				var nextPath = {
					idx: currIdx,
					def: prod.definition.concat(EXIT_NON_TERMINAL_ARR, drop(currDef)),
					ruleStack: newRuleStack,
					occurrenceStack: newOccurrenceStack
				};
				possiblePaths.push(nextPath);
			} else if (prod instanceof Option) {
				var nextPathWithout = {
					idx: currIdx,
					def: drop(currDef),
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPathWithout);
				possiblePaths.push(EXIT_ALTERNATIVE);
				var nextPathWith = {
					idx: currIdx,
					def: prod.definition.concat(drop(currDef)),
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPathWith);
			} else if (prod instanceof RepetitionMandatory) {
				var secondIteration = new Repetition({
					definition: prod.definition,
					idx: prod.idx
				});
				var nextDef = prod.definition.concat([secondIteration], drop(currDef));
				var nextPath = {
					idx: currIdx,
					def: nextDef,
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPath);
			} else if (prod instanceof RepetitionMandatoryWithSeparator) {
				var separatorGast = new Terminal({ terminalType: prod.separator });
				var secondIteration = new Repetition({
					definition: [separatorGast].concat(prod.definition),
					idx: prod.idx
				});
				var nextDef = prod.definition.concat([secondIteration], drop(currDef));
				var nextPath = {
					idx: currIdx,
					def: nextDef,
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPath);
			} else if (prod instanceof RepetitionWithSeparator) {
				var nextPathWithout = {
					idx: currIdx,
					def: drop(currDef),
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPathWithout);
				possiblePaths.push(EXIT_ALTERNATIVE);
				var separatorGast = new Terminal({ terminalType: prod.separator });
				var nthRepetition = new Repetition({
					definition: [separatorGast].concat(prod.definition),
					idx: prod.idx
				});
				var nextDef = prod.definition.concat([nthRepetition], drop(currDef));
				var nextPathWith = {
					idx: currIdx,
					def: nextDef,
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPathWith);
			} else if (prod instanceof Repetition) {
				var nextPathWithout = {
					idx: currIdx,
					def: drop(currDef),
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPathWithout);
				possiblePaths.push(EXIT_ALTERNATIVE);
				var nthRepetition = new Repetition({
					definition: prod.definition,
					idx: prod.idx
				});
				var nextDef = prod.definition.concat([nthRepetition], drop(currDef));
				var nextPathWith = {
					idx: currIdx,
					def: nextDef,
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(nextPathWith);
			} else if (prod instanceof Alternation) for (var i = prod.definition.length - 1; i >= 0; i--) {
				var currAltPath = {
					idx: currIdx,
					def: prod.definition[i].definition.concat(drop(currDef)),
					ruleStack: currRuleStack,
					occurrenceStack: currOccurrenceStack
				};
				possiblePaths.push(currAltPath);
				possiblePaths.push(EXIT_ALTERNATIVE);
			}
			else if (prod instanceof Flat) possiblePaths.push({
				idx: currIdx,
				def: prod.definition.concat(drop(currDef)),
				ruleStack: currRuleStack,
				occurrenceStack: currOccurrenceStack
			});
			else if (prod instanceof Rule$2) possiblePaths.push(expandTopLevelRule(prod, currIdx, currRuleStack, currOccurrenceStack));
			else throw Error("non exhaustive match");
		}
		return result;
	}
	function expandTopLevelRule(topRule, currIdx, currRuleStack, currOccurrenceStack) {
		var newRuleStack = cloneArr(currRuleStack);
		newRuleStack.push(topRule.name);
		var newCurrOccurrenceStack = cloneArr(currOccurrenceStack);
		newCurrOccurrenceStack.push(1);
		return {
			idx: currIdx,
			def: topRule.definition,
			ruleStack: newRuleStack,
			occurrenceStack: newCurrOccurrenceStack
		};
	}
	var __extends$4, AbstractNextPossibleTokensWalker, NextAfterTokenWalker, AbstractNextTerminalAfterProductionWalker, NextTerminalAfterManyWalker, NextTerminalAfterManySepWalker, NextTerminalAfterAtLeastOneWalker, NextTerminalAfterAtLeastOneSepWalker;
	var init_interpreter = __esmMin((() => {
		init_rest();
		init_utils();
		init_first();
		init_gast_public();
		__extends$4 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		AbstractNextPossibleTokensWalker = function(_super) {
			__extends$4(AbstractNextPossibleTokensWalker, _super);
			function AbstractNextPossibleTokensWalker(topProd, path) {
				var _this = _super.call(this) || this;
				_this.topProd = topProd;
				_this.path = path;
				_this.possibleTokTypes = [];
				_this.nextProductionName = "";
				_this.nextProductionOccurrence = 0;
				_this.found = false;
				_this.isAtEndOfPath = false;
				return _this;
			}
			AbstractNextPossibleTokensWalker.prototype.startWalking = function() {
				this.found = false;
				if (this.path.ruleStack[0] !== this.topProd.name) throw Error("The path does not start with the walker's top Rule!");
				this.ruleStack = cloneArr(this.path.ruleStack).reverse();
				this.occurrenceStack = cloneArr(this.path.occurrenceStack).reverse();
				this.ruleStack.pop();
				this.occurrenceStack.pop();
				this.updateExpectedNext();
				this.walk(this.topProd);
				return this.possibleTokTypes;
			};
			AbstractNextPossibleTokensWalker.prototype.walk = function(prod, prevRest) {
				if (prevRest === void 0) prevRest = [];
				if (!this.found) _super.prototype.walk.call(this, prod, prevRest);
			};
			AbstractNextPossibleTokensWalker.prototype.walkProdRef = function(refProd, currRest, prevRest) {
				if (refProd.referencedRule.name === this.nextProductionName && refProd.idx === this.nextProductionOccurrence) {
					var fullRest = currRest.concat(prevRest);
					this.updateExpectedNext();
					this.walk(refProd.referencedRule, fullRest);
				}
			};
			AbstractNextPossibleTokensWalker.prototype.updateExpectedNext = function() {
				if (isEmpty(this.ruleStack)) {
					this.nextProductionName = "";
					this.nextProductionOccurrence = 0;
					this.isAtEndOfPath = true;
				} else {
					this.nextProductionName = this.ruleStack.pop();
					this.nextProductionOccurrence = this.occurrenceStack.pop();
				}
			};
			return AbstractNextPossibleTokensWalker;
		}(RestWalker);
		NextAfterTokenWalker = function(_super) {
			__extends$4(NextAfterTokenWalker, _super);
			function NextAfterTokenWalker(topProd, path) {
				var _this = _super.call(this, topProd, path) || this;
				_this.path = path;
				_this.nextTerminalName = "";
				_this.nextTerminalOccurrence = 0;
				_this.nextTerminalName = _this.path.lastTok.name;
				_this.nextTerminalOccurrence = _this.path.lastTokOccurrence;
				return _this;
			}
			NextAfterTokenWalker.prototype.walkTerminal = function(terminal, currRest, prevRest) {
				if (this.isAtEndOfPath && terminal.terminalType.name === this.nextTerminalName && terminal.idx === this.nextTerminalOccurrence && !this.found) {
					this.possibleTokTypes = first(new Flat({ definition: currRest.concat(prevRest) }));
					this.found = true;
				}
			};
			return NextAfterTokenWalker;
		}(AbstractNextPossibleTokensWalker);
		AbstractNextTerminalAfterProductionWalker = function(_super) {
			__extends$4(AbstractNextTerminalAfterProductionWalker, _super);
			function AbstractNextTerminalAfterProductionWalker(topRule, occurrence) {
				var _this = _super.call(this) || this;
				_this.topRule = topRule;
				_this.occurrence = occurrence;
				_this.result = {
					token: void 0,
					occurrence: void 0,
					isEndOfRule: void 0
				};
				return _this;
			}
			AbstractNextTerminalAfterProductionWalker.prototype.startWalking = function() {
				this.walk(this.topRule);
				return this.result;
			};
			return AbstractNextTerminalAfterProductionWalker;
		}(RestWalker);
		NextTerminalAfterManyWalker = function(_super) {
			__extends$4(NextTerminalAfterManyWalker, _super);
			function NextTerminalAfterManyWalker() {
				return _super !== null && _super.apply(this, arguments) || this;
			}
			NextTerminalAfterManyWalker.prototype.walkMany = function(manyProd, currRest, prevRest) {
				if (manyProd.idx === this.occurrence) {
					var firstAfterMany = first$1(currRest.concat(prevRest));
					this.result.isEndOfRule = firstAfterMany === void 0;
					if (firstAfterMany instanceof Terminal) {
						this.result.token = firstAfterMany.terminalType;
						this.result.occurrence = firstAfterMany.idx;
					}
				} else _super.prototype.walkMany.call(this, manyProd, currRest, prevRest);
			};
			return NextTerminalAfterManyWalker;
		}(AbstractNextTerminalAfterProductionWalker);
		NextTerminalAfterManySepWalker = function(_super) {
			__extends$4(NextTerminalAfterManySepWalker, _super);
			function NextTerminalAfterManySepWalker() {
				return _super !== null && _super.apply(this, arguments) || this;
			}
			NextTerminalAfterManySepWalker.prototype.walkManySep = function(manySepProd, currRest, prevRest) {
				if (manySepProd.idx === this.occurrence) {
					var firstAfterManySep = first$1(currRest.concat(prevRest));
					this.result.isEndOfRule = firstAfterManySep === void 0;
					if (firstAfterManySep instanceof Terminal) {
						this.result.token = firstAfterManySep.terminalType;
						this.result.occurrence = firstAfterManySep.idx;
					}
				} else _super.prototype.walkManySep.call(this, manySepProd, currRest, prevRest);
			};
			return NextTerminalAfterManySepWalker;
		}(AbstractNextTerminalAfterProductionWalker);
		NextTerminalAfterAtLeastOneWalker = function(_super) {
			__extends$4(NextTerminalAfterAtLeastOneWalker, _super);
			function NextTerminalAfterAtLeastOneWalker() {
				return _super !== null && _super.apply(this, arguments) || this;
			}
			NextTerminalAfterAtLeastOneWalker.prototype.walkAtLeastOne = function(atLeastOneProd, currRest, prevRest) {
				if (atLeastOneProd.idx === this.occurrence) {
					var firstAfterAtLeastOne = first$1(currRest.concat(prevRest));
					this.result.isEndOfRule = firstAfterAtLeastOne === void 0;
					if (firstAfterAtLeastOne instanceof Terminal) {
						this.result.token = firstAfterAtLeastOne.terminalType;
						this.result.occurrence = firstAfterAtLeastOne.idx;
					}
				} else _super.prototype.walkAtLeastOne.call(this, atLeastOneProd, currRest, prevRest);
			};
			return NextTerminalAfterAtLeastOneWalker;
		}(AbstractNextTerminalAfterProductionWalker);
		NextTerminalAfterAtLeastOneSepWalker = function(_super) {
			__extends$4(NextTerminalAfterAtLeastOneSepWalker, _super);
			function NextTerminalAfterAtLeastOneSepWalker() {
				return _super !== null && _super.apply(this, arguments) || this;
			}
			NextTerminalAfterAtLeastOneSepWalker.prototype.walkAtLeastOneSep = function(atleastOneSepProd, currRest, prevRest) {
				if (atleastOneSepProd.idx === this.occurrence) {
					var firstAfterfirstAfterAtLeastOneSep = first$1(currRest.concat(prevRest));
					this.result.isEndOfRule = firstAfterfirstAfterAtLeastOneSep === void 0;
					if (firstAfterfirstAfterAtLeastOneSep instanceof Terminal) {
						this.result.token = firstAfterfirstAfterAtLeastOneSep.terminalType;
						this.result.occurrence = firstAfterfirstAfterAtLeastOneSep.idx;
					}
				} else _super.prototype.walkAtLeastOneSep.call(this, atleastOneSepProd, currRest, prevRest);
			};
			return NextTerminalAfterAtLeastOneSepWalker;
		}(AbstractNextTerminalAfterProductionWalker);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/lookahead.js
	function getProdType(prod) {
		/* istanbul ignore else */
		if (prod instanceof Option) return PROD_TYPE.OPTION;
		else if (prod instanceof Repetition) return PROD_TYPE.REPETITION;
		else if (prod instanceof RepetitionMandatory) return PROD_TYPE.REPETITION_MANDATORY;
		else if (prod instanceof RepetitionMandatoryWithSeparator) return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR;
		else if (prod instanceof RepetitionWithSeparator) return PROD_TYPE.REPETITION_WITH_SEPARATOR;
		else if (prod instanceof Alternation) return PROD_TYPE.ALTERNATION;
		else throw Error("non exhaustive match");
	}
	function buildLookaheadFuncForOr(occurrence, ruleGrammar, maxLookahead, hasPredicates, dynamicTokensEnabled, laFuncBuilder) {
		var lookAheadPaths = getLookaheadPathsForOr(occurrence, ruleGrammar, maxLookahead);
		return laFuncBuilder(lookAheadPaths, hasPredicates, areTokenCategoriesNotUsed(lookAheadPaths) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, dynamicTokensEnabled);
	}
	/**
	*  When dealing with an Optional production (OPTION/MANY/2nd iteration of AT_LEAST_ONE/...) we need to compare
	*  the lookahead "inside" the production and the lookahead immediately "after" it in the same top level rule (context free).
	*
	*  Example: given a production:
	*  ABC(DE)?DF
	*
	*  The optional '(DE)?' should only be entered if we see 'DE'. a single Token 'D' is not sufficient to distinguish between the two
	*  alternatives.
	*
	*  @returns A Lookahead function which will return true IFF the parser should parse the Optional production.
	*/
	function buildLookaheadFuncForOptionalProd(occurrence, ruleGrammar, k, dynamicTokensEnabled, prodType, lookaheadBuilder) {
		var lookAheadPaths = getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, k);
		var tokenMatcher = areTokenCategoriesNotUsed(lookAheadPaths) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
		return lookaheadBuilder(lookAheadPaths[0], tokenMatcher, dynamicTokensEnabled);
	}
	function buildAlternativesLookAheadFunc(alts, hasPredicates, tokenMatcher, dynamicTokensEnabled) {
		var numOfAlts = alts.length;
		var areAllOneTokenLookahead = every(alts, function(currAlt) {
			return every(currAlt, function(currPath) {
				return currPath.length === 1;
			});
		});
		if (hasPredicates)
 /**
		* @returns {number} - The chosen alternative index
		*/
		return function(orAlts) {
			var predicates = map(orAlts, function(currAlt) {
				return currAlt.GATE;
			});
			for (var t = 0; t < numOfAlts; t++) {
				var currAlt = alts[t];
				var currNumOfPaths = currAlt.length;
				var currPredicate = predicates[t];
				if (currPredicate !== void 0 && currPredicate.call(this) === false) continue;
				nextPath: for (var j = 0; j < currNumOfPaths; j++) {
					var currPath = currAlt[j];
					var currPathLength = currPath.length;
					for (var i = 0; i < currPathLength; i++) if (tokenMatcher(this.LA(i + 1), currPath[i]) === false) continue nextPath;
					return t;
				}
			}
		};
		else if (areAllOneTokenLookahead && !dynamicTokensEnabled) {
			var choiceToAlt_1 = reduce(map(alts, function(currAlt) {
				return flatten(currAlt);
			}), function(result, currAlt, idx) {
				forEach(currAlt, function(currTokType) {
					if (!has(result, currTokType.tokenTypeIdx)) result[currTokType.tokenTypeIdx] = idx;
					forEach(currTokType.categoryMatches, function(currExtendingType) {
						if (!has(result, currExtendingType)) result[currExtendingType] = idx;
					});
				});
				return result;
			}, []);
			/**
			* @returns {number} - The chosen alternative index
			*/
			return function() {
				return choiceToAlt_1[this.LA(1).tokenTypeIdx];
			};
		} else
 /**
		* @returns {number} - The chosen alternative index
		*/
		return function() {
			for (var t = 0; t < numOfAlts; t++) {
				var currAlt = alts[t];
				var currNumOfPaths = currAlt.length;
				nextPath: for (var j = 0; j < currNumOfPaths; j++) {
					var currPath = currAlt[j];
					var currPathLength = currPath.length;
					for (var i = 0; i < currPathLength; i++) if (tokenMatcher(this.LA(i + 1), currPath[i]) === false) continue nextPath;
					return t;
				}
			}
		};
	}
	function buildSingleAlternativeLookaheadFunction(alt, tokenMatcher, dynamicTokensEnabled) {
		var areAllOneTokenLookahead = every(alt, function(currPath) {
			return currPath.length === 1;
		});
		var numOfPaths = alt.length;
		if (areAllOneTokenLookahead && !dynamicTokensEnabled) {
			var singleTokensTypes = flatten(alt);
			if (singleTokensTypes.length === 1 && isEmpty(singleTokensTypes[0].categoryMatches)) {
				var expectedTokenUniqueKey_1 = singleTokensTypes[0].tokenTypeIdx;
				return function() {
					return this.LA(1).tokenTypeIdx === expectedTokenUniqueKey_1;
				};
			} else {
				var choiceToAlt_2 = reduce(singleTokensTypes, function(result, currTokType, idx) {
					result[currTokType.tokenTypeIdx] = true;
					forEach(currTokType.categoryMatches, function(currExtendingType) {
						result[currExtendingType] = true;
					});
					return result;
				}, []);
				return function() {
					return choiceToAlt_2[this.LA(1).tokenTypeIdx] === true;
				};
			}
		} else return function() {
			nextPath: for (var j = 0; j < numOfPaths; j++) {
				var currPath = alt[j];
				var currPathLength = currPath.length;
				for (var i = 0; i < currPathLength; i++) if (tokenMatcher(this.LA(i + 1), currPath[i]) === false) continue nextPath;
				return true;
			}
			return false;
		};
	}
	function initializeArrayOfArrays(size) {
		var result = new Array(size);
		for (var i = 0; i < size; i++) result[i] = [];
		return result;
	}
	/**
	* A sort of hash function between a Path in the grammar and a string.
	* Note that this returns multiple "hashes" to support the scenario of token categories.
	* -  A single path with categories may match multiple **actual** paths.
	*/
	function pathToHashKeys(path) {
		var keys = [""];
		for (var i = 0; i < path.length; i++) {
			var tokType = path[i];
			var longerKeys = [];
			for (var j = 0; j < keys.length; j++) {
				var currShorterKey = keys[j];
				longerKeys.push(currShorterKey + "_" + tokType.tokenTypeIdx);
				for (var t = 0; t < tokType.categoryMatches.length; t++) {
					var categoriesKeySuffix = "_" + tokType.categoryMatches[t];
					longerKeys.push(currShorterKey + categoriesKeySuffix);
				}
			}
			keys = longerKeys;
		}
		return keys;
	}
	/**
	* Imperative style due to being called from a hot spot
	*/
	function isUniquePrefixHash(altKnownPathsKeys, searchPathKeys, idx) {
		for (var currAltIdx = 0; currAltIdx < altKnownPathsKeys.length; currAltIdx++) {
			if (currAltIdx === idx) continue;
			var otherAltKnownPathsKeys = altKnownPathsKeys[currAltIdx];
			for (var searchIdx = 0; searchIdx < searchPathKeys.length; searchIdx++) if (otherAltKnownPathsKeys[searchPathKeys[searchIdx]] === true) return false;
		}
		return true;
	}
	function lookAheadSequenceFromAlternatives(altsDefs, k) {
		var partialAlts = map(altsDefs, function(currAlt) {
			return possiblePathsFrom([currAlt], 1);
		});
		var finalResult = initializeArrayOfArrays(partialAlts.length);
		var altsHashes = map(partialAlts, function(currAltPaths) {
			var dict = {};
			forEach(currAltPaths, function(item) {
				forEach(pathToHashKeys(item.partialPath), function(currKey) {
					dict[currKey] = true;
				});
			});
			return dict;
		});
		var newData = partialAlts;
		for (var pathLength = 1; pathLength <= k; pathLength++) {
			var currDataset = newData;
			newData = initializeArrayOfArrays(currDataset.length);
			var _loop_1 = function(altIdx) {
				var currAltPathsAndSuffixes = currDataset[altIdx];
				for (var currPathIdx = 0; currPathIdx < currAltPathsAndSuffixes.length; currPathIdx++) {
					var currPathPrefix = currAltPathsAndSuffixes[currPathIdx].partialPath;
					var suffixDef = currAltPathsAndSuffixes[currPathIdx].suffixDef;
					var prefixKeys = pathToHashKeys(currPathPrefix);
					if (isUniquePrefixHash(altsHashes, prefixKeys, altIdx) || isEmpty(suffixDef) || currPathPrefix.length === k) {
						var currAltResult = finalResult[altIdx];
						if (containsPath(currAltResult, currPathPrefix) === false) {
							currAltResult.push(currPathPrefix);
							for (var j = 0; j < prefixKeys.length; j++) {
								var currKey = prefixKeys[j];
								altsHashes[altIdx][currKey] = true;
							}
						}
					} else {
						var newPartialPathsAndSuffixes = possiblePathsFrom(suffixDef, pathLength + 1, currPathPrefix);
						newData[altIdx] = newData[altIdx].concat(newPartialPathsAndSuffixes);
						forEach(newPartialPathsAndSuffixes, function(item) {
							forEach(pathToHashKeys(item.partialPath), function(key) {
								altsHashes[altIdx][key] = true;
							});
						});
					}
				}
			};
			for (var altIdx = 0; altIdx < currDataset.length; altIdx++) _loop_1(altIdx);
		}
		return finalResult;
	}
	function getLookaheadPathsForOr(occurrence, ruleGrammar, k, orProd) {
		var visitor = new InsideDefinitionFinderVisitor(occurrence, PROD_TYPE.ALTERNATION, orProd);
		ruleGrammar.accept(visitor);
		return lookAheadSequenceFromAlternatives(visitor.result, k);
	}
	function getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, k) {
		var insideDefVisitor = new InsideDefinitionFinderVisitor(occurrence, prodType);
		ruleGrammar.accept(insideDefVisitor);
		var insideDef = insideDefVisitor.result;
		var afterDef = new RestDefinitionFinderWalker(ruleGrammar, occurrence, prodType).startWalking();
		return lookAheadSequenceFromAlternatives([new Flat({ definition: insideDef }), new Flat({ definition: afterDef })], k);
	}
	function containsPath(alternative, searchPath) {
		compareOtherPath: for (var i = 0; i < alternative.length; i++) {
			var otherPath = alternative[i];
			if (otherPath.length !== searchPath.length) continue;
			for (var j = 0; j < otherPath.length; j++) {
				var searchTok = searchPath[j];
				var otherTok = otherPath[j];
				if ((searchTok === otherTok || otherTok.categoryMatchesMap[searchTok.tokenTypeIdx] !== void 0) === false) continue compareOtherPath;
			}
			return true;
		}
		return false;
	}
	function isStrictPrefixOfPath(prefix, other) {
		return prefix.length < other.length && every(prefix, function(tokType, idx) {
			var otherTokType = other[idx];
			return tokType === otherTokType || otherTokType.categoryMatchesMap[tokType.tokenTypeIdx];
		});
	}
	function areTokenCategoriesNotUsed(lookAheadPaths) {
		return every(lookAheadPaths, function(singleAltPaths) {
			return every(singleAltPaths, function(singlePath) {
				return every(singlePath, function(token) {
					return isEmpty(token.categoryMatches);
				});
			});
		});
	}
	var __extends$3, PROD_TYPE, RestDefinitionFinderWalker, InsideDefinitionFinderVisitor;
	var init_lookahead = __esmMin((() => {
		init_utils();
		init_interpreter();
		init_rest();
		init_tokens();
		init_gast_public();
		init_gast_visitor_public();
		__extends$3 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		(function(PROD_TYPE) {
			PROD_TYPE[PROD_TYPE["OPTION"] = 0] = "OPTION";
			PROD_TYPE[PROD_TYPE["REPETITION"] = 1] = "REPETITION";
			PROD_TYPE[PROD_TYPE["REPETITION_MANDATORY"] = 2] = "REPETITION_MANDATORY";
			PROD_TYPE[PROD_TYPE["REPETITION_MANDATORY_WITH_SEPARATOR"] = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR";
			PROD_TYPE[PROD_TYPE["REPETITION_WITH_SEPARATOR"] = 4] = "REPETITION_WITH_SEPARATOR";
			PROD_TYPE[PROD_TYPE["ALTERNATION"] = 5] = "ALTERNATION";
		})(PROD_TYPE || (PROD_TYPE = {}));
		RestDefinitionFinderWalker = function(_super) {
			__extends$3(RestDefinitionFinderWalker, _super);
			function RestDefinitionFinderWalker(topProd, targetOccurrence, targetProdType) {
				var _this = _super.call(this) || this;
				_this.topProd = topProd;
				_this.targetOccurrence = targetOccurrence;
				_this.targetProdType = targetProdType;
				return _this;
			}
			RestDefinitionFinderWalker.prototype.startWalking = function() {
				this.walk(this.topProd);
				return this.restDef;
			};
			RestDefinitionFinderWalker.prototype.checkIsTarget = function(node, expectedProdType, currRest, prevRest) {
				if (node.idx === this.targetOccurrence && this.targetProdType === expectedProdType) {
					this.restDef = currRest.concat(prevRest);
					return true;
				}
				return false;
			};
			RestDefinitionFinderWalker.prototype.walkOption = function(optionProd, currRest, prevRest) {
				if (!this.checkIsTarget(optionProd, PROD_TYPE.OPTION, currRest, prevRest)) _super.prototype.walkOption.call(this, optionProd, currRest, prevRest);
			};
			RestDefinitionFinderWalker.prototype.walkAtLeastOne = function(atLeastOneProd, currRest, prevRest) {
				if (!this.checkIsTarget(atLeastOneProd, PROD_TYPE.REPETITION_MANDATORY, currRest, prevRest)) _super.prototype.walkOption.call(this, atLeastOneProd, currRest, prevRest);
			};
			RestDefinitionFinderWalker.prototype.walkAtLeastOneSep = function(atLeastOneSepProd, currRest, prevRest) {
				if (!this.checkIsTarget(atLeastOneSepProd, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, currRest, prevRest)) _super.prototype.walkOption.call(this, atLeastOneSepProd, currRest, prevRest);
			};
			RestDefinitionFinderWalker.prototype.walkMany = function(manyProd, currRest, prevRest) {
				if (!this.checkIsTarget(manyProd, PROD_TYPE.REPETITION, currRest, prevRest)) _super.prototype.walkOption.call(this, manyProd, currRest, prevRest);
			};
			RestDefinitionFinderWalker.prototype.walkManySep = function(manySepProd, currRest, prevRest) {
				if (!this.checkIsTarget(manySepProd, PROD_TYPE.REPETITION_WITH_SEPARATOR, currRest, prevRest)) _super.prototype.walkOption.call(this, manySepProd, currRest, prevRest);
			};
			return RestDefinitionFinderWalker;
		}(RestWalker);
		InsideDefinitionFinderVisitor = function(_super) {
			__extends$3(InsideDefinitionFinderVisitor, _super);
			function InsideDefinitionFinderVisitor(targetOccurrence, targetProdType, targetRef) {
				var _this = _super.call(this) || this;
				_this.targetOccurrence = targetOccurrence;
				_this.targetProdType = targetProdType;
				_this.targetRef = targetRef;
				_this.result = [];
				return _this;
			}
			InsideDefinitionFinderVisitor.prototype.checkIsTarget = function(node, expectedProdName) {
				if (node.idx === this.targetOccurrence && this.targetProdType === expectedProdName && (this.targetRef === void 0 || node === this.targetRef)) this.result = node.definition;
			};
			InsideDefinitionFinderVisitor.prototype.visitOption = function(node) {
				this.checkIsTarget(node, PROD_TYPE.OPTION);
			};
			InsideDefinitionFinderVisitor.prototype.visitRepetition = function(node) {
				this.checkIsTarget(node, PROD_TYPE.REPETITION);
			};
			InsideDefinitionFinderVisitor.prototype.visitRepetitionMandatory = function(node) {
				this.checkIsTarget(node, PROD_TYPE.REPETITION_MANDATORY);
			};
			InsideDefinitionFinderVisitor.prototype.visitRepetitionMandatoryWithSeparator = function(node) {
				this.checkIsTarget(node, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR);
			};
			InsideDefinitionFinderVisitor.prototype.visitRepetitionWithSeparator = function(node) {
				this.checkIsTarget(node, PROD_TYPE.REPETITION_WITH_SEPARATOR);
			};
			InsideDefinitionFinderVisitor.prototype.visitAlternation = function(node) {
				this.checkIsTarget(node, PROD_TYPE.ALTERNATION);
			};
			return InsideDefinitionFinderVisitor;
		}(GAstVisitor);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/checks.js
	function validateGrammar$1(topLevels, globalMaxLookahead, tokenTypes, ignoredIssues, errMsgProvider, grammarName) {
		var duplicateErrors = map(topLevels, function(currTopLevel) {
			return validateDuplicateProductions(currTopLevel, errMsgProvider);
		});
		var leftRecursionErrors = map(topLevels, function(currTopRule) {
			return validateNoLeftRecursion(currTopRule, currTopRule, errMsgProvider);
		});
		var emptyAltErrors = [];
		var ambiguousAltsErrors = [];
		var emptyRepetitionErrors = [];
		if (every(leftRecursionErrors, isEmpty)) {
			emptyAltErrors = map(topLevels, function(currTopRule) {
				return validateEmptyOrAlternative(currTopRule, errMsgProvider);
			});
			ambiguousAltsErrors = map(topLevels, function(currTopRule) {
				return validateAmbiguousAlternationAlternatives(currTopRule, globalMaxLookahead, ignoredIssues, errMsgProvider);
			});
			emptyRepetitionErrors = validateSomeNonEmptyLookaheadPath(topLevels, globalMaxLookahead, errMsgProvider);
		}
		var termsNamespaceConflictErrors = checkTerminalAndNoneTerminalsNameSpace(topLevels, tokenTypes, errMsgProvider);
		var tokenNameErrors = map(tokenTypes, function(currTokType) {
			return validateTokenName(currTokType, errMsgProvider);
		});
		var nestedRulesNameErrors = validateNestedRulesNames(topLevels, errMsgProvider);
		var nestedRulesDuplicateErrors = validateDuplicateNestedRules(topLevels, errMsgProvider);
		var tooManyAltsErrors = map(topLevels, function(curRule) {
			return validateTooManyAlts(curRule, errMsgProvider);
		});
		var ruleNameErrors = map(topLevels, function(curRule) {
			return validateRuleName(curRule, errMsgProvider);
		});
		var duplicateRulesError = map(topLevels, function(curRule) {
			return validateRuleDoesNotAlreadyExist(curRule, topLevels, grammarName, errMsgProvider);
		});
		return flatten(duplicateErrors.concat(tokenNameErrors, nestedRulesNameErrors, nestedRulesDuplicateErrors, emptyRepetitionErrors, leftRecursionErrors, emptyAltErrors, ambiguousAltsErrors, termsNamespaceConflictErrors, tooManyAltsErrors, ruleNameErrors, duplicateRulesError));
	}
	function validateNestedRulesNames(topLevels, errMsgProvider) {
		var result = [];
		forEach(topLevels, function(curTopLevel) {
			var namedCollectorVisitor = new NamedDSLMethodsCollectorVisitor("");
			curTopLevel.accept(namedCollectorVisitor);
			var nestedProds = map(namedCollectorVisitor.result, function(currItem) {
				return currItem.orgProd;
			});
			result.push(map(nestedProds, function(currNestedProd) {
				return validateNestedRuleName(curTopLevel, currNestedProd, errMsgProvider);
			}));
		});
		return flatten(result);
	}
	function validateDuplicateProductions(topLevelRule, errMsgProvider) {
		var collectorVisitor = new OccurrenceValidationCollector();
		topLevelRule.accept(collectorVisitor);
		var allRuleProductions = collectorVisitor.allProductions;
		return map(values(pick(groupBy(allRuleProductions, identifyProductionForDuplicates), function(currGroup) {
			return currGroup.length > 1;
		})), function(currDuplicates) {
			var firstProd = first$1(currDuplicates);
			var msg = errMsgProvider.buildDuplicateFoundError(topLevelRule, currDuplicates);
			var dslName = getProductionDslName(firstProd);
			var defError = {
				message: msg,
				type: ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,
				ruleName: topLevelRule.name,
				dslName,
				occurrence: firstProd.idx
			};
			var param = getExtraProductionArgument(firstProd);
			if (param) defError.parameter = param;
			return defError;
		});
	}
	function identifyProductionForDuplicates(prod) {
		return getProductionDslName(prod) + "_#_" + prod.idx + "_#_" + getExtraProductionArgument(prod);
	}
	function getExtraProductionArgument(prod) {
		if (prod instanceof Terminal) return prod.terminalType.name;
		else if (prod instanceof NonTerminal) return prod.nonTerminalName;
		else return "";
	}
	function validateRuleName(rule, errMsgProvider) {
		var errors = [];
		var ruleName = rule.name;
		if (!ruleName.match(validTermsPattern)) errors.push({
			message: errMsgProvider.buildInvalidRuleNameError({
				topLevelRule: rule,
				expectedPattern: validTermsPattern
			}),
			type: ParserDefinitionErrorType.INVALID_RULE_NAME,
			ruleName
		});
		return errors;
	}
	function validateNestedRuleName(topLevel, nestedProd, errMsgProvider) {
		var errors = [];
		var errMsg;
		if (!nestedProd.name.match(validNestedRuleName)) {
			errMsg = errMsgProvider.buildInvalidNestedRuleNameError(topLevel, nestedProd);
			errors.push({
				message: errMsg,
				type: ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,
				ruleName: topLevel.name
			});
		}
		return errors;
	}
	function validateTokenName(tokenType, errMsgProvider) {
		var errors = [];
		if (!tokenType.name.match(validTermsPattern)) errors.push({
			message: errMsgProvider.buildTokenNameError({
				tokenType,
				expectedPattern: validTermsPattern
			}),
			type: ParserDefinitionErrorType.INVALID_TOKEN_NAME
		});
		return errors;
	}
	function validateRuleDoesNotAlreadyExist(rule, allRules, className, errMsgProvider) {
		var errors = [];
		if (reduce(allRules, function(result, curRule) {
			if (curRule.name === rule.name) return result + 1;
			return result;
		}, 0) > 1) {
			var errMsg = errMsgProvider.buildDuplicateRuleNameError({
				topLevelRule: rule,
				grammarName: className
			});
			errors.push({
				message: errMsg,
				type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME,
				ruleName: rule.name
			});
		}
		return errors;
	}
	function validateRuleIsOverridden(ruleName, definedRulesNames, className) {
		var errors = [];
		var errMsg;
		if (!contains(definedRulesNames, ruleName)) {
			errMsg = "Invalid rule override, rule: ->" + ruleName + "<- cannot be overridden in the grammar: ->" + className + "<-as it is not defined in any of the super grammars ";
			errors.push({
				message: errMsg,
				type: ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,
				ruleName
			});
		}
		return errors;
	}
	function validateNoLeftRecursion(topRule, currRule, errMsgProvider, path) {
		if (path === void 0) path = [];
		var errors = [];
		var nextNonTerminals = getFirstNoneTerminal(currRule.definition);
		if (isEmpty(nextNonTerminals)) return [];
		else {
			var ruleName = topRule.name;
			if (contains(nextNonTerminals, topRule)) errors.push({
				message: errMsgProvider.buildLeftRecursionError({
					topLevelRule: topRule,
					leftRecursionPath: path
				}),
				type: ParserDefinitionErrorType.LEFT_RECURSION,
				ruleName
			});
			var errorsFromNextSteps = map(difference(nextNonTerminals, path.concat([topRule])), function(currRefRule) {
				var newPath = cloneArr(path);
				newPath.push(currRefRule);
				return validateNoLeftRecursion(topRule, currRefRule, errMsgProvider, newPath);
			});
			return errors.concat(flatten(errorsFromNextSteps));
		}
	}
	function getFirstNoneTerminal(definition) {
		var result = [];
		if (isEmpty(definition)) return result;
		var firstProd = first$1(definition);
		/* istanbul ignore else */
		if (firstProd instanceof NonTerminal) result.push(firstProd.referencedRule);
		else if (firstProd instanceof Flat || firstProd instanceof Option || firstProd instanceof RepetitionMandatory || firstProd instanceof RepetitionMandatoryWithSeparator || firstProd instanceof RepetitionWithSeparator || firstProd instanceof Repetition) result = result.concat(getFirstNoneTerminal(firstProd.definition));
		else if (firstProd instanceof Alternation) result = flatten(map(firstProd.definition, function(currSubDef) {
			return getFirstNoneTerminal(currSubDef.definition);
		}));
		else if (firstProd instanceof Terminal) {} else throw Error("non exhaustive match");
		var isFirstOptional = isOptionalProd(firstProd);
		var hasMore = definition.length > 1;
		if (isFirstOptional && hasMore) {
			var rest = drop(definition);
			return result.concat(getFirstNoneTerminal(rest));
		} else return result;
	}
	function validateEmptyOrAlternative(topLevelRule, errMsgProvider) {
		var orCollector = new OrCollector();
		topLevelRule.accept(orCollector);
		var ors = orCollector.alternations;
		return reduce(ors, function(errors, currOr) {
			var currErrors = map(dropRight(currOr.definition), function(currAlternative, currAltIdx) {
				if (isEmpty(nextPossibleTokensAfter([currAlternative], [], null, 1))) return {
					message: errMsgProvider.buildEmptyAlternationError({
						topLevelRule,
						alternation: currOr,
						emptyChoiceIdx: currAltIdx
					}),
					type: ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,
					ruleName: topLevelRule.name,
					occurrence: currOr.idx,
					alternative: currAltIdx + 1
				};
				else return null;
			});
			return errors.concat(compact(currErrors));
		}, []);
	}
	function validateAmbiguousAlternationAlternatives(topLevelRule, globalMaxLookahead, ignoredIssues, errMsgProvider) {
		var orCollector = new OrCollector();
		topLevelRule.accept(orCollector);
		var ors = orCollector.alternations;
		var ignoredIssuesForCurrentRule = ignoredIssues[topLevelRule.name];
		if (ignoredIssuesForCurrentRule) ors = reject(ors, function(currOr) {
			return ignoredIssuesForCurrentRule[getProductionDslName(currOr) + (currOr.idx === 0 ? "" : currOr.idx)];
		});
		ors = reject(ors, function(currOr) {
			return currOr.ignoreAmbiguities === true;
		});
		return reduce(ors, function(result, currOr) {
			var currOccurrence = currOr.idx;
			var alternatives = getLookaheadPathsForOr(currOccurrence, topLevelRule, currOr.maxLookahead || globalMaxLookahead, currOr);
			var altsAmbiguityErrors = checkAlternativesAmbiguities(alternatives, currOr, topLevelRule, errMsgProvider);
			var altsPrefixAmbiguityErrors = checkPrefixAlternativesAmbiguities(alternatives, currOr, topLevelRule, errMsgProvider);
			return result.concat(altsAmbiguityErrors, altsPrefixAmbiguityErrors);
		}, []);
	}
	function validateTooManyAlts(topLevelRule, errMsgProvider) {
		var orCollector = new OrCollector();
		topLevelRule.accept(orCollector);
		var ors = orCollector.alternations;
		return reduce(ors, function(errors, currOr) {
			if (currOr.definition.length > 255) errors.push({
				message: errMsgProvider.buildTooManyAlternativesError({
					topLevelRule,
					alternation: currOr
				}),
				type: ParserDefinitionErrorType.TOO_MANY_ALTS,
				ruleName: topLevelRule.name,
				occurrence: currOr.idx
			});
			return errors;
		}, []);
	}
	function validateSomeNonEmptyLookaheadPath(topLevelRules, maxLookahead, errMsgProvider) {
		var errors = [];
		forEach(topLevelRules, function(currTopRule) {
			var collectorVisitor = new RepetionCollector();
			currTopRule.accept(collectorVisitor);
			var allRuleProductions = collectorVisitor.allProductions;
			forEach(allRuleProductions, function(currProd) {
				var prodType = getProdType(currProd);
				var actualMaxLookahead = currProd.maxLookahead || maxLookahead;
				var currOccurrence = currProd.idx;
				var pathsInsideProduction = getLookaheadPathsForOptionalProd(currOccurrence, currTopRule, prodType, actualMaxLookahead)[0];
				if (isEmpty(flatten(pathsInsideProduction))) {
					var errMsg = errMsgProvider.buildEmptyRepetitionError({
						topLevelRule: currTopRule,
						repetition: currProd
					});
					errors.push({
						message: errMsg,
						type: ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,
						ruleName: currTopRule.name
					});
				}
			});
		});
		return errors;
	}
	function checkAlternativesAmbiguities(alternatives, alternation, rule, errMsgProvider) {
		var foundAmbiguousPaths = [];
		return map(reduce(alternatives, function(result, currAlt, currAltIdx) {
			if (alternation.definition[currAltIdx].ignoreAmbiguities === true) return result;
			forEach(currAlt, function(currPath) {
				var altsCurrPathAppearsIn = [currAltIdx];
				forEach(alternatives, function(currOtherAlt, currOtherAltIdx) {
					if (currAltIdx !== currOtherAltIdx && containsPath(currOtherAlt, currPath) && alternation.definition[currOtherAltIdx].ignoreAmbiguities !== true) altsCurrPathAppearsIn.push(currOtherAltIdx);
				});
				if (altsCurrPathAppearsIn.length > 1 && !containsPath(foundAmbiguousPaths, currPath)) {
					foundAmbiguousPaths.push(currPath);
					result.push({
						alts: altsCurrPathAppearsIn,
						path: currPath
					});
				}
			});
			return result;
		}, []), function(currAmbDescriptor) {
			var ambgIndices = map(currAmbDescriptor.alts, function(currAltIdx) {
				return currAltIdx + 1;
			});
			return {
				message: errMsgProvider.buildAlternationAmbiguityError({
					topLevelRule: rule,
					alternation,
					ambiguityIndices: ambgIndices,
					prefixPath: currAmbDescriptor.path
				}),
				type: ParserDefinitionErrorType.AMBIGUOUS_ALTS,
				ruleName: rule.name,
				occurrence: alternation.idx,
				alternatives: [currAmbDescriptor.alts]
			};
		});
	}
	function checkPrefixAlternativesAmbiguities(alternatives, alternation, rule, errMsgProvider) {
		var errors = [];
		var pathsAndIndices = reduce(alternatives, function(result, currAlt, idx) {
			var currPathsAndIdx = map(currAlt, function(currPath) {
				return {
					idx,
					path: currPath
				};
			});
			return result.concat(currPathsAndIdx);
		}, []);
		forEach(pathsAndIndices, function(currPathAndIdx) {
			if (alternation.definition[currPathAndIdx.idx].ignoreAmbiguities === true) return;
			var targetIdx = currPathAndIdx.idx;
			var targetPath = currPathAndIdx.path;
			var currPathPrefixErrors = map(findAll(pathsAndIndices, function(searchPathAndIdx) {
				return alternation.definition[searchPathAndIdx.idx].ignoreAmbiguities !== true && searchPathAndIdx.idx < targetIdx && isStrictPrefixOfPath(searchPathAndIdx.path, targetPath);
			}), function(currAmbPathAndIdx) {
				var ambgIndices = [currAmbPathAndIdx.idx + 1, targetIdx + 1];
				var occurrence = alternation.idx === 0 ? "" : alternation.idx;
				return {
					message: errMsgProvider.buildAlternationPrefixAmbiguityError({
						topLevelRule: rule,
						alternation,
						ambiguityIndices: ambgIndices,
						prefixPath: currAmbPathAndIdx.path
					}),
					type: ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,
					ruleName: rule.name,
					occurrence,
					alternatives: ambgIndices
				};
			});
			errors = errors.concat(currPathPrefixErrors);
		});
		return errors;
	}
	function checkTerminalAndNoneTerminalsNameSpace(topLevels, tokenTypes, errMsgProvider) {
		var errors = [];
		var tokenNames = map(tokenTypes, function(currToken) {
			return currToken.name;
		});
		forEach(topLevels, function(currRule) {
			var currRuleName = currRule.name;
			if (contains(tokenNames, currRuleName)) {
				var errMsg = errMsgProvider.buildNamespaceConflictError(currRule);
				errors.push({
					message: errMsg,
					type: ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,
					ruleName: currRuleName
				});
			}
		});
		return errors;
	}
	function validateDuplicateNestedRules(topLevelRules, errMsgProvider) {
		var errors = [];
		forEach(topLevelRules, function(currTopRule) {
			var namedCollectorVisitor = new NamedDSLMethodsCollectorVisitor("");
			currTopRule.accept(namedCollectorVisitor);
			forEach(values(pick(groupBy(namedCollectorVisitor.result, function(item) {
				return item.name;
			}), function(currGroup) {
				return currGroup.length > 1;
			})), function(currDupGroup) {
				var currDupProds = map(currDupGroup, function(dupGroup) {
					return dupGroup.orgProd;
				});
				var errMsg = errMsgProvider.buildDuplicateNestedRuleNameError(currTopRule, currDupProds);
				errors.push({
					message: errMsg,
					type: ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,
					ruleName: currTopRule.name
				});
			});
		});
		return errors;
	}
	var __extends$2, OccurrenceValidationCollector, validTermsPattern, validNestedRuleName, OrCollector, RepetionCollector;
	var init_checks = __esmMin((() => {
		init_utils();
		init_parser();
		init_gast();
		init_lookahead();
		init_cst();
		init_interpreter();
		init_gast_public();
		init_gast_visitor_public();
		__extends$2 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		OccurrenceValidationCollector = function(_super) {
			__extends$2(OccurrenceValidationCollector, _super);
			function OccurrenceValidationCollector() {
				var _this = _super !== null && _super.apply(this, arguments) || this;
				_this.allProductions = [];
				return _this;
			}
			OccurrenceValidationCollector.prototype.visitNonTerminal = function(subrule) {
				this.allProductions.push(subrule);
			};
			OccurrenceValidationCollector.prototype.visitOption = function(option) {
				this.allProductions.push(option);
			};
			OccurrenceValidationCollector.prototype.visitRepetitionWithSeparator = function(manySep) {
				this.allProductions.push(manySep);
			};
			OccurrenceValidationCollector.prototype.visitRepetitionMandatory = function(atLeastOne) {
				this.allProductions.push(atLeastOne);
			};
			OccurrenceValidationCollector.prototype.visitRepetitionMandatoryWithSeparator = function(atLeastOneSep) {
				this.allProductions.push(atLeastOneSep);
			};
			OccurrenceValidationCollector.prototype.visitRepetition = function(many) {
				this.allProductions.push(many);
			};
			OccurrenceValidationCollector.prototype.visitAlternation = function(or) {
				this.allProductions.push(or);
			};
			OccurrenceValidationCollector.prototype.visitTerminal = function(terminal) {
				this.allProductions.push(terminal);
			};
			return OccurrenceValidationCollector;
		}(GAstVisitor);
		validTermsPattern = /^[a-zA-Z_]\w*$/;
		validNestedRuleName = new RegExp(validTermsPattern.source.replace("^", "^\\$"));
		OrCollector = function(_super) {
			__extends$2(OrCollector, _super);
			function OrCollector() {
				var _this = _super !== null && _super.apply(this, arguments) || this;
				_this.alternations = [];
				return _this;
			}
			OrCollector.prototype.visitAlternation = function(node) {
				this.alternations.push(node);
			};
			return OrCollector;
		}(GAstVisitor);
		RepetionCollector = function(_super) {
			__extends$2(RepetionCollector, _super);
			function RepetionCollector() {
				var _this = _super !== null && _super.apply(this, arguments) || this;
				_this.allProductions = [];
				return _this;
			}
			RepetionCollector.prototype.visitRepetitionWithSeparator = function(manySep) {
				this.allProductions.push(manySep);
			};
			RepetionCollector.prototype.visitRepetitionMandatory = function(atLeastOne) {
				this.allProductions.push(atLeastOne);
			};
			RepetionCollector.prototype.visitRepetitionMandatoryWithSeparator = function(atLeastOneSep) {
				this.allProductions.push(atLeastOneSep);
			};
			RepetionCollector.prototype.visitRepetition = function(many) {
				this.allProductions.push(many);
			};
			return RepetionCollector;
		}(GAstVisitor);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/errors_public.js
	var defaultParserErrorProvider, defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider;
	var init_errors_public = __esmMin((() => {
		init_tokens_public();
		init_utils();
		init_gast_public();
		init_gast();
		init_checks();
		defaultParserErrorProvider = {
			buildMismatchTokenMessage: function(_a) {
				var expected = _a.expected, actual = _a.actual;
				_a.previous;
				_a.ruleName;
				return "Expecting " + (hasTokenLabel(expected) ? "--> " + tokenLabel(expected) + " <--" : "token of type --> " + expected.name + " <--") + " but found --> '" + actual.image + "' <--";
			},
			buildNotAllInputParsedMessage: function(_a) {
				var firstRedundant = _a.firstRedundant;
				_a.ruleName;
				return "Redundant input, expecting EOF but found: " + firstRedundant.image;
			},
			buildNoViableAltMessage: function(_a) {
				var expectedPathsPerAlt = _a.expectedPathsPerAlt, actual = _a.actual;
				_a.previous;
				var customUserDescription = _a.customUserDescription;
				_a.ruleName;
				var errPrefix = "Expecting: ";
				var errSuffix = "\nbut found: '" + first$1(actual).image + "'";
				if (customUserDescription) return errPrefix + customUserDescription + errSuffix;
				else return errPrefix + ("one of these possible Token sequences:\n" + map(map(reduce(expectedPathsPerAlt, function(result, currAltPaths) {
					return result.concat(currAltPaths);
				}, []), function(currPath) {
					return "[" + map(currPath, function(currTokenType) {
						return tokenLabel(currTokenType);
					}).join(", ") + "]";
				}), function(itemMsg, idx) {
					return "  " + (idx + 1) + ". " + itemMsg;
				}).join("\n")) + errSuffix;
			},
			buildEarlyExitMessage: function(_a) {
				var expectedIterationPaths = _a.expectedIterationPaths, actual = _a.actual, customUserDescription = _a.customUserDescription;
				_a.ruleName;
				var errPrefix = "Expecting: ";
				var errSuffix = "\nbut found: '" + first$1(actual).image + "'";
				if (customUserDescription) return errPrefix + customUserDescription + errSuffix;
				else return errPrefix + ("expecting at least one iteration which starts with one of these possible Token sequences::\n  " + ("<" + map(expectedIterationPaths, function(currPath) {
					return "[" + map(currPath, function(currTokenType) {
						return tokenLabel(currTokenType);
					}).join(",") + "]";
				}).join(" ,") + ">")) + errSuffix;
			}
		};
		Object.freeze(defaultParserErrorProvider);
		defaultGrammarResolverErrorProvider = { buildRuleNotFoundError: function(topLevelRule, undefinedRule) {
			return "Invalid grammar, reference to a rule which is not defined: ->" + undefinedRule.nonTerminalName + "<-\ninside top level rule: ->" + topLevelRule.name + "<-";
		} };
		defaultGrammarValidatorErrorProvider = {
			buildDuplicateFoundError: function(topLevelRule, duplicateProds) {
				function getExtraProductionArgument(prod) {
					if (prod instanceof Terminal) return prod.terminalType.name;
					else if (prod instanceof NonTerminal) return prod.nonTerminalName;
					else return "";
				}
				var topLevelName = topLevelRule.name;
				var duplicateProd = first$1(duplicateProds);
				var index = duplicateProd.idx;
				var dslName = getProductionDslName(duplicateProd);
				var extraArgument = getExtraProductionArgument(duplicateProd);
				var hasExplicitIndex = index > 0;
				var msg = "->" + dslName + (hasExplicitIndex ? index : "") + "<- " + (extraArgument ? "with argument: ->" + extraArgument + "<-" : "") + "\n                  appears more than once (" + duplicateProds.length + " times) in the top level rule: ->" + topLevelName + "<-.                  \n                  For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n                  ";
				msg = msg.replace(/[ \t]+/g, " ");
				msg = msg.replace(/\s\s+/g, "\n");
				return msg;
			},
			buildInvalidNestedRuleNameError: function(topLevelRule, nestedProd) {
				return "Invalid nested rule name: ->" + nestedProd.name + "<- inside rule: ->" + topLevelRule.name + "<-\n" + ("it must match the pattern: ->" + validNestedRuleName.toString() + "<-.\n") + "Note that this means a nested rule name must start with the '$'(dollar) sign.";
			},
			buildDuplicateNestedRuleNameError: function(topLevelRule, nestedProd) {
				return "Duplicate nested rule name: ->" + first$1(nestedProd).name + "<- inside rule: ->" + topLevelRule.name + "<-\nA nested name must be unique in the scope of a top level grammar rule.";
			},
			buildNamespaceConflictError: function(rule) {
				return "Namespace conflict found in grammar.\n" + ("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <" + rule.name + ">.\n") + "To resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.";
			},
			buildAlternationPrefixAmbiguityError: function(options) {
				var pathMsg = map(options.prefixPath, function(currTok) {
					return tokenLabel(currTok);
				}).join(", ");
				var occurrence = options.alternation.idx === 0 ? "" : options.alternation.idx;
				return "Ambiguous alternatives: <" + options.ambiguityIndices.join(" ,") + "> due to common lookahead prefix\n" + ("in <OR" + occurrence + "> inside <" + options.topLevelRule.name + "> Rule,\n") + ("<" + pathMsg + "> may appears as a prefix path in all these alternatives.\n") + "See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.";
			},
			buildAlternationAmbiguityError: function(options) {
				var pathMsg = map(options.prefixPath, function(currtok) {
					return tokenLabel(currtok);
				}).join(", ");
				var occurrence = options.alternation.idx === 0 ? "" : options.alternation.idx;
				var currMessage = "Ambiguous Alternatives Detected: <" + options.ambiguityIndices.join(" ,") + "> in <OR" + occurrence + ">" + (" inside <" + options.topLevelRule.name + "> Rule,\n") + ("<" + pathMsg + "> may appears as a prefix path in all these alternatives.\n");
				currMessage = currMessage + "See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.";
				return currMessage;
			},
			buildEmptyRepetitionError: function(options) {
				var dslName = getProductionDslName(options.repetition);
				if (options.repetition.idx !== 0) dslName += options.repetition.idx;
				return "The repetition <" + dslName + "> within Rule <" + options.topLevelRule.name + "> can never consume any tokens.\nThis could lead to an infinite loop.";
			},
			buildTokenNameError: function(options) {
				return "Invalid Grammar Token name: ->" + options.tokenType.name + "<- it must match the pattern: ->" + options.expectedPattern.toString() + "<-";
			},
			buildEmptyAlternationError: function(options) {
				return "Ambiguous empty alternative: <" + (options.emptyChoiceIdx + 1) + ">" + (" in <OR" + options.alternation.idx + "> inside <" + options.topLevelRule.name + "> Rule.\n") + "Only the last alternative may be an empty alternative.";
			},
			buildTooManyAlternativesError: function(options) {
				return "An Alternation cannot have more than 256 alternatives:\n" + ("<OR" + options.alternation.idx + "> inside <" + options.topLevelRule.name + "> Rule.\n has " + (options.alternation.definition.length + 1) + " alternatives.");
			},
			buildLeftRecursionError: function(options) {
				var ruleName = options.topLevelRule.name;
				var pathNames = map(options.leftRecursionPath, function(currRule) {
					return currRule.name;
				});
				var leftRecursivePath = ruleName + " --> " + pathNames.concat([ruleName]).join(" --> ");
				return "Left Recursion found in grammar.\n" + ("rule: <" + ruleName + "> can be invoked from itself (directly or indirectly)\n") + ("without consuming any Tokens. The grammar path that causes this is: \n " + leftRecursivePath + "\n") + " To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.";
			},
			buildInvalidRuleNameError: function(options) {
				var ruleName = options.topLevelRule.name;
				var expectedPatternString = options.expectedPattern.toString();
				return "Invalid grammar rule name: ->" + ruleName + "<- it must match the pattern: ->" + expectedPatternString + "<-";
			},
			buildDuplicateRuleNameError: function(options) {
				var ruleName;
				if (options.topLevelRule instanceof Rule$2) ruleName = options.topLevelRule.name;
				else ruleName = options.topLevelRule;
				return "Duplicate definition, rule: ->" + ruleName + "<- is already defined in the grammar: ->" + options.grammarName + "<-";
			}
		};
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/resolver.js
	function resolveGrammar$1(topLevels, errMsgProvider) {
		var refResolver = new GastRefResolverVisitor(topLevels, errMsgProvider);
		refResolver.resolveRefs();
		return refResolver.errors;
	}
	var __extends$1, GastRefResolverVisitor;
	var init_resolver = __esmMin((() => {
		init_parser();
		init_utils();
		init_gast_visitor_public();
		__extends$1 = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		GastRefResolverVisitor = function(_super) {
			__extends$1(GastRefResolverVisitor, _super);
			function GastRefResolverVisitor(nameToTopRule, errMsgProvider) {
				var _this = _super.call(this) || this;
				_this.nameToTopRule = nameToTopRule;
				_this.errMsgProvider = errMsgProvider;
				_this.errors = [];
				return _this;
			}
			GastRefResolverVisitor.prototype.resolveRefs = function() {
				var _this = this;
				forEach(values(this.nameToTopRule), function(prod) {
					_this.currTopLevel = prod;
					prod.accept(_this);
				});
			};
			GastRefResolverVisitor.prototype.visitNonTerminal = function(node) {
				var ref = this.nameToTopRule[node.nonTerminalName];
				if (!ref) {
					var msg = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, node);
					this.errors.push({
						message: msg,
						type: ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,
						ruleName: this.currTopLevel.name,
						unresolvedRefName: node.nonTerminalName
					});
				} else node.referencedRule = ref;
			};
			return GastRefResolverVisitor;
		}(GAstVisitor);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/grammar/gast/gast_resolver_public.js
	function resolveGrammar(options) {
		options = defaults(options, { errMsgProvider: defaultGrammarResolverErrorProvider });
		var topRulesTable = {};
		forEach(options.rules, function(rule) {
			topRulesTable[rule.name] = rule;
		});
		return resolveGrammar$1(topRulesTable, options.errMsgProvider);
	}
	function validateGrammar(options) {
		options = defaults(options, {
			errMsgProvider: defaultGrammarValidatorErrorProvider,
			ignoredIssues: {}
		});
		return validateGrammar$1(options.rules, options.maxLookahead, options.tokenTypes, options.ignoredIssues, options.errMsgProvider, options.grammarName);
	}
	var init_gast_resolver_public = __esmMin((() => {
		init_utils();
		init_resolver();
		init_checks();
		init_errors_public();
		init_gast();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/exceptions_public.js
	function isRecognitionException(error) {
		return contains(RECOGNITION_EXCEPTION_NAMES, error.name);
	}
	function MismatchedTokenException(message, token, previousToken) {
		this.name = MISMATCHED_TOKEN_EXCEPTION;
		this.message = message;
		this.token = token;
		this.previousToken = previousToken;
		this.resyncedTokens = [];
	}
	function NoViableAltException(message, token, previousToken) {
		this.name = NO_VIABLE_ALT_EXCEPTION;
		this.message = message;
		this.token = token;
		this.previousToken = previousToken;
		this.resyncedTokens = [];
	}
	function NotAllInputParsedException(message, token) {
		this.name = NOT_ALL_INPUT_PARSED_EXCEPTION;
		this.message = message;
		this.token = token;
		this.resyncedTokens = [];
	}
	function EarlyExitException(message, token, previousToken) {
		this.name = EARLY_EXIT_EXCEPTION;
		this.message = message;
		this.token = token;
		this.previousToken = previousToken;
		this.resyncedTokens = [];
	}
	var MISMATCHED_TOKEN_EXCEPTION, NO_VIABLE_ALT_EXCEPTION, EARLY_EXIT_EXCEPTION, NOT_ALL_INPUT_PARSED_EXCEPTION, RECOGNITION_EXCEPTION_NAMES;
	var init_exceptions_public = __esmMin((() => {
		init_utils();
		MISMATCHED_TOKEN_EXCEPTION = "MismatchedTokenException";
		NO_VIABLE_ALT_EXCEPTION = "NoViableAltException";
		EARLY_EXIT_EXCEPTION = "EarlyExitException";
		NOT_ALL_INPUT_PARSED_EXCEPTION = "NotAllInputParsedException";
		RECOGNITION_EXCEPTION_NAMES = [
			MISMATCHED_TOKEN_EXCEPTION,
			NO_VIABLE_ALT_EXCEPTION,
			EARLY_EXIT_EXCEPTION,
			NOT_ALL_INPUT_PARSED_EXCEPTION
		];
		Object.freeze(RECOGNITION_EXCEPTION_NAMES);
		MismatchedTokenException.prototype = Error.prototype;
		NoViableAltException.prototype = Error.prototype;
		NotAllInputParsedException.prototype = Error.prototype;
		EarlyExitException.prototype = Error.prototype;
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/recoverable.js
	function InRuleRecoveryException(message) {
		this.name = IN_RULE_RECOVERY_EXCEPTION;
		this.message = message;
	}
	function attemptInRepetitionRecovery(prodFunc, args, lookaheadFunc, dslMethodIdx, prodOccurrence, nextToksWalker, notStuck) {
		var key = this.getKeyForAutomaticLookahead(dslMethodIdx, prodOccurrence);
		var firstAfterRepInfo = this.firstAfterRepMap[key];
		if (firstAfterRepInfo === void 0) {
			var currRuleName = this.getCurrRuleFullName();
			var ruleGrammar = this.getGAstProductions()[currRuleName];
			firstAfterRepInfo = new nextToksWalker(ruleGrammar, prodOccurrence).startWalking();
			this.firstAfterRepMap[key] = firstAfterRepInfo;
		}
		var expectTokAfterLastMatch = firstAfterRepInfo.token;
		var nextTokIdx = firstAfterRepInfo.occurrence;
		var isEndOfRule = firstAfterRepInfo.isEndOfRule;
		if (this.RULE_STACK.length === 1 && isEndOfRule && expectTokAfterLastMatch === void 0) {
			expectTokAfterLastMatch = EOF;
			nextTokIdx = 1;
		}
		if (this.shouldInRepetitionRecoveryBeTried(expectTokAfterLastMatch, nextTokIdx, notStuck)) this.tryInRepetitionRecovery(prodFunc, args, lookaheadFunc, expectTokAfterLastMatch);
	}
	var EOF_FOLLOW_KEY, IN_RULE_RECOVERY_EXCEPTION, Recoverable;
	var init_recoverable = __esmMin((() => {
		init_tokens_public();
		init_utils();
		init_exceptions_public();
		init_constants();
		init_parser();
		EOF_FOLLOW_KEY = {};
		IN_RULE_RECOVERY_EXCEPTION = "InRuleRecoveryException";
		InRuleRecoveryException.prototype = Error.prototype;
		Recoverable = function() {
			function Recoverable() {}
			Recoverable.prototype.initRecoverable = function(config) {
				this.firstAfterRepMap = {};
				this.resyncFollows = {};
				this.recoveryEnabled = has(config, "recoveryEnabled") ? config.recoveryEnabled : DEFAULT_PARSER_CONFIG.recoveryEnabled;
				if (this.recoveryEnabled) this.attemptInRepetitionRecovery = attemptInRepetitionRecovery;
			};
			Recoverable.prototype.getTokenToInsert = function(tokType) {
				var tokToInsert = createTokenInstance(tokType, "", NaN, NaN, NaN, NaN, NaN, NaN);
				tokToInsert.isInsertedInRecovery = true;
				return tokToInsert;
			};
			Recoverable.prototype.canTokenTypeBeInsertedInRecovery = function(tokType) {
				return true;
			};
			Recoverable.prototype.tryInRepetitionRecovery = function(grammarRule, grammarRuleArgs, lookAheadFunc, expectedTokType) {
				var _this = this;
				var reSyncTokType = this.findReSyncTokenType();
				var savedLexerState = this.exportLexerState();
				var resyncedTokens = [];
				var passedResyncPoint = false;
				var nextTokenWithoutResync = this.LA(1);
				var currToken = this.LA(1);
				var generateErrorMessage = function() {
					var previousToken = _this.LA(0);
					var error = new MismatchedTokenException(_this.errorMessageProvider.buildMismatchTokenMessage({
						expected: expectedTokType,
						actual: nextTokenWithoutResync,
						previous: previousToken,
						ruleName: _this.getCurrRuleFullName()
					}), nextTokenWithoutResync, _this.LA(0));
					error.resyncedTokens = dropRight(resyncedTokens);
					_this.SAVE_ERROR(error);
				};
				while (!passedResyncPoint) if (this.tokenMatcher(currToken, expectedTokType)) {
					generateErrorMessage();
					return;
				} else if (lookAheadFunc.call(this)) {
					generateErrorMessage();
					grammarRule.apply(this, grammarRuleArgs);
					return;
				} else if (this.tokenMatcher(currToken, reSyncTokType)) passedResyncPoint = true;
				else {
					currToken = this.SKIP_TOKEN();
					this.addToResyncTokens(currToken, resyncedTokens);
				}
				this.importLexerState(savedLexerState);
			};
			Recoverable.prototype.shouldInRepetitionRecoveryBeTried = function(expectTokAfterLastMatch, nextTokIdx, notStuck) {
				if (notStuck === false) return false;
				if (expectTokAfterLastMatch === void 0 || nextTokIdx === void 0) return false;
				if (this.tokenMatcher(this.LA(1), expectTokAfterLastMatch)) return false;
				if (this.isBackTracking()) return false;
				if (this.canPerformInRuleRecovery(expectTokAfterLastMatch, this.getFollowsForInRuleRecovery(expectTokAfterLastMatch, nextTokIdx))) return false;
				return true;
			};
			Recoverable.prototype.getFollowsForInRuleRecovery = function(tokType, tokIdxInRule) {
				var grammarPath = this.getCurrentGrammarPath(tokType, tokIdxInRule);
				return this.getNextPossibleTokenTypes(grammarPath);
			};
			Recoverable.prototype.tryInRuleRecovery = function(expectedTokType, follows) {
				if (this.canRecoverWithSingleTokenInsertion(expectedTokType, follows)) return this.getTokenToInsert(expectedTokType);
				if (this.canRecoverWithSingleTokenDeletion(expectedTokType)) {
					var nextTok = this.SKIP_TOKEN();
					this.consumeToken();
					return nextTok;
				}
				throw new InRuleRecoveryException("sad sad panda");
			};
			Recoverable.prototype.canPerformInRuleRecovery = function(expectedToken, follows) {
				return this.canRecoverWithSingleTokenInsertion(expectedToken, follows) || this.canRecoverWithSingleTokenDeletion(expectedToken);
			};
			Recoverable.prototype.canRecoverWithSingleTokenInsertion = function(expectedTokType, follows) {
				var _this = this;
				if (!this.canTokenTypeBeInsertedInRecovery(expectedTokType)) return false;
				if (isEmpty(follows)) return false;
				var mismatchedTok = this.LA(1);
				return find(follows, function(possibleFollowsTokType) {
					return _this.tokenMatcher(mismatchedTok, possibleFollowsTokType);
				}) !== void 0;
			};
			Recoverable.prototype.canRecoverWithSingleTokenDeletion = function(expectedTokType) {
				return this.tokenMatcher(this.LA(2), expectedTokType);
			};
			Recoverable.prototype.isInCurrentRuleReSyncSet = function(tokenTypeIdx) {
				var followKey = this.getCurrFollowKey();
				return contains(this.getFollowSetFromFollowKey(followKey), tokenTypeIdx);
			};
			Recoverable.prototype.findReSyncTokenType = function() {
				var allPossibleReSyncTokTypes = this.flattenFollowSet();
				var nextToken = this.LA(1);
				var k = 2;
				while (true) {
					var nextTokenType = nextToken.tokenType;
					if (contains(allPossibleReSyncTokTypes, nextTokenType)) return nextTokenType;
					nextToken = this.LA(k);
					k++;
				}
			};
			Recoverable.prototype.getCurrFollowKey = function() {
				if (this.RULE_STACK.length === 1) return EOF_FOLLOW_KEY;
				var currRuleShortName = this.getLastExplicitRuleShortName();
				var currRuleIdx = this.getLastExplicitRuleOccurrenceIndex();
				var prevRuleShortName = this.getPreviousExplicitRuleShortName();
				return {
					ruleName: this.shortRuleNameToFullName(currRuleShortName),
					idxInCallingRule: currRuleIdx,
					inRule: this.shortRuleNameToFullName(prevRuleShortName)
				};
			};
			Recoverable.prototype.buildFullFollowKeyStack = function() {
				var _this = this;
				var explicitRuleStack = this.RULE_STACK;
				var explicitOccurrenceStack = this.RULE_OCCURRENCE_STACK;
				if (!isEmpty(this.LAST_EXPLICIT_RULE_STACK)) {
					explicitRuleStack = map(this.LAST_EXPLICIT_RULE_STACK, function(idx) {
						return _this.RULE_STACK[idx];
					});
					explicitOccurrenceStack = map(this.LAST_EXPLICIT_RULE_STACK, function(idx) {
						return _this.RULE_OCCURRENCE_STACK[idx];
					});
				}
				return map(explicitRuleStack, function(ruleName, idx) {
					if (idx === 0) return EOF_FOLLOW_KEY;
					return {
						ruleName: _this.shortRuleNameToFullName(ruleName),
						idxInCallingRule: explicitOccurrenceStack[idx],
						inRule: _this.shortRuleNameToFullName(explicitRuleStack[idx - 1])
					};
				});
			};
			Recoverable.prototype.flattenFollowSet = function() {
				var _this = this;
				return flatten(map(this.buildFullFollowKeyStack(), function(currKey) {
					return _this.getFollowSetFromFollowKey(currKey);
				}));
			};
			Recoverable.prototype.getFollowSetFromFollowKey = function(followKey) {
				if (followKey === EOF_FOLLOW_KEY) return [EOF];
				var followName = followKey.ruleName + followKey.idxInCallingRule + IN + followKey.inRule;
				return this.resyncFollows[followName];
			};
			Recoverable.prototype.addToResyncTokens = function(token, resyncTokens) {
				if (!this.tokenMatcher(token, EOF)) resyncTokens.push(token);
				return resyncTokens;
			};
			Recoverable.prototype.reSyncTo = function(tokType) {
				var resyncedTokens = [];
				var nextTok = this.LA(1);
				while (this.tokenMatcher(nextTok, tokType) === false) {
					nextTok = this.SKIP_TOKEN();
					this.addToResyncTokens(nextTok, resyncedTokens);
				}
				return dropRight(resyncedTokens);
			};
			Recoverable.prototype.attemptInRepetitionRecovery = function(prodFunc, args, lookaheadFunc, dslMethodIdx, prodOccurrence, nextToksWalker, notStuck) {};
			Recoverable.prototype.getCurrentGrammarPath = function(tokType, tokIdxInRule) {
				return {
					ruleStack: this.getHumanReadableRuleStack(),
					occurrenceStack: cloneArr(this.RULE_OCCURRENCE_STACK),
					lastTok: tokType,
					lastTokOccurrence: tokIdxInRule
				};
			};
			Recoverable.prototype.getHumanReadableRuleStack = function() {
				var _this = this;
				if (!isEmpty(this.LAST_EXPLICIT_RULE_STACK)) return map(this.LAST_EXPLICIT_RULE_STACK, function(currIdx) {
					return _this.shortRuleNameToFullName(_this.RULE_STACK[currIdx]);
				});
				else return map(this.RULE_STACK, function(currShortName) {
					return _this.shortRuleNameToFullName(currShortName);
				});
			};
			return Recoverable;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/looksahead.js
	var LooksAhead;
	var init_looksahead = __esmMin((() => {
		init_lookahead();
		init_utils();
		init_parser();
		init_keys();
		init_gast();
		LooksAhead = function() {
			function LooksAhead() {}
			LooksAhead.prototype.initLooksAhead = function(config) {
				this.dynamicTokensEnabled = has(config, "dynamicTokensEnabled") ? config.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled;
				this.maxLookahead = has(config, "maxLookahead") ? config.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead;
				/* istanbul ignore next - Using plain array as dictionary will be tested on older node.js versions and IE11 */
				this.lookAheadFuncsCache = isES2015MapSupported() ? /* @__PURE__ */ new Map() : [];
				/* istanbul ignore else - The else branch will be tested on older node.js versions and IE11 */
				if (isES2015MapSupported()) {
					this.getLaFuncFromCache = this.getLaFuncFromMap;
					this.setLaFuncCache = this.setLaFuncCacheUsingMap;
				} else {
					this.getLaFuncFromCache = this.getLaFuncFromObj;
					this.setLaFuncCache = this.setLaFuncUsingObj;
				}
			};
			LooksAhead.prototype.preComputeLookaheadFunctions = function(rules) {
				var _this = this;
				forEach(rules, function(currRule) {
					_this.TRACE_INIT(currRule.name + " Rule Lookahead", function() {
						var _a = collectMethods(currRule), alternation = _a.alternation, repetition = _a.repetition, option = _a.option, repetitionMandatory = _a.repetitionMandatory, repetitionMandatoryWithSeparator = _a.repetitionMandatoryWithSeparator, repetitionWithSeparator = _a.repetitionWithSeparator;
						forEach(alternation, function(currProd) {
							var prodIdx = currProd.idx === 0 ? "" : currProd.idx;
							_this.TRACE_INIT("" + getProductionDslName(currProd) + prodIdx, function() {
								var laFunc = buildLookaheadFuncForOr(currProd.idx, currRule, currProd.maxLookahead || _this.maxLookahead, currProd.hasPredicates, _this.dynamicTokensEnabled, _this.lookAheadBuilderForAlternatives);
								var key = getKeyForAutomaticLookahead(_this.fullRuleNameToShort[currRule.name], 256, currProd.idx);
								_this.setLaFuncCache(key, laFunc);
							});
						});
						forEach(repetition, function(currProd) {
							_this.computeLookaheadFunc(currRule, currProd.idx, 768, PROD_TYPE.REPETITION, currProd.maxLookahead, getProductionDslName(currProd));
						});
						forEach(option, function(currProd) {
							_this.computeLookaheadFunc(currRule, currProd.idx, 512, PROD_TYPE.OPTION, currProd.maxLookahead, getProductionDslName(currProd));
						});
						forEach(repetitionMandatory, function(currProd) {
							_this.computeLookaheadFunc(currRule, currProd.idx, AT_LEAST_ONE_IDX, PROD_TYPE.REPETITION_MANDATORY, currProd.maxLookahead, getProductionDslName(currProd));
						});
						forEach(repetitionMandatoryWithSeparator, function(currProd) {
							_this.computeLookaheadFunc(currRule, currProd.idx, AT_LEAST_ONE_SEP_IDX, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, currProd.maxLookahead, getProductionDslName(currProd));
						});
						forEach(repetitionWithSeparator, function(currProd) {
							_this.computeLookaheadFunc(currRule, currProd.idx, MANY_SEP_IDX, PROD_TYPE.REPETITION_WITH_SEPARATOR, currProd.maxLookahead, getProductionDslName(currProd));
						});
					});
				});
			};
			LooksAhead.prototype.computeLookaheadFunc = function(rule, prodOccurrence, prodKey, prodType, prodMaxLookahead, dslMethodName) {
				var _this = this;
				this.TRACE_INIT("" + dslMethodName + (prodOccurrence === 0 ? "" : prodOccurrence), function() {
					var laFunc = buildLookaheadFuncForOptionalProd(prodOccurrence, rule, prodMaxLookahead || _this.maxLookahead, _this.dynamicTokensEnabled, prodType, _this.lookAheadBuilderForOptional);
					var key = getKeyForAutomaticLookahead(_this.fullRuleNameToShort[rule.name], prodKey, prodOccurrence);
					_this.setLaFuncCache(key, laFunc);
				});
			};
			LooksAhead.prototype.lookAheadBuilderForOptional = function(alt, tokenMatcher, dynamicTokensEnabled) {
				return buildSingleAlternativeLookaheadFunction(alt, tokenMatcher, dynamicTokensEnabled);
			};
			LooksAhead.prototype.lookAheadBuilderForAlternatives = function(alts, hasPredicates, tokenMatcher, dynamicTokensEnabled) {
				return buildAlternativesLookAheadFunc(alts, hasPredicates, tokenMatcher, dynamicTokensEnabled);
			};
			LooksAhead.prototype.getKeyForAutomaticLookahead = function(dslMethodIdx, occurrence) {
				return getKeyForAutomaticLookahead(this.getLastExplicitRuleShortName(), dslMethodIdx, occurrence);
			};
			/* istanbul ignore next */
			LooksAhead.prototype.getLaFuncFromCache = function(key) {};
			LooksAhead.prototype.getLaFuncFromMap = function(key) {
				return this.lookAheadFuncsCache.get(key);
			};
			/* istanbul ignore next - Using plain array as dictionary will be tested on older node.js versions and IE11 */
			LooksAhead.prototype.getLaFuncFromObj = function(key) {
				return this.lookAheadFuncsCache[key];
			};
			/* istanbul ignore next */
			LooksAhead.prototype.setLaFuncCache = function(key, value) {};
			LooksAhead.prototype.setLaFuncCacheUsingMap = function(key, value) {
				this.lookAheadFuncsCache.set(key, value);
			};
			/* istanbul ignore next - Using plain array as dictionary will be tested on older node.js versions and IE11 */
			LooksAhead.prototype.setLaFuncUsingObj = function(key, value) {
				this.lookAheadFuncsCache[key] = value;
			};
			return LooksAhead;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/lang/lang_extensions.js
	function classNameFromInstance(instance) {
		return functionName(instance.constructor);
	}
	/* istanbul ignore next too many hacks for IE/old versions of node.js here*/
	function functionName(func) {
		var existingNameProp = func.name;
		if (existingNameProp) return existingNameProp;
		return func.toString().match(FUNC_NAME_REGEXP)[1];
	}
	/**
	* @returns {boolean} - has the property been successfully defined
	*/
	function defineNameProp(obj, nameValue) {
		var namePropDescriptor = Object.getOwnPropertyDescriptor(obj, NAME);
		/* istanbul ignore else -> will only run in old versions of node.js */
		if (isUndefined(namePropDescriptor) || namePropDescriptor.configurable) {
			Object.defineProperty(obj, NAME, {
				enumerable: false,
				configurable: true,
				writable: false,
				value: nameValue
			});
			return true;
		}
		/* istanbul ignore next -> will only run in old versions of node.js */
		return false;
	}
	var FUNC_NAME_REGEXP, NAME;
	var init_lang_extensions = __esmMin((() => {
		init_utils();
		FUNC_NAME_REGEXP = /^\s*function\s*(\S*)\s*\(/;
		NAME = "name";
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/cst/cst_visitor.js
	function defaultVisit(ctx, param) {
		var childrenNames = keys(ctx);
		var childrenNamesLength = childrenNames.length;
		for (var i = 0; i < childrenNamesLength; i++) {
			var currChildArray = ctx[childrenNames[i]];
			var currChildArrayLength = currChildArray.length;
			for (var j = 0; j < currChildArrayLength; j++) {
				var currChild = currChildArray[j];
				if (currChild.tokenTypeIdx === void 0) if (currChild.fullName !== void 0) this[currChild.fullName](currChild.children, param);
				else this[currChild.name](currChild.children, param);
			}
		}
	}
	function createBaseSemanticVisitorConstructor(grammarName, ruleNames) {
		var derivedConstructor = function() {};
		defineNameProp(derivedConstructor, grammarName + "BaseSemantics");
		derivedConstructor.prototype = {
			visit: function(cstNode, param) {
				if (isArray(cstNode)) cstNode = cstNode[0];
				if (isUndefined(cstNode)) return;
				if (cstNode.fullName !== void 0) return this[cstNode.fullName](cstNode.children, param);
				else return this[cstNode.name](cstNode.children, param);
			},
			validateVisitor: function() {
				var semanticDefinitionErrors = validateVisitor(this, ruleNames);
				if (!isEmpty(semanticDefinitionErrors)) {
					var errorMessages = map(semanticDefinitionErrors, function(currDefError) {
						return currDefError.msg;
					});
					throw Error("Errors Detected in CST Visitor <" + functionName(this.constructor) + ">:\n	" + ("" + errorMessages.join("\n\n").replace(/\n/g, "\n	")));
				}
			}
		};
		derivedConstructor.prototype.constructor = derivedConstructor;
		derivedConstructor._RULE_NAMES = ruleNames;
		return derivedConstructor;
	}
	function createBaseVisitorConstructorWithDefaults(grammarName, ruleNames, baseConstructor) {
		var derivedConstructor = function() {};
		defineNameProp(derivedConstructor, grammarName + "BaseSemanticsWithDefaults");
		var withDefaultsProto = Object.create(baseConstructor.prototype);
		forEach(ruleNames, function(ruleName) {
			withDefaultsProto[ruleName] = defaultVisit;
		});
		derivedConstructor.prototype = withDefaultsProto;
		derivedConstructor.prototype.constructor = derivedConstructor;
		return derivedConstructor;
	}
	function validateVisitor(visitorInstance, ruleNames) {
		var missingErrors = validateMissingCstMethods(visitorInstance, ruleNames);
		var redundantErrors = validateRedundantMethods(visitorInstance, ruleNames);
		return missingErrors.concat(redundantErrors);
	}
	function validateMissingCstMethods(visitorInstance, ruleNames) {
		return compact(map(ruleNames, function(currRuleName) {
			if (!isFunction(visitorInstance[currRuleName])) return {
				msg: "Missing visitor method: <" + currRuleName + "> on " + functionName(visitorInstance.constructor) + " CST Visitor.",
				type: CstVisitorDefinitionError.MISSING_METHOD,
				methodName: currRuleName
			};
		}));
	}
	function validateRedundantMethods(visitorInstance, ruleNames) {
		var errors = [];
		for (var prop in visitorInstance) if (validTermsPattern.test(prop) && isFunction(visitorInstance[prop]) && !contains(VALID_PROP_NAMES, prop) && !contains(ruleNames, prop)) errors.push({
			msg: "Redundant visitor method: <" + prop + "> on " + functionName(visitorInstance.constructor) + " CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\n" + ("For utility methods on visitor classes use methods names that do not match /" + validTermsPattern.source + "/."),
			type: CstVisitorDefinitionError.REDUNDANT_METHOD,
			methodName: prop
		});
		return errors;
	}
	var CstVisitorDefinitionError, VALID_PROP_NAMES;
	var init_cst_visitor = __esmMin((() => {
		init_utils();
		init_lang_extensions();
		init_checks();
		(function(CstVisitorDefinitionError) {
			CstVisitorDefinitionError[CstVisitorDefinitionError["REDUNDANT_METHOD"] = 0] = "REDUNDANT_METHOD";
			CstVisitorDefinitionError[CstVisitorDefinitionError["MISSING_METHOD"] = 1] = "MISSING_METHOD";
		})(CstVisitorDefinitionError || (CstVisitorDefinitionError = {}));
		VALID_PROP_NAMES = [
			"constructor",
			"visit",
			"validateVisitor"
		];
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/tree_builder.js
	var TreeBuilder;
	var init_tree_builder = __esmMin((() => {
		init_cst();
		init_utils();
		init_cst_visitor();
		init_keys();
		init_parser();
		TreeBuilder = function() {
			function TreeBuilder() {}
			TreeBuilder.prototype.initTreeBuilder = function(config) {
				this.LAST_EXPLICIT_RULE_STACK = [];
				this.CST_STACK = [];
				this.outputCst = has(config, "outputCst") ? config.outputCst : DEFAULT_PARSER_CONFIG.outputCst;
				this.nodeLocationTracking = has(config, "nodeLocationTracking") ? config.nodeLocationTracking : DEFAULT_PARSER_CONFIG.nodeLocationTracking;
				if (!this.outputCst) {
					this.cstInvocationStateUpdate = NOOP;
					this.cstFinallyStateUpdate = NOOP;
					this.cstPostTerminal = NOOP;
					this.cstPostNonTerminal = NOOP;
					this.cstPostRule = NOOP;
					this.getLastExplicitRuleShortName = this.getLastExplicitRuleShortNameNoCst;
					this.getPreviousExplicitRuleShortName = this.getPreviousExplicitRuleShortNameNoCst;
					this.getLastExplicitRuleOccurrenceIndex = this.getLastExplicitRuleOccurrenceIndexNoCst;
					this.manyInternal = this.manyInternalNoCst;
					this.orInternal = this.orInternalNoCst;
					this.optionInternal = this.optionInternalNoCst;
					this.atLeastOneInternal = this.atLeastOneInternalNoCst;
					this.manySepFirstInternal = this.manySepFirstInternalNoCst;
					this.atLeastOneSepFirstInternal = this.atLeastOneSepFirstInternalNoCst;
				} else if (/full/i.test(this.nodeLocationTracking)) if (this.recoveryEnabled) {
					this.setNodeLocationFromToken = setNodeLocationFull;
					this.setNodeLocationFromNode = setNodeLocationFull;
					this.cstPostRule = NOOP;
					this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery;
				} else {
					this.setNodeLocationFromToken = NOOP;
					this.setNodeLocationFromNode = NOOP;
					this.cstPostRule = this.cstPostRuleFull;
					this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular;
				}
				else if (/onlyOffset/i.test(this.nodeLocationTracking)) if (this.recoveryEnabled) {
					this.setNodeLocationFromToken = setNodeLocationOnlyOffset;
					this.setNodeLocationFromNode = setNodeLocationOnlyOffset;
					this.cstPostRule = NOOP;
					this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery;
				} else {
					this.setNodeLocationFromToken = NOOP;
					this.setNodeLocationFromNode = NOOP;
					this.cstPostRule = this.cstPostRuleOnlyOffset;
					this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular;
				}
				else if (/none/i.test(this.nodeLocationTracking)) {
					this.setNodeLocationFromToken = NOOP;
					this.setNodeLocationFromNode = NOOP;
					this.cstPostRule = NOOP;
					this.setInitialNodeLocation = NOOP;
				} else throw Error("Invalid <nodeLocationTracking> config option: \"" + config.nodeLocationTracking + "\"");
			};
			TreeBuilder.prototype.setInitialNodeLocationOnlyOffsetRecovery = function(cstNode) {
				cstNode.location = {
					startOffset: NaN,
					endOffset: NaN
				};
			};
			TreeBuilder.prototype.setInitialNodeLocationOnlyOffsetRegular = function(cstNode) {
				cstNode.location = {
					startOffset: this.LA(1).startOffset,
					endOffset: NaN
				};
			};
			TreeBuilder.prototype.setInitialNodeLocationFullRecovery = function(cstNode) {
				cstNode.location = {
					startOffset: NaN,
					startLine: NaN,
					startColumn: NaN,
					endOffset: NaN,
					endLine: NaN,
					endColumn: NaN
				};
			};
			/**
			*  @see setInitialNodeLocationOnlyOffsetRegular for explanation why this work
			
			* @param cstNode
			*/
			TreeBuilder.prototype.setInitialNodeLocationFullRegular = function(cstNode) {
				var nextToken = this.LA(1);
				cstNode.location = {
					startOffset: nextToken.startOffset,
					startLine: nextToken.startLine,
					startColumn: nextToken.startColumn,
					endOffset: NaN,
					endLine: NaN,
					endColumn: NaN
				};
			};
			TreeBuilder.prototype.cstNestedInvocationStateUpdate = function(nestedName, shortName) {
				var cstNode = {
					name: nestedName,
					fullName: this.shortRuleNameToFull[this.getLastExplicitRuleShortName()] + nestedName,
					children: {}
				};
				this.setInitialNodeLocation(cstNode);
				this.CST_STACK.push(cstNode);
			};
			TreeBuilder.prototype.cstInvocationStateUpdate = function(fullRuleName, shortName) {
				this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length - 1);
				var cstNode = {
					name: fullRuleName,
					children: {}
				};
				this.setInitialNodeLocation(cstNode);
				this.CST_STACK.push(cstNode);
			};
			TreeBuilder.prototype.cstFinallyStateUpdate = function() {
				this.LAST_EXPLICIT_RULE_STACK.pop();
				this.CST_STACK.pop();
			};
			TreeBuilder.prototype.cstNestedFinallyStateUpdate = function() {
				var lastCstNode = this.CST_STACK.pop();
				this.cstPostRule(lastCstNode);
			};
			TreeBuilder.prototype.cstPostRuleFull = function(ruleCstNode) {
				var prevToken = this.LA(0);
				var loc = ruleCstNode.location;
				if (loc.startOffset <= prevToken.startOffset === true) {
					loc.endOffset = prevToken.endOffset;
					loc.endLine = prevToken.endLine;
					loc.endColumn = prevToken.endColumn;
				} else {
					loc.startOffset = NaN;
					loc.startLine = NaN;
					loc.startColumn = NaN;
				}
			};
			TreeBuilder.prototype.cstPostRuleOnlyOffset = function(ruleCstNode) {
				var prevToken = this.LA(0);
				var loc = ruleCstNode.location;
				if (loc.startOffset <= prevToken.startOffset === true) loc.endOffset = prevToken.endOffset;
				else loc.startOffset = NaN;
			};
			TreeBuilder.prototype.cstPostTerminal = function(key, consumedToken) {
				var rootCst = this.CST_STACK[this.CST_STACK.length - 1];
				addTerminalToCst(rootCst, consumedToken, key);
				this.setNodeLocationFromToken(rootCst.location, consumedToken);
			};
			TreeBuilder.prototype.cstPostNonTerminal = function(ruleCstResult, ruleName) {
				if (this.isBackTracking() !== true) {
					var preCstNode = this.CST_STACK[this.CST_STACK.length - 1];
					addNoneTerminalToCst(preCstNode, ruleName, ruleCstResult);
					this.setNodeLocationFromNode(preCstNode.location, ruleCstResult.location);
				}
			};
			TreeBuilder.prototype.getBaseCstVisitorConstructor = function() {
				if (isUndefined(this.baseCstVisitorConstructor)) {
					var newBaseCstVisitorConstructor = createBaseSemanticVisitorConstructor(this.className, this.allRuleNames);
					this.baseCstVisitorConstructor = newBaseCstVisitorConstructor;
					return newBaseCstVisitorConstructor;
				}
				return this.baseCstVisitorConstructor;
			};
			TreeBuilder.prototype.getBaseCstVisitorConstructorWithDefaults = function() {
				if (isUndefined(this.baseCstVisitorWithDefaultsConstructor)) {
					var newConstructor = createBaseVisitorConstructorWithDefaults(this.className, this.allRuleNames, this.getBaseCstVisitorConstructor());
					this.baseCstVisitorWithDefaultsConstructor = newConstructor;
					return newConstructor;
				}
				return this.baseCstVisitorWithDefaultsConstructor;
			};
			TreeBuilder.prototype.nestedRuleBeforeClause = function(methodOpts, laKey) {
				var nestedName;
				if (methodOpts.NAME !== void 0) {
					nestedName = methodOpts.NAME;
					this.nestedRuleInvocationStateUpdate(nestedName, laKey);
					return nestedName;
				} else return;
			};
			TreeBuilder.prototype.nestedAltBeforeClause = function(methodOpts, occurrence, methodKeyIdx, altIdx) {
				var shortName = getKeyForAltIndex(this.getLastExplicitRuleShortName(), methodKeyIdx, occurrence, altIdx);
				var nestedName;
				if (methodOpts.NAME !== void 0) {
					nestedName = methodOpts.NAME;
					this.nestedRuleInvocationStateUpdate(nestedName, shortName);
					return {
						shortName,
						nestedName
					};
				} else return;
			};
			TreeBuilder.prototype.nestedRuleFinallyClause = function(laKey, nestedName) {
				var cstStack = this.CST_STACK;
				var nestedRuleCst = cstStack[cstStack.length - 1];
				this.nestedRuleFinallyStateUpdate();
				var parentCstNode = cstStack[cstStack.length - 1];
				addNoneTerminalToCst(parentCstNode, nestedName, nestedRuleCst);
				this.setNodeLocationFromNode(parentCstNode.location, nestedRuleCst.location);
			};
			TreeBuilder.prototype.getLastExplicitRuleShortName = function() {
				var lastExplictIndex = this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length - 1];
				return this.RULE_STACK[lastExplictIndex];
			};
			TreeBuilder.prototype.getLastExplicitRuleShortNameNoCst = function() {
				var ruleStack = this.RULE_STACK;
				return ruleStack[ruleStack.length - 1];
			};
			TreeBuilder.prototype.getPreviousExplicitRuleShortName = function() {
				var lastExplicitIndex = this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length - 2];
				return this.RULE_STACK[lastExplicitIndex];
			};
			TreeBuilder.prototype.getPreviousExplicitRuleShortNameNoCst = function() {
				var ruleStack = this.RULE_STACK;
				return ruleStack[ruleStack.length - 2];
			};
			TreeBuilder.prototype.getLastExplicitRuleOccurrenceIndex = function() {
				var lastExplicitIndex = this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length - 1];
				return this.RULE_OCCURRENCE_STACK[lastExplicitIndex];
			};
			TreeBuilder.prototype.getLastExplicitRuleOccurrenceIndexNoCst = function() {
				var occurrenceStack = this.RULE_OCCURRENCE_STACK;
				return occurrenceStack[occurrenceStack.length - 1];
			};
			TreeBuilder.prototype.nestedRuleInvocationStateUpdate = function(nestedRuleName, shortNameKey) {
				this.RULE_OCCURRENCE_STACK.push(1);
				this.RULE_STACK.push(shortNameKey);
				this.cstNestedInvocationStateUpdate(nestedRuleName, shortNameKey);
			};
			TreeBuilder.prototype.nestedRuleFinallyStateUpdate = function() {
				this.RULE_STACK.pop();
				this.RULE_OCCURRENCE_STACK.pop();
				this.cstNestedFinallyStateUpdate();
			};
			return TreeBuilder;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/lexer_adapter.js
	var LexerAdapter;
	var init_lexer_adapter = __esmMin((() => {
		init_parser();
		LexerAdapter = function() {
			function LexerAdapter() {}
			LexerAdapter.prototype.initLexerAdapter = function() {
				this.tokVector = [];
				this.tokVectorLength = 0;
				this.currIdx = -1;
			};
			Object.defineProperty(LexerAdapter.prototype, "input", {
				get: function() {
					return this.tokVector;
				},
				set: function(newInput) {
					if (this.selfAnalysisDone !== true) throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");
					this.reset();
					this.tokVector = newInput;
					this.tokVectorLength = newInput.length;
				},
				enumerable: true,
				configurable: true
			});
			LexerAdapter.prototype.SKIP_TOKEN = function() {
				if (this.currIdx <= this.tokVector.length - 2) {
					this.consumeToken();
					return this.LA(1);
				} else return END_OF_FILE;
			};
			LexerAdapter.prototype.LA = function(howMuch) {
				var soughtIdx = this.currIdx + howMuch;
				if (soughtIdx < 0 || this.tokVectorLength <= soughtIdx) return END_OF_FILE;
				else return this.tokVector[soughtIdx];
			};
			LexerAdapter.prototype.consumeToken = function() {
				this.currIdx++;
			};
			LexerAdapter.prototype.exportLexerState = function() {
				return this.currIdx;
			};
			LexerAdapter.prototype.importLexerState = function(newState) {
				this.currIdx = newState;
			};
			LexerAdapter.prototype.resetLexerState = function() {
				this.currIdx = -1;
			};
			LexerAdapter.prototype.moveToTerminatedState = function() {
				this.currIdx = this.tokVector.length - 1;
			};
			LexerAdapter.prototype.getLexerPosition = function() {
				return this.exportLexerState();
			};
			return LexerAdapter;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/recognizer_api.js
	var RecognizerApi;
	var init_recognizer_api = __esmMin((() => {
		init_utils();
		init_exceptions_public();
		init_parser();
		init_errors_public();
		init_checks();
		init_gast_public();
		RecognizerApi = function() {
			function RecognizerApi() {}
			RecognizerApi.prototype.ACTION = function(impl) {
				return impl.call(this);
			};
			RecognizerApi.prototype.consume = function(idx, tokType, options) {
				return this.consumeInternal(tokType, idx, options);
			};
			RecognizerApi.prototype.subrule = function(idx, ruleToCall, options) {
				return this.subruleInternal(ruleToCall, idx, options);
			};
			RecognizerApi.prototype.option = function(idx, actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, idx);
			};
			RecognizerApi.prototype.or = function(idx, altsOrOpts) {
				return this.orInternal(altsOrOpts, idx);
			};
			RecognizerApi.prototype.many = function(idx, actionORMethodDef) {
				return this.manyInternal(idx, actionORMethodDef);
			};
			RecognizerApi.prototype.atLeastOne = function(idx, actionORMethodDef) {
				return this.atLeastOneInternal(idx, actionORMethodDef);
			};
			RecognizerApi.prototype.CONSUME = function(tokType, options) {
				return this.consumeInternal(tokType, 0, options);
			};
			RecognizerApi.prototype.CONSUME1 = function(tokType, options) {
				return this.consumeInternal(tokType, 1, options);
			};
			RecognizerApi.prototype.CONSUME2 = function(tokType, options) {
				return this.consumeInternal(tokType, 2, options);
			};
			RecognizerApi.prototype.CONSUME3 = function(tokType, options) {
				return this.consumeInternal(tokType, 3, options);
			};
			RecognizerApi.prototype.CONSUME4 = function(tokType, options) {
				return this.consumeInternal(tokType, 4, options);
			};
			RecognizerApi.prototype.CONSUME5 = function(tokType, options) {
				return this.consumeInternal(tokType, 5, options);
			};
			RecognizerApi.prototype.CONSUME6 = function(tokType, options) {
				return this.consumeInternal(tokType, 6, options);
			};
			RecognizerApi.prototype.CONSUME7 = function(tokType, options) {
				return this.consumeInternal(tokType, 7, options);
			};
			RecognizerApi.prototype.CONSUME8 = function(tokType, options) {
				return this.consumeInternal(tokType, 8, options);
			};
			RecognizerApi.prototype.CONSUME9 = function(tokType, options) {
				return this.consumeInternal(tokType, 9, options);
			};
			RecognizerApi.prototype.SUBRULE = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 0, options);
			};
			RecognizerApi.prototype.SUBRULE1 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 1, options);
			};
			RecognizerApi.prototype.SUBRULE2 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 2, options);
			};
			RecognizerApi.prototype.SUBRULE3 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 3, options);
			};
			RecognizerApi.prototype.SUBRULE4 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 4, options);
			};
			RecognizerApi.prototype.SUBRULE5 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 5, options);
			};
			RecognizerApi.prototype.SUBRULE6 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 6, options);
			};
			RecognizerApi.prototype.SUBRULE7 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 7, options);
			};
			RecognizerApi.prototype.SUBRULE8 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 8, options);
			};
			RecognizerApi.prototype.SUBRULE9 = function(ruleToCall, options) {
				return this.subruleInternal(ruleToCall, 9, options);
			};
			RecognizerApi.prototype.OPTION = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 0);
			};
			RecognizerApi.prototype.OPTION1 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 1);
			};
			RecognizerApi.prototype.OPTION2 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 2);
			};
			RecognizerApi.prototype.OPTION3 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 3);
			};
			RecognizerApi.prototype.OPTION4 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 4);
			};
			RecognizerApi.prototype.OPTION5 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 5);
			};
			RecognizerApi.prototype.OPTION6 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 6);
			};
			RecognizerApi.prototype.OPTION7 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 7);
			};
			RecognizerApi.prototype.OPTION8 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 8);
			};
			RecognizerApi.prototype.OPTION9 = function(actionORMethodDef) {
				return this.optionInternal(actionORMethodDef, 9);
			};
			RecognizerApi.prototype.OR = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 0);
			};
			RecognizerApi.prototype.OR1 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 1);
			};
			RecognizerApi.prototype.OR2 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 2);
			};
			RecognizerApi.prototype.OR3 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 3);
			};
			RecognizerApi.prototype.OR4 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 4);
			};
			RecognizerApi.prototype.OR5 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 5);
			};
			RecognizerApi.prototype.OR6 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 6);
			};
			RecognizerApi.prototype.OR7 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 7);
			};
			RecognizerApi.prototype.OR8 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 8);
			};
			RecognizerApi.prototype.OR9 = function(altsOrOpts) {
				return this.orInternal(altsOrOpts, 9);
			};
			RecognizerApi.prototype.MANY = function(actionORMethodDef) {
				this.manyInternal(0, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY1 = function(actionORMethodDef) {
				this.manyInternal(1, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY2 = function(actionORMethodDef) {
				this.manyInternal(2, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY3 = function(actionORMethodDef) {
				this.manyInternal(3, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY4 = function(actionORMethodDef) {
				this.manyInternal(4, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY5 = function(actionORMethodDef) {
				this.manyInternal(5, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY6 = function(actionORMethodDef) {
				this.manyInternal(6, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY7 = function(actionORMethodDef) {
				this.manyInternal(7, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY8 = function(actionORMethodDef) {
				this.manyInternal(8, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY9 = function(actionORMethodDef) {
				this.manyInternal(9, actionORMethodDef);
			};
			RecognizerApi.prototype.MANY_SEP = function(options) {
				this.manySepFirstInternal(0, options);
			};
			RecognizerApi.prototype.MANY_SEP1 = function(options) {
				this.manySepFirstInternal(1, options);
			};
			RecognizerApi.prototype.MANY_SEP2 = function(options) {
				this.manySepFirstInternal(2, options);
			};
			RecognizerApi.prototype.MANY_SEP3 = function(options) {
				this.manySepFirstInternal(3, options);
			};
			RecognizerApi.prototype.MANY_SEP4 = function(options) {
				this.manySepFirstInternal(4, options);
			};
			RecognizerApi.prototype.MANY_SEP5 = function(options) {
				this.manySepFirstInternal(5, options);
			};
			RecognizerApi.prototype.MANY_SEP6 = function(options) {
				this.manySepFirstInternal(6, options);
			};
			RecognizerApi.prototype.MANY_SEP7 = function(options) {
				this.manySepFirstInternal(7, options);
			};
			RecognizerApi.prototype.MANY_SEP8 = function(options) {
				this.manySepFirstInternal(8, options);
			};
			RecognizerApi.prototype.MANY_SEP9 = function(options) {
				this.manySepFirstInternal(9, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE = function(actionORMethodDef) {
				this.atLeastOneInternal(0, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE1 = function(actionORMethodDef) {
				return this.atLeastOneInternal(1, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE2 = function(actionORMethodDef) {
				this.atLeastOneInternal(2, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE3 = function(actionORMethodDef) {
				this.atLeastOneInternal(3, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE4 = function(actionORMethodDef) {
				this.atLeastOneInternal(4, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE5 = function(actionORMethodDef) {
				this.atLeastOneInternal(5, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE6 = function(actionORMethodDef) {
				this.atLeastOneInternal(6, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE7 = function(actionORMethodDef) {
				this.atLeastOneInternal(7, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE8 = function(actionORMethodDef) {
				this.atLeastOneInternal(8, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE9 = function(actionORMethodDef) {
				this.atLeastOneInternal(9, actionORMethodDef);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP = function(options) {
				this.atLeastOneSepFirstInternal(0, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP1 = function(options) {
				this.atLeastOneSepFirstInternal(1, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP2 = function(options) {
				this.atLeastOneSepFirstInternal(2, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP3 = function(options) {
				this.atLeastOneSepFirstInternal(3, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP4 = function(options) {
				this.atLeastOneSepFirstInternal(4, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP5 = function(options) {
				this.atLeastOneSepFirstInternal(5, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP6 = function(options) {
				this.atLeastOneSepFirstInternal(6, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP7 = function(options) {
				this.atLeastOneSepFirstInternal(7, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP8 = function(options) {
				this.atLeastOneSepFirstInternal(8, options);
			};
			RecognizerApi.prototype.AT_LEAST_ONE_SEP9 = function(options) {
				this.atLeastOneSepFirstInternal(9, options);
			};
			RecognizerApi.prototype.RULE = function(name, implementation, config) {
				if (config === void 0) config = DEFAULT_RULE_CONFIG;
				if (contains(this.definedRulesNames, name)) {
					var error = {
						message: defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({
							topLevelRule: name,
							grammarName: this.className
						}),
						type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME,
						ruleName: name
					};
					this.definitionErrors.push(error);
				}
				this.definedRulesNames.push(name);
				var ruleImplementation = this.defineRule(name, implementation, config);
				this[name] = ruleImplementation;
				return ruleImplementation;
			};
			RecognizerApi.prototype.OVERRIDE_RULE = function(name, impl, config) {
				if (config === void 0) config = DEFAULT_RULE_CONFIG;
				var ruleErrors = [];
				ruleErrors = ruleErrors.concat(validateRuleIsOverridden(name, this.definedRulesNames, this.className));
				this.definitionErrors.push.apply(this.definitionErrors, ruleErrors);
				var ruleImplementation = this.defineRule(name, impl, config);
				this[name] = ruleImplementation;
				return ruleImplementation;
			};
			RecognizerApi.prototype.BACKTRACK = function(grammarRule, args) {
				return function() {
					this.isBackTrackingStack.push(1);
					var orgState = this.saveRecogState();
					try {
						grammarRule.apply(this, args);
						return true;
					} catch (e) {
						if (isRecognitionException(e)) return false;
						else throw e;
					} finally {
						this.reloadRecogState(orgState);
						this.isBackTrackingStack.pop();
					}
				};
			};
			RecognizerApi.prototype.getGAstProductions = function() {
				return this.gastProductionsCache;
			};
			RecognizerApi.prototype.getSerializedGastProductions = function() {
				return serializeGrammar(values(this.gastProductionsCache));
			};
			return RecognizerApi;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/recognizer_engine.js
	var RecognizerEngine;
	var init_recognizer_engine = __esmMin((() => {
		init_utils();
		init_keys();
		init_exceptions_public();
		init_lookahead();
		init_interpreter();
		init_parser();
		init_recoverable();
		init_tokens_public();
		init_tokens();
		init_lang_extensions();
		RecognizerEngine = function() {
			function RecognizerEngine() {}
			RecognizerEngine.prototype.initRecognizerEngine = function(tokenVocabulary, config) {
				this.className = classNameFromInstance(this);
				this.shortRuleNameToFull = {};
				this.fullRuleNameToShort = {};
				this.ruleShortNameIdx = 256;
				this.tokenMatcher = tokenStructuredMatcherNoCategories;
				this.definedRulesNames = [];
				this.tokensMap = {};
				this.allRuleNames = [];
				this.isBackTrackingStack = [];
				this.RULE_STACK = [];
				this.RULE_OCCURRENCE_STACK = [];
				this.gastProductionsCache = {};
				if (has(config, "serializedGrammar")) throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n	See: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n	For Further details.");
				if (isArray(tokenVocabulary)) {
					if (isEmpty(tokenVocabulary)) throw Error("A Token Vocabulary cannot be empty.\n	Note that the first argument for the parser constructor\n	is no longer a Token vector (since v4.0).");
					if (typeof tokenVocabulary[0].startOffset === "number") throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n	See: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n	For Further details.");
				}
				if (isArray(tokenVocabulary)) this.tokensMap = reduce(tokenVocabulary, function(acc, tokType) {
					acc[tokType.name] = tokType;
					return acc;
				}, {});
				else if (has(tokenVocabulary, "modes") && every(flatten(values(tokenVocabulary.modes)), isTokenType)) this.tokensMap = reduce(uniq(flatten(values(tokenVocabulary.modes))), function(acc, tokType) {
					acc[tokType.name] = tokType;
					return acc;
				}, {});
				else if (isObject(tokenVocabulary)) this.tokensMap = cloneObj(tokenVocabulary);
				else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");
				this.tokensMap["EOF"] = EOF;
				this.tokenMatcher = every(values(tokenVocabulary), function(tokenConstructor) {
					return isEmpty(tokenConstructor.categoryMatches);
				}) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
				augmentTokenTypes(values(this.tokensMap));
			};
			RecognizerEngine.prototype.defineRule = function(ruleName, impl, config) {
				if (this.selfAnalysisDone) throw Error("Grammar rule <" + ruleName + "> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");
				var resyncEnabled = has(config, "resyncEnabled") ? config.resyncEnabled : DEFAULT_RULE_CONFIG.resyncEnabled;
				var recoveryValueFunc = has(config, "recoveryValueFunc") ? config.recoveryValueFunc : DEFAULT_RULE_CONFIG.recoveryValueFunc;
				var shortName = this.ruleShortNameIdx << 12;
				this.ruleShortNameIdx++;
				this.shortRuleNameToFull[shortName] = ruleName;
				this.fullRuleNameToShort[ruleName] = shortName;
				function invokeRuleWithTry(args) {
					try {
						if (this.outputCst === true) {
							impl.apply(this, args);
							var cst = this.CST_STACK[this.CST_STACK.length - 1];
							this.cstPostRule(cst);
							return cst;
						} else return impl.apply(this, args);
					} catch (e) {
						return this.invokeRuleCatch(e, resyncEnabled, recoveryValueFunc);
					} finally {
						this.ruleFinallyStateUpdate();
					}
				}
				var wrappedGrammarRule = function(idxInCallingRule, args) {
					if (idxInCallingRule === void 0) idxInCallingRule = 0;
					this.ruleInvocationStateUpdate(shortName, ruleName, idxInCallingRule);
					return invokeRuleWithTry.call(this, args);
				};
				var ruleNamePropName = "ruleName";
				wrappedGrammarRule[ruleNamePropName] = ruleName;
				wrappedGrammarRule["originalGrammarAction"] = impl;
				return wrappedGrammarRule;
			};
			RecognizerEngine.prototype.invokeRuleCatch = function(e, resyncEnabledConfig, recoveryValueFunc) {
				var isFirstInvokedRule = this.RULE_STACK.length === 1;
				var reSyncEnabled = resyncEnabledConfig && !this.isBackTracking() && this.recoveryEnabled;
				if (isRecognitionException(e)) {
					var recogError = e;
					if (reSyncEnabled) {
						var reSyncTokType = this.findReSyncTokenType();
						if (this.isInCurrentRuleReSyncSet(reSyncTokType)) {
							recogError.resyncedTokens = this.reSyncTo(reSyncTokType);
							if (this.outputCst) {
								var partialCstResult = this.CST_STACK[this.CST_STACK.length - 1];
								partialCstResult.recoveredNode = true;
								return partialCstResult;
							} else return recoveryValueFunc();
						} else {
							if (this.outputCst) {
								var partialCstResult = this.CST_STACK[this.CST_STACK.length - 1];
								partialCstResult.recoveredNode = true;
								recogError.partialCstResult = partialCstResult;
							}
							throw recogError;
						}
					} else if (isFirstInvokedRule) {
						this.moveToTerminatedState();
						return recoveryValueFunc();
					} else throw recogError;
				} else throw e;
			};
			RecognizerEngine.prototype.optionInternal = function(actionORMethodDef, occurrence) {
				var key = this.getKeyForAutomaticLookahead(512, occurrence);
				var nestedName = this.nestedRuleBeforeClause(actionORMethodDef, key);
				try {
					return this.optionInternalLogic(actionORMethodDef, occurrence, key);
				} finally {
					if (nestedName !== void 0) this.nestedRuleFinallyClause(key, nestedName);
				}
			};
			RecognizerEngine.prototype.optionInternalNoCst = function(actionORMethodDef, occurrence) {
				var key = this.getKeyForAutomaticLookahead(512, occurrence);
				return this.optionInternalLogic(actionORMethodDef, occurrence, key);
			};
			RecognizerEngine.prototype.optionInternalLogic = function(actionORMethodDef, occurrence, key) {
				var _this = this;
				var lookAheadFunc = this.getLaFuncFromCache(key);
				var action;
				var predicate;
				if (actionORMethodDef.DEF !== void 0) {
					action = actionORMethodDef.DEF;
					predicate = actionORMethodDef.GATE;
					if (predicate !== void 0) {
						var orgLookaheadFunction_1 = lookAheadFunc;
						lookAheadFunc = function() {
							return predicate.call(_this) && orgLookaheadFunction_1.call(_this);
						};
					}
				} else action = actionORMethodDef;
				if (lookAheadFunc.call(this) === true) return action.call(this);
			};
			RecognizerEngine.prototype.atLeastOneInternal = function(prodOccurrence, actionORMethodDef) {
				var laKey = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_IDX, prodOccurrence);
				var nestedName = this.nestedRuleBeforeClause(actionORMethodDef, laKey);
				try {
					return this.atLeastOneInternalLogic(prodOccurrence, actionORMethodDef, laKey);
				} finally {
					if (nestedName !== void 0) this.nestedRuleFinallyClause(laKey, nestedName);
				}
			};
			RecognizerEngine.prototype.atLeastOneInternalNoCst = function(prodOccurrence, actionORMethodDef) {
				var key = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_IDX, prodOccurrence);
				this.atLeastOneInternalLogic(prodOccurrence, actionORMethodDef, key);
			};
			RecognizerEngine.prototype.atLeastOneInternalLogic = function(prodOccurrence, actionORMethodDef, key) {
				var _this = this;
				var lookAheadFunc = this.getLaFuncFromCache(key);
				var action;
				var predicate;
				if (actionORMethodDef.DEF !== void 0) {
					action = actionORMethodDef.DEF;
					predicate = actionORMethodDef.GATE;
					if (predicate !== void 0) {
						var orgLookaheadFunction_2 = lookAheadFunc;
						lookAheadFunc = function() {
							return predicate.call(_this) && orgLookaheadFunction_2.call(_this);
						};
					}
				} else action = actionORMethodDef;
				if (lookAheadFunc.call(this) === true) {
					var notStuck = this.doSingleRepetition(action);
					while (lookAheadFunc.call(this) === true && notStuck === true) notStuck = this.doSingleRepetition(action);
				} else throw this.raiseEarlyExitException(prodOccurrence, PROD_TYPE.REPETITION_MANDATORY, actionORMethodDef.ERR_MSG);
				this.attemptInRepetitionRecovery(this.atLeastOneInternal, [prodOccurrence, actionORMethodDef], lookAheadFunc, AT_LEAST_ONE_IDX, prodOccurrence, NextTerminalAfterAtLeastOneWalker);
			};
			RecognizerEngine.prototype.atLeastOneSepFirstInternal = function(prodOccurrence, options) {
				var laKey = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_SEP_IDX, prodOccurrence);
				var nestedName = this.nestedRuleBeforeClause(options, laKey);
				try {
					this.atLeastOneSepFirstInternalLogic(prodOccurrence, options, laKey);
				} finally {
					if (nestedName !== void 0) this.nestedRuleFinallyClause(laKey, nestedName);
				}
			};
			RecognizerEngine.prototype.atLeastOneSepFirstInternalNoCst = function(prodOccurrence, options) {
				var laKey = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_SEP_IDX, prodOccurrence);
				this.atLeastOneSepFirstInternalLogic(prodOccurrence, options, laKey);
			};
			RecognizerEngine.prototype.atLeastOneSepFirstInternalLogic = function(prodOccurrence, options, key) {
				var _this = this;
				var action = options.DEF;
				var separator = options.SEP;
				if (this.getLaFuncFromCache(key).call(this) === true) {
					action.call(this);
					var separatorLookAheadFunc = function() {
						return _this.tokenMatcher(_this.LA(1), separator);
					};
					while (this.tokenMatcher(this.LA(1), separator) === true) {
						this.CONSUME(separator);
						action.call(this);
					}
					this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
						prodOccurrence,
						separator,
						separatorLookAheadFunc,
						action,
						NextTerminalAfterAtLeastOneSepWalker
					], separatorLookAheadFunc, AT_LEAST_ONE_SEP_IDX, prodOccurrence, NextTerminalAfterAtLeastOneSepWalker);
				} else throw this.raiseEarlyExitException(prodOccurrence, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, options.ERR_MSG);
			};
			RecognizerEngine.prototype.manyInternal = function(prodOccurrence, actionORMethodDef) {
				var laKey = this.getKeyForAutomaticLookahead(768, prodOccurrence);
				var nestedName = this.nestedRuleBeforeClause(actionORMethodDef, laKey);
				try {
					return this.manyInternalLogic(prodOccurrence, actionORMethodDef, laKey);
				} finally {
					if (nestedName !== void 0) this.nestedRuleFinallyClause(laKey, nestedName);
				}
			};
			RecognizerEngine.prototype.manyInternalNoCst = function(prodOccurrence, actionORMethodDef) {
				var laKey = this.getKeyForAutomaticLookahead(768, prodOccurrence);
				return this.manyInternalLogic(prodOccurrence, actionORMethodDef, laKey);
			};
			RecognizerEngine.prototype.manyInternalLogic = function(prodOccurrence, actionORMethodDef, key) {
				var _this = this;
				var lookaheadFunction = this.getLaFuncFromCache(key);
				var action;
				var predicate;
				if (actionORMethodDef.DEF !== void 0) {
					action = actionORMethodDef.DEF;
					predicate = actionORMethodDef.GATE;
					if (predicate !== void 0) {
						var orgLookaheadFunction_3 = lookaheadFunction;
						lookaheadFunction = function() {
							return predicate.call(_this) && orgLookaheadFunction_3.call(_this);
						};
					}
				} else action = actionORMethodDef;
				var notStuck = true;
				while (lookaheadFunction.call(this) === true && notStuck === true) notStuck = this.doSingleRepetition(action);
				this.attemptInRepetitionRecovery(this.manyInternal, [prodOccurrence, actionORMethodDef], lookaheadFunction, 768, prodOccurrence, NextTerminalAfterManyWalker, notStuck);
			};
			RecognizerEngine.prototype.manySepFirstInternal = function(prodOccurrence, options) {
				var laKey = this.getKeyForAutomaticLookahead(MANY_SEP_IDX, prodOccurrence);
				var nestedName = this.nestedRuleBeforeClause(options, laKey);
				try {
					this.manySepFirstInternalLogic(prodOccurrence, options, laKey);
				} finally {
					if (nestedName !== void 0) this.nestedRuleFinallyClause(laKey, nestedName);
				}
			};
			RecognizerEngine.prototype.manySepFirstInternalNoCst = function(prodOccurrence, options) {
				var laKey = this.getKeyForAutomaticLookahead(MANY_SEP_IDX, prodOccurrence);
				this.manySepFirstInternalLogic(prodOccurrence, options, laKey);
			};
			RecognizerEngine.prototype.manySepFirstInternalLogic = function(prodOccurrence, options, key) {
				var _this = this;
				var action = options.DEF;
				var separator = options.SEP;
				if (this.getLaFuncFromCache(key).call(this) === true) {
					action.call(this);
					var separatorLookAheadFunc = function() {
						return _this.tokenMatcher(_this.LA(1), separator);
					};
					while (this.tokenMatcher(this.LA(1), separator) === true) {
						this.CONSUME(separator);
						action.call(this);
					}
					this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
						prodOccurrence,
						separator,
						separatorLookAheadFunc,
						action,
						NextTerminalAfterManySepWalker
					], separatorLookAheadFunc, MANY_SEP_IDX, prodOccurrence, NextTerminalAfterManySepWalker);
				}
			};
			RecognizerEngine.prototype.repetitionSepSecondInternal = function(prodOccurrence, separator, separatorLookAheadFunc, action, nextTerminalAfterWalker) {
				while (separatorLookAheadFunc()) {
					this.CONSUME(separator);
					action.call(this);
				}
				/* istanbul ignore else */
				this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
					prodOccurrence,
					separator,
					separatorLookAheadFunc,
					action,
					nextTerminalAfterWalker
				], separatorLookAheadFunc, AT_LEAST_ONE_SEP_IDX, prodOccurrence, nextTerminalAfterWalker);
			};
			RecognizerEngine.prototype.doSingleRepetition = function(action) {
				var beforeIteration = this.getLexerPosition();
				action.call(this);
				return this.getLexerPosition() > beforeIteration;
			};
			RecognizerEngine.prototype.orInternalNoCst = function(altsOrOpts, occurrence) {
				var alts = isArray(altsOrOpts) ? altsOrOpts : altsOrOpts.DEF;
				var laKey = this.getKeyForAutomaticLookahead(256, occurrence);
				var altIdxToTake = this.getLaFuncFromCache(laKey).call(this, alts);
				if (altIdxToTake !== void 0) return alts[altIdxToTake].ALT.call(this);
				this.raiseNoAltException(occurrence, altsOrOpts.ERR_MSG);
			};
			RecognizerEngine.prototype.orInternal = function(altsOrOpts, occurrence) {
				var laKey = this.getKeyForAutomaticLookahead(256, occurrence);
				var nestedName = this.nestedRuleBeforeClause(altsOrOpts, laKey);
				try {
					var alts = isArray(altsOrOpts) ? altsOrOpts : altsOrOpts.DEF;
					var altIdxToTake = this.getLaFuncFromCache(laKey).call(this, alts);
					if (altIdxToTake !== void 0) {
						var chosenAlternative = alts[altIdxToTake];
						var nestedAltBeforeClauseResult = this.nestedAltBeforeClause(chosenAlternative, occurrence, 256, altIdxToTake);
						try {
							return chosenAlternative.ALT.call(this);
						} finally {
							if (nestedAltBeforeClauseResult !== void 0) this.nestedRuleFinallyClause(nestedAltBeforeClauseResult.shortName, nestedAltBeforeClauseResult.nestedName);
						}
					}
					this.raiseNoAltException(occurrence, altsOrOpts.ERR_MSG);
				} finally {
					if (nestedName !== void 0) this.nestedRuleFinallyClause(laKey, nestedName);
				}
			};
			RecognizerEngine.prototype.ruleFinallyStateUpdate = function() {
				this.RULE_STACK.pop();
				this.RULE_OCCURRENCE_STACK.pop();
				this.cstFinallyStateUpdate();
				if (this.RULE_STACK.length === 0 && this.isAtEndOfInput() === false) {
					var firstRedundantTok = this.LA(1);
					var errMsg = this.errorMessageProvider.buildNotAllInputParsedMessage({
						firstRedundant: firstRedundantTok,
						ruleName: this.getCurrRuleFullName()
					});
					this.SAVE_ERROR(new NotAllInputParsedException(errMsg, firstRedundantTok));
				}
			};
			RecognizerEngine.prototype.subruleInternal = function(ruleToCall, idx, options) {
				var ruleResult;
				try {
					var args = options !== void 0 ? options.ARGS : void 0;
					ruleResult = ruleToCall.call(this, idx, args);
					this.cstPostNonTerminal(ruleResult, options !== void 0 && options.LABEL !== void 0 ? options.LABEL : ruleToCall.ruleName);
					return ruleResult;
				} catch (e) {
					this.subruleInternalError(e, options, ruleToCall.ruleName);
				}
			};
			RecognizerEngine.prototype.subruleInternalError = function(e, options, ruleName) {
				if (isRecognitionException(e) && e.partialCstResult !== void 0) {
					this.cstPostNonTerminal(e.partialCstResult, options !== void 0 && options.LABEL !== void 0 ? options.LABEL : ruleName);
					delete e.partialCstResult;
				}
				throw e;
			};
			RecognizerEngine.prototype.consumeInternal = function(tokType, idx, options) {
				var consumedToken;
				try {
					var nextToken = this.LA(1);
					if (this.tokenMatcher(nextToken, tokType) === true) {
						this.consumeToken();
						consumedToken = nextToken;
					} else this.consumeInternalError(tokType, nextToken, options);
				} catch (eFromConsumption) {
					consumedToken = this.consumeInternalRecovery(tokType, idx, eFromConsumption);
				}
				this.cstPostTerminal(options !== void 0 && options.LABEL !== void 0 ? options.LABEL : tokType.name, consumedToken);
				return consumedToken;
			};
			RecognizerEngine.prototype.consumeInternalError = function(tokType, nextToken, options) {
				var msg;
				var previousToken = this.LA(0);
				if (options !== void 0 && options.ERR_MSG) msg = options.ERR_MSG;
				else msg = this.errorMessageProvider.buildMismatchTokenMessage({
					expected: tokType,
					actual: nextToken,
					previous: previousToken,
					ruleName: this.getCurrRuleFullName()
				});
				throw this.SAVE_ERROR(new MismatchedTokenException(msg, nextToken, previousToken));
			};
			RecognizerEngine.prototype.consumeInternalRecovery = function(tokType, idx, eFromConsumption) {
				if (this.recoveryEnabled && eFromConsumption.name === "MismatchedTokenException" && !this.isBackTracking()) {
					var follows = this.getFollowsForInRuleRecovery(tokType, idx);
					try {
						return this.tryInRuleRecovery(tokType, follows);
					} catch (eFromInRuleRecovery) {
						if (eFromInRuleRecovery.name === "InRuleRecoveryException") throw eFromConsumption;
						else throw eFromInRuleRecovery;
					}
				} else throw eFromConsumption;
			};
			RecognizerEngine.prototype.saveRecogState = function() {
				var savedErrors = this.errors;
				var savedRuleStack = cloneArr(this.RULE_STACK);
				return {
					errors: savedErrors,
					lexerState: this.exportLexerState(),
					RULE_STACK: savedRuleStack,
					CST_STACK: this.CST_STACK,
					LAST_EXPLICIT_RULE_STACK: this.LAST_EXPLICIT_RULE_STACK
				};
			};
			RecognizerEngine.prototype.reloadRecogState = function(newState) {
				this.errors = newState.errors;
				this.importLexerState(newState.lexerState);
				this.RULE_STACK = newState.RULE_STACK;
			};
			RecognizerEngine.prototype.ruleInvocationStateUpdate = function(shortName, fullName, idxInCallingRule) {
				this.RULE_OCCURRENCE_STACK.push(idxInCallingRule);
				this.RULE_STACK.push(shortName);
				this.cstInvocationStateUpdate(fullName, shortName);
			};
			RecognizerEngine.prototype.isBackTracking = function() {
				return this.isBackTrackingStack.length !== 0;
			};
			RecognizerEngine.prototype.getCurrRuleFullName = function() {
				var shortName = this.getLastExplicitRuleShortName();
				return this.shortRuleNameToFull[shortName];
			};
			RecognizerEngine.prototype.shortRuleNameToFullName = function(shortName) {
				return this.shortRuleNameToFull[shortName];
			};
			RecognizerEngine.prototype.isAtEndOfInput = function() {
				return this.tokenMatcher(this.LA(1), EOF);
			};
			RecognizerEngine.prototype.reset = function() {
				this.resetLexerState();
				this.isBackTrackingStack = [];
				this.errors = [];
				this.RULE_STACK = [];
				this.LAST_EXPLICIT_RULE_STACK = [];
				this.CST_STACK = [];
				this.RULE_OCCURRENCE_STACK = [];
			};
			return RecognizerEngine;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/error_handler.js
	var ErrorHandler;
	var init_error_handler = __esmMin((() => {
		init_exceptions_public();
		init_utils();
		init_lookahead();
		init_parser();
		ErrorHandler = function() {
			function ErrorHandler() {}
			ErrorHandler.prototype.initErrorHandler = function(config) {
				this._errors = [];
				this.errorMessageProvider = defaults(config.errorMessageProvider, DEFAULT_PARSER_CONFIG.errorMessageProvider);
			};
			ErrorHandler.prototype.SAVE_ERROR = function(error) {
				if (isRecognitionException(error)) {
					error.context = {
						ruleStack: this.getHumanReadableRuleStack(),
						ruleOccurrenceStack: cloneArr(this.RULE_OCCURRENCE_STACK)
					};
					this._errors.push(error);
					return error;
				} else throw Error("Trying to save an Error which is not a RecognitionException");
			};
			Object.defineProperty(ErrorHandler.prototype, "errors", {
				get: function() {
					return cloneArr(this._errors);
				},
				set: function(newErrors) {
					this._errors = newErrors;
				},
				enumerable: true,
				configurable: true
			});
			ErrorHandler.prototype.raiseEarlyExitException = function(occurrence, prodType, userDefinedErrMsg) {
				var ruleName = this.getCurrRuleFullName();
				var ruleGrammar = this.getGAstProductions()[ruleName];
				var insideProdPaths = getLookaheadPathsForOptionalProd(occurrence, ruleGrammar, prodType, this.maxLookahead)[0];
				var actualTokens = [];
				for (var i = 1; i <= this.maxLookahead; i++) actualTokens.push(this.LA(i));
				var msg = this.errorMessageProvider.buildEarlyExitMessage({
					expectedIterationPaths: insideProdPaths,
					actual: actualTokens,
					previous: this.LA(0),
					customUserDescription: userDefinedErrMsg,
					ruleName
				});
				throw this.SAVE_ERROR(new EarlyExitException(msg, this.LA(1), this.LA(0)));
			};
			ErrorHandler.prototype.raiseNoAltException = function(occurrence, errMsgTypes) {
				var ruleName = this.getCurrRuleFullName();
				var ruleGrammar = this.getGAstProductions()[ruleName];
				var lookAheadPathsPerAlternative = getLookaheadPathsForOr(occurrence, ruleGrammar, this.maxLookahead);
				var actualTokens = [];
				for (var i = 1; i <= this.maxLookahead; i++) actualTokens.push(this.LA(i));
				var previousToken = this.LA(0);
				var errMsg = this.errorMessageProvider.buildNoViableAltMessage({
					expectedPathsPerAlt: lookAheadPathsPerAlternative,
					actual: actualTokens,
					previous: previousToken,
					customUserDescription: errMsgTypes,
					ruleName: this.getCurrRuleFullName()
				});
				throw this.SAVE_ERROR(new NoViableAltException(errMsg, this.LA(1), previousToken));
			};
			return ErrorHandler;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/context_assist.js
	var ContentAssist;
	var init_context_assist = __esmMin((() => {
		init_interpreter();
		init_utils();
		ContentAssist = function() {
			function ContentAssist() {}
			ContentAssist.prototype.initContentAssist = function() {};
			ContentAssist.prototype.computeContentAssist = function(startRuleName, precedingInput) {
				var startRuleGast = this.gastProductionsCache[startRuleName];
				if (isUndefined(startRuleGast)) throw Error("Rule ->" + startRuleName + "<- does not exist in this grammar.");
				return nextPossibleTokensAfter([startRuleGast], precedingInput, this.tokenMatcher, this.maxLookahead);
			};
			ContentAssist.prototype.getNextPossibleTokenTypes = function(grammarPath) {
				var topRuleName = first$1(grammarPath.ruleStack);
				var topProduction = this.getGAstProductions()[topRuleName];
				return new NextAfterTokenWalker(topProduction, grammarPath).startWalking();
			};
			return ContentAssist;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/gast_recorder.js
	function recordProd(prodConstructor, mainProdArg, occurrence, handleSep) {
		if (handleSep === void 0) handleSep = false;
		assertMethodIdxIsValid(occurrence);
		var prevProd = peek(this.recordingProdStack);
		var grammarAction = isFunction(mainProdArg) ? mainProdArg : mainProdArg.DEF;
		var newProd = new prodConstructor({
			definition: [],
			idx: occurrence
		});
		if (has(mainProdArg, "NAME")) newProd.name = mainProdArg.NAME;
		if (handleSep) newProd.separator = mainProdArg.SEP;
		if (has(mainProdArg, "MAX_LOOKAHEAD")) newProd.maxLookahead = mainProdArg.MAX_LOOKAHEAD;
		this.recordingProdStack.push(newProd);
		grammarAction.call(this);
		prevProd.definition.push(newProd);
		this.recordingProdStack.pop();
		return RECORDING_NULL_OBJECT;
	}
	function recordOrProd(mainProdArg, occurrence) {
		var _this = this;
		assertMethodIdxIsValid(occurrence);
		var prevProd = peek(this.recordingProdStack);
		var hasOptions = isArray(mainProdArg) === false;
		var alts = hasOptions === false ? mainProdArg : mainProdArg.DEF;
		var newOrProd = new Alternation({
			definition: [],
			idx: occurrence,
			ignoreAmbiguities: hasOptions && mainProdArg.IGNORE_AMBIGUITIES === true
		});
		if (has(mainProdArg, "NAME")) newOrProd.name = mainProdArg.NAME;
		if (has(mainProdArg, "MAX_LOOKAHEAD")) newOrProd.maxLookahead = mainProdArg.MAX_LOOKAHEAD;
		newOrProd.hasPredicates = some(alts, function(currAlt) {
			return isFunction(currAlt.GATE);
		});
		prevProd.definition.push(newOrProd);
		forEach(alts, function(currAlt) {
			var currAltFlat = new Flat({ definition: [] });
			newOrProd.definition.push(currAltFlat);
			if (has(currAlt, "NAME")) currAltFlat.name = currAlt.NAME;
			if (has(currAlt, "IGNORE_AMBIGUITIES")) currAltFlat.ignoreAmbiguities = currAlt.IGNORE_AMBIGUITIES;
			else if (has(currAlt, "GATE")) currAltFlat.ignoreAmbiguities = true;
			_this.recordingProdStack.push(currAltFlat);
			currAlt.ALT.call(_this);
			_this.recordingProdStack.pop();
		});
		return RECORDING_NULL_OBJECT;
	}
	function getIdxSuffix(idx) {
		return idx === 0 ? "" : "" + idx;
	}
	function assertMethodIdxIsValid(idx) {
		if (idx < 0 || idx > MAX_METHOD_IDX) {
			var error = /* @__PURE__ */ new Error("Invalid DSL Method idx value: <" + idx + ">\n	" + ("Idx value must be a none negative value smaller than " + (MAX_METHOD_IDX + 1)));
			error.KNOWN_RECORDER_ERROR = true;
			throw error;
		}
	}
	var RECORDING_NULL_OBJECT, HANDLE_SEPARATOR, MAX_METHOD_IDX, RFT, RECORDING_PHASE_TOKEN, RECORDING_PHASE_CSTNODE, GastRecorder;
	var init_gast_recorder = __esmMin((() => {
		init_utils();
		init_gast_public();
		init_lexer_public();
		init_tokens();
		init_tokens_public();
		init_parser();
		init_keys();
		RECORDING_NULL_OBJECT = { description: "This Object indicates the Parser is during Recording Phase" };
		Object.freeze(RECORDING_NULL_OBJECT);
		HANDLE_SEPARATOR = true;
		MAX_METHOD_IDX = Math.pow(2, 8) - 1;
		RFT = createToken({
			name: "RECORDING_PHASE_TOKEN",
			pattern: Lexer.NA
		});
		augmentTokenTypes([RFT]);
		RECORDING_PHASE_TOKEN = createTokenInstance(RFT, "This IToken indicates the Parser is in Recording Phase\n	See: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details", -1, -1, -1, -1, -1, -1);
		Object.freeze(RECORDING_PHASE_TOKEN);
		RECORDING_PHASE_CSTNODE = {
			name: "This CSTNode indicates the Parser is in Recording Phase\n	See: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",
			children: {}
		};
		GastRecorder = function() {
			function GastRecorder() {}
			GastRecorder.prototype.initGastRecorder = function(config) {
				this.recordingProdStack = [];
				this.RECORDING_PHASE = false;
			};
			GastRecorder.prototype.enableRecording = function() {
				var _this = this;
				this.RECORDING_PHASE = true;
				this.TRACE_INIT("Enable Recording", function() {
					var _loop_1 = function(i) {
						var idx = i > 0 ? i : "";
						_this["CONSUME" + idx] = function(arg1, arg2) {
							return this.consumeInternalRecord(arg1, i, arg2);
						};
						_this["SUBRULE" + idx] = function(arg1, arg2) {
							return this.subruleInternalRecord(arg1, i, arg2);
						};
						_this["OPTION" + idx] = function(arg1) {
							return this.optionInternalRecord(arg1, i);
						};
						_this["OR" + idx] = function(arg1) {
							return this.orInternalRecord(arg1, i);
						};
						_this["MANY" + idx] = function(arg1) {
							this.manyInternalRecord(i, arg1);
						};
						_this["MANY_SEP" + idx] = function(arg1) {
							this.manySepFirstInternalRecord(i, arg1);
						};
						_this["AT_LEAST_ONE" + idx] = function(arg1) {
							this.atLeastOneInternalRecord(i, arg1);
						};
						_this["AT_LEAST_ONE_SEP" + idx] = function(arg1) {
							this.atLeastOneSepFirstInternalRecord(i, arg1);
						};
					};
					/**
					* Warning Dark Voodoo Magic upcoming!
					* We are "replacing" the public parsing DSL methods API
					* With **new** alternative implementations on the Parser **instance**
					*
					* So far this is the only way I've found to avoid performance regressions during parsing time.
					* - Approx 30% performance regression was measured on Chrome 75 Canary when attempting to replace the "internal"
					*   implementations directly instead.
					*/
					for (var i = 0; i < 10; i++) _loop_1(i);
					_this["consume"] = function(idx, arg1, arg2) {
						return this.consumeInternalRecord(arg1, idx, arg2);
					};
					_this["subrule"] = function(idx, arg1, arg2) {
						return this.subruleInternalRecord(arg1, idx, arg2);
					};
					_this["option"] = function(idx, arg1) {
						return this.optionInternalRecord(arg1, idx);
					};
					_this["or"] = function(idx, arg1) {
						return this.orInternalRecord(arg1, idx);
					};
					_this["many"] = function(idx, arg1) {
						this.manyInternalRecord(idx, arg1);
					};
					_this["atLeastOne"] = function(idx, arg1) {
						this.atLeastOneInternalRecord(idx, arg1);
					};
					_this.ACTION = _this.ACTION_RECORD;
					_this.BACKTRACK = _this.BACKTRACK_RECORD;
					_this.LA = _this.LA_RECORD;
				});
			};
			GastRecorder.prototype.disableRecording = function() {
				var _this = this;
				this.RECORDING_PHASE = false;
				this.TRACE_INIT("Deleting Recording methods", function() {
					for (var i = 0; i < 10; i++) {
						var idx = i > 0 ? i : "";
						delete _this["CONSUME" + idx];
						delete _this["SUBRULE" + idx];
						delete _this["OPTION" + idx];
						delete _this["OR" + idx];
						delete _this["MANY" + idx];
						delete _this["MANY_SEP" + idx];
						delete _this["AT_LEAST_ONE" + idx];
						delete _this["AT_LEAST_ONE_SEP" + idx];
					}
					delete _this["consume"];
					delete _this["subrule"];
					delete _this["option"];
					delete _this["or"];
					delete _this["many"];
					delete _this["atLeastOne"];
					delete _this.ACTION;
					delete _this.BACKTRACK;
					delete _this.LA;
				});
			};
			GastRecorder.prototype.ACTION_RECORD = function(impl) {};
			GastRecorder.prototype.BACKTRACK_RECORD = function(grammarRule, args) {
				return function() {
					return true;
				};
			};
			GastRecorder.prototype.LA_RECORD = function(howMuch) {
				return END_OF_FILE;
			};
			GastRecorder.prototype.topLevelRuleRecord = function(name, def) {
				try {
					var newTopLevelRule = new Rule$2({
						definition: [],
						name
					});
					newTopLevelRule.name = name;
					this.recordingProdStack.push(newTopLevelRule);
					def.call(this);
					this.recordingProdStack.pop();
					return newTopLevelRule;
				} catch (originalError) {
					if (originalError.KNOWN_RECORDER_ERROR !== true) try {
						originalError.message = originalError.message + "\n	 This error was thrown during the \"grammar recording phase\" For more info see:\n	https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording";
					} catch (mutabilityError) {
						throw originalError;
					}
					throw originalError;
				}
			};
			GastRecorder.prototype.optionInternalRecord = function(actionORMethodDef, occurrence) {
				return recordProd.call(this, Option, actionORMethodDef, occurrence);
			};
			GastRecorder.prototype.atLeastOneInternalRecord = function(occurrence, actionORMethodDef) {
				recordProd.call(this, RepetitionMandatory, actionORMethodDef, occurrence);
			};
			GastRecorder.prototype.atLeastOneSepFirstInternalRecord = function(occurrence, options) {
				recordProd.call(this, RepetitionMandatoryWithSeparator, options, occurrence, HANDLE_SEPARATOR);
			};
			GastRecorder.prototype.manyInternalRecord = function(occurrence, actionORMethodDef) {
				recordProd.call(this, Repetition, actionORMethodDef, occurrence);
			};
			GastRecorder.prototype.manySepFirstInternalRecord = function(occurrence, options) {
				recordProd.call(this, RepetitionWithSeparator, options, occurrence, HANDLE_SEPARATOR);
			};
			GastRecorder.prototype.orInternalRecord = function(altsOrOpts, occurrence) {
				return recordOrProd.call(this, altsOrOpts, occurrence);
			};
			GastRecorder.prototype.subruleInternalRecord = function(ruleToCall, occurrence, options) {
				assertMethodIdxIsValid(occurrence);
				if (!ruleToCall || has(ruleToCall, "ruleName") === false) {
					var error = /* @__PURE__ */ new Error("<SUBRULE" + getIdxSuffix(occurrence) + "> argument is invalid" + (" expecting a Parser method reference but got: <" + JSON.stringify(ruleToCall) + ">") + ("\n inside top level rule: <" + this.recordingProdStack[0].name + ">"));
					error.KNOWN_RECORDER_ERROR = true;
					throw error;
				}
				var prevProd = peek(this.recordingProdStack);
				var ruleName = ruleToCall["ruleName"];
				var newNoneTerminal = new NonTerminal({
					idx: occurrence,
					nonTerminalName: ruleName,
					referencedRule: void 0
				});
				prevProd.definition.push(newNoneTerminal);
				return this.outputCst ? RECORDING_PHASE_CSTNODE : RECORDING_NULL_OBJECT;
			};
			GastRecorder.prototype.consumeInternalRecord = function(tokType, occurrence, options) {
				assertMethodIdxIsValid(occurrence);
				if (!hasShortKeyProperty(tokType)) {
					var error = /* @__PURE__ */ new Error("<CONSUME" + getIdxSuffix(occurrence) + "> argument is invalid" + (" expecting a TokenType reference but got: <" + JSON.stringify(tokType) + ">") + ("\n inside top level rule: <" + this.recordingProdStack[0].name + ">"));
					error.KNOWN_RECORDER_ERROR = true;
					throw error;
				}
				var prevProd = peek(this.recordingProdStack);
				var newNoneTerminal = new Terminal({
					idx: occurrence,
					terminalType: tokType
				});
				prevProd.definition.push(newNoneTerminal);
				return RECORDING_PHASE_TOKEN;
			};
			return GastRecorder;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/traits/perf_tracer.js
	var PerformanceTracer;
	var init_perf_tracer = __esmMin((() => {
		init_utils();
		init_parser();
		PerformanceTracer = function() {
			function PerformanceTracer() {}
			PerformanceTracer.prototype.initPerformanceTracer = function(config) {
				if (has(config, "traceInitPerf")) {
					var userTraceInitPerf = config.traceInitPerf;
					var traceIsNumber = typeof userTraceInitPerf === "number";
					this.traceInitMaxIdent = traceIsNumber ? userTraceInitPerf : Infinity;
					this.traceInitPerf = traceIsNumber ? userTraceInitPerf > 0 : userTraceInitPerf;
				} else {
					this.traceInitMaxIdent = 0;
					this.traceInitPerf = DEFAULT_PARSER_CONFIG.traceInitPerf;
				}
				this.traceInitIndent = -1;
			};
			PerformanceTracer.prototype.TRACE_INIT = function(phaseDesc, phaseImpl) {
				if (this.traceInitPerf === true) {
					this.traceInitIndent++;
					var indent = new Array(this.traceInitIndent + 1).join("	");
					if (this.traceInitIndent < this.traceInitMaxIdent) console.log(indent + "--> <" + phaseDesc + ">");
					var _a = timer(phaseImpl), time = _a.time, value = _a.value;
					/* istanbul ignore next - Difficult to reproduce specific performance behavior (>10ms) in tests */
					var traceMethod = time > 10 ? console.warn : console.log;
					if (this.traceInitIndent < this.traceInitMaxIdent) traceMethod(indent + "<-- <" + phaseDesc + "> time: " + time + "ms");
					this.traceInitIndent--;
					return value;
				} else return phaseImpl();
			};
			return PerformanceTracer;
		}();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/parse/parser/parser.js
	function EMPTY_ALT(value) {
		if (value === void 0) value = void 0;
		return function() {
			return value;
		};
	}
	var __extends, END_OF_FILE, DEFAULT_PARSER_CONFIG, DEFAULT_RULE_CONFIG, ParserDefinitionErrorType, Parser, EmbeddedActionsParser;
	var init_parser = __esmMin((() => {
		init_utils();
		init_follow();
		init_tokens_public();
		init_cst();
		init_errors_public();
		init_gast_resolver_public();
		init_recoverable();
		init_looksahead();
		init_tree_builder();
		init_lexer_adapter();
		init_recognizer_api();
		init_recognizer_engine();
		init_error_handler();
		init_context_assist();
		init_gast_recorder();
		init_perf_tracer();
		__extends = (function() {
			var extendStatics = function(d, b) {
				extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
					d.__proto__ = b;
				} || function(d, b) {
					for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
				};
				return extendStatics(d, b);
			};
			return function(d, b) {
				extendStatics(d, b);
				function __() {
					this.constructor = d;
				}
				d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
			};
		})();
		END_OF_FILE = createTokenInstance(EOF, "", NaN, NaN, NaN, NaN, NaN, NaN);
		Object.freeze(END_OF_FILE);
		DEFAULT_PARSER_CONFIG = Object.freeze({
			recoveryEnabled: false,
			maxLookahead: 4,
			ignoredIssues: {},
			dynamicTokensEnabled: false,
			outputCst: true,
			errorMessageProvider: defaultParserErrorProvider,
			nodeLocationTracking: "none",
			traceInitPerf: false,
			skipValidations: false
		});
		DEFAULT_RULE_CONFIG = Object.freeze({
			recoveryValueFunc: function() {},
			resyncEnabled: true
		});
		(function(ParserDefinitionErrorType) {
			ParserDefinitionErrorType[ParserDefinitionErrorType["INVALID_RULE_NAME"] = 0] = "INVALID_RULE_NAME";
			ParserDefinitionErrorType[ParserDefinitionErrorType["DUPLICATE_RULE_NAME"] = 1] = "DUPLICATE_RULE_NAME";
			ParserDefinitionErrorType[ParserDefinitionErrorType["INVALID_RULE_OVERRIDE"] = 2] = "INVALID_RULE_OVERRIDE";
			ParserDefinitionErrorType[ParserDefinitionErrorType["DUPLICATE_PRODUCTIONS"] = 3] = "DUPLICATE_PRODUCTIONS";
			ParserDefinitionErrorType[ParserDefinitionErrorType["UNRESOLVED_SUBRULE_REF"] = 4] = "UNRESOLVED_SUBRULE_REF";
			ParserDefinitionErrorType[ParserDefinitionErrorType["LEFT_RECURSION"] = 5] = "LEFT_RECURSION";
			ParserDefinitionErrorType[ParserDefinitionErrorType["NONE_LAST_EMPTY_ALT"] = 6] = "NONE_LAST_EMPTY_ALT";
			ParserDefinitionErrorType[ParserDefinitionErrorType["AMBIGUOUS_ALTS"] = 7] = "AMBIGUOUS_ALTS";
			ParserDefinitionErrorType[ParserDefinitionErrorType["CONFLICT_TOKENS_RULES_NAMESPACE"] = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE";
			ParserDefinitionErrorType[ParserDefinitionErrorType["INVALID_TOKEN_NAME"] = 9] = "INVALID_TOKEN_NAME";
			ParserDefinitionErrorType[ParserDefinitionErrorType["INVALID_NESTED_RULE_NAME"] = 10] = "INVALID_NESTED_RULE_NAME";
			ParserDefinitionErrorType[ParserDefinitionErrorType["DUPLICATE_NESTED_NAME"] = 11] = "DUPLICATE_NESTED_NAME";
			ParserDefinitionErrorType[ParserDefinitionErrorType["NO_NON_EMPTY_LOOKAHEAD"] = 12] = "NO_NON_EMPTY_LOOKAHEAD";
			ParserDefinitionErrorType[ParserDefinitionErrorType["AMBIGUOUS_PREFIX_ALTS"] = 13] = "AMBIGUOUS_PREFIX_ALTS";
			ParserDefinitionErrorType[ParserDefinitionErrorType["TOO_MANY_ALTS"] = 14] = "TOO_MANY_ALTS";
		})(ParserDefinitionErrorType || (ParserDefinitionErrorType = {}));
		Parser = function() {
			function Parser(tokenVocabulary, config) {
				if (config === void 0) config = DEFAULT_PARSER_CONFIG;
				this.ignoredIssues = DEFAULT_PARSER_CONFIG.ignoredIssues;
				this.definitionErrors = [];
				this.selfAnalysisDone = false;
				var that = this;
				that.initErrorHandler(config);
				that.initLexerAdapter();
				that.initLooksAhead(config);
				that.initRecognizerEngine(tokenVocabulary, config);
				that.initRecoverable(config);
				that.initTreeBuilder(config);
				that.initContentAssist();
				that.initGastRecorder(config);
				that.initPerformanceTracer(config);
				/* istanbul ignore if - complete over-kill to test this, we should only add a test when we actually hard deprecate it and throw an error... */
				if (has(config, "ignoredIssues") && config.ignoredIssues !== DEFAULT_PARSER_CONFIG.ignoredIssues) PRINT_WARNING("The <ignoredIssues> IParserConfig property is soft-deprecated and will be removed in future versions.\n	Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.");
				this.ignoredIssues = has(config, "ignoredIssues") ? config.ignoredIssues : DEFAULT_PARSER_CONFIG.ignoredIssues;
				this.skipValidations = has(config, "skipValidations") ? config.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations;
			}
			/**
			*  @deprecated use the **instance** method with the same name instead
			*/
			Parser.performSelfAnalysis = function(parserInstance) {
				parserInstance.performSelfAnalysis();
			};
			Parser.prototype.performSelfAnalysis = function() {
				var _this = this;
				this.TRACE_INIT("performSelfAnalysis", function() {
					var defErrorsMsgs;
					_this.selfAnalysisDone = true;
					var className = _this.className;
					_this.TRACE_INIT("toFastProps", function() {
						toFastProperties(_this);
					});
					_this.TRACE_INIT("Grammar Recording", function() {
						try {
							_this.enableRecording();
							forEach(_this.definedRulesNames, function(currRuleName) {
								var originalGrammarAction = _this[currRuleName]["originalGrammarAction"];
								var recordedRuleGast = void 0;
								_this.TRACE_INIT(currRuleName + " Rule", function() {
									recordedRuleGast = _this.topLevelRuleRecord(currRuleName, originalGrammarAction);
								});
								_this.gastProductionsCache[currRuleName] = recordedRuleGast;
							});
						} finally {
							_this.disableRecording();
						}
					});
					var resolverErrors = [];
					_this.TRACE_INIT("Grammar Resolving", function() {
						resolverErrors = resolveGrammar({ rules: values(_this.gastProductionsCache) });
						_this.definitionErrors.push.apply(_this.definitionErrors, resolverErrors);
					});
					_this.TRACE_INIT("Grammar Validations", function() {
						if (isEmpty(resolverErrors) && _this.skipValidations === false) {
							var validationErrors = validateGrammar({
								rules: values(_this.gastProductionsCache),
								maxLookahead: _this.maxLookahead,
								tokenTypes: values(_this.tokensMap),
								ignoredIssues: _this.ignoredIssues,
								errMsgProvider: defaultGrammarValidatorErrorProvider,
								grammarName: className
							});
							_this.definitionErrors.push.apply(_this.definitionErrors, validationErrors);
						}
					});
					if (isEmpty(_this.definitionErrors)) {
						if (_this.recoveryEnabled) _this.TRACE_INIT("computeAllProdsFollows", function() {
							_this.resyncFollows = computeAllProdsFollows(values(_this.gastProductionsCache));
						});
						_this.TRACE_INIT("ComputeLookaheadFunctions", function() {
							_this.preComputeLookaheadFunctions(values(_this.gastProductionsCache));
						});
					}
					_this.TRACE_INIT("expandAllNestedRuleNames", function() {
						_this.allRuleNames = expandAllNestedRuleNames(values(_this.gastProductionsCache), _this.fullRuleNameToShort).allRuleNames;
					});
					if (!Parser.DEFER_DEFINITION_ERRORS_HANDLING && !isEmpty(_this.definitionErrors)) {
						defErrorsMsgs = map(_this.definitionErrors, function(defError) {
							return defError.message;
						});
						throw new Error("Parser Definition Errors detected:\n " + defErrorsMsgs.join("\n-------------------------------\n"));
					}
				});
			};
			Parser.DEFER_DEFINITION_ERRORS_HANDLING = false;
			return Parser;
		}();
		applyMixins(Parser, [
			Recoverable,
			LooksAhead,
			TreeBuilder,
			LexerAdapter,
			RecognizerEngine,
			RecognizerApi,
			ErrorHandler,
			ContentAssist,
			GastRecorder,
			PerformanceTracer
		]);
		(function(_super) {
			__extends(CstParser, _super);
			function CstParser(tokenVocabulary, config) {
				if (config === void 0) config = DEFAULT_PARSER_CONFIG;
				var _this = this;
				var configClone = cloneObj(config);
				configClone.outputCst = true;
				_this = _super.call(this, tokenVocabulary, configClone) || this;
				return _this;
			}
			return CstParser;
		})(Parser);
		EmbeddedActionsParser = function(_super) {
			__extends(EmbeddedActionsParser, _super);
			function EmbeddedActionsParser(tokenVocabulary, config) {
				if (config === void 0) config = DEFAULT_PARSER_CONFIG;
				var _this = this;
				var configClone = cloneObj(config);
				configClone.outputCst = false;
				_this = _super.call(this, tokenVocabulary, configClone) || this;
				return _this;
			}
			return EmbeddedActionsParser;
		}(Parser);
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/generate/generate.js
	var init_generate = __esmMin((() => {
		init_gast_public();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/generate/generate_public.js
	var init_generate_public = __esmMin((() => {
		init_generate();
	}));
	//#endregion
	//#region ../../node_modules/chevrotain/lib_esm/src/api.js
	var init_api = __esmMin((() => {
		init_parser();
		init_lexer_public();
		init_tokens_public();
		init_errors_public();
		init_exceptions_public();
		init_lexer_errors_public();
		init_gast_public();
		init_gast_visitor_public();
		init_gast_resolver_public();
		init_generate_public();
	}));
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/Ast.mjs
	init_api();
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var parsingError = (type, message) => ({
		type,
		message
	});
	/**
	* Represents types of parsing errors.
	*/
	var ParsingErrorType;
	(function(ParsingErrorType) {
		ParsingErrorType["LexingError"] = "LexingError";
		ParsingErrorType["ParserError"] = "ParsingError";
		ParsingErrorType["StaticOffsetError"] = "StaticOffsetError";
		ParsingErrorType["StaticOffsetOutOfRangeError"] = "StaticOffsetOutOfRangeError";
		ParsingErrorType["RangeOffsetNotAllowed"] = "RangeOffsetNotAllowed";
		ParsingErrorType["InvalidRangeSize"] = "InvalidRangeSize";
	})(ParsingErrorType || (ParsingErrorType = {}));
	var AstNodeType;
	(function(AstNodeType) {
		AstNodeType["EMPTY"] = "EMPTY";
		AstNodeType["NUMBER"] = "NUMBER";
		AstNodeType["STRING"] = "STRING";
		AstNodeType["MINUS_UNARY_OP"] = "MINUS_UNARY_OP";
		AstNodeType["PLUS_UNARY_OP"] = "PLUS_UNARY_OP";
		AstNodeType["PERCENT_OP"] = "PERCENT_OP";
		AstNodeType["CONCATENATE_OP"] = "CONCATENATE_OP";
		AstNodeType["EQUALS_OP"] = "EQUALS_OP";
		AstNodeType["NOT_EQUAL_OP"] = "NOT_EQUAL_OP";
		AstNodeType["GREATER_THAN_OP"] = "GREATER_THAN_OP";
		AstNodeType["LESS_THAN_OP"] = "LESS_THAN_OP";
		AstNodeType["GREATER_THAN_OR_EQUAL_OP"] = "GREATER_THAN_OR_EQUAL_OP";
		AstNodeType["LESS_THAN_OR_EQUAL_OP"] = "LESS_THAN_OR_EQUAL_OP";
		AstNodeType["PLUS_OP"] = "PLUS_OP";
		AstNodeType["MINUS_OP"] = "MINUS_OP";
		AstNodeType["TIMES_OP"] = "TIMES_OP";
		AstNodeType["DIV_OP"] = "DIV_OP";
		AstNodeType["POWER_OP"] = "POWER_OP";
		AstNodeType["FUNCTION_CALL"] = "FUNCTION_CALL";
		AstNodeType["NAMED_EXPRESSION"] = "NAMED_EXPRESSION";
		AstNodeType["PARENTHESIS"] = "PARENTHESES";
		AstNodeType["CELL_REFERENCE"] = "CELL_REFERENCE";
		AstNodeType["CELL_RANGE"] = "CELL_RANGE";
		AstNodeType["COLUMN_RANGE"] = "COLUMN_RANGE";
		AstNodeType["ROW_RANGE"] = "ROW_RANGE";
		AstNodeType["ERROR"] = "ERROR";
		AstNodeType["ERROR_WITH_RAW_INPUT"] = "ERROR_WITH_RAW_INPUT";
		AstNodeType["ARRAY"] = "ARRAY";
	})(AstNodeType || (AstNodeType = {}));
	var RangeSheetReferenceType;
	(function(RangeSheetReferenceType) {
		RangeSheetReferenceType[RangeSheetReferenceType["RELATIVE"] = 0] = "RELATIVE";
		RangeSheetReferenceType[RangeSheetReferenceType["START_ABSOLUTE"] = 1] = "START_ABSOLUTE";
		RangeSheetReferenceType[RangeSheetReferenceType["BOTH_ABSOLUTE"] = 2] = "BOTH_ABSOLUTE";
	})(RangeSheetReferenceType || (RangeSheetReferenceType = {}));
	var buildEmptyArgAst = (leadingWhitespace) => ({
		type: AstNodeType.EMPTY,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildNumberAst = (value, leadingWhitespace) => ({
		type: AstNodeType.NUMBER,
		value,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildStringAst = (token) => {
		var _a;
		return {
			type: AstNodeType.STRING,
			value: token.image.slice(1, -1),
			leadingWhitespace: (_a = token.leadingWhitespace) === null || _a === void 0 ? void 0 : _a.image
		};
	};
	var buildCellReferenceAst = (reference, leadingWhitespace) => ({
		type: AstNodeType.CELL_REFERENCE,
		reference,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildCellRangeAst = (start, end, sheetReferenceType, leadingWhitespace) => {
		assertRangeConsistency(start, end, sheetReferenceType);
		return {
			type: AstNodeType.CELL_RANGE,
			start,
			end,
			sheetReferenceType,
			leadingWhitespace
		};
	};
	var buildColumnRangeAst = (start, end, sheetReferenceType, leadingWhitespace) => {
		assertRangeConsistency(start, end, sheetReferenceType);
		return {
			type: AstNodeType.COLUMN_RANGE,
			start,
			end,
			sheetReferenceType,
			leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
		};
	};
	var buildRowRangeAst = (start, end, sheetReferenceType, leadingWhitespace) => {
		assertRangeConsistency(start, end, sheetReferenceType);
		return {
			type: AstNodeType.ROW_RANGE,
			start,
			end,
			sheetReferenceType,
			leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
		};
	};
	var buildConcatenateOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.CONCATENATE_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildEqualsOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.EQUALS_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildNotEqualOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.NOT_EQUAL_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildGreaterThanOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.GREATER_THAN_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildLessThanOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.LESS_THAN_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildGreaterThanOrEqualOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.GREATER_THAN_OR_EQUAL_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildLessThanOrEqualOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.LESS_THAN_OR_EQUAL_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildPlusOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.PLUS_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildMinusOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.MINUS_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildTimesOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.TIMES_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildDivOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.DIV_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildPowerOpAst = (left, right, leadingWhitespace) => ({
		type: AstNodeType.POWER_OP,
		left,
		right,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildMinusUnaryOpAst = (value, leadingWhitespace) => ({
		type: AstNodeType.MINUS_UNARY_OP,
		value,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildPlusUnaryOpAst = (value, leadingWhitespace) => ({
		type: AstNodeType.PLUS_UNARY_OP,
		value,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildPercentOpAst = (value, leadingWhitespace) => ({
		type: AstNodeType.PERCENT_OP,
		value,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildProcedureAst = (procedureName, args, leadingWhitespace, internalWhitespace, hyperlink) => ({
		type: AstNodeType.FUNCTION_CALL,
		procedureName,
		args,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image,
		internalWhitespace: internalWhitespace === null || internalWhitespace === void 0 ? void 0 : internalWhitespace.image,
		hyperlink
	});
	var buildArrayAst = (args, leadingWhitespace, internalWhitespace) => ({
		type: AstNodeType.ARRAY,
		args,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image,
		internalWhitespace: internalWhitespace === null || internalWhitespace === void 0 ? void 0 : internalWhitespace.image
	});
	var buildNamedExpressionAst = (expressionName, leadingWhitespace) => ({
		type: AstNodeType.NAMED_EXPRESSION,
		expressionName,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildParenthesisAst = (expression, leadingWhitespace, internalWhitespace) => ({
		type: AstNodeType.PARENTHESIS,
		expression,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image,
		internalWhitespace: internalWhitespace === null || internalWhitespace === void 0 ? void 0 : internalWhitespace.image
	});
	var buildCellErrorAst = (error, leadingWhitespace) => ({
		type: AstNodeType.ERROR,
		error,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildErrorWithRawInputAst = (rawInput, error, leadingWhitespace) => ({
		type: AstNodeType.ERROR_WITH_RAW_INPUT,
		error,
		rawInput,
		leadingWhitespace: leadingWhitespace === null || leadingWhitespace === void 0 ? void 0 : leadingWhitespace.image
	});
	var buildParsingErrorAst = () => ({
		type: AstNodeType.ERROR,
		error: CellError.parsingError()
	});
	function assertRangeConsistency(start, end, sheetReferenceType) {
		if (start.sheet !== void 0 && end.sheet === void 0 || start.sheet === void 0 && end.sheet !== void 0) throw new Error("Start address inconsistent with end address");
		if (start.sheet === void 0 && sheetReferenceType !== RangeSheetReferenceType.RELATIVE || start.sheet !== void 0 && sheetReferenceType === RangeSheetReferenceType.RELATIVE) throw new Error("Sheet address inconsistent with sheet reference type");
	}
	function imageWithWhitespace(image, leadingWhitespace) {
		return (leadingWhitespace !== null && leadingWhitespace !== void 0 ? leadingWhitespace : "") + image;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/binaryOpTokenMap.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var binaryOpTokenMap = {
		[AstNodeType.PLUS_OP]: "+",
		[AstNodeType.MINUS_OP]: "-",
		[AstNodeType.TIMES_OP]: "*",
		[AstNodeType.DIV_OP]: "/",
		[AstNodeType.CONCATENATE_OP]: "&",
		[AstNodeType.POWER_OP]: "^",
		[AstNodeType.EQUALS_OP]: "=",
		[AstNodeType.NOT_EQUAL_OP]: "<>",
		[AstNodeType.GREATER_THAN_OP]: ">",
		[AstNodeType.GREATER_THAN_OR_EQUAL_OP]: ">=",
		[AstNodeType.LESS_THAN_OP]: "<",
		[AstNodeType.LESS_THAN_OR_EQUAL_OP]: "<="
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/Cache.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var buildCacheEntry = (ast, relativeDependencies, hasVolatileFunction, hasStructuralChangeFunction) => ({
		ast,
		relativeDependencies,
		hasVolatileFunction,
		hasStructuralChangeFunction
	});
	var Cache = class {
		constructor(functionRegistry) {
			this.functionRegistry = functionRegistry;
			this.cache = /* @__PURE__ */ new Map();
		}
		set(hash, ast) {
			const cacheEntry = buildCacheEntry(ast, collectDependencies(ast, this.functionRegistry), doesContainFunctions(ast, this.functionRegistry.isFunctionVolatile), doesContainFunctions(ast, this.functionRegistry.isFunctionDependentOnSheetStructureChange));
			this.cache.set(hash, cacheEntry);
			return cacheEntry;
		}
		get(hash) {
			return this.cache.get(hash);
		}
		maybeSetAndThenGet(hash, ast) {
			const entryFromCache = this.cache.get(hash);
			if (entryFromCache !== void 0) return entryFromCache.ast;
			else {
				this.set(hash, ast);
				return ast;
			}
		}
	};
	var doesContainFunctions = (ast, functionCriterion) => {
		switch (ast.type) {
			case AstNodeType.EMPTY:
			case AstNodeType.NUMBER:
			case AstNodeType.STRING:
			case AstNodeType.ERROR:
			case AstNodeType.ERROR_WITH_RAW_INPUT:
			case AstNodeType.CELL_REFERENCE:
			case AstNodeType.CELL_RANGE:
			case AstNodeType.COLUMN_RANGE:
			case AstNodeType.ROW_RANGE:
			case AstNodeType.NAMED_EXPRESSION: return false;
			case AstNodeType.PERCENT_OP:
			case AstNodeType.PLUS_UNARY_OP:
			case AstNodeType.MINUS_UNARY_OP: return doesContainFunctions(ast.value, functionCriterion);
			case AstNodeType.CONCATENATE_OP:
			case AstNodeType.EQUALS_OP:
			case AstNodeType.NOT_EQUAL_OP:
			case AstNodeType.LESS_THAN_OP:
			case AstNodeType.GREATER_THAN_OP:
			case AstNodeType.LESS_THAN_OR_EQUAL_OP:
			case AstNodeType.GREATER_THAN_OR_EQUAL_OP:
			case AstNodeType.MINUS_OP:
			case AstNodeType.PLUS_OP:
			case AstNodeType.TIMES_OP:
			case AstNodeType.DIV_OP:
			case AstNodeType.POWER_OP: return doesContainFunctions(ast.left, functionCriterion) || doesContainFunctions(ast.right, functionCriterion);
			case AstNodeType.PARENTHESIS: return doesContainFunctions(ast.expression, functionCriterion);
			case AstNodeType.FUNCTION_CALL:
				if (functionCriterion(ast.procedureName)) return true;
				return ast.args.some((arg) => doesContainFunctions(arg, functionCriterion));
			case AstNodeType.ARRAY: return ast.args.some((row) => row.some((arg) => doesContainFunctions(arg, functionCriterion)));
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/error-message.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* This is a class for detailed error messages across HyperFormula.
	*/
	var ErrorMessage = class {};
	ErrorMessage.DistinctSigns = "Distinct signs.";
	ErrorMessage.WrongArgNumber = "Wrong number of arguments.";
	ErrorMessage.EmptyArg = "Empty function argument.";
	ErrorMessage.EmptyArray = "Empty array not allowed.";
	ErrorMessage.ArrayDimensions = "Array dimensions are not compatible.";
	ErrorMessage.NoSpaceForArrayResult = "No space for array result.";
	ErrorMessage.ValueSmall = "Value too small.";
	ErrorMessage.ValueLarge = "Value too large.";
	ErrorMessage.BadCriterion = "Incorrect criterion.";
	ErrorMessage.RangeManySheets = "Range spans more than one sheet.";
	ErrorMessage.CellRangeExpected = "Cell range expected.";
	ErrorMessage.WrongDimension = "Wrong range dimension.";
	ErrorMessage.ScalarExpected = "Cell range not allowed.";
	ErrorMessage.NumberCoercion = "Value cannot be coerced to number.";
	ErrorMessage.NumberExpected = "Number argument expected.";
	ErrorMessage.IntegerExpected = "Value needs to be an integer.";
	ErrorMessage.BadMode = "Mode not recognized.";
	ErrorMessage.DateBounds = "Date outside of bounds.";
	ErrorMessage.OutOfSheet = "Resulting reference is out of the sheet.";
	ErrorMessage.WrongType = "Wrong type of argument.";
	ErrorMessage.NaN = "NaN or infinite value encountered.";
	ErrorMessage.EqualLength = "Ranges need to be of equal length.";
	ErrorMessage.Negative = "Value cannot be negative.";
	ErrorMessage.NotBinary = "String does not represent a binary number.";
	ErrorMessage.NotOctal = "String does not represent an octal number.";
	ErrorMessage.NotHex = "String does not represent a hexadecimal number.";
	ErrorMessage.EndStartPeriod = "End period needs to be at least start period.";
	ErrorMessage.CellRefExpected = "Cell reference expected.";
	ErrorMessage.EmptyRange = "Empty range not allowed.";
	ErrorMessage.BadRef = "Address is not correct.";
	ErrorMessage.NumberRange = "Number-only range expected.";
	ErrorMessage.ValueNotFound = "Value not found.";
	ErrorMessage.ValueBaseLarge = "Value in base too large.";
	ErrorMessage.ValueBaseSmall = "Value in base too small.";
	ErrorMessage.ValueBaseLong = "Value in base too long.";
	ErrorMessage.NegativeLength = "Length cannot be negative.";
	ErrorMessage.PatternNotFound = "Pattern not found.";
	ErrorMessage.OneValue = "Needs at least one value.";
	ErrorMessage.TwoValues = "Range needs to contain at least two elements.";
	ErrorMessage.ThreeValues = "Range needs to contain at least three elements.";
	ErrorMessage.IndexBounds = "Index out of bounds.";
	ErrorMessage.IndexLarge = "Index too large.";
	ErrorMessage.Formula = "Expected formula.";
	ErrorMessage.NegativeCount = "Count cannot be negative.";
	ErrorMessage.ParseError = "Parsing error.";
	ErrorMessage.SheetRef = "Sheet does not exist.";
	ErrorMessage.PeriodLong = "Period number cannot exceed life length.";
	ErrorMessage.InvalidDate = "Invalid date.";
	ErrorMessage.BitshiftLong = "Result of bitshift is too long.";
	ErrorMessage.EmptyString = "Empty-string argument not allowed.";
	ErrorMessage.LengthBounds = "Length out of bounds.";
	ErrorMessage.NegativeTime = "Time cannot be negative.";
	ErrorMessage.NoDefault = "No default option.";
	ErrorMessage.NoConditionMet = "None of the conditions were met.";
	ErrorMessage.Selector = "Selector cannot exceed the number of arguments.";
	ErrorMessage.StartEndDate = "Start date needs to be earlier than end date.";
	ErrorMessage.IncorrectDateTime = "String does not represent correct DateTime.";
	ErrorMessage.CharacterCodeBounds = "Character code out of bounds.";
	ErrorMessage.NonZero = "Argument cannot be 0.";
	ErrorMessage.LessThanOne = "Argument cannot be less than 1.";
	ErrorMessage.WeekendString = "Incorrect weekend bitmask string.";
	ErrorMessage.InvalidRoman = "Invalid roman numeral.";
	ErrorMessage.WrongOrder = "Wrong order of values.";
	ErrorMessage.ComplexNumberExpected = "Complex number expected.";
	ErrorMessage.ShouldBeIorJ = "Should be 'i' or 'j'.";
	ErrorMessage.SizeMismatch = "Array dimensions mismatched.";
	ErrorMessage.FunctionName = (arg) => `Function name ${arg} not recognized.`;
	ErrorMessage.NamedExpressionName = (arg) => `Named expression ${arg} not recognized.`;
	ErrorMessage.LicenseKey = (arg) => `License key is ${arg}.`;
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/CellReferenceMatcher.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Helper class for recognizing CellReference token in text
	*/
	var CellReferenceMatcher = class {
		constructor() {
			this.POSSIBLE_START_CHARACTERS = [
				...ALL_UNICODE_LETTERS_ARRAY,
				...ALL_DIGITS_ARRAY,
				"$",
				"'",
				"_"
			];
			this.cellReferenceRegexp = new RegExp(CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN, "y");
		}
		/**
		* Method used by the lexer to recognize CellReference token in text
		*
		* Note: using 'y' sticky flag for a named expression which is not supported on IE11...
		* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky
		*/
		match(text, startOffset) {
			this.cellReferenceRegexp.lastIndex = startOffset;
			const execResult = this.cellReferenceRegexp.exec(text + "@");
			if (execResult == null || execResult[1] == null) return null;
			execResult[0] = execResult[1];
			return execResult;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/NamedExpressionMatcher.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Helper class for recognizing NamedExpression token in text
	*/
	var NamedExpressionMatcher = class {
		constructor() {
			this.POSSIBLE_START_CHARACTERS = [...ALL_UNICODE_LETTERS_ARRAY, "_"];
			this.namedExpressionRegexp = new RegExp(NAMED_EXPRESSION_PATTERN, "y");
			this.r1c1CellRefRegexp = new RegExp(`^${R1C1_CELL_REFERENCE_PATTERN}$`);
		}
		/**
		* Method used by the lexer to recognize NamedExpression token in text
		*
		* Note: using 'y' sticky flag for a named expression which is not supported on IE11...
		* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky
		*/
		match(text, startOffset) {
			this.namedExpressionRegexp.lastIndex = startOffset;
			const execResult = this.namedExpressionRegexp.exec(text);
			if (execResult == null || execResult[0] == null) return null;
			if (this.r1c1CellRefRegexp.test(execResult[0])) return null;
			return execResult;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/LexerConfig.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AdditionOp = createToken({
		name: "AdditionOp",
		pattern: Lexer.NA
	});
	var PlusOp = createToken({
		name: "PlusOp",
		pattern: /\+/,
		categories: AdditionOp
	});
	var MinusOp = createToken({
		name: "MinusOp",
		pattern: /-/,
		categories: AdditionOp
	});
	var MultiplicationOp = createToken({
		name: "MultiplicationOp",
		pattern: Lexer.NA
	});
	var TimesOp = createToken({
		name: "TimesOp",
		pattern: /\*/,
		categories: MultiplicationOp
	});
	var DivOp = createToken({
		name: "DivOp",
		pattern: /\//,
		categories: MultiplicationOp
	});
	var PowerOp = createToken({
		name: "PowerOp",
		pattern: /\^/
	});
	var PercentOp = createToken({
		name: "PercentOp",
		pattern: /%/
	});
	var BooleanOp = createToken({
		name: "BooleanOp",
		pattern: Lexer.NA
	});
	var EqualsOp = createToken({
		name: "EqualsOp",
		pattern: /=/,
		categories: BooleanOp
	});
	var NotEqualOp = createToken({
		name: "NotEqualOp",
		pattern: /<>/,
		categories: BooleanOp
	});
	var GreaterThanOp = createToken({
		name: "GreaterThanOp",
		pattern: />/,
		categories: BooleanOp
	});
	var LessThanOp = createToken({
		name: "LessThanOp",
		pattern: /</,
		categories: BooleanOp
	});
	var GreaterThanOrEqualOp = createToken({
		name: "GreaterThanOrEqualOp",
		pattern: />=/,
		categories: BooleanOp
	});
	var LessThanOrEqualOp = createToken({
		name: "LessThanOrEqualOp",
		pattern: /<=/,
		categories: BooleanOp
	});
	var ConcatenateOp = createToken({
		name: "ConcatenateOp",
		pattern: /&/
	});
	var LParen = createToken({
		name: "LParen",
		pattern: /\(/
	});
	var RParen = createToken({
		name: "RParen",
		pattern: /\)/
	});
	var ArrayLParen = createToken({
		name: "ArrayLParen",
		pattern: /{/
	});
	var ArrayRParen = createToken({
		name: "ArrayRParen",
		pattern: /}/
	});
	var StringLiteral = createToken({
		name: "StringLiteral",
		pattern: /"([^"\\]*(\\.[^"\\]*)*)"/
	});
	var ErrorLiteral = createToken({
		name: "ErrorLiteral",
		pattern: /#[A-Za-z0-9\/]+[?!]?/
	});
	var RangeSeparator = createToken({
		name: "RangeSeparator",
		pattern: /* @__PURE__ */ new RegExp(":")
	});
	var ColumnRange = createToken({
		name: "ColumnRange",
		pattern: new RegExp(`${COLUMN_REFERENCE_PATTERN}:${COLUMN_REFERENCE_PATTERN}`)
	});
	var RowRange = createToken({
		name: "RowRange",
		pattern: new RegExp(`${ROW_REFERENCE_PATTERN}:${ROW_REFERENCE_PATTERN}`)
	});
	var ProcedureName = createToken({
		name: "ProcedureName",
		pattern: new RegExp(`([${UNICODE_LETTER_PATTERN}][${NON_RESERVED_CHARACTER_PATTERN}]*)\\(`)
	});
	var cellReferenceMatcher = new CellReferenceMatcher();
	var CellReference = createToken({
		name: "CellReference",
		pattern: cellReferenceMatcher.match.bind(cellReferenceMatcher),
		start_chars_hint: cellReferenceMatcher.POSSIBLE_START_CHARACTERS,
		line_breaks: false
	});
	var namedExpressionMatcher = new NamedExpressionMatcher();
	var NamedExpression = createToken({
		name: "NamedExpression",
		pattern: namedExpressionMatcher.match.bind(namedExpressionMatcher),
		start_chars_hint: namedExpressionMatcher.POSSIBLE_START_CHARACTERS,
		line_breaks: false
	});
	/**
	* Builds the configuration object for the lexer
	*/
	var buildLexerConfig = (config) => {
		const offsetProcedureNameLiteral = config.translationPackage.getFunctionTranslation("OFFSET");
		const errorMapping = config.errorMapping;
		const functionMapping = config.translationPackage.buildFunctionMapping();
		const WhiteSpace = createToken({
			name: "WhiteSpace",
			pattern: new RegExp(config.ignoreWhiteSpace === "standard" ? ODFF_WHITESPACE_PATTERN : "\\s+")
		});
		const ArrayRowSeparator = createToken({
			name: "ArrayRowSep",
			pattern: config.arrayRowSeparator
		});
		const ArrayColSeparator = createToken({
			name: "ArrayColSep",
			pattern: config.arrayColumnSeparator
		});
		const NumberLiteral = createToken({
			name: "NumberLiteral",
			pattern: new RegExp(`(([${config.decimalSeparator}]\\d+)|(\\d+([${config.decimalSeparator}]\\d*)?))(e[+-]?\\d+)?`)
		});
		const OffsetProcedureName = createToken({
			name: "OffsetProcedureName",
			pattern: new RegExp(offsetProcedureNameLiteral, "i")
		});
		let ArgSeparator;
		let inject;
		if (config.functionArgSeparator === config.arrayColumnSeparator) {
			ArgSeparator = ArrayColSeparator;
			inject = [];
		} else if (config.functionArgSeparator === config.arrayRowSeparator) {
			ArgSeparator = ArrayRowSeparator;
			inject = [];
		} else {
			ArgSeparator = createToken({
				name: "ArgSeparator",
				pattern: config.functionArgSeparator
			});
			inject = [ArgSeparator];
		}
		const allTokens = [
			WhiteSpace,
			PlusOp,
			MinusOp,
			TimesOp,
			DivOp,
			PowerOp,
			EqualsOp,
			NotEqualOp,
			PercentOp,
			GreaterThanOrEqualOp,
			LessThanOrEqualOp,
			GreaterThanOp,
			LessThanOp,
			LParen,
			RParen,
			ArrayLParen,
			ArrayRParen,
			OffsetProcedureName,
			ProcedureName,
			RangeSeparator,
			...inject,
			ColumnRange,
			RowRange,
			NumberLiteral,
			StringLiteral,
			ErrorLiteral,
			ConcatenateOp,
			BooleanOp,
			AdditionOp,
			MultiplicationOp,
			CellReference,
			NamedExpression,
			ArrayRowSeparator,
			ArrayColSeparator
		];
		return {
			ArgSeparator,
			NumberLiteral,
			OffsetProcedureName,
			ArrayRowSeparator,
			ArrayColSeparator,
			WhiteSpace,
			allTokens,
			errorMapping,
			functionMapping,
			decimalSeparator: config.decimalSeparator,
			maxColumns: config.maxColumns,
			maxRows: config.maxRows
		};
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/FormulaParser.mjs
	init_api();
	/**
	* LL(k) formula parser described using Chevrotain DSL
	*
	* It is equivalent to the grammar below:
	*
	* F -> '=' E <br/>
	* B -> K < B | K >= B ... | K <br/>
	* K -> E & K | E <br/>
	* E -> M + E | M - E | M <br/>
	* M -> W * M | W / M | W <br/>
	* W -> C * W | C <br/>
	* C -> N | R | O | A | P | num <br/>
	* N -> '(' E ')' <br/>
	* R -> A:OFFSET(..) | A:A <br/>
	* O -> OFFSET(..) | OFFSET(..):A | OFFSET(..):OFFSET(..) <br/>
	* A -> A1 | $A1 | A$1 | $A$1 <br/>
	* P -> SUM(..) <br/>
	*/
	var FormulaParser = class FormulaParser extends EmbeddedActionsParser {
		constructor(lexerConfig, resolveSheetReference) {
			super(lexerConfig.allTokens, {
				outputCst: false,
				maxLookahead: 7
			});
			this.resolveSheetReference = resolveSheetReference;
			this.booleanExpressionOrEmpty = this.RULE("booleanExpressionOrEmpty", () => {
				return this.OR([{ ALT: () => this.SUBRULE(this.booleanExpression) }, { ALT: EMPTY_ALT(buildEmptyArgAst()) }]);
			});
			/**
			* Rule for procedure expressions: SUM(1,A1)
			*/
			this.procedureExpression = this.RULE("procedureExpression", () => {
				var _a;
				const procedureNameToken = this.CONSUME(ProcedureName);
				const procedureName = procedureNameToken.image.toUpperCase().slice(0, -1);
				const canonicalProcedureName = (_a = this.lexerConfig.functionMapping[procedureName]) !== null && _a !== void 0 ? _a : procedureName;
				const args = [];
				let argument = this.SUBRULE(this.booleanExpressionOrEmpty);
				this.MANY(() => {
					var _a;
					const separator = this.CONSUME(this.lexerConfig.ArgSeparator);
					if (argument.type === AstNodeType.EMPTY) argument.leadingWhitespace = (_a = separator.leadingWhitespace) === null || _a === void 0 ? void 0 : _a.image;
					args.push(argument);
					argument = this.SUBRULE2(this.booleanExpressionOrEmpty);
				});
				args.push(argument);
				if (args.length === 1 && args[0].type === AstNodeType.EMPTY) args.length = 0;
				const rParenToken = this.CONSUME(RParen);
				return buildProcedureAst(canonicalProcedureName, args, procedureNameToken.leadingWhitespace, rParenToken.leadingWhitespace);
			});
			this.namedExpressionExpression = this.RULE("namedExpressionExpression", () => {
				const name = this.CONSUME(NamedExpression);
				return buildNamedExpressionAst(name.image, name.leadingWhitespace);
			});
			/**
			* Rule for OFFSET() function expression
			*/
			this.offsetProcedureExpression = this.RULE("offsetProcedureExpression", () => {
				const args = [];
				this.CONSUME(this.lexerConfig.OffsetProcedureName);
				this.CONSUME(LParen);
				this.MANY_SEP({
					SEP: this.lexerConfig.ArgSeparator,
					DEF: () => {
						args.push(this.SUBRULE(this.booleanExpression));
					}
				});
				this.CONSUME(RParen);
				return this.handleOffsetHeuristic(args);
			});
			/**
			* Rule for column range, e.g., A:B, Sheet1!A:B, Sheet1!A:Sheet1!B
			*/
			this.columnRangeExpression = this.RULE("columnRangeExpression", () => {
				const range = this.CONSUME(ColumnRange);
				const [startImage, endImage] = range.image.split(":");
				const firstAddress = this.ACTION(() => columnAddressFromString(startImage, this.formulaAddress, this.resolveSheetReference));
				const secondAddress = this.ACTION(() => columnAddressFromString(endImage, this.formulaAddress, this.resolveSheetReference));
				if (firstAddress === void 0 || secondAddress === void 0) return buildCellErrorAst(new CellError(ErrorType.REF));
				if (firstAddress.exceedsSheetSizeLimits(this.lexerConfig.maxColumns) || secondAddress.exceedsSheetSizeLimits(this.lexerConfig.maxColumns)) return buildErrorWithRawInputAst(range.image, new CellError(ErrorType.NAME), range.leadingWhitespace);
				if (firstAddress.sheet === void 0 && secondAddress.sheet !== void 0) return this.parsingError(ParsingErrorType.ParserError, "Malformed range expression");
				const { firstEnd, secondEnd, sheetRefType } = FormulaParser.fixSheetIdsForRangeEnds(firstAddress, secondAddress);
				return buildColumnRangeAst(firstEnd, secondEnd, sheetRefType, range.leadingWhitespace);
			});
			/**
			* Rule for row range, e.g., 1:2, Sheet1!1:2, Sheet1!1:Sheet1!2
			*/
			this.rowRangeExpression = this.RULE("rowRangeExpression", () => {
				const range = this.CONSUME(RowRange);
				const [startImage, endImage] = range.image.split(":");
				const firstAddress = this.ACTION(() => rowAddressFromString(startImage, this.formulaAddress, this.resolveSheetReference));
				const secondAddress = this.ACTION(() => rowAddressFromString(endImage, this.formulaAddress, this.resolveSheetReference));
				if (firstAddress === void 0 || secondAddress === void 0) return buildCellErrorAst(new CellError(ErrorType.REF));
				if (firstAddress.exceedsSheetSizeLimits(this.lexerConfig.maxRows) || secondAddress.exceedsSheetSizeLimits(this.lexerConfig.maxRows)) return buildErrorWithRawInputAst(range.image, new CellError(ErrorType.NAME), range.leadingWhitespace);
				if (firstAddress.sheet === void 0 && secondAddress.sheet !== void 0) return this.parsingError(ParsingErrorType.ParserError, "Malformed range expression");
				const { firstEnd, secondEnd, sheetRefType } = FormulaParser.fixSheetIdsForRangeEnds(firstAddress, secondAddress);
				return buildRowRangeAst(firstEnd, secondEnd, sheetRefType, range.leadingWhitespace);
			});
			/**
			* Rule for cell reference expression (e.g., A1, $A1, A$1, $A$1, $Sheet42!A$17)
			*/
			this.cellReference = this.RULE("cellReference", () => {
				const cell = this.CONSUME(CellReference);
				const address = this.ACTION(() => {
					return cellAddressFromString(cell.image, this.formulaAddress, this.resolveSheetReference);
				});
				if (address === void 0) return buildErrorWithRawInputAst(cell.image, new CellError(ErrorType.REF), cell.leadingWhitespace);
				else if (address.exceedsSheetSizeLimits(this.lexerConfig.maxColumns, this.lexerConfig.maxRows)) return buildErrorWithRawInputAst(cell.image, new CellError(ErrorType.NAME), cell.leadingWhitespace);
				else return buildCellReferenceAst(address, cell.leadingWhitespace);
			});
			/**
			* Rule for end range reference expression with additional checks considering range start
			*/
			this.endRangeReference = this.RULE("endRangeReference", (start) => {
				var _a;
				const end = this.CONSUME(CellReference);
				const startAddress = this.ACTION(() => {
					return cellAddressFromString(start.image, this.formulaAddress, this.resolveSheetReference);
				});
				const endAddress = this.ACTION(() => {
					return cellAddressFromString(end.image, this.formulaAddress, this.resolveSheetReference);
				});
				if (startAddress === void 0 || endAddress === void 0) return this.ACTION(() => {
					return buildErrorWithRawInputAst(`${start.image}:${end.image}`, new CellError(ErrorType.REF), start.leadingWhitespace);
				});
				else if (startAddress.exceedsSheetSizeLimits(this.lexerConfig.maxColumns, this.lexerConfig.maxRows) || endAddress.exceedsSheetSizeLimits(this.lexerConfig.maxColumns, this.lexerConfig.maxRows)) return this.ACTION(() => {
					return buildErrorWithRawInputAst(`${start.image}:${end.image}`, new CellError(ErrorType.NAME), start.leadingWhitespace);
				});
				return this.buildCellRange(startAddress, endAddress, (_a = start.leadingWhitespace) === null || _a === void 0 ? void 0 : _a.image);
			});
			/**
			* Rule for end of range expression
			*
			* End of range may be a cell reference or OFFSET() function call
			*/
			this.endOfRangeExpression = this.RULE("endOfRangeExpression", (start) => {
				return this.OR([{ ALT: () => {
					return this.SUBRULE(this.endRangeReference, { ARGS: [start] });
				} }, { ALT: () => {
					var _a;
					const offsetProcedure = this.SUBRULE(this.offsetProcedureExpression);
					const startAddress = this.ACTION(() => {
						return cellAddressFromString(start.image, this.formulaAddress, this.resolveSheetReference);
					});
					if (startAddress === void 0) return buildCellErrorAst(new CellError(ErrorType.REF));
					if (offsetProcedure.type === AstNodeType.CELL_REFERENCE) return this.buildCellRange(startAddress, offsetProcedure.reference, (_a = start.leadingWhitespace) === null || _a === void 0 ? void 0 : _a.image);
					else return this.parsingError(ParsingErrorType.RangeOffsetNotAllowed, "Range offset not allowed here");
				} }]);
			});
			/**
			* Rule for cell ranges (e.g., A1:B$3, A1:OFFSET())
			*/
			this.cellRangeExpression = this.RULE("cellRangeExpression", () => {
				const start = this.CONSUME(CellReference);
				this.CONSUME2(RangeSeparator);
				return this.SUBRULE(this.endOfRangeExpression, { ARGS: [start] });
			});
			/**
			* Rule for end range reference expression starting with offset procedure with additional checks considering range start
			*/
			this.endRangeWithOffsetStartReference = this.RULE("endRangeWithOffsetStartReference", (start) => {
				const end = this.CONSUME(CellReference);
				const endAddress = this.ACTION(() => {
					return cellAddressFromString(end.image, this.formulaAddress, this.resolveSheetReference);
				});
				if (endAddress === void 0) return this.ACTION(() => {
					return buildCellErrorAst(new CellError(ErrorType.REF));
				});
				return this.buildCellRange(start.reference, endAddress, start.leadingWhitespace);
			});
			/**
			* Rule for end of range expression
			*
			* End of range may be a cell reference or OFFSET() function call
			*/
			this.endOfRangeWithOffsetStartExpression = this.RULE("endOfRangeWithOffsetStartExpression", (start) => {
				return this.OR([{ ALT: () => {
					return this.SUBRULE(this.endRangeWithOffsetStartReference, { ARGS: [start] });
				} }, { ALT: () => {
					const offsetProcedure = this.SUBRULE(this.offsetProcedureExpression);
					if (offsetProcedure.type === AstNodeType.CELL_REFERENCE) return this.buildCellRange(start.reference, offsetProcedure.reference, start.leadingWhitespace);
					else return this.parsingError(ParsingErrorType.RangeOffsetNotAllowed, "Range offset not allowed here");
				} }]);
			});
			/**
			* Rule for expressions that start with the OFFSET function.
			*
			* The OFFSET function can occur as a cell reference, or as a part of a cell range.
			* To preserve LL(k) properties, expressions that start with the OFFSET function need a separate rule.
			*
			* Depending on the presence of the {@link RangeSeparator}, a proper {@link Ast} node type is built.
			*/
			this.offsetExpression = this.RULE("offsetExpression", () => {
				const offsetProcedure = this.SUBRULE(this.offsetProcedureExpression);
				let end;
				this.OPTION(() => {
					this.CONSUME(RangeSeparator);
					if (offsetProcedure.type === AstNodeType.CELL_RANGE) end = this.parsingError(ParsingErrorType.RangeOffsetNotAllowed, "Range offset not allowed here");
					else end = this.SUBRULE(this.endOfRangeWithOffsetStartExpression, { ARGS: [offsetProcedure] });
				});
				if (end !== void 0) return end;
				return offsetProcedure;
			});
			this.insideArrayExpression = this.RULE("insideArrayExpression", () => {
				const ret = [[]];
				ret[ret.length - 1].push(this.SUBRULE(this.booleanExpression));
				this.MANY(() => {
					this.OR([{ ALT: () => {
						this.CONSUME(this.lexerConfig.ArrayColSeparator);
						ret[ret.length - 1].push(this.SUBRULE2(this.booleanExpression));
					} }, { ALT: () => {
						this.CONSUME(this.lexerConfig.ArrayRowSeparator);
						ret.push([]);
						ret[ret.length - 1].push(this.SUBRULE3(this.booleanExpression));
					} }]);
				});
				return buildArrayAst(ret);
			});
			/**
			* Rule for parenthesis expression
			*/
			this.parenthesisExpression = this.RULE("parenthesisExpression", () => {
				const lParenToken = this.CONSUME(LParen);
				const expression = this.SUBRULE(this.booleanExpression);
				const rParenToken = this.CONSUME(RParen);
				return buildParenthesisAst(expression, lParenToken.leadingWhitespace, rParenToken.leadingWhitespace);
			});
			this.arrayExpression = this.RULE("arrayExpression", () => {
				return this.OR([{ ALT: () => {
					const ltoken = this.CONSUME(ArrayLParen);
					const ret = this.SUBRULE(this.insideArrayExpression);
					const rtoken = this.CONSUME(ArrayRParen);
					return buildArrayAst(ret.args, ltoken.leadingWhitespace, rtoken.leadingWhitespace);
				} }, { ALT: () => this.SUBRULE(this.parenthesisExpression) }]);
			});
			this.numericStringToNumber = (input) => {
				const normalized = input.replace(this.lexerConfig.decimalSeparator, ".");
				return Number(normalized);
			};
			/**
			* Rule for positive atomic expressions
			*/
			this.positiveAtomicExpression = this.RULE("positiveAtomicExpression", () => {
				var _a;
				return this.OR((_a = this.atomicExpCache) !== null && _a !== void 0 ? _a : this.atomicExpCache = [
					{ ALT: () => this.SUBRULE(this.arrayExpression) },
					{ ALT: () => this.SUBRULE(this.cellRangeExpression) },
					{ ALT: () => this.SUBRULE(this.columnRangeExpression) },
					{ ALT: () => this.SUBRULE(this.rowRangeExpression) },
					{ ALT: () => this.SUBRULE(this.offsetExpression) },
					{ ALT: () => this.SUBRULE(this.cellReference) },
					{ ALT: () => this.SUBRULE(this.procedureExpression) },
					{ ALT: () => this.SUBRULE(this.namedExpressionExpression) },
					{ ALT: () => {
						const number = this.CONSUME(this.lexerConfig.NumberLiteral);
						return buildNumberAst(this.numericStringToNumber(number.image), number.leadingWhitespace);
					} },
					{ ALT: () => {
						return buildStringAst(this.CONSUME(StringLiteral));
					} },
					{ ALT: () => {
						const token = this.CONSUME(ErrorLiteral);
						const errString = token.image.toUpperCase();
						const errorType = this.lexerConfig.errorMapping[errString];
						if (errorType) return buildCellErrorAst(new CellError(errorType), token.leadingWhitespace);
						else return this.parsingError(ParsingErrorType.ParserError, "Unknown error literal");
					} }
				]);
			});
			this.rightUnaryOpAtomicExpression = this.RULE("rightUnaryOpAtomicExpression", () => {
				const positiveAtomicExpression = this.SUBRULE(this.positiveAtomicExpression);
				const percentage = this.OPTION(() => {
					return this.CONSUME(PercentOp);
				});
				if (percentage) return buildPercentOpAst(positiveAtomicExpression, percentage.leadingWhitespace);
				return positiveAtomicExpression;
			});
			/**
			* Rule for atomic expressions, which is positive atomic expression or negation of it
			*/
			this.atomicExpression = this.RULE("atomicExpression", () => {
				return this.OR([{ ALT: () => {
					const op = this.CONSUME(AdditionOp);
					const value = this.SUBRULE(this.atomicExpression);
					if (tokenMatcher(op, PlusOp)) return buildPlusUnaryOpAst(value, op.leadingWhitespace);
					else if (tokenMatcher(op, MinusOp)) return buildMinusUnaryOpAst(value, op.leadingWhitespace);
					else {
						this.customParsingError = parsingError(ParsingErrorType.ParserError, "Mismatched token type");
						return this.customParsingError;
					}
				} }, { ALT: () => this.SUBRULE2(this.rightUnaryOpAtomicExpression) }]);
			});
			/**
			* Rule for power expression
			*/
			this.powerExpression = this.RULE("powerExpression", () => {
				let lhs = this.SUBRULE(this.atomicExpression);
				this.MANY(() => {
					const op = this.CONSUME(PowerOp);
					const rhs = this.SUBRULE2(this.atomicExpression);
					if (tokenMatcher(op, PowerOp)) lhs = buildPowerOpAst(lhs, rhs, op.leadingWhitespace);
					else this.ACTION(() => {
						throw Error("Operator not supported");
					});
				});
				return lhs;
			});
			/**
			* Rule for multiplication category operators (e.g., 1 * A1, 1 / A1)
			*/
			this.multiplicationExpression = this.RULE("multiplicationExpression", () => {
				let lhs = this.SUBRULE(this.powerExpression);
				this.MANY(() => {
					const op = this.CONSUME(MultiplicationOp);
					const rhs = this.SUBRULE2(this.powerExpression);
					if (tokenMatcher(op, TimesOp)) lhs = buildTimesOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, DivOp)) lhs = buildDivOpAst(lhs, rhs, op.leadingWhitespace);
					else this.ACTION(() => {
						throw Error("Operator not supported");
					});
				});
				return lhs;
			});
			/**
			* Rule for addition category operators (e.g., 1 + A1, 1 - A1)
			*/
			this.additionExpression = this.RULE("additionExpression", () => {
				let lhs = this.SUBRULE(this.multiplicationExpression);
				this.MANY(() => {
					const op = this.CONSUME(AdditionOp);
					const rhs = this.SUBRULE2(this.multiplicationExpression);
					if (tokenMatcher(op, PlusOp)) lhs = buildPlusOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, MinusOp)) lhs = buildMinusOpAst(lhs, rhs, op.leadingWhitespace);
					else this.ACTION(() => {
						throw Error("Operator not supported");
					});
				});
				return lhs;
			});
			/**
			* Rule for concatenation operator expression (e.g., "=" & A1)
			*/
			this.concatenateExpression = this.RULE("concatenateExpression", () => {
				let lhs = this.SUBRULE(this.additionExpression);
				this.MANY(() => {
					const op = this.CONSUME(ConcatenateOp);
					const rhs = this.SUBRULE2(this.additionExpression);
					lhs = buildConcatenateOpAst(lhs, rhs, op.leadingWhitespace);
				});
				return lhs;
			});
			/**
			* Rule for boolean expression (e.g., 1 <= A1)
			*/
			this.booleanExpression = this.RULE("booleanExpression", () => {
				let lhs = this.SUBRULE(this.concatenateExpression);
				this.MANY(() => {
					const op = this.CONSUME(BooleanOp);
					const rhs = this.SUBRULE2(this.concatenateExpression);
					if (tokenMatcher(op, EqualsOp)) lhs = buildEqualsOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, NotEqualOp)) lhs = buildNotEqualOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, GreaterThanOp)) lhs = buildGreaterThanOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, LessThanOp)) lhs = buildLessThanOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, GreaterThanOrEqualOp)) lhs = buildGreaterThanOrEqualOpAst(lhs, rhs, op.leadingWhitespace);
					else if (tokenMatcher(op, LessThanOrEqualOp)) lhs = buildLessThanOrEqualOpAst(lhs, rhs, op.leadingWhitespace);
					else this.ACTION(() => {
						throw Error("Operator not supported");
					});
				});
				return lhs;
			});
			/**
			* Entry rule
			*/
			this.formula = this.RULE("formula", () => {
				this.CONSUME(EqualsOp);
				return this.SUBRULE(this.booleanExpression);
			});
			this.lexerConfig = lexerConfig;
			this.formulaAddress = simpleCellAddress(0, 0, 0);
			this.performSelfAnalysis();
		}
		/**
		* Parses tokenized formula and builds abstract syntax tree
		*
		* @param {ExtendedToken[]} tokens - tokenized formula
		* @param {SimpleCellAddress} formulaAddress - address of the cell in which formula is located
		*/
		parseFromTokens(tokens, formulaAddress) {
			this.input = tokens;
			let ast = this.formulaWithContext(formulaAddress);
			let errors = [];
			if (this.customParsingError) errors.push(this.customParsingError);
			errors = errors.concat(this.errors.map((e) => ({
				type: ParsingErrorType.ParserError,
				message: e.message
			})));
			if (errors.length > 0) ast = buildParsingErrorAst();
			return {
				ast,
				errors
			};
		}
		reset() {
			super.reset();
			this.customParsingError = void 0;
		}
		/**
		* Entry rule wrapper that sets formula address
		*
		* @param {SimpleCellAddress} address - address of the cell in which formula is located
		*/
		formulaWithContext(address) {
			this.formulaAddress = address;
			return this.formula();
		}
		buildCellRange(firstAddress, secondAddress, leadingWhitespace) {
			if (firstAddress.sheet === void 0 && secondAddress.sheet !== void 0) return this.parsingError(ParsingErrorType.ParserError, "Malformed range expression");
			const { firstEnd, secondEnd, sheetRefType } = FormulaParser.fixSheetIdsForRangeEnds(firstAddress, secondAddress);
			return buildCellRangeAst(firstEnd, secondEnd, sheetRefType, leadingWhitespace);
		}
		static fixSheetIdsForRangeEnds(firstEnd, secondEnd) {
			const sheetRefType = FormulaParser.rangeSheetReferenceType(firstEnd.sheet, secondEnd.sheet);
			return {
				firstEnd,
				secondEnd: firstEnd.sheet !== void 0 && secondEnd.sheet === void 0 ? secondEnd.withSheet(firstEnd.sheet) : secondEnd,
				sheetRefType
			};
		}
		/**
		* Returns {@link CellReferenceAst} or {@link CellRangeAst} based on OFFSET function arguments
		*
		* @param {Ast[]} args - OFFSET function arguments
		*/
		handleOffsetHeuristic(args) {
			var _a;
			const cellArg = args[0];
			if (cellArg.type !== AstNodeType.CELL_REFERENCE) return this.parsingError(ParsingErrorType.StaticOffsetError, "First argument to OFFSET is not a reference");
			const rowsArg = args[1];
			let rowShift;
			if (rowsArg.type === AstNodeType.NUMBER && Number.isInteger(rowsArg.value)) rowShift = rowsArg.value;
			else if (rowsArg.type === AstNodeType.PLUS_UNARY_OP && rowsArg.value.type === AstNodeType.NUMBER && Number.isInteger(rowsArg.value.value)) rowShift = rowsArg.value.value;
			else if (rowsArg.type === AstNodeType.MINUS_UNARY_OP && rowsArg.value.type === AstNodeType.NUMBER && Number.isInteger(rowsArg.value.value)) rowShift = -rowsArg.value.value;
			else return this.parsingError(ParsingErrorType.StaticOffsetError, "Second argument to OFFSET is not a static number");
			const columnsArg = args[2];
			let colShift;
			if (columnsArg.type === AstNodeType.NUMBER && Number.isInteger(columnsArg.value)) colShift = columnsArg.value;
			else if (columnsArg.type === AstNodeType.PLUS_UNARY_OP && columnsArg.value.type === AstNodeType.NUMBER && Number.isInteger(columnsArg.value.value)) colShift = columnsArg.value.value;
			else if (columnsArg.type === AstNodeType.MINUS_UNARY_OP && columnsArg.value.type === AstNodeType.NUMBER && Number.isInteger(columnsArg.value.value)) colShift = -columnsArg.value.value;
			else return this.parsingError(ParsingErrorType.StaticOffsetError, "Third argument to OFFSET is not a static number");
			const heightArg = args[3];
			let height;
			if (heightArg === void 0) height = 1;
			else if (heightArg.type === AstNodeType.NUMBER) {
				height = heightArg.value;
				if (height < 1) return this.parsingError(ParsingErrorType.StaticOffsetError, "Fourth argument to OFFSET is too small number");
				else if (!Number.isInteger(height)) return this.parsingError(ParsingErrorType.StaticOffsetError, "Fourth argument to OFFSET is not integer");
			} else return this.parsingError(ParsingErrorType.StaticOffsetError, "Fourth argument to OFFSET is not a static number");
			const widthArg = args[4];
			let width;
			if (widthArg === void 0) width = 1;
			else if (widthArg.type === AstNodeType.NUMBER) {
				width = widthArg.value;
				if (width < 1) return this.parsingError(ParsingErrorType.StaticOffsetError, "Fifth argument to OFFSET is too small number");
				else if (!Number.isInteger(width)) return this.parsingError(ParsingErrorType.StaticOffsetError, "Fifth argument to OFFSET is not integer");
			} else return this.parsingError(ParsingErrorType.StaticOffsetError, "Fifth argument to OFFSET is not a static number");
			const topLeftCorner = new CellAddress(cellArg.reference.col + colShift, cellArg.reference.row + rowShift, cellArg.reference.type, (_a = cellArg.reference.sheet) !== null && _a !== void 0 ? _a : void 0);
			let absoluteCol = topLeftCorner.col;
			let absoluteRow = topLeftCorner.row;
			if (cellArg.reference.type === CellReferenceType.CELL_REFERENCE_RELATIVE || cellArg.reference.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_COL) absoluteRow = absoluteRow + this.formulaAddress.row;
			if (cellArg.reference.type === CellReferenceType.CELL_REFERENCE_RELATIVE || cellArg.reference.type === CellReferenceType.CELL_REFERENCE_ABSOLUTE_ROW) absoluteCol = absoluteCol + this.formulaAddress.col;
			if (absoluteCol < 0 || absoluteRow < 0) return buildCellErrorAst(new CellError(ErrorType.REF, ErrorMessage.OutOfSheet));
			if (width === 1 && height === 1) return buildCellReferenceAst(topLeftCorner);
			else return buildCellRangeAst(topLeftCorner, new CellAddress(topLeftCorner.col + width - 1, topLeftCorner.row + height - 1, topLeftCorner.type, topLeftCorner.sheet), cellArg.reference.sheet == null ? RangeSheetReferenceType.RELATIVE : RangeSheetReferenceType.BOTH_ABSOLUTE);
		}
		parsingError(type, message) {
			this.customParsingError = parsingError(type, message);
			return buildParsingErrorAst();
		}
		static rangeSheetReferenceType(start, end) {
			if (start === void 0) return RangeSheetReferenceType.RELATIVE;
			else if (end === void 0) return RangeSheetReferenceType.START_ABSOLUTE;
			else return RangeSheetReferenceType.BOTH_ABSOLUTE;
		}
	};
	var FormulaLexer = class FormulaLexer {
		constructor(lexerConfig) {
			this.lexerConfig = lexerConfig;
			this.lexer = new Lexer(lexerConfig.allTokens, { ensureOptimizations: true });
		}
		/**
		* Returns Lexer tokens from formula string
		*
		* @param {string} text - string representation of a formula
		*/
		tokenizeFormula(text) {
			const lexingResult = this.lexer.tokenize(text);
			let tokens = lexingResult.tokens;
			tokens = this.trimTrailingWhitespaces(tokens);
			tokens = this.skipWhitespacesInsideRanges(tokens);
			tokens = this.skipWhitespacesBeforeArgSeparators(tokens);
			lexingResult.tokens = tokens;
			return lexingResult;
		}
		skipWhitespacesInsideRanges(tokens) {
			return FormulaLexer.filterTokensByNeighbors(tokens, (previous, current, next) => {
				return (tokenMatcher(previous, CellReference) || tokenMatcher(previous, RangeSeparator)) && tokenMatcher(current, this.lexerConfig.WhiteSpace) && (tokenMatcher(next, CellReference) || tokenMatcher(next, RangeSeparator));
			});
		}
		skipWhitespacesBeforeArgSeparators(tokens) {
			return FormulaLexer.filterTokensByNeighbors(tokens, (previous, current, next) => {
				return !tokenMatcher(previous, this.lexerConfig.ArgSeparator) && tokenMatcher(current, this.lexerConfig.WhiteSpace) && tokenMatcher(next, this.lexerConfig.ArgSeparator);
			});
		}
		static filterTokensByNeighbors(tokens, shouldBeSkipped) {
			if (tokens.length < 3) return tokens;
			let i = 0;
			const filteredTokens = [tokens[i++]];
			while (i < tokens.length - 1) {
				if (!shouldBeSkipped(tokens[i - 1], tokens[i], tokens[i + 1])) filteredTokens.push(tokens[i]);
				++i;
			}
			filteredTokens.push(tokens[i]);
			return filteredTokens;
		}
		trimTrailingWhitespaces(tokens) {
			if (tokens.length > 0 && tokenMatcher(tokens[tokens.length - 1], this.lexerConfig.WhiteSpace)) tokens.pop();
			return tokens;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/Unparser.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var Unparser = class {
		constructor(config, sheetMapping, namedExpressions) {
			this.config = config;
			this.sheetMapping = sheetMapping;
			this.namedExpressions = namedExpressions;
		}
		unparse(ast, address) {
			return "=" + this.unparseAst(ast, address);
		}
		unparseAst(ast, address) {
			var _a, _b;
			switch (ast.type) {
				case AstNodeType.EMPTY: return imageWithWhitespace("", ast.leadingWhitespace);
				case AstNodeType.NUMBER: return imageWithWhitespace(formatNumber(ast.value, this.config.decimalSeparator), ast.leadingWhitespace);
				case AstNodeType.STRING: return imageWithWhitespace("\"" + ast.value + "\"", ast.leadingWhitespace);
				case AstNodeType.FUNCTION_CALL: {
					const args = ast.args.map((arg) => arg !== void 0 ? this.unparseAst(arg, address) : "").join(this.config.functionArgSeparator);
					return imageWithWhitespace((this.config.translationPackage.isFunctionTranslated(ast.procedureName) ? this.config.translationPackage.getFunctionTranslation(ast.procedureName) : ast.procedureName) + "(" + args + imageWithWhitespace(")", ast.internalWhitespace), ast.leadingWhitespace);
				}
				case AstNodeType.NAMED_EXPRESSION: return imageWithWhitespace(((_a = this.namedExpressions.nearestNamedExpression(ast.expressionName, address.sheet)) === null || _a === void 0 ? void 0 : _a.displayName) || ast.expressionName, ast.leadingWhitespace);
				case AstNodeType.CELL_REFERENCE: {
					let image;
					if (ast.reference.sheet !== void 0) image = this.unparseSheetName(ast.reference.sheet) + "!";
					else image = "";
					image += (_b = ast.reference.unparse(address)) !== null && _b !== void 0 ? _b : this.config.translationPackage.getErrorTranslation(ErrorType.REF);
					return imageWithWhitespace(image, ast.leadingWhitespace);
				}
				case AstNodeType.COLUMN_RANGE:
				case AstNodeType.ROW_RANGE:
				case AstNodeType.CELL_RANGE: return imageWithWhitespace(this.formatRange(ast, address), ast.leadingWhitespace);
				case AstNodeType.PLUS_UNARY_OP: {
					const unparsedExpr = this.unparseAst(ast.value, address);
					return imageWithWhitespace("+", ast.leadingWhitespace) + unparsedExpr;
				}
				case AstNodeType.MINUS_UNARY_OP: {
					const unparsedExpr = this.unparseAst(ast.value, address);
					return imageWithWhitespace("-", ast.leadingWhitespace) + unparsedExpr;
				}
				case AstNodeType.PERCENT_OP: return this.unparseAst(ast.value, address) + imageWithWhitespace("%", ast.leadingWhitespace);
				case AstNodeType.ERROR: return imageWithWhitespace(this.config.translationPackage.getErrorTranslation(ast.error ? ast.error.type : ErrorType.ERROR), ast.leadingWhitespace);
				case AstNodeType.ERROR_WITH_RAW_INPUT: return imageWithWhitespace(ast.rawInput, ast.leadingWhitespace);
				case AstNodeType.PARENTHESIS: return imageWithWhitespace("(" + this.unparseAst(ast.expression, address) + imageWithWhitespace(")", ast.internalWhitespace), ast.leadingWhitespace);
				case AstNodeType.ARRAY: return imageWithWhitespace("{" + ast.args.map((row) => row.map((val) => this.unparseAst(val, address)).join(this.config.arrayColumnSeparator)).join(this.config.arrayRowSeparator) + imageWithWhitespace("}", ast.internalWhitespace), ast.leadingWhitespace);
				default: {
					const left = this.unparseAst(ast.left, address);
					const right = this.unparseAst(ast.right, address);
					return left + imageWithWhitespace(binaryOpTokenMap[ast.type], ast.leadingWhitespace) + right;
				}
			}
		}
		/**
		* Unparses a sheet name.
		* @param {number} sheetId - the ID of the sheet
		* @returns {string} the unparsed sheet name
		*/
		unparseSheetName(sheetId) {
			const sheetName = sheetIndexToString(sheetId, (id) => this.sheetMapping.getSheetNameOrThrowError(id, { includePlaceholders: true }));
			if (sheetName === void 0) throw new NoSheetWithIdError(sheetId);
			return sheetName;
		}
		formatRange(ast, baseAddress) {
			let startSheeet = "";
			let endSheet = "";
			if (ast.start.sheet !== void 0 && ast.sheetReferenceType !== RangeSheetReferenceType.RELATIVE) startSheeet = this.unparseSheetName(ast.start.sheet) + "!";
			if (ast.end.sheet !== void 0 && ast.sheetReferenceType === RangeSheetReferenceType.BOTH_ABSOLUTE) endSheet = this.unparseSheetName(ast.end.sheet) + "!";
			const unparsedStart = ast.start.unparse(baseAddress);
			const unparsedEnd = ast.end.unparse(baseAddress);
			if (unparsedStart === void 0 || unparsedEnd === void 0) return this.config.translationPackage.getErrorTranslation(ErrorType.REF);
			return `${startSheeet}${unparsedStart}:${endSheet}${unparsedEnd}`;
		}
	};
	function formatNumber(number, decimalSeparator) {
		return number.toString().replace(".", decimalSeparator);
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/ParserWithCaching.mjs
	init_api();
	/**
	* Parses formula using caching if feasible.
	*/
	var ParserWithCaching = class ParserWithCaching {
		constructor(config, functionRegistry, resolveSheetReference) {
			this.config = config;
			this.functionRegistry = functionRegistry;
			this.resolveSheetReference = resolveSheetReference;
			this.statsCacheUsed = 0;
			this.lexerConfig = buildLexerConfig(config);
			this.lexer = new FormulaLexer(this.lexerConfig);
			this.formulaParser = new FormulaParser(this.lexerConfig, this.resolveSheetReference);
			this.cache = new Cache(this.functionRegistry);
		}
		/**
		* Parses a formula.
		*
		* @param text - formula to parse
		* @param formulaAddress - address with regard to which formula should be parsed. Impacts computed addresses in R0C0 format.
		*/
		parse(text, formulaAddress) {
			this.formulaAddress = formulaAddress;
			const lexerResult = this.tokenizeFormula(text);
			if (lexerResult.errors.length > 0) {
				const errors = lexerResult.errors.map((e) => ({
					type: ParsingErrorType.LexingError,
					message: e.message
				}));
				return {
					ast: buildParsingErrorAst(),
					errors,
					hasVolatileFunction: false,
					hasStructuralChangeFunction: false,
					dependencies: []
				};
			}
			const hash = this.computeHashFromTokens(lexerResult.tokens, formulaAddress);
			let cacheResult = this.cache.get(hash);
			if (cacheResult !== void 0) ++this.statsCacheUsed;
			else {
				const processedTokens = this.bindWhitespacesToTokens(lexerResult.tokens);
				const parsingResult = this.formulaParser.parseFromTokens(processedTokens, formulaAddress);
				if (parsingResult.errors.length > 0) return Object.assign(Object.assign({}, parsingResult), {
					hasVolatileFunction: false,
					hasStructuralChangeFunction: false,
					dependencies: []
				});
				else cacheResult = this.cache.set(hash, parsingResult.ast);
			}
			const { ast, hasVolatileFunction, hasStructuralChangeFunction } = cacheResult;
			const astWithNoReversedRanges = this.convertReversedRangesToRegularRanges(ast);
			return {
				ast: astWithNoReversedRanges,
				errors: [],
				hasVolatileFunction,
				hasStructuralChangeFunction,
				dependencies: collectDependencies(astWithNoReversedRanges, this.functionRegistry)
			};
		}
		convertReversedRangesToRegularRanges(ast) {
			switch (ast.type) {
				case AstNodeType.EMPTY:
				case AstNodeType.NUMBER:
				case AstNodeType.STRING:
				case AstNodeType.ERROR:
				case AstNodeType.ERROR_WITH_RAW_INPUT:
				case AstNodeType.CELL_REFERENCE:
				case AstNodeType.NAMED_EXPRESSION: return ast;
				case AstNodeType.CELL_RANGE: {
					const { start, end } = ast;
					const orderedEnds = this.orderCellRangeEnds(start, end);
					return Object.assign(Object.assign({}, ast), {
						start: orderedEnds.start,
						end: orderedEnds.end
					});
				}
				case AstNodeType.COLUMN_RANGE: {
					const { start, end } = ast;
					const orderedEnds = this.orderColumnRangeEnds(start, end);
					return Object.assign(Object.assign({}, ast), {
						start: orderedEnds.start,
						end: orderedEnds.end
					});
				}
				case AstNodeType.ROW_RANGE: {
					const { start, end } = ast;
					const orderedEnds = this.orderRowRangeEnds(start, end);
					return Object.assign(Object.assign({}, ast), {
						start: orderedEnds.start,
						end: orderedEnds.end
					});
				}
				case AstNodeType.PERCENT_OP:
				case AstNodeType.PLUS_UNARY_OP:
				case AstNodeType.MINUS_UNARY_OP: {
					const valueFixed = this.convertReversedRangesToRegularRanges(ast.value);
					return Object.assign(Object.assign({}, ast), { value: valueFixed });
				}
				case AstNodeType.CONCATENATE_OP:
				case AstNodeType.EQUALS_OP:
				case AstNodeType.NOT_EQUAL_OP:
				case AstNodeType.LESS_THAN_OP:
				case AstNodeType.GREATER_THAN_OP:
				case AstNodeType.LESS_THAN_OR_EQUAL_OP:
				case AstNodeType.GREATER_THAN_OR_EQUAL_OP:
				case AstNodeType.MINUS_OP:
				case AstNodeType.PLUS_OP:
				case AstNodeType.TIMES_OP:
				case AstNodeType.DIV_OP:
				case AstNodeType.POWER_OP: {
					const leftFixed = this.convertReversedRangesToRegularRanges(ast.left);
					const rightFixed = this.convertReversedRangesToRegularRanges(ast.right);
					return Object.assign(Object.assign({}, ast), {
						left: leftFixed,
						right: rightFixed
					});
				}
				case AstNodeType.PARENTHESIS: {
					const exprFixed = this.convertReversedRangesToRegularRanges(ast.expression);
					return Object.assign(Object.assign({}, ast), { expression: exprFixed });
				}
				case AstNodeType.FUNCTION_CALL: {
					const argsFixed = ast.args.map((arg) => this.convertReversedRangesToRegularRanges(arg));
					return Object.assign(Object.assign({}, ast), { args: argsFixed });
				}
				case AstNodeType.ARRAY: {
					const argsFixed = ast.args.map((argsRow) => argsRow.map((arg) => this.convertReversedRangesToRegularRanges(arg)));
					return Object.assign(Object.assign({}, ast), { args: argsFixed });
				}
			}
		}
		orderCellRangeEnds(endA, endB) {
			const ends = [endA, endB];
			const [startCol, endCol] = ends.map((e) => e.toColumnAddress()).sort(ColumnAddress.compareByAbsoluteAddress(this.formulaAddress));
			const [startRow, endRow] = ends.map((e) => e.toRowAddress()).sort(RowAddress.compareByAbsoluteAddress(this.formulaAddress));
			const [startSheet, endSheet] = ends.map((e) => e.sheet).sort(ParserWithCaching.compareSheetIds.bind(this));
			return {
				start: CellAddress.fromColAndRow(startCol, startRow, startSheet),
				end: CellAddress.fromColAndRow(endCol, endRow, endSheet)
			};
		}
		orderColumnRangeEnds(endA, endB) {
			const ends = [endA, endB];
			const [startCol, endCol] = ends.sort(ColumnAddress.compareByAbsoluteAddress(this.formulaAddress));
			const [startSheet, endSheet] = ends.map((e) => e.sheet).sort(ParserWithCaching.compareSheetIds.bind(this));
			return {
				start: new ColumnAddress(startCol.type, startCol.col, startSheet),
				end: new ColumnAddress(endCol.type, endCol.col, endSheet)
			};
		}
		orderRowRangeEnds(endA, endB) {
			const ends = [endA, endB];
			const [startRow, endRow] = ends.sort(RowAddress.compareByAbsoluteAddress(this.formulaAddress));
			const [startSheet, endSheet] = ends.map((e) => e.sheet).sort(ParserWithCaching.compareSheetIds.bind(this));
			return {
				start: new RowAddress(startRow.type, startRow.row, startSheet),
				end: new RowAddress(endRow.type, endRow.row, endSheet)
			};
		}
		static compareSheetIds(sheetA, sheetB) {
			sheetA = sheetA != null ? sheetA : Infinity;
			sheetB = sheetB != null ? sheetB : Infinity;
			return sheetA - sheetB;
		}
		fetchCachedResultForAst(ast) {
			const hash = this.computeHashFromAst(ast);
			return this.fetchCachedResult(hash);
		}
		fetchCachedResult(hash) {
			const cacheResult = this.cache.get(hash);
			if (cacheResult === void 0) throw new Error("There is no AST with such key in the cache");
			else {
				const { ast, hasVolatileFunction, hasStructuralChangeFunction, relativeDependencies } = cacheResult;
				return {
					ast,
					errors: [],
					hasVolatileFunction,
					hasStructuralChangeFunction,
					dependencies: relativeDependencies
				};
			}
		}
		computeHashFromTokens(tokens, baseAddress) {
			var _a;
			let hash = "";
			let idx = 0;
			while (idx < tokens.length) {
				const token = tokens[idx];
				if (tokenMatcher(token, CellReference)) {
					const cellAddress = cellAddressFromString(token.image, baseAddress, this.resolveSheetReference);
					if (cellAddress === void 0) hash = hash.concat(token.image);
					else hash = hash.concat(cellAddress.hash(true));
				} else if (tokenMatcher(token, ProcedureName)) {
					const procedureName = token.image.toUpperCase().slice(0, -1);
					const canonicalProcedureName = (_a = this.lexerConfig.functionMapping[procedureName]) !== null && _a !== void 0 ? _a : procedureName;
					hash = hash.concat(canonicalProcedureName, "(");
				} else if (tokenMatcher(token, ColumnRange)) {
					const [start, end] = token.image.split(":");
					const startAddress = columnAddressFromString(start, baseAddress, this.resolveSheetReference);
					const endAddress = columnAddressFromString(end, baseAddress, this.resolveSheetReference);
					if (startAddress === void 0 || endAddress === void 0) hash = hash.concat("!REF");
					else hash = hash.concat(startAddress.hash(true), ":", endAddress.hash(true));
				} else if (tokenMatcher(token, RowRange)) {
					const [start, end] = token.image.split(":");
					const startAddress = rowAddressFromString(start, baseAddress, this.resolveSheetReference);
					const endAddress = rowAddressFromString(end, baseAddress, this.resolveSheetReference);
					if (startAddress === void 0 || endAddress === void 0) hash = hash.concat("!REF");
					else hash = hash.concat(startAddress.hash(true), ":", endAddress.hash(true));
				} else hash = hash.concat(token.image);
				idx++;
			}
			return hash;
		}
		rememberNewAst(ast) {
			const hash = this.computeHashFromAst(ast);
			return this.cache.maybeSetAndThenGet(hash, ast);
		}
		computeHashFromAst(ast) {
			return "=" + this.computeHashOfAstNode(ast);
		}
		computeHashOfAstNode(ast) {
			switch (ast.type) {
				case AstNodeType.EMPTY: return ast.leadingWhitespace || "";
				case AstNodeType.NUMBER: return imageWithWhitespace(formatNumber(ast.value, this.config.decimalSeparator), ast.leadingWhitespace);
				case AstNodeType.STRING: return imageWithWhitespace("\"" + ast.value + "\"", ast.leadingWhitespace);
				case AstNodeType.NAMED_EXPRESSION: return imageWithWhitespace(ast.expressionName, ast.leadingWhitespace);
				case AstNodeType.FUNCTION_CALL: {
					const args = ast.args.map((arg) => this.computeHashOfAstNode(arg)).join(this.config.functionArgSeparator);
					return imageWithWhitespace(ast.procedureName + "(" + args + imageWithWhitespace(")", ast.internalWhitespace), ast.leadingWhitespace);
				}
				case AstNodeType.CELL_REFERENCE: return imageWithWhitespace(ast.reference.hash(true), ast.leadingWhitespace);
				case AstNodeType.COLUMN_RANGE:
				case AstNodeType.ROW_RANGE:
				case AstNodeType.CELL_RANGE: {
					const start = ast.start.hash(ast.sheetReferenceType !== RangeSheetReferenceType.RELATIVE);
					const end = ast.end.hash(ast.sheetReferenceType === RangeSheetReferenceType.BOTH_ABSOLUTE);
					return imageWithWhitespace(start + ":" + end, ast.leadingWhitespace);
				}
				case AstNodeType.MINUS_UNARY_OP: return imageWithWhitespace("-" + this.computeHashOfAstNode(ast.value), ast.leadingWhitespace);
				case AstNodeType.PLUS_UNARY_OP: return imageWithWhitespace("+" + this.computeHashOfAstNode(ast.value), ast.leadingWhitespace);
				case AstNodeType.PERCENT_OP: return this.computeHashOfAstNode(ast.value) + imageWithWhitespace("%", ast.leadingWhitespace);
				case AstNodeType.ERROR: return imageWithWhitespace(this.config.translationPackage.getErrorTranslation(ast.error ? ast.error.type : ErrorType.ERROR), ast.leadingWhitespace);
				case AstNodeType.ERROR_WITH_RAW_INPUT: return imageWithWhitespace(ast.rawInput, ast.leadingWhitespace);
				case AstNodeType.ARRAY: return imageWithWhitespace("{" + ast.args.map((row) => row.map((val) => this.computeHashOfAstNode(val)).join(",")).join(";") + imageWithWhitespace("}", ast.internalWhitespace), ast.leadingWhitespace);
				case AstNodeType.PARENTHESIS: return imageWithWhitespace("(" + this.computeHashOfAstNode(ast.expression) + imageWithWhitespace(")", ast.internalWhitespace), ast.leadingWhitespace);
				default: return this.computeHashOfAstNode(ast.left) + imageWithWhitespace(binaryOpTokenMap[ast.type], ast.leadingWhitespace) + this.computeHashOfAstNode(ast.right);
			}
		}
		bindWhitespacesToTokens(tokens) {
			const processedTokens = [];
			const first = tokens[0];
			if (!tokenMatcher(first, this.lexerConfig.WhiteSpace)) processedTokens.push(first);
			for (let i = 1; i < tokens.length; ++i) {
				const current = tokens[i];
				if (tokenMatcher(current, this.lexerConfig.WhiteSpace)) continue;
				const previous = tokens[i - 1];
				if (tokenMatcher(previous, this.lexerConfig.WhiteSpace)) current.leadingWhitespace = previous;
				processedTokens.push(current);
			}
			return processedTokens;
		}
		tokenizeFormula(text) {
			return this.lexer.tokenizeFormula(text);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/collectDependencies.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var collectDependenciesFn = (ast, functionRegistry, dependenciesSet, needArgument) => {
		switch (ast.type) {
			case AstNodeType.EMPTY:
			case AstNodeType.NUMBER:
			case AstNodeType.STRING:
			case AstNodeType.ERROR: return;
			case AstNodeType.NAMED_EXPRESSION:
				if (needArgument) dependenciesSet.push(new NamedExpressionDependency(ast.expressionName));
				return;
			case AstNodeType.CELL_REFERENCE:
				if (needArgument) dependenciesSet.push(new AddressDependency(ast.reference));
				return;
			case AstNodeType.CELL_RANGE:
				if (needArgument && ast.start.sheet === ast.end.sheet) dependenciesSet.push(new CellRangeDependency(ast.start, ast.end));
				return;
			case AstNodeType.COLUMN_RANGE:
				if (needArgument && ast.start.sheet === ast.end.sheet) dependenciesSet.push(new ColumnRangeDependency(ast.start, ast.end));
				return;
			case AstNodeType.ROW_RANGE:
				if (needArgument && ast.start.sheet === ast.end.sheet) dependenciesSet.push(new RowRangeDependency(ast.start, ast.end));
				return;
			case AstNodeType.PERCENT_OP:
			case AstNodeType.PLUS_UNARY_OP:
			case AstNodeType.MINUS_UNARY_OP:
				collectDependenciesFn(ast.value, functionRegistry, dependenciesSet, true);
				return;
			case AstNodeType.CONCATENATE_OP:
			case AstNodeType.EQUALS_OP:
			case AstNodeType.NOT_EQUAL_OP:
			case AstNodeType.LESS_THAN_OP:
			case AstNodeType.GREATER_THAN_OP:
			case AstNodeType.LESS_THAN_OR_EQUAL_OP:
			case AstNodeType.GREATER_THAN_OR_EQUAL_OP:
			case AstNodeType.MINUS_OP:
			case AstNodeType.PLUS_OP:
			case AstNodeType.TIMES_OP:
			case AstNodeType.DIV_OP:
			case AstNodeType.POWER_OP:
				collectDependenciesFn(ast.left, functionRegistry, dependenciesSet, true);
				collectDependenciesFn(ast.right, functionRegistry, dependenciesSet, true);
				return;
			case AstNodeType.PARENTHESIS:
				collectDependenciesFn(ast.expression, functionRegistry, dependenciesSet, needArgument);
				return;
			case AstNodeType.FUNCTION_CALL: {
				const functionNeedArgument = !functionRegistry.doesFunctionNeedArgumentToBeComputed(ast.procedureName);
				ast.args.forEach((argAst) => collectDependenciesFn(argAst, functionRegistry, dependenciesSet, functionNeedArgument));
				return;
			}
		}
	};
	var collectDependencies = (ast, functionRegistry) => {
		const result = new Array();
		collectDependenciesFn(ast, functionRegistry, result, true);
		return result;
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/parser/RelativeDependency.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AddressDependency = class {
		constructor(dependency) {
			this.dependency = dependency;
		}
		absolutize(baseAddress) {
			return this.dependency.toSimpleCellAddress(baseAddress);
		}
	};
	var CellRangeDependency = class {
		constructor(start, end) {
			this.start = start;
			this.end = end;
		}
		absolutize(baseAddress) {
			return new AbsoluteCellRange(this.start.toSimpleCellAddress(baseAddress), this.end.toSimpleCellAddress(baseAddress));
		}
	};
	var ColumnRangeDependency = class {
		constructor(start, end) {
			this.start = start;
			this.end = end;
		}
		absolutize(baseAddress) {
			const start = this.start.toSimpleColumnAddress(baseAddress);
			const end = this.end.toSimpleColumnAddress(baseAddress);
			return new AbsoluteColumnRange(start.sheet, start.col, end.col);
		}
	};
	var RowRangeDependency = class {
		constructor(start, end) {
			this.start = start;
			this.end = end;
		}
		absolutize(baseAddress) {
			const start = this.start.toSimpleRowAddress(baseAddress);
			const end = this.end.toSimpleRowAddress(baseAddress);
			return new AbsoluteRowRange(start.sheet, start.row, end.row);
		}
	};
	var NamedExpressionDependency = class {
		constructor(name) {
			this.name = name;
		}
		absolutize(_baseAddress) {
			return this;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/absolutizeDependencies.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Converts dependencies from maybe relative addressing to absolute addressing.
	*
	* @param deps - list of addresses in R0C0 format
	* @param baseAddress - base address with regard to which make a convertion
	*/
	var absolutizeDependencies = (deps, baseAddress) => {
		return deps.map((dep) => dep.absolutize(baseAddress));
	};
	var filterDependenciesOutOfScope = (deps) => {
		return deps.filter((dep) => {
			if (dep instanceof NamedExpressionDependency) return true;
			if (dep instanceof AbsoluteCellRange) return !(isColOrRowInvalid(dep.start) || isColOrRowInvalid(dep.end));
			else return !isColOrRowInvalid(dep);
		});
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/InterpreterValue.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* A symbol representing an empty cell value.
	*/
	var EmptyValue = Symbol("Empty value");
	function getRawValue(num) {
		if (num instanceof RichNumber) return num.val;
		else return num;
	}
	var RichNumber = class {
		constructor(val, format) {
			this.val = val;
			this.format = format;
		}
		fromNumber(val) {
			return new this.constructor(val);
		}
	};
	function cloneNumber(val, newVal) {
		if (typeof val === "number") return newVal;
		else {
			const ret = val.fromNumber(newVal);
			ret.format = val.format;
			return ret;
		}
	}
	var DateNumber = class extends RichNumber {
		getDetailedType() {
			return NumberType.NUMBER_DATE;
		}
	};
	var CurrencyNumber = class extends RichNumber {
		getDetailedType() {
			return NumberType.NUMBER_CURRENCY;
		}
	};
	var TimeNumber = class extends RichNumber {
		getDetailedType() {
			return NumberType.NUMBER_TIME;
		}
	};
	var DateTimeNumber = class extends RichNumber {
		getDetailedType() {
			return NumberType.NUMBER_DATETIME;
		}
	};
	var PercentNumber = class extends RichNumber {
		getDetailedType() {
			return NumberType.NUMBER_PERCENT;
		}
	};
	function isExtendedNumber(val) {
		return typeof val === "number" || val instanceof RichNumber;
	}
	var NumberType;
	(function(NumberType) {
		NumberType["NUMBER_RAW"] = "NUMBER_RAW";
		NumberType["NUMBER_DATE"] = "NUMBER_DATE";
		NumberType["NUMBER_TIME"] = "NUMBER_TIME";
		NumberType["NUMBER_DATETIME"] = "NUMBER_DATETIME";
		NumberType["NUMBER_CURRENCY"] = "NUMBER_CURRENCY";
		NumberType["NUMBER_PERCENT"] = "NUMBER_PERCENT";
	})(NumberType || (NumberType = {}));
	function getTypeOfExtendedNumber(num) {
		if (num instanceof RichNumber) return num.getDetailedType();
		else return NumberType.NUMBER_RAW;
	}
	function getFormatOfExtendedNumber(num) {
		if (num instanceof RichNumber) return num.format;
		else return;
	}
	function getTypeFormatOfExtendedNumber(num) {
		if (num instanceof RichNumber) return {
			type: num.getDetailedType(),
			format: num.format
		};
		else return { type: NumberType.NUMBER_RAW };
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/SimpleRangeValue.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* A class that represents a range of data.
	*/
	var SimpleRangeValue = class SimpleRangeValue {
		/**
		* In most cases, it's more convenient to create a `SimpleRangeValue` object
		* by calling one of the [static factory methods](#fromrange).
		*/
		constructor(_data, range, dependencyGraph, _hasOnlyNumbers) {
			this._data = _data;
			this.range = range;
			this.dependencyGraph = dependencyGraph;
			this._hasOnlyNumbers = _hasOnlyNumbers;
			this.size = _data === void 0 ? new ArraySize(range.effectiveWidth(dependencyGraph), range.effectiveHeight(dependencyGraph)) : new ArraySize(_data[0].length, _data.length);
		}
		/**
		* Returns the range data as a 2D array.
		*/
		get data() {
			this.ensureThatComputed();
			return this._data;
		}
		/**
		* A factory method. Returns a `SimpleRangeValue` object with the provided range address and the provided data.
		*/
		static fromRange(data, range, dependencyGraph) {
			return new SimpleRangeValue(data, range, dependencyGraph, true);
		}
		/**
		* A factory method. Returns a `SimpleRangeValue` object with the provided numeric data.
		*/
		static onlyNumbers(data) {
			return new SimpleRangeValue(data, void 0, void 0, true);
		}
		/**
		* A factory method. Returns a `SimpleRangeValue` object with the provided data.
		*/
		static onlyValues(data) {
			return new SimpleRangeValue(data, void 0, void 0, void 0);
		}
		/**
		* A factory method. Returns a `SimpleRangeValue` object with the provided range address.
		*/
		static onlyRange(range, dependencyGraph) {
			return new SimpleRangeValue(void 0, range, dependencyGraph, void 0);
		}
		/**
		* A factory method. Returns a `SimpleRangeValue` object that contains a single value.
		*/
		static fromScalar(scalar) {
			return new SimpleRangeValue([[scalar]], void 0, void 0, void 0);
		}
		/**
		* Returns `true` if and only if the `SimpleRangeValue` has no address set.
		*/
		isAdHoc() {
			return this.range === void 0;
		}
		/**
		* Returns the number of columns contained in the range.
		*/
		width() {
			return this.size.width;
		}
		/**
		* Returns the number of rows contained in the range.
		*/
		height() {
			return this.size.height;
		}
		/**
		* Returns the range data as a 1D array.
		*/
		valuesFromTopLeftCorner() {
			this.ensureThatComputed();
			const ret = [];
			for (let i = 0; i < this._data.length; i++) for (let j = 0; j < this._data[0].length; j++) ret.push(this._data[i][j]);
			return ret;
		}
		/**
		* Generates the addresses of the cells contained in the range assuming the provided address is the left corner of the range.
		*/
		*effectiveAddressesFromData(leftCorner) {
			for (let row = 0; row < this.data.length; ++row) {
				const rowData = this.data[row];
				for (let col = 0; col < rowData.length; ++col) yield simpleCellAddress(leftCorner.sheet, leftCorner.col + col, leftCorner.row + row);
			}
		}
		/**
		* Generates values and addresses of the cells contained in the range assuming the provided address is the left corner of the range.
		*
		* This method combines the functionalities of [`iterateValuesFromTopLeftCorner()`](#iteratevaluesfromtopleftcorner) and [`effectiveAddressesFromData()`](#effectiveaddressesfromdata).
		*/
		*entriesFromTopLeftCorner(leftCorner) {
			this.ensureThatComputed();
			for (let row = 0; row < this.size.height; ++row) for (let col = 0; col < this.size.width; ++col) yield [this._data[row][col], simpleCellAddress(leftCorner.sheet, leftCorner.col + col, leftCorner.row + row)];
		}
		/**
		* Generates the values of the cells contained in the range assuming the provided address is the left corner of the range.
		*/
		*iterateValuesFromTopLeftCorner() {
			yield* this.valuesFromTopLeftCorner();
		}
		/**
		* Returns the number of cells contained in the range.
		*/
		numberOfElements() {
			return this.size.width * this.size.height;
		}
		/**
		* Returns `true` if and only if the range contains only numeric values.
		*/
		hasOnlyNumbers() {
			if (this._hasOnlyNumbers === void 0) {
				this._hasOnlyNumbers = true;
				for (const row of this.data) for (const v of row) if (typeof v !== "number") {
					this._hasOnlyNumbers = false;
					return false;
				}
			}
			return this._hasOnlyNumbers;
		}
		/**
		* Returns the range data as a 2D array of numbers.
		*
		* Internal use only.
		*/
		rawNumbers() {
			return this._data;
		}
		/**
		* Returns the range data as a 2D array.
		*
		* Internal use only.
		*/
		rawData() {
			var _a;
			this.ensureThatComputed();
			return (_a = this._data) !== null && _a !== void 0 ? _a : [];
		}
		/**
		* Returns `true` if and only if the range has the same width and height as the `other` range object.
		*/
		sameDimensionsAs(other) {
			return this.width() === other.width() && this.height() === other.height();
		}
		/**
		* Computes the range data if it is not computed yet.
		*/
		ensureThatComputed() {
			if (this._data !== void 0) return;
			this._hasOnlyNumbers = true;
			this._data = this.range.addressesArrayMap(this.dependencyGraph, (cellFromRange) => {
				const value = this.dependencyGraph.getCellValue(cellFromRange);
				if (value instanceof SimpleRangeValue) {
					this._hasOnlyNumbers = false;
					return new CellError(ErrorType.VALUE, ErrorMessage.ScalarExpected);
				} else if (isExtendedNumber(value)) return value;
				else {
					this._hasOnlyNumbers = false;
					return value;
				}
			});
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/ContentChanges.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ContentChanges = class ContentChanges {
		constructor() {
			this.changes = /* @__PURE__ */ new Map();
		}
		static empty() {
			return new ContentChanges();
		}
		addAll(other) {
			for (const change of other.changes.values()) this.add(change.address, change);
			return this;
		}
		addChange(newValue, address, oldValue) {
			this.addInterpreterValue(newValue, address, oldValue);
		}
		exportChanges(exporter) {
			let ret = [];
			this.changes.forEach((e) => {
				const change = exporter.exportChange(e);
				if (Array.isArray(change)) ret = ret.concat(change);
				else ret.push(change);
			});
			return ret;
		}
		getChanges() {
			return Array.from(this.changes.values());
		}
		isEmpty() {
			return this.changes.size === 0;
		}
		add(address, change) {
			const value = change.value;
			if (value instanceof SimpleRangeValue) for (const cellAddress of value.effectiveAddressesFromData(address)) this.changes.delete(addressKey(cellAddress));
			this.changes.set(addressKey(address), change);
		}
		addInterpreterValue(value, address, oldValue) {
			this.add(address, {
				address,
				value,
				oldValue
			});
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/NamedExpressions.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var InternalNamedExpression = class InternalNamedExpression {
		constructor(displayName, address, added, options) {
			this.displayName = displayName;
			this.address = address;
			this.added = added;
			this.options = options;
		}
		normalizeExpressionName() {
			return this.displayName.toLowerCase();
		}
		copy() {
			return new InternalNamedExpression(this.displayName, this.address, this.added, this.options);
		}
	};
	var WorkbookStore = class {
		constructor() {
			this.mapping = /* @__PURE__ */ new Map();
		}
		has(expressionName) {
			return this.mapping.has(this.normalizeExpressionName(expressionName));
		}
		isNameAvailable(expressionName) {
			const normalizedExpressionName = this.normalizeExpressionName(expressionName);
			const namedExpression = this.mapping.get(normalizedExpressionName);
			return !(namedExpression && namedExpression.added);
		}
		add(namedExpression) {
			this.mapping.set(namedExpression.normalizeExpressionName(), namedExpression);
		}
		get(expressionName) {
			return this.mapping.get(this.normalizeExpressionName(expressionName));
		}
		getExisting(expressionName) {
			const namedExpression = this.mapping.get(this.normalizeExpressionName(expressionName));
			if (namedExpression && namedExpression.added) return namedExpression;
			else return;
		}
		remove(expressionName) {
			const normalizedExpressionName = this.normalizeExpressionName(expressionName);
			const namedExpression = this.mapping.get(normalizedExpressionName);
			if (namedExpression) namedExpression.added = false;
		}
		getAllNamedExpressions() {
			return Array.from(this.mapping.values()).filter((ne) => ne.added);
		}
		normalizeExpressionName(expressionName) {
			return expressionName.toLowerCase();
		}
	};
	var WorksheetStore = class {
		constructor() {
			this.mapping = /* @__PURE__ */ new Map();
		}
		add(namedExpression) {
			this.mapping.set(this.normalizeExpressionName(namedExpression.displayName), namedExpression);
		}
		get(expressionName) {
			return this.mapping.get(this.normalizeExpressionName(expressionName));
		}
		has(expressionName) {
			return this.mapping.has(this.normalizeExpressionName(expressionName));
		}
		getAllNamedExpressions() {
			return Array.from(this.mapping.values()).filter((ne) => ne.added);
		}
		isNameAvailable(expressionName) {
			const normalizedExpressionName = this.normalizeExpressionName(expressionName);
			return !this.mapping.has(normalizedExpressionName);
		}
		remove(expressionName) {
			const normalizedExpressionName = this.normalizeExpressionName(expressionName);
			if (this.mapping.get(normalizedExpressionName)) this.mapping.delete(normalizedExpressionName);
		}
		normalizeExpressionName(expressionName) {
			return expressionName.toLowerCase();
		}
	};
	var NamedExpressions = class NamedExpressions {
		constructor() {
			this.nextNamedExpressionRow = 0;
			this.workbookStore = new WorkbookStore();
			this.worksheetStores = /* @__PURE__ */ new Map();
			this.addressCache = /* @__PURE__ */ new Map();
		}
		isNameAvailable(expressionName, sheetId) {
			var _a, _b;
			if (sheetId === void 0) return this.workbookStore.isNameAvailable(expressionName);
			else return (_b = (_a = this.worksheetStore(sheetId)) === null || _a === void 0 ? void 0 : _a.isNameAvailable(expressionName)) !== null && _b !== void 0 ? _b : true;
		}
		namedExpressionInAddress(row) {
			const namedExpression = this.addressCache.get(row);
			if (namedExpression && namedExpression.added) return namedExpression;
			else return;
		}
		namedExpressionForScope(expressionName, sheetId) {
			var _a;
			if (sheetId === void 0) return this.workbookStore.getExisting(expressionName);
			else return (_a = this.worksheetStore(sheetId)) === null || _a === void 0 ? void 0 : _a.get(expressionName);
		}
		nearestNamedExpression(expressionName, sheetId) {
			var _a, _b;
			return (_b = (_a = this.worksheetStore(sheetId)) === null || _a === void 0 ? void 0 : _a.get(expressionName)) !== null && _b !== void 0 ? _b : this.workbookStore.getExisting(expressionName);
		}
		isExpressionInScope(expressionName, sheetId) {
			var _a, _b;
			return (_b = (_a = this.worksheetStore(sheetId)) === null || _a === void 0 ? void 0 : _a.has(expressionName)) !== null && _b !== void 0 ? _b : false;
		}
		/**
		* Checks the validity of a named-expression's name.
		*
		* The name:
		* - Must start with a Unicode letter or with an underscore (`_`).
		* - Can contain only Unicode letters, numbers, underscores, and periods (`.`).
		* - Can't be the same as any possible reference in the A1 notation (`[A-Za-z]+[0-9]+`).
		* - Can't be the same as any possible reference in the R1C1 notation (`[rR][0-9]*[cC][0-9]*`).
		*
		* The naming rules follow the [OpenDocument](https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#__RefHeading__1017964_715980110) standard.
		*/
		isNameValid(expressionName) {
			const a1CellRefRegexp = new RegExp(`^${CELL_REFERENCE_PATTERN}$`);
			const r1c1CellRefRegexp = new RegExp(`^${R1C1_CELL_REFERENCE_PATTERN}$`);
			const namedExpRegexp = new RegExp(`^${NAMED_EXPRESSION_PATTERN}$`);
			if (a1CellRefRegexp.test(expressionName) || r1c1CellRefRegexp.test(expressionName)) return false;
			return namedExpRegexp.test(expressionName);
		}
		addNamedExpression(expressionName, sheetId, options) {
			const store = sheetId === void 0 ? this.workbookStore : this.worksheetStoreOrCreate(sheetId);
			let namedExpression = store.get(expressionName);
			if (namedExpression !== void 0) {
				namedExpression.added = true;
				namedExpression.displayName = expressionName;
				namedExpression.options = options;
			} else {
				namedExpression = new InternalNamedExpression(expressionName, this.nextAddress(), true, options);
				store.add(namedExpression);
			}
			this.addressCache.set(namedExpression.address.row, namedExpression);
			return namedExpression;
		}
		restoreNamedExpression(namedExpression, sheetId) {
			const store = sheetId === void 0 ? this.workbookStore : this.worksheetStoreOrCreate(sheetId);
			namedExpression.added = true;
			store.add(namedExpression);
			this.addressCache.set(namedExpression.address.row, namedExpression);
			return namedExpression;
		}
		namedExpressionOrPlaceholder(expressionName, sheetId) {
			var _a;
			return (_a = this.worksheetStoreOrCreate(sheetId).get(expressionName)) !== null && _a !== void 0 ? _a : this.workbookNamedExpressionOrPlaceholder(expressionName);
		}
		workbookNamedExpressionOrPlaceholder(expressionName) {
			let namedExpression = this.workbookStore.get(expressionName);
			if (namedExpression === void 0) {
				namedExpression = new InternalNamedExpression(expressionName, this.nextAddress(), false);
				this.workbookStore.add(namedExpression);
			}
			return namedExpression;
		}
		remove(expressionName, sheetId) {
			let store;
			if (sheetId === void 0) store = this.workbookStore;
			else store = this.worksheetStore(sheetId);
			const namedExpression = store === null || store === void 0 ? void 0 : store.get(expressionName);
			if (store === void 0 || namedExpression === void 0 || !namedExpression.added) throw Error("Named expression does not exist");
			store.remove(expressionName);
			if (store instanceof WorksheetStore && store.mapping.size === 0) this.worksheetStores.delete(sheetId);
			this.addressCache.delete(namedExpression.address.row);
		}
		getAllNamedExpressionsNamesInScope(sheetId) {
			return this.getAllNamedExpressions().filter(({ scope }) => scope === sheetId).map((ne) => ne.expression.displayName);
		}
		getAllNamedExpressionsNames() {
			return this.getAllNamedExpressions().map((ne) => ne.expression.displayName);
		}
		getAllNamedExpressions() {
			const storedNamedExpressions = [];
			this.workbookStore.getAllNamedExpressions().forEach((expr) => {
				storedNamedExpressions.push({
					expression: expr,
					scope: void 0
				});
			});
			this.worksheetStores.forEach((store, sheetNum) => {
				store.getAllNamedExpressions().forEach((expr) => {
					storedNamedExpressions.push({
						expression: expr,
						scope: sheetNum
					});
				});
			});
			return storedNamedExpressions;
		}
		getAllNamedExpressionsForScope(scope) {
			var _a, _b;
			if (scope === void 0) return this.workbookStore.getAllNamedExpressions();
			else return (_b = (_a = this.worksheetStores.get(scope)) === null || _a === void 0 ? void 0 : _a.getAllNamedExpressions()) !== null && _b !== void 0 ? _b : [];
		}
		worksheetStoreOrCreate(sheetId) {
			let store = this.worksheetStores.get(sheetId);
			if (!store) {
				store = new WorksheetStore();
				this.worksheetStores.set(sheetId, store);
			}
			return store;
		}
		worksheetStore(sheetId) {
			return this.worksheetStores.get(sheetId);
		}
		nextAddress() {
			return simpleCellAddress(NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS, 0, this.nextNamedExpressionRow++);
		}
	};
	NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS = -1;
	var doesContainRelativeReferences = (ast) => {
		switch (ast.type) {
			case AstNodeType.EMPTY:
			case AstNodeType.NUMBER:
			case AstNodeType.STRING:
			case AstNodeType.ERROR:
			case AstNodeType.ERROR_WITH_RAW_INPUT: return false;
			case AstNodeType.CELL_REFERENCE: return !ast.reference.isAbsolute();
			case AstNodeType.CELL_RANGE:
			case AstNodeType.COLUMN_RANGE:
			case AstNodeType.ROW_RANGE: return !ast.start.isAbsolute();
			case AstNodeType.NAMED_EXPRESSION: return false;
			case AstNodeType.PERCENT_OP:
			case AstNodeType.PLUS_UNARY_OP:
			case AstNodeType.MINUS_UNARY_OP: return doesContainRelativeReferences(ast.value);
			case AstNodeType.CONCATENATE_OP:
			case AstNodeType.EQUALS_OP:
			case AstNodeType.NOT_EQUAL_OP:
			case AstNodeType.LESS_THAN_OP:
			case AstNodeType.GREATER_THAN_OP:
			case AstNodeType.LESS_THAN_OR_EQUAL_OP:
			case AstNodeType.GREATER_THAN_OR_EQUAL_OP:
			case AstNodeType.MINUS_OP:
			case AstNodeType.PLUS_OP:
			case AstNodeType.TIMES_OP:
			case AstNodeType.DIV_OP:
			case AstNodeType.POWER_OP: return doesContainRelativeReferences(ast.left) || doesContainRelativeReferences(ast.right);
			case AstNodeType.PARENTHESIS: return doesContainRelativeReferences(ast.expression);
			case AstNodeType.FUNCTION_CALL: return ast.args.some((arg) => doesContainRelativeReferences(arg));
			case AstNodeType.ARRAY: return ast.args.some((row) => row.some((arg) => doesContainRelativeReferences(arg)));
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Span.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RowsSpan = class RowsSpan {
		constructor(sheet, rowStart, rowEnd) {
			this.sheet = sheet;
			this.rowStart = rowStart;
			this.rowEnd = rowEnd;
			if (rowStart < 0) throw Error("Starting row cant be less than 0");
			if (rowEnd < rowStart) throw Error("Row span cant end before start");
		}
		get numberOfRows() {
			return this.rowEnd - this.rowStart + 1;
		}
		get start() {
			return this.rowStart;
		}
		get end() {
			return this.rowEnd;
		}
		static fromNumberOfRows(sheet, rowStart, numberOfRows) {
			return new RowsSpan(sheet, rowStart, rowStart + numberOfRows - 1);
		}
		static fromRowStartAndEnd(sheet, rowStart, rowEnd) {
			return new RowsSpan(sheet, rowStart, rowEnd);
		}
		*rows() {
			for (let col = this.rowStart; col <= this.rowEnd; ++col) yield col;
		}
		intersect(otherSpan) {
			if (this.sheet !== otherSpan.sheet) throw Error("Can't intersect spans from different sheets");
			const start = Math.max(this.rowStart, otherSpan.rowStart);
			const end = Math.min(this.rowEnd, otherSpan.rowEnd);
			if (start > end) return null;
			return new RowsSpan(this.sheet, start, end);
		}
		firstRow() {
			return new RowsSpan(this.sheet, this.rowStart, this.rowStart);
		}
	};
	var ColumnsSpan = class ColumnsSpan {
		constructor(sheet, columnStart, columnEnd) {
			this.sheet = sheet;
			this.columnStart = columnStart;
			this.columnEnd = columnEnd;
			if (columnStart < 0) throw Error("Starting column cant be less than 0");
			if (columnEnd < columnStart) throw Error("Column span cant end before start");
		}
		get numberOfColumns() {
			return this.columnEnd - this.columnStart + 1;
		}
		get start() {
			return this.columnStart;
		}
		get end() {
			return this.columnEnd;
		}
		static fromNumberOfColumns(sheet, columnStart, numberOfColumns) {
			return new ColumnsSpan(sheet, columnStart, columnStart + numberOfColumns - 1);
		}
		static fromColumnStartAndEnd(sheet, columnStart, columnEnd) {
			return new ColumnsSpan(sheet, columnStart, columnEnd);
		}
		*columns() {
			for (let col = this.columnStart; col <= this.columnEnd; ++col) yield col;
		}
		intersect(otherSpan) {
			if (this.sheet !== otherSpan.sheet) throw Error("Can't intersect spans from different sheets");
			const start = Math.max(this.columnStart, otherSpan.columnStart);
			const end = Math.min(this.columnEnd, otherSpan.columnEnd);
			if (start > end) return null;
			return new ColumnsSpan(this.sheet, start, end);
		}
		firstColumn() {
			return new ColumnsSpan(this.sheet, this.columnStart, this.columnStart);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/statistics/StatType.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var StatType;
	(function(StatType) {
		StatType["BUILD_ENGINE_TOTAL"] = "BUILD_ENGINE_TOTAL";
		StatType["PARSER"] = "PARSER";
		StatType["GRAPH_BUILD"] = "GRAPH_BUILD";
		StatType["COLLECT_DEPENDENCIES"] = "COLLECT_DEPENDENCIES";
		StatType["PROCESS_DEPENDENCIES"] = "PROCESS_DEPENDENCIES";
		StatType["TOP_SORT"] = "TOP_SORT";
		StatType["BUILD_COLUMN_INDEX"] = "BUILD_COLUMN_INDEX";
		StatType["EVALUATION"] = "EVALUATION";
		StatType["VLOOKUP"] = "VLOOKUP";
		StatType["TRANSFORM_ASTS"] = "TRANSFORM_ASTS";
		StatType["TRANSFORM_ASTS_POSTPONED"] = "TRANSFORM_ASTS_POSTPONED";
		StatType["ADJUSTING_ADDRESS_MAPPING"] = "ADJUSTING_ADDRESS_MAPPING";
		StatType["ADJUSTING_ARRAY_MAPPING"] = "ADJUSTING_ARRAY_MAPPING";
		StatType["ADJUSTING_RANGES"] = "ADJUSTING_RANGES";
		StatType["ADJUSTING_GRAPH"] = "ADJUSTING_GRAPH";
		StatType["CRITERION_FUNCTION_FULL_CACHE_USED"] = "CRITERION_FUNCTION_FULL_CACHE_USED";
		StatType["CRITERION_FUNCTION_PARTIAL_CACHE_USED"] = "CRITERION_FUNCTION_PARTIAL_CACHE_USED";
	})(StatType || (StatType = {}));
	//#endregion
	//#region ../../node_modules/hyperformula/es/statistics/Statistics.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Provides tracking performance statistics to the engine
	*/
	var Statistics = class {
		constructor() {
			this.stats = new Map([[StatType.CRITERION_FUNCTION_FULL_CACHE_USED, 0], [StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED, 0]]);
			this.startTimes = /* @__PURE__ */ new Map();
		}
		incrementCriterionFunctionFullCacheUsed() {
			var _a;
			const newValue = ((_a = this.stats.get(StatType.CRITERION_FUNCTION_FULL_CACHE_USED)) !== null && _a !== void 0 ? _a : 0) + 1;
			this.stats.set(StatType.CRITERION_FUNCTION_FULL_CACHE_USED, newValue);
		}
		incrementCriterionFunctionPartialCacheUsed() {
			var _a;
			const newValue = ((_a = this.stats.get(StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED)) !== null && _a !== void 0 ? _a : 0) + 1;
			this.stats.set(StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED, newValue);
		}
		/**
		* Resets statistics
		*/
		reset() {
			this.stats.clear();
			this.startTimes.clear();
			this.stats.set(StatType.CRITERION_FUNCTION_FULL_CACHE_USED, 0);
			this.stats.set(StatType.CRITERION_FUNCTION_PARTIAL_CACHE_USED, 0);
		}
		/**
		* Starts tracking particular statistic.
		*
		* @param name - statistic to start tracking
		*/
		start(name) {
			if (this.startTimes.get(name)) throw Error(`Statistics ${name} already started`);
			else this.startTimes.set(name, Date.now());
		}
		/**
		* Stops tracking particular statistic.
		* Raise error if tracking statistic wasn't started.
		*
		* @param name - statistic to stop tracking
		*/
		end(name) {
			var _a;
			const now = Date.now();
			const startTime = this.startTimes.get(name);
			if (startTime) {
				let values = (_a = this.stats.get(name)) !== null && _a !== void 0 ? _a : 0;
				values += now - startTime;
				this.stats.set(name, values);
				this.startTimes.delete(name);
			} else throw Error(`Statistics ${name} not started`);
		}
		/**
		* Measure given statistic as execution of given function.
		*
		* @param name - statistic to track
		* @param func - function to call
		* @returns result of the function call
		*/
		measure(name, func) {
			this.start(name);
			const result = func();
			this.end(name);
			return result;
		}
		/**
		* Returns the snapshot of current results
		*/
		snapshot() {
			return new Map(this.stats);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/statistics/EmptyStatistics.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/** Do not store stats in the memory. Stats are not needed on daily basis */
	var EmptyStatistics = class extends Statistics {
		/** @inheritDoc */
		incrementCriterionFunctionFullCacheUsed() {}
		/** @inheritDoc */
		incrementCriterionFunctionPartialCacheUsed() {}
		/** @inheritDoc */
		start(_name) {}
		/** @inheritDoc */
		end(_name) {}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/errors.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Error thrown when the sheet of a given ID does not exist.
	*/
	var NoSheetWithIdError = class extends Error {
		constructor(sheetId) {
			super(`There's no sheet with id = ${sheetId}`);
		}
	};
	/**
	* Error thrown when the sheet of a given name does not exist.
	*/
	var NoSheetWithNameError = class extends Error {
		constructor(sheetName) {
			super(`There's no sheet with name '${sheetName}'`);
		}
	};
	/**
	* Error thrown when the sheet of a given name already exists.
	*/
	var SheetNameAlreadyTakenError = class extends Error {
		constructor(sheetName) {
			super(`Sheet with name ${sheetName} already exists`);
		}
	};
	/**
	* Error thrown when loaded sheet size exceeds configured limits.
	*/
	var SheetSizeLimitExceededError = class extends Error {
		constructor() {
			super("Sheet size limit exceeded");
		}
	};
	/**
	* Error thrown when the the provided string is not a valid formula, i.e does not start with "="
	*/
	var NotAFormulaError = class extends Error {
		constructor() {
			super("This is not a formula");
		}
	};
	/**
	* Error thrown when the given address is invalid.
	*/
	var InvalidAddressError = class extends Error {
		constructor(address) {
			super(`Address (row = ${address.row}, col = ${address.col}) is invalid`);
		}
	};
	/**
	* Error thrown when the given arguments are invalid
	*/
	var InvalidArgumentsError = class extends Error {
		constructor(expectedArguments) {
			super(`Invalid arguments, expected ${expectedArguments}`);
		}
	};
	/**
	* Error thrown when the given sheets are not equal.
	*/
	var SheetsNotEqual = class extends Error {
		constructor(sheet1, sheet2) {
			super(`Sheets ${sheet1} and ${sheet2} are not equal.`);
		}
	};
	/**
	* Error thrown when the given named expression already exists in the workbook and therefore it cannot be added.
	*/
	var NamedExpressionNameIsAlreadyTakenError = class extends Error {
		constructor(expressionName) {
			super(`Name of Named Expression '${expressionName}' is already present`);
		}
	};
	/**
	* Error thrown when the name given for the named expression is invalid.
	*/
	var NamedExpressionNameIsInvalidError = class extends Error {
		constructor(expressionName) {
			super(`Name of Named Expression '${expressionName}' is invalid`);
		}
	};
	/**
	* Error thrown when the given named expression does not exist.
	*/
	var NamedExpressionDoesNotExistError = class extends Error {
		constructor(expressionName) {
			super(`Named Expression '${expressionName}' does not exist`);
		}
	};
	/**
	* Error thrown when there are no operations to be undone by the [[undo]] method.
	*/
	var NoOperationToUndoError = class extends Error {
		constructor() {
			super("There is no operation to undo");
		}
	};
	/**
	* Error thrown when there are no operations to redo by the [[redo]] method.
	*/
	var NoOperationToRedoError = class extends Error {
		constructor() {
			super("There is no operation to redo");
		}
	};
	/**
	* Error thrown when there is nothing to paste by the [[paste]] method.
	*/
	var NothingToPasteError = class extends Error {
		constructor() {
			super("There is nothing to paste");
		}
	};
	function replacer(key, val) {
		switch (typeof val) {
			case "function":
			case "symbol": return val.toString();
			case "bigint": return "BigInt(" + val.toString() + ")";
			default: if (val instanceof RegExp) return "RegExp(" + val.toString() + ")";
			else return val;
		}
	}
	/**
	* Error thrown when the given value cannot be parsed.
	*
	* Checks against the validity in:
	*
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	* @see [[setCellsContents]]
	*/
	var UnableToParseError = class extends Error {
		constructor(value) {
			super(`Unable to parse value: ${JSON.stringify(value, replacer, 4)}`);
		}
	};
	/**
	* Error thrown when the expected value type differs from the given value type.
	* It also displays the expected type.
	* This error might be thrown while setting or updating the [[ConfigParams]].
	* The following methods accept [[ConfigParams]] as a parameter:
	*
	* @see [[buildEmpty]]
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	* @see [[updateConfig]]
	*/
	var ExpectedValueOfTypeError = class extends Error {
		constructor(expectedType, paramName) {
			super(`Expected value of type: ${expectedType} for config parameter: ${paramName}`);
		}
	};
	/**
	* Error thrown when supplied config parameter value is an empty string.
	* This error might be thrown while setting or updating the [[ConfigParams]].
	* The following methods accept [[ConfigParams]] as a parameter:
	*
	* @see [[buildEmpty]]
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	* @see [[updateConfig]]
	*/
	var ConfigValueEmpty = class extends Error {
		constructor(paramName) {
			super(`Config parameter ${paramName} cannot be empty.`);
		}
	};
	/**
	* Error thrown when supplied config parameter value is too small.
	* This error might be thrown while setting or updating the [[ConfigParams]].
	* The following methods accept [[ConfigParams]] as a parameter:
	*
	* @see [[buildEmpty]]
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	* @see [[updateConfig]]
	*/
	var ConfigValueTooSmallError = class extends Error {
		constructor(paramName, minimum) {
			super(`Config parameter ${paramName} should be at least ${minimum}`);
		}
	};
	/**
	* Error thrown when supplied config parameter value is too big.
	* This error might be thrown while setting or updating the [[ConfigParams]].
	* The following methods accept [[ConfigParams]] as a parameter:
	*
	* @see [[buildEmpty]]
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	* @see [[updateConfig]]
	*/
	var ConfigValueTooBigError = class extends Error {
		constructor(paramName, maximum) {
			super(`Config parameter ${paramName} should be at most ${maximum}`);
		}
	};
	/**
	* Error thrown when the value was expected to be set for a config parameter.
	* It also displays the expected value.
	* This error might be thrown while setting or updating the [[ConfigParams]].
	* The following methods accept [[ConfigParams]] as a parameter:
	*
	* @see [[buildEmpty]]
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	* @see [[updateConfig]]
	*/
	var ExpectedOneOfValuesError = class extends Error {
		constructor(values, paramName) {
			super(`Expected one of ${values} for config parameter: ${paramName}`);
		}
	};
	/**
	* Error thrown when computations become suspended.
	* To perform any other action wait for the batch to complete or resume the evaluation.
	* Relates to:
	*
	* @see [[batch]]
	* @see [[suspendEvaluation]]
	* @see [[resumeEvaluation]]
	*/
	var EvaluationSuspendedError = class extends Error {
		constructor() {
			super("Computations are suspended");
		}
	};
	/**
	* Error thrown when translation is missing in translation package.
	*/
	var MissingTranslationError = class extends Error {
		constructor(key) {
			super(`Translation for ${key} is missing in the translation package you're using.`);
		}
	};
	/**
	* Error thrown when trying to override protected translation.
	*
	* @see [[registerLanguage]]
	* @see [[registerFunction]]
	* @see [[registerFunctionPlugin]]
	*/
	var ProtectedFunctionTranslationError = class extends Error {
		constructor(key) {
			super(`Cannot register translation for function with id: ${key}`);
		}
	};
	/**
	* Error thrown when trying to retrieve not registered language
	*
	* @see [[getLanguage]]
	* @see [[unregisterLanguage]]
	*/
	var LanguageNotRegisteredError = class extends Error {
		constructor() {
			super("Language not registered.");
		}
	};
	/**
	* Error thrown when trying to register already registered language
	*
	* @see [[registerLanguage]]
	*/
	var LanguageAlreadyRegisteredError = class extends Error {
		constructor() {
			super("Language already registered.");
		}
	};
	/**
	* Error thrown when function plugin is invalid.
	*
	* @see [[registerFunction]]
	* @see [[registerFunctionPlugin]]
	* @see [[buildFromArray]]
	* @see [[buildFromSheets]]
	*/
	var FunctionPluginValidationError = class FunctionPluginValidationError extends Error {
		static functionNotDeclaredInPlugin(functionId, pluginName) {
			return new FunctionPluginValidationError(`Function with id ${functionId} not declared in plugin ${pluginName}`);
		}
		static functionMethodNotFound(functionName, pluginName) {
			return new FunctionPluginValidationError(`Function method ${functionName} not found in plugin ${pluginName}`);
		}
	};
	/**
	* Error thrown when trying to register, override or remove function with reserved id.
	*
	* @see [[registerFunctionPlugin]]
	* @see [[registerFunction]]
	* @see [[unregisterFunction]]
	*/
	var ProtectedFunctionError = class ProtectedFunctionError extends Error {
		static cannotRegisterFunctionWithId(functionId) {
			return new ProtectedFunctionError(`Cannot register function with id ${functionId}`);
		}
		static cannotUnregisterFunctionWithId(functionId) {
			return new ProtectedFunctionError(`Cannot unregister function with id ${functionId}`);
		}
		static cannotUnregisterProtectedPlugin() {
			return new ProtectedFunctionError("Cannot unregister protected plugin");
		}
	};
	/**
	* Error thrown when selected source location has an array.
	*/
	var SourceLocationHasArrayError = class extends Error {
		constructor() {
			super("Cannot perform this operation, source location has an array inside.");
		}
	};
	/**
	* Error thrown when selected target location has an array.
	*
	* @see [[addRows]]
	* @see [[addColumns]]
	* @see [[moveCells]]
	* @see [[moveRows]]
	* @see [[moveColumns]]
	* @see [[paste]]
	*/
	var TargetLocationHasArrayError = class extends Error {
		constructor() {
			super("Cannot perform this operation, target location has an array inside.");
		}
	};
	/**
	* Error thrown when named expression contains relative addresses.
	*
	* @see [[addNamedExpression]]
	* @see [[changeNamedExpression]]
	*/
	var NoRelativeAddressesAllowedError = class extends Error {
		constructor() {
			super("Relative addresses not allowed in named expressions.");
		}
	};
	/**
	* Error thrown when alias to a function is already defined.
	*
	* @see [[registerFunctionPlugin]]
	* @see [[registerFunction]]
	*/
	var AliasAlreadyExisting = class extends Error {
		constructor(name, pluginName) {
			super(`Alias id ${name} in plugin ${pluginName} already defined as a function or alias.`);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/AddressMapping/AddressMapping.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Manages cell vertices and provides access to vertex by SimpleCellAddress.
	* For each sheet it stores vertices according to AddressMappingStrategy: DenseStrategy or SparseStrategy.
	*
	* Pleceholder sheets:
	* - for placeholders sheets (sheets that are used in formulas but not yet added), it stores placeholder strategy entries (DenseStrategy(0, 0))
	* - placeholder strategy entries may contain EmptyCellVertex-es but never ValueCellVertex or FormulaVertex as they content is empty
	* - vertices in placeholder strategy entries are used only for dependency tracking
	*/
	var AddressMapping = class {
		constructor(policy) {
			this.policy = policy;
			this.mapping = /* @__PURE__ */ new Map();
		}
		/**
		* Gets the cell vertex at the specified address.
		*/
		getCell(address, options = {}) {
			const sheetMapping = this.mapping.get(address.sheet);
			if (!sheetMapping) {
				if (options.throwIfSheetNotExists) throw new NoSheetWithIdError(address.sheet);
				return;
			}
			const cell = sheetMapping.getCell(address);
			if (!cell && options.throwIfCellNotExists) throw Error("Vertex for address missing in AddressMapping");
			return cell;
		}
		/**
		* Gets the cell vertex at the specified address or throws if it doesn't exist.
		* @throws {NoSheetWithIdError} if sheet doesn't exist
		* @throws {Error} if cell doesn't exist
		*/
		getCellOrThrow(address) {
			const sheetMapping = this.mapping.get(address.sheet);
			if (!sheetMapping) throw new NoSheetWithIdError(address.sheet);
			const cell = sheetMapping.getCell(address);
			if (!cell) throw Error("Vertex for address missing in AddressMapping");
			return cell;
		}
		/**
		* Gets the address mapping strategy for the specified sheet.
		* @throws {NoSheetWithIdError} if sheet doesn't exist
		*/
		getStrategyForSheetOrThrow(sheetId) {
			const strategy = this.mapping.get(sheetId);
			if (strategy === void 0) throw new NoSheetWithIdError(sheetId);
			return strategy;
		}
		/**
		* Adds a new sheet with the specified strategy.
		* @throws {Error} if sheet is already added and throwIfSheetAlreadyExists is true
		*/
		addSheetWithStrategy(sheetId, strategy, options = { throwIfSheetAlreadyExists: true }) {
			const strategyFound = this.mapping.get(sheetId);
			if (strategyFound) {
				if (options.throwIfSheetAlreadyExists) throw Error("Sheet already added");
				return strategyFound;
			}
			this.mapping.set(sheetId, strategy);
			return strategy;
		}
		/**
		* Adds a sheet or changes the strategy for an existing sheet.
		* Designed for the purpose of exchanging the placeholder strategy for a real strategy.
		*/
		addSheetOrChangeStrategy(sheetId, sheetBoundaries) {
			const newStrategy = this.createStrategyBasedOnBoundaries(sheetBoundaries);
			const strategyPlaceholder = this.mapping.get(sheetId);
			if (!strategyPlaceholder) {
				this.mapping.set(sheetId, newStrategy);
				return newStrategy;
			}
			if (newStrategy instanceof DenseStrategy) return strategyPlaceholder;
			this.moveStrategyContent(strategyPlaceholder, newStrategy, sheetId);
			this.mapping.set(sheetId, newStrategy);
			return newStrategy;
		}
		/**
		* Moves the content of the source strategy to the target strategy.
		*/
		moveStrategyContent(sourceStrategy, targetStrategy, sheetContext) {
			const sourceVertices = sourceStrategy.getEntries(sheetContext);
			for (const [address, vertex] of sourceVertices) targetStrategy.setCell(address, vertex);
		}
		/**
		* Adds a sheet and sets the strategy based on the sheet boundaries.
		* @throws {Error} if sheet already exists and throwIfSheetAlreadyExists is true
		*/
		addSheetAndSetStrategyBasedOnBoundaries(sheetId, sheetBoundaries, options = { throwIfSheetAlreadyExists: true }) {
			this.addSheetWithStrategy(sheetId, this.createStrategyBasedOnBoundaries(sheetBoundaries), options);
		}
		/**
		* Creates a strategy based on the sheet boundaries.
		*/
		createStrategyBasedOnBoundaries(sheetBoundaries) {
			const { height, width, fill } = sheetBoundaries;
			return new (this.policy.call(fill))(width, height);
		}
		/**
		* Adds a placeholder strategy (DenseStrategy) for a sheet. If the sheet already exists, does nothing.
		*/
		addSheetStrategyPlaceholderIfNotExists(sheetId) {
			if (this.mapping.has(sheetId)) return;
			this.mapping.set(sheetId, new DenseStrategy(0, 0));
		}
		/**
		* Removes a sheet from the address mapping.
		* If sheet does not exist, does nothing.
		* @returns {boolean} true if sheet was removed, false if it did not exist.
		*/
		removeSheetIfExists(sheetId) {
			return this.mapping.delete(sheetId);
		}
		/**
		* Gets the interpreter value of a cell at the specified address.
		* @returns {InterpreterValue} The interpreter value (returns EmptyValue if cell doesn't exist)
		*/
		getCellValue(address) {
			const vertex = this.getCell(address);
			if (vertex === void 0) return EmptyValue;
			else if (vertex instanceof ArrayFormulaVertex) return vertex.getArrayCellValue(address);
			else return vertex.getCellValue();
		}
		/**
		* Gets the raw cell content at the specified address.
		* @returns {RawCellContent} The raw cell content or null if cell doesn't exist or is not a value cell
		*/
		getRawValue(address) {
			const vertex = this.getCell(address);
			if (vertex instanceof ValueCellVertex) return vertex.getValues().rawValue;
			else if (vertex instanceof ArrayFormulaVertex) return vertex.getArrayCellRawValue(address);
			else return null;
		}
		/**
		* Sets a cell vertex at the specified address.
		* @throws {Error} if sheet not initialized
		*/
		setCell(address, newVertex) {
			const sheetMapping = this.mapping.get(address.sheet);
			if (!sheetMapping) throw Error("Sheet not initialized");
			sheetMapping.setCell(address, newVertex);
		}
		/**
		* Moves a cell from source address to destination address.
		* Supports cross-sheet moves (used for placeholder sheet merging).
		* @throws {Error} if source sheet not initialized
		* @throws {Error} if destination occupied
		* @throws {Error} if source cell doesn't exist
		*/
		moveCell(source, destination) {
			const sheetMapping = this.mapping.get(source.sheet);
			if (!sheetMapping) throw Error("Sheet not initialized.");
			if (this.has(destination)) throw new Error("Cannot move cell. Destination already occupied.");
			const vertex = sheetMapping.getCell(source);
			if (vertex === void 0) throw new Error("Cannot move cell. No cell with such address.");
			this.setCell(destination, vertex);
			this.removeCell(source);
		}
		/**
		* Removes a cell at the specified address.
		* @throws Error if sheet not initialized
		*/
		removeCell(address) {
			const sheetMapping = this.mapping.get(address.sheet);
			if (!sheetMapping) throw Error("Sheet not initialized");
			sheetMapping.removeCell(address);
		}
		/**
		* Checks if a cell exists at the specified address.
		*/
		has(address) {
			const sheetMapping = this.mapping.get(address.sheet);
			if (sheetMapping === void 0) return false;
			return sheetMapping.has(address);
		}
		/**
		* Gets the height of the specified sheet.
		*/
		getSheetHeight(sheetId) {
			return this.getStrategyForSheetOrThrow(sheetId).getHeight();
		}
		/**
		* Gets the width of the specified sheet.
		*/
		getSheetWidth(sheetId) {
			return this.getStrategyForSheetOrThrow(sheetId).getWidth();
		}
		/**
		* Adds rows to a sheet.
		*/
		addRows(sheetId, row, numberOfRows) {
			this.getStrategyForSheetOrThrow(sheetId).addRows(row, numberOfRows);
		}
		/**
		* Removes rows from a sheet.
		*/
		removeRows(removedRows) {
			this.getStrategyForSheetOrThrow(removedRows.sheet).removeRows(removedRows);
		}
		/**
		* Adds columns to a sheet starting at the specified column index.
		*/
		addColumns(sheetId, column, numberOfColumns) {
			this.getStrategyForSheetOrThrow(sheetId).addColumns(column, numberOfColumns);
		}
		/**
		* Removes columns from a sheet.
		*/
		removeColumns(removedColumns) {
			this.getStrategyForSheetOrThrow(removedColumns.sheet).removeColumns(removedColumns);
		}
		/**
		* Returns an iterator of cell vertices within the specified rows span.
		*/
		*verticesFromRowsSpan(rowsSpan) {
			yield* this.mapping.get(rowsSpan.sheet).verticesFromRowsSpan(rowsSpan);
		}
		/**
		* Returns an iterator of cell vertices within the specified columns span.
		*/
		*verticesFromColumnsSpan(columnsSpan) {
			yield* this.mapping.get(columnsSpan.sheet).verticesFromColumnsSpan(columnsSpan);
		}
		/**
		* Returns an iterator of address-vertex pairs within the specified rows span.
		*/
		*entriesFromRowsSpan(rowsSpan) {
			yield* this.getStrategyForSheetOrThrow(rowsSpan.sheet).entriesFromRowsSpan(rowsSpan);
		}
		/**
		* Returns an iterator of address-vertex pairs within the specified columns span.
		*/
		*entriesFromColumnsSpan(columnsSpan) {
			yield* this.getStrategyForSheetOrThrow(columnsSpan.sheet).entriesFromColumnsSpan(columnsSpan);
		}
		/**
		* Returns an iterator of all address-vertex pairs across all sheets.
		* @returns {IterableIterator<[SimpleCellAddress, Maybe<CellVertex>]>} Iterator of [address, vertex] tuples
		*/
		*entries() {
			for (const [sheet, mapping] of this.mapping.entries()) yield* mapping.getEntries(sheet);
		}
		/**
		* Returns an iterator of address-vertex pairs for a specific sheet.
		* @returns {IterableIterator<[SimpleCellAddress, CellVertex]>} Iterator of [address, vertex] tuples
		* @throws {NoSheetWithIdError} if sheet doesn't exist
		*/
		*sheetEntries(sheetId) {
			yield* this.getStrategyForSheetOrThrow(sheetId).getEntries(sheetId);
		}
		/**
		* Checks if a sheet has any entries.
		* @throws {NoSheetWithIdError} if sheet doesn't exist
		*/
		hasAnyEntries(sheetId) {
			return !this.sheetEntries(sheetId).next().done;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/ArrayMapping.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Maps top-left corner addresses to their ArrayFormulaVertex instances.
	* An ArrayFormulaVertex is created for formulas that output multiple values (e.g., MMULT, TRANSPOSE, array literals).
	* The same ArrayFormulaVertex is referenced in AddressMapping for all cells within its spill range.
	* ArrayFormulaVertex lifecycle:
	* - Prediction (ArraySizePredictor.checkArraySize) → determines if formula will produce array
	* - Creation → new ArrayFormulaVertex(...) added via addArrayFormulaVertex()
	* - Address registration → setAddressMappingForArrayFormulaVertex() sets the vertex for all cells in range
	* - Evaluation → computes actual values, stores in ArrayFormulaVertex.array
	* - Shrinking → if content placed in array area, array shrinks via shrinkArrayToCorner()
	*/
	var ArrayMapping = class {
		constructor() {
			this.arrayMapping = /* @__PURE__ */ new Map();
		}
		getArray(range) {
			const array = this.getArrayByCorner(range.start);
			if (array === null || array === void 0 ? void 0 : array.getRange().sameAs(range)) return array;
		}
		getArrayByCorner(address) {
			return this.arrayMapping.get(addressKey(address));
		}
		setArray(range, vertex) {
			this.arrayMapping.set(addressKey(range.start), vertex);
		}
		removeArray(range) {
			if (typeof range === "string") this.arrayMapping.delete(range);
			else this.arrayMapping.delete(addressKey(range.start));
		}
		count() {
			return this.arrayMapping.size;
		}
		*arraysInRows(rowsSpan) {
			for (const [mtxKey, mtx] of this.arrayMapping.entries()) if (mtx.spansThroughSheetRows(rowsSpan.sheet, rowsSpan.rowStart, rowsSpan.rowEnd)) yield [mtxKey, mtx];
		}
		*arraysInCols(col) {
			for (const [mtxKey, mtx] of this.arrayMapping.entries()) if (mtx.spansThroughSheetColumn(col.sheet, col.columnStart, col.columnEnd)) yield [mtxKey, mtx];
		}
		isFormulaArrayInRow(sheet, row) {
			for (const mtx of this.arrayMapping.values()) if (mtx.spansThroughSheetRows(sheet, row)) return true;
			return false;
		}
		isFormulaArrayInAllRows(span) {
			let result = true;
			for (const row of span.rows()) if (!this.isFormulaArrayInRow(span.sheet, row)) result = false;
			return result;
		}
		isFormulaArrayInColumn(sheet, column) {
			for (const mtx of this.arrayMapping.values()) if (mtx.spansThroughSheetColumn(sheet, column)) return true;
			return false;
		}
		isFormulaArrayInAllColumns(span) {
			let result = true;
			for (const col of span.columns()) if (!this.isFormulaArrayInColumn(span.sheet, col)) result = false;
			return result;
		}
		isFormulaArrayInRange(range) {
			for (const mtx of this.arrayMapping.values()) if (mtx.getRange().doesOverlap(range)) return true;
			return false;
		}
		isFormulaArrayAtAddress(address) {
			for (const mtx of this.arrayMapping.values()) if (mtx.getRange().addressInRange(address)) return true;
			return false;
		}
		moveArrayVerticesAfterRowByRows(sheet, row, numberOfRows) {
			this.updateArrayVerticesInSheet(sheet, (key, vertex) => {
				const range = vertex.getRange();
				return row <= range.start.row ? [range.shifted(0, numberOfRows), vertex] : void 0;
			});
		}
		moveArrayVerticesAfterColumnByColumns(sheet, column, numberOfColumns) {
			this.updateArrayVerticesInSheet(sheet, (key, vertex) => {
				const range = vertex.getRange();
				return column <= range.start.col ? [range.shifted(numberOfColumns, 0), vertex] : void 0;
			});
		}
		updateArrayVerticesInSheet(sheet, fn) {
			const updated = Array();
			for (const [key, vertex] of this.arrayMapping.entries()) {
				if (vertex.sheet !== sheet) continue;
				const result = fn(key, vertex);
				if (result !== void 0) {
					this.removeArray(key);
					updated.push(result);
				}
			}
			updated.forEach(([range, array]) => {
				this.setArray(range, array);
			});
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/ArrayValue.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var NotComputedArray = class {
		constructor(size) {
			this.size = size;
		}
		width() {
			return this.size.width;
		}
		height() {
			return this.size.height;
		}
		get(col, row) {
			throw Error("Array not computed yet.");
		}
		simpleRangeValue() {
			throw Error("Array not computed yet.");
		}
	};
	var ArrayValue = class ArrayValue {
		constructor(array) {
			this.size = new ArraySize(array.length > 0 ? array[0].length : 0, array.length);
			this.array = array;
			if (this.size.width <= 0 || this.size.height <= 0) throw Error("Incorrect array size");
		}
		static fromInterpreterValue(value) {
			if (value instanceof SimpleRangeValue) return new ArrayValue(value.data);
			else return new ArrayValue([[value]]);
		}
		simpleRangeValue() {
			return SimpleRangeValue.onlyValues(this.array);
		}
		addRows(aboveRow, numberOfRows) {
			this.array.splice(aboveRow, 0, ...this.nullArrays(numberOfRows, this.width()));
			this.size.height += numberOfRows;
		}
		addColumns(aboveColumn, numberOfColumns) {
			for (let i = 0; i < this.height(); i++) this.array[i].splice(aboveColumn, 0, ...new Array(numberOfColumns).fill(EmptyValue));
			this.size.width += numberOfColumns;
		}
		removeRows(startRow, endRow) {
			if (this.outOfBound(0, startRow) || this.outOfBound(0, endRow)) throw Error("Array index out of bound");
			const numberOfRows = endRow - startRow + 1;
			this.array.splice(startRow, numberOfRows);
			this.size.height -= numberOfRows;
		}
		removeColumns(leftmostColumn, rightmostColumn) {
			if (this.outOfBound(leftmostColumn, 0) || this.outOfBound(rightmostColumn, 0)) throw Error("Array index out of bound");
			const numberOfColumns = rightmostColumn - leftmostColumn + 1;
			for (const row of this.array) row.splice(leftmostColumn, numberOfColumns);
			this.size.width -= numberOfColumns;
		}
		nullArrays(count, size) {
			const result = [];
			for (let i = 0; i < count; ++i) result.push(new Array(size).fill(EmptyValue));
			return result;
		}
		get(col, row) {
			if (this.outOfBound(col, row)) throw Error("Array index out of bound");
			return this.array[row][col];
		}
		set(col, row, value) {
			if (this.outOfBound(col, row)) throw Error("Array index out of bound");
			this.array[row][col] = value;
		}
		width() {
			return this.size.width;
		}
		height() {
			return this.size.height;
		}
		raw() {
			return this.array;
		}
		resize(newSize) {
			if (this.height() < newSize.height && isFinite(newSize.height)) this.addRows(this.height(), newSize.height - this.height());
			if (this.height() > newSize.height) throw Error("Resizing to smaller array");
			if (this.width() < newSize.width && isFinite(newSize.width)) this.addColumns(this.width(), newSize.width - this.width());
			if (this.width() > newSize.width) throw Error("Resizing to smaller array");
		}
		outOfBound(col, row) {
			return col < 0 || row < 0 || row > this.size.height - 1 || col > this.size.width - 1;
		}
	};
	var ErroredArray = class {
		constructor(error, size) {
			this.error = error;
			this.size = size;
		}
		get(col, row) {
			return this.error;
		}
		width() {
			return this.size.width;
		}
		height() {
			return this.size.height;
		}
		simpleRangeValue() {
			return this.error;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/Vertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Base class for all types of vertices in the dependency graph
	*/
	var Vertex = class {};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/CellVertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Represents vertex which keeps values of one or more cells
	*/
	var CellVertex = class extends Vertex {
		constructor() {
			super();
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/FormulaVertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Abstract base class for vertices that contain formulas in the dependency graph.
	*
	* Stores formula AST, cell address, and version for lazy transformation support.
	* Has two concrete implementations: {@link ScalarFormulaVertex} for single-cell formulas
	* and {@link ArrayFormulaVertex} for array formulas that span multiple cells.
	*/
	var FormulaVertex = class extends CellVertex {
		constructor(formula, cellAddress, version) {
			super();
			this.formula = formula;
			this.cellAddress = cellAddress;
			this.version = version;
		}
		get width() {
			return 1;
		}
		get height() {
			return 1;
		}
		static fromAst(formula, address, size, version) {
			if (size.isScalar()) return new ScalarFormulaVertex(formula, address, version);
			else return new ArrayFormulaVertex(formula, address, size, version);
		}
		/**
		* Returns formula stored in this vertex
		*/
		getFormula(updatingService) {
			this.ensureRecentData(updatingService);
			return this.formula;
		}
		ensureRecentData(updatingService) {
			if (this.version != updatingService.version()) {
				const [newAst, newAddress, newVersion] = updatingService.applyTransformations(this.formula, this.cellAddress, this.version);
				this.formula = newAst;
				this.cellAddress = newAddress;
				this.version = newVersion;
			}
		}
		/**
		* Returns address of the cell associated with vertex
		*/
		getAddress(updatingService) {
			this.ensureRecentData(updatingService);
			return this.cellAddress;
		}
	};
	/**
	* Represents a formula vertex that produces an array result spanning multiple cells.
	*
	* Array formulas are transformed eagerly (unlike scalar formulas) and store their
	* computed values in a {@link CellArray} structure.
	*/
	var ArrayFormulaVertex = class extends FormulaVertex {
		constructor(formula, cellAddress, size, version = 0) {
			super(formula, cellAddress, version);
			if (size.isRef) this.array = new ErroredArray(new CellError(ErrorType.REF, ErrorMessage.NoSpaceForArrayResult), ArraySize.error());
			else this.array = new NotComputedArray(size);
		}
		get width() {
			return this.array.width();
		}
		get height() {
			return this.array.height();
		}
		get sheet() {
			return this.cellAddress.sheet;
		}
		get leftCorner() {
			return this.cellAddress;
		}
		setCellValue(value) {
			if (value instanceof CellError) {
				this.setErrorValue(value);
				return value;
			}
			const array = ArrayValue.fromInterpreterValue(value);
			array.resize(this.array.size);
			this.array = array;
			return value;
		}
		getCellValue() {
			if (this.array instanceof NotComputedArray) throw Error("Array not computed yet.");
			return this.array.simpleRangeValue();
		}
		valueOrUndef() {
			if (this.array instanceof NotComputedArray) return;
			return this.array.simpleRangeValue();
		}
		getArrayCellValue(address) {
			const col = address.col - this.cellAddress.col;
			const row = address.row - this.cellAddress.row;
			try {
				return this.array.get(col, row);
			} catch (e) {
				return new CellError(ErrorType.REF);
			}
		}
		getArrayCellRawValue(address) {
			const val = this.getArrayCellValue(address);
			if (val instanceof CellError || val === EmptyValue) return;
			else return getRawValue(val);
		}
		setArrayCellValue(address, value) {
			const col = address.col - this.cellAddress.col;
			const row = address.row - this.cellAddress.row;
			if (this.array instanceof ArrayValue) this.array.set(col, row, value);
		}
		setNoSpace() {
			this.array = new ErroredArray(new CellError(ErrorType.SPILL, ErrorMessage.NoSpaceForArrayResult), ArraySize.error());
			return this.getCellValue();
		}
		getRange() {
			return AbsoluteCellRange.spanFrom(this.cellAddress, this.width, this.height);
		}
		getRangeOrUndef() {
			return AbsoluteCellRange.spanFromOrUndef(this.cellAddress, this.width, this.height);
		}
		setAddress(address) {
			this.cellAddress = address;
		}
		setFormula(newFormula) {
			this.formula = newFormula;
		}
		spansThroughSheetRows(sheet, startRow, endRow = startRow) {
			return this.cellAddress.sheet === sheet && this.cellAddress.row <= endRow && startRow < this.cellAddress.row + this.height;
		}
		spansThroughSheetColumn(sheet, col, columnEnd = col) {
			return this.cellAddress.sheet === sheet && this.cellAddress.col <= columnEnd && col < this.cellAddress.col + this.width;
		}
		isComputed() {
			return !(this.array instanceof NotComputedArray);
		}
		columnsFromArray() {
			return ColumnsSpan.fromNumberOfColumns(this.cellAddress.sheet, this.cellAddress.col, this.width);
		}
		rowsFromArray() {
			return RowsSpan.fromNumberOfRows(this.cellAddress.sheet, this.cellAddress.row, this.height);
		}
		/**
		* No-op as array vertices are transformed eagerly.
		*/
		ensureRecentData(_updatingService) {}
		isLeftCorner(address) {
			return equalSimpleCellAddress(this.cellAddress, address);
		}
		setErrorValue(error) {
			this.array = new ErroredArray(error, this.array.size);
		}
	};
	/**
	* Represents a formula vertex that produces a single scalar value.
	*
	* Unlike {@link ArrayFormulaVertex}, scalar formulas are transformed lazily
	* and cache their computed value for retrieval.
	*/
	var ScalarFormulaVertex = class extends FormulaVertex {
		constructor(formula, address, version) {
			super(formula, address, version);
		}
		valueOrUndef() {
			return this.cachedCellValue;
		}
		/**
		* Sets computed cell value stored in this vertex
		*/
		setCellValue(cellValue) {
			this.cachedCellValue = cellValue;
			return this.cachedCellValue;
		}
		/**
		* Returns cell value stored in vertex
		*/
		getCellValue() {
			if (this.cachedCellValue !== void 0) return this.cachedCellValue;
			else throw Error("Value of the formula cell is not computed.");
		}
		isComputed() {
			return this.cachedCellValue !== void 0;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/RangeVertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Represents vertex bound to range
	*/
	var RangeVertex = class extends Vertex {
		constructor(range) {
			super();
			this.range = range;
			this.functionCache = /* @__PURE__ */ new Map();
			this.criterionFunctionCache = /* @__PURE__ */ new Map();
			this.dependentCacheRanges = /* @__PURE__ */ new Set();
			this.bruteForce = false;
		}
		get start() {
			return this.range.start;
		}
		get end() {
			return this.range.end;
		}
		get sheet() {
			return this.range.start.sheet;
		}
		/**
		* Returns cached value stored for given function
		*
		* @param functionName - name of the function
		*/
		getFunctionValue(functionName) {
			return this.functionCache.get(functionName);
		}
		/**
		* Stores cached value for given function
		*
		* @param functionName - name of the function
		* @param value - cached value
		*/
		setFunctionValue(functionName, value) {
			this.functionCache.set(functionName, value);
		}
		/**
		* Returns cached value for given cache key and criterion text representation
		*
		* @param cacheKey - key to retrieve from the cache
		* @param criterionString - criterion text (ex. '<=5')
		*/
		getCriterionFunctionValue(cacheKey, criterionString) {
			var _a;
			return (_a = this.getCriterionFunctionValues(cacheKey).get(criterionString)) === null || _a === void 0 ? void 0 : _a[0];
		}
		/**
		* Returns all cached values stored for given criterion function
		*
		* @param cacheKey - key to retrieve from the cache
		*/
		getCriterionFunctionValues(cacheKey) {
			var _a;
			return (_a = this.criterionFunctionCache.get(cacheKey)) !== null && _a !== void 0 ? _a : /* @__PURE__ */ new Map();
		}
		/**
		* Stores all values for given criterion function
		*
		* @param cacheKey - key to store in the cache
		* @param values - map with values
		*/
		setCriterionFunctionValues(cacheKey, values) {
			this.criterionFunctionCache.set(cacheKey, values);
		}
		addDependentCacheRange(dependentRange) {
			if (dependentRange !== this) this.dependentCacheRanges.add(dependentRange);
		}
		/**
		* Clears function cache
		*/
		clearCache() {
			this.functionCache.clear();
			this.criterionFunctionCache.clear();
			this.dependentCacheRanges.forEach((range) => range.criterionFunctionCache.clear());
			this.dependentCacheRanges.clear();
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/collectAddressesDependentToRange.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var collectAddressesDependentToRange = (functionRegistry, vertex, range, lazilyTransformingAstService, dependencyGraph) => {
		if (vertex instanceof RangeVertex) {
			const intersection = vertex.range.intersectionWith(range);
			if (intersection !== void 0) return Array.from(intersection.addresses(dependencyGraph));
			else return [];
		}
		let formula;
		let address;
		if (vertex instanceof FormulaVertex) {
			formula = vertex.getFormula(lazilyTransformingAstService);
			address = vertex.getAddress(lazilyTransformingAstService);
		} else return [];
		return collectDependencies(formula, functionRegistry).filter((d) => d instanceof AddressDependency).map((d) => d.dependency.toSimpleCellAddress(address)).filter((d) => range.addressInRange(d));
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/TopSort.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var NodeVisitStatus;
	(function(NodeVisitStatus) {
		NodeVisitStatus[NodeVisitStatus["ON_STACK"] = 0] = "ON_STACK";
		NodeVisitStatus[NodeVisitStatus["PROCESSED"] = 1] = "PROCESSED";
		NodeVisitStatus[NodeVisitStatus["POPPED"] = 2] = "POPPED";
	})(NodeVisitStatus || (NodeVisitStatus = {}));
	/**
	* An algorithm class. Provides an iterative implementation of Tarjan's algorithm for finding strongly connected components
	*/
	var TopSort = class {
		constructor(nodesSparseArray = [], edgesSparseArray = []) {
			this.nodesSparseArray = nodesSparseArray;
			this.edgesSparseArray = edgesSparseArray;
			this.entranceTime = [];
			this.low = [];
			this.parent = [];
			this.inSCC = [];
			this.nodeStatus = [];
			this.order = [];
			this.sccNonSingletons = [];
			this.timeCounter = 0;
		}
		/**
		* An iterative implementation of Tarjan's algorithm for finding strongly connected components.
		* Returns vertices in order of topological sort, but vertices that are on cycles are kept separate.
		*
		* @param modifiedNodes - seed for computation. During engine init run, all of the vertices of grap. In recomputation run, changed vertices.
		* @param operatingFunction - recomputes value of a node, and returns whether a change occurred
		* @param onCycle - action to be performed when node is on cycle
		*/
		getTopSortedWithSccSubgraphFrom(modifiedNodeIds, operatingFunction, onCycle) {
			const modifiedNodeIdsReversed = modifiedNodeIds.reverse();
			modifiedNodeIdsReversed.forEach((id) => this.runDFS(id));
			return this.postprocess(modifiedNodeIdsReversed, onCycle, operatingFunction);
		}
		/**
		* Returns adjacent nodes of a given node.
		*/
		getAdjacentNodeIds(id) {
			return this.edgesSparseArray[id].filter((adjacentId) => adjacentId !== void 0 && this.nodesSparseArray[adjacentId]);
		}
		/**
		* Runs DFS starting from a given node.
		*/
		runDFS(v) {
			if (this.nodeStatus[v] !== void 0) return;
			this.nodeStatus[v] = NodeVisitStatus.ON_STACK;
			const DFSstack = [v];
			const SCCstack = [];
			while (DFSstack.length > 0) {
				const u = DFSstack[DFSstack.length - 1];
				switch (this.nodeStatus[u]) {
					case NodeVisitStatus.ON_STACK:
						this.handleOnStack(u, SCCstack, DFSstack);
						break;
					case NodeVisitStatus.PROCESSED:
						this.handleProcessed(u, SCCstack, DFSstack);
						break;
					case NodeVisitStatus.POPPED:
						DFSstack.pop();
						break;
				}
			}
		}
		/**
		* Handles a node that is on stack.
		*/
		handleOnStack(u, SCCstack, DFSstack) {
			this.entranceTime[u] = this.timeCounter;
			this.low[u] = this.timeCounter;
			this.timeCounter++;
			SCCstack.push(u);
			this.getAdjacentNodeIds(u).forEach((t) => {
				if (this.entranceTime[t] === void 0) {
					DFSstack.push(t);
					this.parent[t] = u;
					this.nodeStatus[t] = NodeVisitStatus.ON_STACK;
				}
			});
			this.nodeStatus[u] = NodeVisitStatus.PROCESSED;
		}
		/**
		* Handles a node that is already processed.
		*/
		handleProcessed(u, SCCstack, DFSstack) {
			let uLow = this.entranceTime[u];
			this.getAdjacentNodeIds(u).forEach((t) => {
				if (this.inSCC[t]) return;
				uLow = this.parent[t] === u ? Math.min(uLow, this.low[t]) : Math.min(uLow, this.entranceTime[t]);
			});
			this.low[u] = uLow;
			if (uLow === this.entranceTime[u]) {
				const currentSCC = [];
				do {
					currentSCC.push(SCCstack[SCCstack.length - 1]);
					SCCstack.pop();
				} while (currentSCC[currentSCC.length - 1] !== u);
				currentSCC.forEach((t) => {
					this.inSCC[t] = true;
				});
				this.order.push(...currentSCC);
				if (currentSCC.length > 1) currentSCC.forEach((t) => {
					this.sccNonSingletons[t] = true;
				});
			}
			DFSstack.pop();
			this.nodeStatus[u] = NodeVisitStatus.POPPED;
		}
		/**
		* Postprocesses the result of Tarjan's algorithm.
		*/
		postprocess(modifiedNodeIds, onCycle, operatingFunction) {
			const shouldBeUpdatedMapping = [];
			modifiedNodeIds.forEach((t) => {
				shouldBeUpdatedMapping[t] = true;
			});
			const sorted = [];
			const cycled = [];
			this.order.reverse();
			this.order.forEach((t) => {
				const adjacentNodes = this.getAdjacentNodeIds(t);
				if (this.sccNonSingletons[t] || adjacentNodes.includes(t)) {
					cycled.push(this.nodesSparseArray[t]);
					onCycle(this.nodesSparseArray[t]);
					adjacentNodes.forEach((s) => shouldBeUpdatedMapping[s] = true);
				} else {
					sorted.push(this.nodesSparseArray[t]);
					if (shouldBeUpdatedMapping[t] && operatingFunction(this.nodesSparseArray[t])) adjacentNodes.forEach((s) => shouldBeUpdatedMapping[s] = true);
				}
			});
			return {
				sorted,
				cycled
			};
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/ProcessableValue.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ProcessableValue = class {
		constructor(rawValue, processFn) {
			this.rawValue = rawValue;
			this.processFn = processFn;
			this.processedValue = null;
		}
		getProcessedValue() {
			if (this.processedValue === null) this.processedValue = this.processFn(this.rawValue);
			return this.processedValue;
		}
		markAsModified() {
			this.processedValue = null;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/Graph.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Provides directed graph structure.
	*
	* Idea for performance improvement:
	* - use Set<Node>[] instead of NodeId[][] for edgesSparseArray
	*/
	var Graph = class {
		constructor(dependencyQuery) {
			this.dependencyQuery = dependencyQuery;
			/**
			* A sparse array. The value nodesSparseArray[n] exists if and only if node n is in the graph.
			* @private
			*/
			this.nodesSparseArray = [];
			/**
			* A sparse array. The value edgesSparseArray[n] exists if and only if node n is in the graph.
			* The edgesSparseArray[n] is also a sparse array. It may contain removed nodes. To make sure check nodesSparseArray.
			* @private
			*/
			this.edgesSparseArray = [];
			/**
			* A ProcessableValue object.
			* @private
			*/
			this.dirtyAndVolatileNodeIds = new ProcessableValue({
				dirty: [],
				volatile: []
			}, (r) => this.processDirtyAndVolatileNodeIds(r));
			/**
			* A set of node ids. The value infiniteRangeIds.get(nodeId) exists if and only if node is in the graph.
			* @private
			*/
			this.infiniteRangeIds = /* @__PURE__ */ new Set();
			/**
			* A dense array. It may contain duplicates and removed nodes.
			* @private
			*/
			this.changingWithStructureNodeIds = [];
			this.nextId = 0;
		}
		/**
		* Iterate over all nodes the in graph
		*/
		getNodes() {
			return this.nodesSparseArray.filter((node) => node !== void 0);
		}
		/**
		* Checks whether a node is present in graph
		*
		* @param {Node} node - node to check
		*/
		hasNode(node) {
			return node.idInGraph != null;
		}
		/**
		* Checks whether exists edge between nodes. If one or both of nodes are not present in graph, returns false.
		*
		* @param {Node} fromNode - node from which edge is outcoming
		* @param {Node} toNode - node to which edge is incoming
		*/
		existsEdge(fromNode, toNode) {
			const fromId = fromNode.idInGraph;
			const toId = toNode.idInGraph;
			if (fromId === void 0 || toId === void 0) return false;
			return this.edgesSparseArray[fromId].includes(toId);
		}
		/**
		* Returns nodes adjacent to given node. May contain removed nodes.
		*
		* @param {Node} node - node to which adjacent nodes we want to retrieve
		*
		* Idea for performance improvement:
		* - return an array instead of set
		*/
		adjacentNodes(node) {
			const nodeId = node.idInGraph;
			if (nodeId === void 0) throw this.missingNodeError(node);
			return new Set(this.edgesSparseArray[nodeId].filter((id) => id !== void 0).map((id) => this.nodesSparseArray[id]).filter((node) => node !== void 0));
		}
		/**
		* Returns number of nodes adjacent to given node. Contrary to adjacentNodes(), this method returns only nodes that are present in graph.
		*
		* @param {Node} node - node to which adjacent nodes we want to retrieve
		*/
		adjacentNodesCount(node) {
			const id = node.idInGraph;
			if (id === void 0) throw this.missingNodeError(node);
			return this.fixEdgesArrayForNode(id).length;
		}
		/**
		* Adds node to a graph if it does not exist yet.
		*
		* @param {Node} node - a node to be added
		* @returns {NodeId} - the id of the added node
		*/
		addNodeIfNotExists(node) {
			const idOfExistingNode = node.idInGraph;
			if (idOfExistingNode !== void 0) return idOfExistingNode;
			const newId = this.nextId;
			this.nextId++;
			this.nodesSparseArray[newId] = node;
			this.edgesSparseArray[newId] = [];
			node.idInGraph = newId;
			return newId;
		}
		/**
		* Adds edge between nodes.
		*
		* The nodes had to be added to the graph before, or the error will be raised
		*
		* @param {Node | NodeId} fromNode - node from which edge is outcoming
		* @param {Node | NodeId} toNode - node to which edge is incoming
		*/
		addEdge(fromNode, toNode) {
			const fromId = this.getNodeIdIfNotNumber(fromNode);
			const toId = this.getNodeIdIfNotNumber(toNode);
			if (fromId === void 0) throw this.missingNodeError(fromNode);
			if (toId === void 0) throw this.missingNodeError(toNode);
			if (this.edgesSparseArray[fromId].includes(toId)) return;
			this.edgesSparseArray[fromId].push(toId);
		}
		/**
		* Removes node from graph
		*/
		removeNode(node) {
			const id = node.idInGraph;
			if (id === void 0) throw this.missingNodeError(node);
			if (this.edgesSparseArray[id].length > 0) {
				this.edgesSparseArray[id].forEach((adjacentId) => this.dirtyAndVolatileNodeIds.rawValue.dirty.push(adjacentId));
				this.dirtyAndVolatileNodeIds.markAsModified();
			}
			const dependencies = this.removeDependencies(node);
			delete this.nodesSparseArray[id];
			delete this.edgesSparseArray[id];
			this.infiniteRangeIds.delete(id);
			node.idInGraph = void 0;
			return dependencies;
		}
		/**
		* Removes edge between nodes.
		*/
		removeEdge(fromNode, toNode) {
			const fromId = this.getNodeIdIfNotNumber(fromNode);
			const toId = this.getNodeIdIfNotNumber(toNode);
			if (fromId === void 0) throw this.missingNodeError(fromNode);
			if (toId === void 0) throw this.missingNodeError(toNode);
			const indexOfToId = this.edgesSparseArray[fromId].indexOf(toId);
			if (indexOfToId === -1) throw new Error("Edge does not exist");
			delete this.edgesSparseArray[fromId][indexOfToId];
		}
		/**
		* Removes edge between nodes if it exists.
		*/
		removeEdgeIfExists(fromNode, toNode) {
			const fromId = this.getNodeIdIfNotNumber(fromNode);
			const toId = this.getNodeIdIfNotNumber(toNode);
			if (fromId === void 0) return;
			if (toId === void 0) return;
			const indexOfToId = this.edgesSparseArray[fromId].indexOf(toId);
			if (indexOfToId === -1) return;
			delete this.edgesSparseArray[fromId][indexOfToId];
		}
		/**
		* Sorts the whole graph topologically. Nodes that are on cycles are kept separate.
		*/
		topSortWithScc() {
			return this.getTopSortedWithSccSubgraphFrom(this.getNodes(), () => true, () => {});
		}
		/**
		* Sorts the graph topologically. Nodes that are on cycles are kept separate.
		*
		* @param {Node[]} modifiedNodes - seed for computation. The algorithm assumes that only these nodes have changed since the last run.
		* @param {(node: Node) => boolean} operatingFunction - recomputes value of a node, and returns whether a change occurred
		* @param {(node: Node) => void} onCycle - action to be performed when node is on cycle
		*/
		getTopSortedWithSccSubgraphFrom(modifiedNodes, operatingFunction, onCycle) {
			const topSortAlgorithm = new TopSort(this.nodesSparseArray, this.edgesSparseArray);
			const modifiedNodesIds = modifiedNodes.map((node) => node.idInGraph).filter((id) => id !== void 0);
			return topSortAlgorithm.getTopSortedWithSccSubgraphFrom(modifiedNodesIds, operatingFunction, onCycle);
		}
		/**
		* Marks node as volatile.
		*/
		markNodeAsVolatile(node) {
			const id = node.idInGraph;
			if (id === void 0) return;
			this.dirtyAndVolatileNodeIds.rawValue.volatile.push(id);
			this.dirtyAndVolatileNodeIds.markAsModified();
		}
		/**
		* Marks node as dirty.
		*/
		markNodeAsDirty(node) {
			const id = node.idInGraph;
			if (id === void 0) return;
			this.dirtyAndVolatileNodeIds.rawValue.dirty.push(id);
			this.dirtyAndVolatileNodeIds.markAsModified();
		}
		/**
		* Returns an array of nodes that are marked as dirty and/or volatile.
		*/
		getDirtyAndVolatileNodes() {
			return this.dirtyAndVolatileNodeIds.getProcessedValue();
		}
		/**
		* Clears dirty nodes.
		*/
		clearDirtyNodes() {
			this.dirtyAndVolatileNodeIds.rawValue.dirty = [];
			this.dirtyAndVolatileNodeIds.markAsModified();
		}
		/**
		* Marks node as changingWithStructure.
		*/
		markNodeAsChangingWithStructure(node) {
			const id = node.idInGraph;
			if (id === void 0) return;
			this.changingWithStructureNodeIds.push(id);
		}
		/**
		* Marks all nodes marked as changingWithStructure as dirty.
		*/
		markChangingWithStructureNodesAsDirty() {
			if (this.changingWithStructureNodeIds.length <= 0) return;
			this.dirtyAndVolatileNodeIds.rawValue.dirty = [...this.dirtyAndVolatileNodeIds.rawValue.dirty, ...this.changingWithStructureNodeIds];
			this.dirtyAndVolatileNodeIds.markAsModified();
		}
		/**
		* Marks node as infinite range.
		*/
		markNodeAsInfiniteRange(node) {
			const id = this.getNodeIdIfNotNumber(node);
			if (id === void 0) return;
			this.infiniteRangeIds.add(id);
		}
		/**
		* Returns an array of nodes marked as infinite ranges
		*/
		getInfiniteRanges() {
			return [...this.infiniteRangeIds].map((id) => this.nodesSparseArray[id]);
		}
		/**
		*
		*/
		getNodeIdIfNotNumber(node) {
			return typeof node === "number" ? node : node.idInGraph;
		}
		/**
		* Removes invalid neighbors of a given node from the edges array and returns adjacent nodes for the input node.
		*/
		fixEdgesArrayForNode(id) {
			const adjacentNodeIds = this.edgesSparseArray[id];
			this.edgesSparseArray[id] = adjacentNodeIds.filter((adjacentId) => adjacentId !== void 0 && this.nodesSparseArray[adjacentId]);
			return this.edgesSparseArray[id];
		}
		/**
		* Removes edges from the given node to its dependencies based on the dependencyQuery function.
		*/
		removeDependencies(node) {
			const dependencies = this.dependencyQuery(node);
			dependencies.forEach(([_, dependency]) => {
				this.removeEdgeIfExists(dependency, node);
			});
			return dependencies;
		}
		/**
		* processFn for dirtyAndVolatileNodeIds ProcessableValue instance
		* @private
		*/
		processDirtyAndVolatileNodeIds({ dirty, volatile }) {
			return [...new Set([...dirty, ...volatile])].map((id) => this.nodesSparseArray[id]).filter((node) => node !== void 0);
		}
		/**
		* Returns error for missing node.
		*/
		missingNodeError(node) {
			return /* @__PURE__ */ new Error(`Unknown node ${JSON.stringify(node)}`);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/RangeMapping.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Maintains a per-sheet map from serialized start/end coordinates to `RangeVertex`.
	* - Every range vertex in dependency graph should be stored in this mapping.
	* - Guarantees uniqueness: one vertex per distinct rectangle, enabling cache reuse.
	* - Implements "smaller prefix + tail row" optimization: if A1:A4 exists, A1:A5 depends on it + only A5.
	* - RangeVertex stores cached results for associative aggregates (SUM, COUNT) and criterion functions.
	*/
	var RangeMapping = class RangeMapping {
		constructor() {
			/**
			* Map sheetId -> address of start and end (as string) -> vertex
			*/
			this.rangeMapping = /* @__PURE__ */ new Map();
		}
		/**
		* Returns number of ranges in the sheet or 0 if the sheet does not exist
		*/
		getNumberOfRangesInSheet(sheet) {
			var _a, _b;
			return (_b = (_a = this.rangeMapping.get(sheet)) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;
		}
		/**
		* Adds or updates vertex in the mapping
		*/
		addOrUpdateVertex(vertex) {
			let sheetMap = this.rangeMapping.get(vertex.sheet);
			if (sheetMap === void 0) {
				sheetMap = /* @__PURE__ */ new Map();
				this.rangeMapping.set(vertex.sheet, sheetMap);
			}
			const key = RangeMapping.calculateRangeKey(vertex.start, vertex.end);
			sheetMap.set(key, vertex);
		}
		/**
		* Removes vertex from the mapping if it exists
		*/
		removeVertexIfExists(vertex) {
			const sheet = vertex.sheet;
			const sheetMap = this.rangeMapping.get(sheet);
			if (sheetMap === void 0) return;
			const key = RangeMapping.calculateRangeKey(vertex.start, vertex.end);
			sheetMap.delete(key);
			if (sheetMap.size === 0) this.rangeMapping.delete(sheet);
		}
		/**
		* Returns associated vertex for given range
		*/
		getRangeVertex(start, end) {
			const sheetMap = this.rangeMapping.get(start.sheet);
			const key = RangeMapping.calculateRangeKey(start, end);
			return sheetMap === null || sheetMap === void 0 ? void 0 : sheetMap.get(key);
		}
		/**
		* Returns associated vertex for given range or throws an error if not found
		*/
		getVertexOrThrow(start, end) {
			const maybeRange = this.getRangeVertex(start, end);
			if (!maybeRange) throw Error("Range does not exist");
			return maybeRange;
		}
		truncateRanges(span, coordinate) {
			const verticesToRemove = Array();
			const updated = Array();
			const verticesWithChangedSize = Array();
			const sheet = span.sheet;
			for (const [key, vertex] of this.entriesFromSheet(span.sheet)) {
				const range = vertex.range;
				if (span.start <= coordinate(vertex.range.end)) {
					range.removeSpan(span);
					if (range.shouldBeRemoved()) {
						this.removeByKey(sheet, key);
						verticesToRemove.push(vertex);
					} else updated.push([key, vertex]);
					verticesWithChangedSize.push(vertex);
				}
			}
			const verticesToMerge = [];
			updated.sort((left, right) => RangeMapping.compareBy(left[1], right[1], coordinate));
			for (const [oldKey, vertex] of updated) {
				const newKey = RangeMapping.calculateRangeKey(vertex.range.start, vertex.range.end);
				if (newKey === oldKey) continue;
				const existingVertex = this.getByKey(sheet, newKey);
				this.removeByKey(sheet, oldKey);
				if (existingVertex !== void 0 && vertex != existingVertex) verticesToMerge.push([existingVertex, vertex]);
				else this.addOrUpdateVertex(vertex);
			}
			return {
				verticesToRemove,
				verticesToMerge,
				verticesWithChangedSize
			};
		}
		moveAllRangesInSheetAfterAddingRows(sheet, row, numberOfRows) {
			return this.updateVerticesFromSheet(sheet, (key, vertex) => {
				if (row <= vertex.start.row) {
					vertex.range.shiftByRows(numberOfRows);
					return {
						changedSize: false,
						vertex
					};
				} else if (row > vertex.start.row && row <= vertex.end.row) {
					vertex.range.expandByRows(numberOfRows);
					return {
						changedSize: true,
						vertex
					};
				} else return;
			});
		}
		moveAllRangesInSheetAfterAddingColumns(sheet, column, numberOfColumns) {
			return this.updateVerticesFromSheet(sheet, (key, vertex) => {
				if (column <= vertex.start.col) {
					vertex.range.shiftByColumns(numberOfColumns);
					return {
						changedSize: false,
						vertex
					};
				} else if (column > vertex.start.col && column <= vertex.end.col) {
					vertex.range.expandByColumns(numberOfColumns);
					return {
						changedSize: true,
						vertex
					};
				} else return;
			});
		}
		moveRangesInsideSourceRange(sourceRange, toRight, toBottom, toSheet) {
			this.updateVerticesFromSheet(sourceRange.sheet, (key, vertex) => {
				if (sourceRange.containsRange(vertex.range)) {
					vertex.range.shiftByColumns(toRight);
					vertex.range.shiftByRows(toBottom);
					vertex.range.moveToSheet(toSheet);
					return {
						changedSize: false,
						vertex
					};
				} else return;
			});
		}
		*rangesInSheet(sheet) {
			const sheetMap = this.rangeMapping.get(sheet);
			if (!sheetMap) return;
			yield* sheetMap.values();
		}
		*rangeVerticesContainedInRange(sourceRange) {
			for (const rangeVertex of this.rangesInSheet(sourceRange.sheet)) if (sourceRange.containsRange(rangeVertex.range)) yield rangeVertex;
		}
		/**
		* Finds smaller range if exists.
		*/
		findSmallerRange(range) {
			if (range.height() > 1 && Number.isFinite(range.height())) {
				const valuesRangeEndRowLess = simpleCellAddress(range.end.sheet, range.end.col, range.end.row - 1);
				const rowLessVertex = this.getRangeVertex(range.start, valuesRangeEndRowLess);
				if (rowLessVertex !== void 0) return {
					smallerRangeVertex: rowLessVertex,
					restRange: AbsoluteCellRange.fromSimpleCellAddresses(simpleCellAddress(range.start.sheet, range.start.col, range.end.row), range.end)
				};
			}
			return { restRange: range };
		}
		/**
		* Calculates a string key from start and end addresses
		*/
		static calculateRangeKey(start, end) {
			return `${start.col},${start.row},${end.col},${end.row}`;
		}
		/**
		* Compares two range vertices by their start and end addresses using the provided coordinate function
		*/
		static compareBy(left, right, coordinate) {
			const leftStart = coordinate(left.range.start);
			const rightStart = coordinate(right.range.start);
			if (leftStart === rightStart) return coordinate(left.range.end) - coordinate(right.range.end);
			else return leftStart - rightStart;
		}
		*entriesFromSheet(sheet) {
			const sheetMap = this.rangeMapping.get(sheet);
			if (!sheetMap) return;
			yield* sheetMap.entries();
		}
		removeByKey(sheet, key) {
			const sheetMap = this.rangeMapping.get(sheet);
			if (!sheetMap) throw new Error(`Sheet ${sheet} not found`);
			sheetMap.delete(key);
		}
		getByKey(sheet, key) {
			var _a;
			return (_a = this.rangeMapping.get(sheet)) === null || _a === void 0 ? void 0 : _a.get(key);
		}
		updateVerticesFromSheet(sheet, fn) {
			const updated = Array();
			for (const [key, vertex] of this.entriesFromSheet(sheet)) {
				const result = fn(key, vertex);
				if (result !== void 0) {
					this.removeByKey(sheet, key);
					updated.push(result);
				}
			}
			updated.forEach((entry) => {
				this.addOrUpdateVertex(entry.vertex);
			});
			return { verticesWithChangedSize: updated.filter((entry) => entry.changedSize).map((entry) => entry.vertex) };
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/i18n/TranslationPackage.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var TranslationPackage = class {
		constructor(functions, errors, ui) {
			this.functions = functions;
			this.errors = errors;
			this.ui = ui;
			this._protectedTranslations = { "VERSION": "VERSION" };
			this.checkUI();
			this.checkErrors();
			this.checkFunctionTranslations(this.functions);
			Object.assign(this.functions, this._protectedTranslations);
		}
		extendFunctions(additionalFunctionTranslations) {
			this.checkFunctionTranslations(additionalFunctionTranslations);
			Object.assign(this.functions, additionalFunctionTranslations);
		}
		buildFunctionMapping() {
			return Object.keys(this.functions).reduce((ret, key) => {
				ret[this.functions[key]] = key;
				return ret;
			}, {});
		}
		buildErrorMapping() {
			return Object.keys(this.errors).reduce((ret, key) => {
				ret[this.errors[key]] = key;
				return ret;
			}, {});
		}
		isFunctionTranslated(key) {
			return this.functions[key] !== void 0;
		}
		getFunctionTranslations(functionIds) {
			const translations = [];
			for (const functionId of functionIds) if (this.isFunctionTranslated(functionId)) translations.push(this.functions[functionId]);
			return translations;
		}
		getFunctionTranslation(key) {
			const val = this.functions[key];
			if (val === void 0) throw new MissingTranslationError(`functions.${key}`);
			else return val;
		}
		getMaybeFunctionTranslation(key) {
			return this.functions[key];
		}
		getErrorTranslation(key) {
			if (key === ErrorType.LIC) return `#${ErrorType.LIC}!`;
			const val = this.errors[key];
			if (val === void 0) throw new MissingTranslationError(`errors.${key}`);
			else return val;
		}
		getUITranslation(key) {
			const val = this.ui[key];
			if (val === void 0) throw new MissingTranslationError(`ui.${key}`);
			else return val;
		}
		checkUI() {
			for (const key of Object.values(UIElement)) if (!(key in this.ui)) throw new MissingTranslationError(`ui.${key}`);
		}
		checkErrors() {
			for (const key of Object.values(ErrorType)) if (!(key in this.errors) && key !== ErrorType.LIC) throw new MissingTranslationError(`errors.${key}`);
		}
		checkFunctionTranslations(functions) {
			const functionNames = new Set(Object.getOwnPropertyNames(functions));
			for (const protectedTranslation of Object.getOwnPropertyNames(this._protectedTranslations)) if (functionNames.has(protectedTranslation)) throw new ProtectedFunctionTranslationError(protectedTranslation);
		}
	};
	function buildTranslationPackage(rawTranslationPackage) {
		return new TranslationPackage(Object.assign({}, rawTranslationPackage.functions), Object.assign({}, rawTranslationPackage.errors), Object.assign({}, rawTranslationPackage.ui));
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/i18n/index.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var UIElement;
	(function(UIElement) {
		UIElement["NEW_SHEET_PREFIX"] = "NEW_SHEET_PREFIX";
	})(UIElement || (UIElement = {}));
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/SheetMapping.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Representation of a sheet internal to SheetMapping. Not exported outside of this file.
	*/
	var Sheet = class {
		constructor(id, displayName, isPlaceholder = false) {
			this.id = id;
			this.displayName = displayName;
			this.isPlaceholder = isPlaceholder;
		}
		/**
		* Returns the canonical (normalized) name of the sheet.
		*/
		get canonicalName() {
			return SheetMapping.canonicalizeSheetName(this.displayName);
		}
	};
	/**
	* Manages the sheets in the instance.
	* - Can convert between sheet names and ids and vice versa.
	* - Also stores placeholders for sheets that are used in formulas but not yet added. They are marked as isPlaceholder=true.
	* - Sheetnames thet differ only in case are considered the same. (See: canonicalizeSheetName)
	*/
	var SheetMapping = class SheetMapping {
		constructor(languages) {
			/**
			* Last used sheet ID. Used to generate new sheet IDs.
			*/
			this.lastSheetId = -1;
			/**
			* Mapping from canonical sheet name to sheet ID.
			*/
			this.mappingFromCanonicalNameToId = /* @__PURE__ */ new Map();
			/**
			* Mapping from sheet ID to sheet.
			*/
			this.allSheets = /* @__PURE__ */ new Map();
			this.sheetNamePrefix = languages.getUITranslation(UIElement.NEW_SHEET_PREFIX);
		}
		/**
		* Converts sheet name to canonical/normalized form.
		* @static
		*/
		static canonicalizeSheetName(sheetDisplayName) {
			return sheetDisplayName.toLowerCase();
		}
		/**
		* Returns sheet ID for the given name. By default excludes placeholders.
		*/
		getSheetId(sheetName, options = {}) {
			var _a;
			return (_a = this._getSheetByName(sheetName, options)) === null || _a === void 0 ? void 0 : _a.id;
		}
		/**
		* Returns sheet ID for the given name. Excludes placeholders.
		*
		* @throws {NoSheetWithNameError} if the sheet with the given name does not exist.
		*/
		getSheetIdOrThrowError(sheetName) {
			const sheet = this._getSheetByName(sheetName, {});
			if (sheet === void 0) throw new NoSheetWithNameError(sheetName);
			return sheet.id;
		}
		/**
		* Returns display name for the given sheet ID. Excludes placeholders.
		*
		* @returns {Maybe<string>} the display name, or undefined if the sheet with the given ID does not exist.
		*/
		getSheetName(sheetId) {
			var _a;
			return (_a = this._getSheet(sheetId, {})) === null || _a === void 0 ? void 0 : _a.displayName;
		}
		/**
		* Returns display name for the given sheet ID. Excludes placeholders.
		*
		* @throws {NoSheetWithIdError} if the sheet with the given ID does not exist.
		*/
		getSheetNameOrThrowError(sheetId, options = {}) {
			return this._getSheetOrThrowError(sheetId, options).displayName;
		}
		/**
		* Iterates over all sheet display names. By default excludes placeholders.
		*/
		*iterateSheetNames(options = {}) {
			for (const sheet of this.allSheets.values()) if (options.includePlaceholders || !sheet.isPlaceholder) yield sheet.displayName;
		}
		/**
		* Returns array of all sheet display names. By default excludes placeholders.
		*/
		getSheetNames(options = {}) {
			return Array.from(this.iterateSheetNames(options));
		}
		/**
		* Returns total count of sheets. By default excludes placeholders.
		*/
		numberOfSheets(options = {}) {
			return this.getSheetNames(options).length;
		}
		/**
		* Checks if sheet with given ID exists. By default excludes placeholders.
		*/
		hasSheetWithId(sheetId, options = {}) {
			return this._getSheet(sheetId, options) !== void 0;
		}
		/**
		* Checks if sheet with given name exists (case-insensitive). Excludes placeholders.
		*/
		hasSheetWithName(sheetName) {
			return this._getSheetByName(sheetName, {}) !== void 0;
		}
		/**
		* Adds new sheet with optional name and returns its ID.
		* If called with a name of an existing placeholder sheet, converts the placeholder sheet to a real sheet.
		*
		* @throws {SheetNameAlreadyTakenError} if the sheet with the given name already exists.
		*/
		addSheet(newSheetDisplayName = `${this.sheetNamePrefix}${this.lastSheetId + 2}`) {
			const sheetWithConflictingName = this._getSheetByName(newSheetDisplayName, { includePlaceholders: true });
			if (sheetWithConflictingName) {
				if (!sheetWithConflictingName.isPlaceholder) throw new SheetNameAlreadyTakenError(newSheetDisplayName);
				sheetWithConflictingName.isPlaceholder = false;
				return sheetWithConflictingName.id;
			}
			this.lastSheetId++;
			const sheet = new Sheet(this.lastSheetId, newSheetDisplayName);
			this._storeSheetInMappings(sheet);
			return sheet.id;
		}
		/**
		* Adds a sheet with a specific ID and name. Used for redo operations.
		* If called with a name of an existing placeholder sheet, converts the placeholder sheet to a real sheet.
		*
		* @throws {SheetNameAlreadyTakenError} if the sheet with the given name already exists.
		*/
		addSheetWithId(sheetId, sheetDisplayName) {
			const sheetWithConflictingName = this._getSheetByName(sheetDisplayName, { includePlaceholders: true });
			if (sheetWithConflictingName) {
				if (sheetWithConflictingName.id !== sheetId) throw new SheetNameAlreadyTakenError(sheetDisplayName);
				if (!sheetWithConflictingName.isPlaceholder) throw new SheetNameAlreadyTakenError(sheetDisplayName);
				sheetWithConflictingName.isPlaceholder = false;
				return;
			}
			if (sheetId > this.lastSheetId) this.lastSheetId = sheetId;
			const sheet = new Sheet(sheetId, sheetDisplayName);
			this._storeSheetInMappings(sheet);
		}
		/**
		* Adds a placeholder sheet with the given name if it does not exist yet
		*/
		addPlaceholderIfNotExists(sheetName) {
			const sheetWithConflictingName = this._getSheetByName(sheetName, { includePlaceholders: true });
			if (sheetWithConflictingName) return sheetWithConflictingName.id;
			this.lastSheetId++;
			const sheet = new Sheet(this.lastSheetId, sheetName, true);
			this._storeSheetInMappings(sheet);
			return sheet.id;
		}
		/**
		* Adds a placeholder sheet with a specific ID and name.
		* Used for undo operations to restore previously merged placeholder sheets.
		*
		* @throws {SheetNameAlreadyTakenError} if the sheet with the given name already exists.
		*/
		addPlaceholderWithId(sheetId, sheetDisplayName) {
			if (this._getSheetByName(sheetDisplayName, { includePlaceholders: true })) throw new SheetNameAlreadyTakenError(sheetDisplayName);
			if (this.hasSheetWithId(sheetId, { includePlaceholders: true })) throw new Error(`Sheet with id ${sheetId} already exists`);
			if (sheetId > this.lastSheetId) this.lastSheetId = sheetId;
			const sheet = new Sheet(sheetId, sheetDisplayName, true);
			this._storeSheetInMappings(sheet);
		}
		/**
		*
		* Removes sheet with given ID.
		* If sheet does not exist, does nothing.
		* @returns {boolean} true if sheet was removed, false if it did not exist.
		*/
		removeSheetIfExists(sheetId, options = {}) {
			const sheet = this._getSheet(sheetId, options);
			if (!sheet) return false;
			this.allSheets.delete(sheetId);
			this.mappingFromCanonicalNameToId.delete(sheet.canonicalName);
			if (sheetId === this.lastSheetId) this.lastSheetId--;
			return true;
		}
		/**
		* Marks sheet with given ID as a placeholder.
		* @throws {NoSheetWithIdError} if the sheet with the given ID does not exist
		*/
		markSheetAsPlaceholder(sheetId) {
			const sheet = this._getSheetOrThrowError(sheetId, {});
			sheet.isPlaceholder = true;
		}
		/**
		* Renames sheet.
		* - If called with sheetId of a placeholder sheet, throws {NoSheetWithIdError}.
		* - If newDisplayName is conflicting with an existing sheet, throws {SheetNameAlreadyTakenError}.
		* - If newDisplayName is conflicting with a placeholder sheet name, deletes the placeholder sheet and returns its id as mergedWithPlaceholderSheet.
		*
		* @throws {SheetNameAlreadyTakenError} if the sheet with the given name already exists.
		* @throws {NoSheetWithIdError} if the sheet with the given ID does not exist.
		*/
		renameSheet(sheetId, newDisplayName) {
			const sheet = this._getSheetOrThrowError(sheetId, {});
			const currentDisplayName = sheet.displayName;
			if (currentDisplayName === newDisplayName) return { previousDisplayName: void 0 };
			const sheetWithConflictingName = this._getSheetByName(newDisplayName, { includePlaceholders: true });
			let mergedWithPlaceholderSheet = void 0;
			if (sheetWithConflictingName !== void 0 && sheetWithConflictingName.id !== sheet.id) if (!sheetWithConflictingName.isPlaceholder) throw new SheetNameAlreadyTakenError(newDisplayName);
			else {
				this.mappingFromCanonicalNameToId.delete(sheetWithConflictingName.canonicalName);
				this.allSheets.delete(sheetWithConflictingName.id);
				if (sheetWithConflictingName.id === this.lastSheetId) this.lastSheetId--;
				mergedWithPlaceholderSheet = sheetWithConflictingName.id;
			}
			const currentCanonicalName = sheet.canonicalName;
			this.mappingFromCanonicalNameToId.delete(currentCanonicalName);
			sheet.displayName = newDisplayName;
			this._storeSheetInMappings(sheet);
			return {
				previousDisplayName: currentDisplayName,
				mergedWithPlaceholderSheet
			};
		}
		/**
		* Stores sheet in both internal mappings.
		* - If ID exists, it is updated. If not, it is added.
		* - If canonical name exists, it is updated. If not, it is added.
		*
		* @internal
		*/
		_storeSheetInMappings(sheet) {
			this.allSheets.set(sheet.id, sheet);
			this.mappingFromCanonicalNameToId.set(sheet.canonicalName, sheet.id);
		}
		/**
		* Returns sheet by ID
		*
		* @returns {Maybe<Sheet>} the sheet, or undefined if not found.
		* @internal
		*/
		_getSheet(sheetId, options) {
			const retrievedSheet = this.allSheets.get(sheetId);
			if (retrievedSheet === void 0) return;
			return options.includePlaceholders || !retrievedSheet.isPlaceholder ? retrievedSheet : void 0;
		}
		/**
		* Returns sheet by name
		*
		* @returns {Maybe<Sheet>} the sheet, or undefined if not found.
		* @internal
		*/
		_getSheetByName(sheetName, options) {
			const sheetId = this.mappingFromCanonicalNameToId.get(SheetMapping.canonicalizeSheetName(sheetName));
			if (sheetId === void 0) return;
			return this._getSheet(sheetId, options);
		}
		/**
		* Returns sheet by ID
		*
		* @throws {NoSheetWithIdError} if the sheet with the given ID does not exist.
		* @internal
		*/
		_getSheetOrThrowError(sheetId, options) {
			const sheet = this._getSheet(sheetId, options);
			if (sheet === void 0) throw new NoSheetWithIdError(sheetId);
			return sheet;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/SheetReferenceRegistrar.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Converts sheet names to ids and adds placeholder sheets if they don't exist.
	*/
	var SheetReferenceRegistrar = class {
		constructor(sheetMapping, addressMapping) {
			this.sheetMapping = sheetMapping;
			this.addressMapping = addressMapping;
		}
		/**
		* Adds placeholder sheet if it doesn't exist and adds placeholder strategy to address mapping.
		* @returns {number} sheet id
		*/
		ensureSheetRegistered(sheetName) {
			const sheetId = this.sheetMapping.addPlaceholderIfNotExists(sheetName);
			this.addressMapping.addSheetStrategyPlaceholderIfNotExists(sheetId);
			return sheetId;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Sheet.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function validateAsSheet(sheet) {
		if (!Array.isArray(sheet)) throw new InvalidArgumentsError("an array of arrays.");
		for (let i = 0; i < sheet.length; i++) if (!Array.isArray(sheet[i])) throw new InvalidArgumentsError("an array of arrays.");
	}
	/**
	* Returns actual width, height and fill ratio of a sheet
	*
	* @param sheet - two-dimmensional array sheet representation
	*/
	function findBoundaries(sheet) {
		let width = 0;
		let height = 0;
		let cellsCount = 0;
		for (let currentRow = 0; currentRow < sheet.length; currentRow++) {
			let currentRowWidth = 0;
			for (let currentCol = 0; currentCol < sheet[currentRow].length; currentCol++) {
				const currentValue = sheet[currentRow][currentCol];
				if (currentValue === void 0 || currentValue === null) continue;
				currentRowWidth = currentCol + 1;
				++cellsCount;
			}
			width = Math.max(width, currentRowWidth);
			if (currentRowWidth > 0) height = currentRow + 1;
		}
		const sheetSize = width * height;
		return {
			height,
			width,
			fill: sheetSize === 0 ? 0 : cellsCount / sheetSize
		};
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/DependencyGraph.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var DependencyGraph = class DependencyGraph {
		constructor(addressMapping, rangeMapping, sheetMapping, arrayMapping, stats, lazilyTransformingAstService, functionRegistry, namedExpressions) {
			this.addressMapping = addressMapping;
			this.rangeMapping = rangeMapping;
			this.sheetMapping = sheetMapping;
			this.arrayMapping = arrayMapping;
			this.stats = stats;
			this.lazilyTransformingAstService = lazilyTransformingAstService;
			this.functionRegistry = functionRegistry;
			this.namedExpressions = namedExpressions;
			this.changes = ContentChanges.empty();
			this.dependencyQueryAddresses = (vertex) => {
				if (vertex instanceof RangeVertex) return this.rangeDependencyQuery(vertex).map(([address, _]) => address);
				else {
					const dependenciesResult = this.formulaDependencyQuery(vertex);
					if (dependenciesResult !== void 0) {
						const [address, dependencies] = dependenciesResult;
						return dependencies.map((dependency) => {
							if (dependency instanceof NamedExpressionDependency) return this.namedExpressions.namedExpressionOrPlaceholder(dependency.name, address.sheet).address;
							else if (isSimpleCellAddress(dependency)) return dependency;
							else return simpleCellRange(dependency.start, dependency.end);
						});
					} else return [];
				}
			};
			this.dependencyQueryVertices = (vertex) => {
				if (vertex instanceof RangeVertex) return this.rangeDependencyQuery(vertex);
				else {
					const dependenciesResult = this.formulaDependencyQuery(vertex);
					if (dependenciesResult !== void 0) {
						const [address, dependencies] = dependenciesResult;
						return dependencies.map((dependency) => {
							if (dependency instanceof AbsoluteCellRange) return [dependency.start, this.rangeMapping.getVertexOrThrow(dependency.start, dependency.end)];
							else if (dependency instanceof NamedExpressionDependency) {
								const namedExpression = this.namedExpressions.namedExpressionOrPlaceholder(dependency.name, address.sheet);
								return [namedExpression.address, this.addressMapping.getCellOrThrow(namedExpression.address)];
							} else return [dependency, this.addressMapping.getCellOrThrow(dependency)];
						});
					} else return [];
				}
			};
			this.rangeDependencyQuery = (vertex) => {
				const allDeps = [];
				const { smallerRangeVertex, restRange } = this.rangeMapping.findSmallerRange(vertex.range);
				let range;
				if (smallerRangeVertex !== void 0 && this.graph.adjacentNodes(smallerRangeVertex).has(vertex)) {
					range = restRange;
					allDeps.push([new AbsoluteCellRange(smallerRangeVertex.start, smallerRangeVertex.end), smallerRangeVertex]);
				} else range = vertex.range;
				for (const address of range.addresses(this)) {
					const cell = this.addressMapping.getCell(address);
					if (cell !== void 0) allDeps.push([address, cell]);
				}
				return allDeps;
			};
			this.formulaDependencyQuery = (vertex) => {
				let formula;
				let address;
				if (vertex instanceof FormulaVertex) {
					address = vertex.getAddress(this.lazilyTransformingAstService);
					formula = vertex.getFormula(this.lazilyTransformingAstService);
				} else return;
				const deps = collectDependencies(formula, this.functionRegistry);
				return [address, absolutizeDependencies(deps, address)];
			};
			this.graph = new Graph(this.dependencyQueryVertices);
			this.sheetReferenceRegistrar = new SheetReferenceRegistrar(sheetMapping, addressMapping);
		}
		/**
		* Invariants:
		* - empty cell has associated EmptyCellVertex if and only if it is a dependency (possibly indirect, through range) to some formula
		*/
		static buildEmpty(lazilyTransformingAstService, config, functionRegistry, namedExpressions, stats) {
			return new DependencyGraph(new AddressMapping(config.chooseAddressMappingPolicy), new RangeMapping(), new SheetMapping(config.translationPackage), new ArrayMapping(), stats, lazilyTransformingAstService, functionRegistry, namedExpressions);
		}
		setFormulaToCell(address, ast, dependencies, size, hasVolatileFunction, hasStructuralChangeFunction) {
			const newVertex = FormulaVertex.fromAst(ast, address, size, this.lazilyTransformingAstService.version());
			this.exchangeOrAddFormulaVertex(newVertex);
			this.processCellDependencies(dependencies, newVertex);
			this.graph.markNodeAsDirty(newVertex);
			if (hasVolatileFunction) this.markAsVolatile(newVertex);
			if (hasStructuralChangeFunction) this.markAsDependentOnStructureChange(newVertex);
			this.correctInfiniteRangesDependency(address);
			return this.getAndClearContentChanges();
		}
		setParsingErrorToCell(address, errorVertex) {
			const vertex = this.shrinkPossibleArrayAndGetCell(address);
			this.exchangeOrAddGraphNode(vertex, errorVertex);
			this.addressMapping.setCell(address, errorVertex);
			this.graph.markNodeAsDirty(errorVertex);
			this.correctInfiniteRangesDependency(address);
			return this.getAndClearContentChanges();
		}
		setValueToCell(address, value) {
			const vertex = this.shrinkPossibleArrayAndGetCell(address);
			if (vertex instanceof ArrayFormulaVertex) this.arrayMapping.removeArray(vertex.getRange());
			if (vertex instanceof ValueCellVertex) {
				if (vertex.getValues().rawValue !== value.rawValue) {
					vertex.setValues(value);
					this.graph.markNodeAsDirty(vertex);
				}
			} else {
				const newVertex = new ValueCellVertex(value.parsedValue, value.rawValue);
				this.exchangeOrAddGraphNode(vertex, newVertex);
				this.addressMapping.setCell(address, newVertex);
				this.graph.markNodeAsDirty(newVertex);
			}
			this.correctInfiniteRangesDependency(address);
			return this.getAndClearContentChanges();
		}
		/**
		* Sets a cell empty.
		* - if vertex has no dependents, removes it from graph, address mapping and range mapping and cleans up its dependencies
		* - if vertex has dependents, exchanges it for an EmptyCellVertex and marks it as dirty
		*/
		setCellEmpty(address) {
			const vertex = this.shrinkPossibleArrayAndGetCell(address);
			if (vertex === void 0) return ContentChanges.empty();
			if (this.graph.adjacentNodes(vertex).size > 0) {
				const emptyVertex = new EmptyCellVertex();
				this.exchangeGraphNode(vertex, emptyVertex);
				if (this.graph.adjacentNodesCount(emptyVertex) === 0) {
					this.removeVertex(emptyVertex);
					this.addressMapping.removeCell(address);
				} else {
					this.graph.markNodeAsDirty(emptyVertex);
					this.addressMapping.setCell(address, emptyVertex);
				}
			} else {
				this.removeVertex(vertex);
				this.addressMapping.removeCell(address);
			}
			return this.getAndClearContentChanges();
		}
		clearDirtyVertices() {
			this.graph.clearDirtyNodes();
		}
		verticesToRecompute() {
			return this.graph.getDirtyAndVolatileNodes();
		}
		processCellDependencies(cellDependencies, endVertex) {
			const endVertexId = endVertex.idInGraph;
			if (endVertexId === void 0) throw new Error("End vertex not found");
			cellDependencies.forEach((dep) => {
				if (dep instanceof AbsoluteCellRange) {
					const range = dep;
					let rangeVertex = this.getRange(range.start, range.end);
					if (rangeVertex === void 0) {
						rangeVertex = new RangeVertex(range);
						this.rangeMapping.addOrUpdateVertex(rangeVertex);
					}
					this.graph.addNodeIfNotExists(rangeVertex);
					const rangeVertexId = rangeVertex.idInGraph;
					if (rangeVertexId === void 0) throw new Error("Range vertex not found");
					if (!range.isFinite()) this.graph.markNodeAsInfiniteRange(rangeVertexId);
					const { smallerRangeVertex, restRange } = this.rangeMapping.findSmallerRange(range);
					if (smallerRangeVertex !== void 0) {
						this.graph.addEdge(smallerRangeVertex, rangeVertexId);
						if (rangeVertex.bruteForce) {
							rangeVertex.bruteForce = false;
							for (const cellFromRange of range.addresses(this)) this.graph.removeEdge(this.fetchCell(cellFromRange), rangeVertexId);
						}
					} else rangeVertex.bruteForce = true;
					const array = this.arrayMapping.getArray(restRange);
					if (array !== void 0) this.graph.addEdge(array, rangeVertexId);
					else for (const cellFromRange of restRange.addresses(this)) {
						const { vertex, id } = this.fetchCellOrCreateEmpty(cellFromRange);
						this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, rangeVertexId);
					}
					this.graph.addEdge(rangeVertexId, endVertexId);
					if (range.isFinite()) this.correctInfiniteRangesDependenciesByRangeVertex(rangeVertex);
				} else if (dep instanceof NamedExpressionDependency) {
					const sheetOfVertex = endVertex.getAddress(this.lazilyTransformingAstService).sheet;
					const { vertex, id } = this.fetchNamedExpressionVertex(dep.name, sheetOfVertex);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, endVertexId);
				} else {
					const { vertex, id } = this.fetchCellOrCreateEmpty(dep);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, endVertexId);
				}
			});
		}
		fetchNamedExpressionVertex(expressionName, sheetId) {
			const namedExpression = this.namedExpressions.namedExpressionOrPlaceholder(expressionName, sheetId);
			return this.fetchCellOrCreateEmpty(namedExpression.address);
		}
		exchangeNode(addressFrom, addressTo) {
			const vertexFrom = this.fetchCellOrCreateEmpty(addressFrom).vertex;
			const vertexTo = this.fetchCellOrCreateEmpty(addressTo).vertex;
			this.addressMapping.removeCell(addressFrom);
			this.exchangeGraphNode(vertexFrom, vertexTo);
		}
		fetchCellOrCreateEmpty(address) {
			const existingVertex = this.addressMapping.getCell(address);
			if (existingVertex !== void 0) return {
				vertex: existingVertex,
				id: void 0
			};
			const newVertex = new EmptyCellVertex();
			const newVertexId = this.graph.addNodeIfNotExists(newVertex);
			this.addressMapping.setCell(address, newVertex);
			return {
				vertex: newVertex,
				id: newVertexId
			};
		}
		removeRows(removedRows) {
			this.stats.measure(StatType.ADJUSTING_GRAPH, () => {
				for (const [address, vertex] of this.addressMapping.entriesFromRowsSpan(removedRows)) {
					for (const adjacentNode of this.graph.adjacentNodes(vertex)) this.graph.markNodeAsDirty(adjacentNode);
					if (vertex instanceof ArrayFormulaVertex) if (vertex.isLeftCorner(address)) {
						this.shrinkArrayToCorner(vertex);
						this.arrayMapping.removeArray(vertex.getRange());
					} else continue;
					this.removeVertex(vertex);
				}
			});
			this.stats.measure(StatType.ADJUSTING_ADDRESS_MAPPING, () => {
				this.addressMapping.removeRows(removedRows);
			});
			const affectedArrays = this.stats.measure(StatType.ADJUSTING_RANGES, () => {
				const affectedRanges = this.truncateRanges(removedRows, (address) => address.row);
				return this.getArrayVerticesRelatedToRanges(affectedRanges);
			});
			this.stats.measure(StatType.ADJUSTING_ARRAY_MAPPING, () => {
				this.fixArraysAfterRemovingRows(removedRows.sheet, removedRows.rowStart, removedRows.numberOfRows);
			});
			this.addStructuralNodesToChangeSet();
			return {
				affectedArrays,
				contentChanges: this.getAndClearContentChanges()
			};
		}
		/**
		* Adds a new sheet to the graph.
		* If the sheetId was a placeholder sheet, marks its vertices as dirty.
		*/
		addSheet(sheetId) {
			this.addressMapping.addSheetOrChangeStrategy(sheetId, findBoundaries([]));
			this.stats.measure(StatType.ADJUSTING_ADDRESS_MAPPING, () => {
				this.markAllCellsAsDirtyInSheet(sheetId);
			});
			this.stats.measure(StatType.ADJUSTING_RANGES, () => {
				this.markAllRangesAsDirtyInSheet(sheetId);
			});
		}
		/**
		* Removes all vertices without dependents in other sheets from address mapping, range mapping and array mapping.
		* - If nothing is left, removes the sheet from sheet mapping and address mapping.
		* - Otherwise, marks it as placeholder.
		*/
		removeSheet(sheetId) {
			this.clearSheet(sheetId);
			const addressMappingCleared = !this.addressMapping.hasAnyEntries(sheetId);
			const rangeMappingCleared = this.rangeMapping.getNumberOfRangesInSheet(sheetId) === 0;
			if (addressMappingCleared && rangeMappingCleared) {
				this.sheetMapping.removeSheetIfExists(sheetId);
				this.addressMapping.removeSheetIfExists(sheetId);
			} else this.sheetMapping.markSheetAsPlaceholder(sheetId);
		}
		/**
		* Removes placeholderSheetToDelete and reroutes edges to the corresponding vertices in sheetToKeep
		*
		* Assumptions about placeholderSheetToDelete:
		* - is empty (contains only empty cell vertices and range vertices),
		* - empty cell vertices have no dependencies,
		* - range vertices have dependencies only in placeholderSheetToDelete,
		* - vertices may have dependents in placeholderSheetToDelete and other sheets,
		*/
		mergeSheets(sheetToKeep, placeholderSheetToDelete) {
			if (!this.isPlaceholder(placeholderSheetToDelete)) throw new Error(`Cannot merge sheets: sheet ${placeholderSheetToDelete} is not a placeholder`);
			this.mergeRangeVertices(sheetToKeep, placeholderSheetToDelete);
			this.mergeCellVertices(sheetToKeep, placeholderSheetToDelete);
			this.addressMapping.removeSheetIfExists(placeholderSheetToDelete);
			this.addStructuralNodesToChangeSet();
		}
		/**
		* Clears the sheet content.
		* - removes all cell vertices without dependents
		* - removes all array vertices
		* - for vertices with dependents, exchanges them for EmptyCellVertex and marks them as dirty
		*/
		clearSheet(sheetId) {
			const arrays = /* @__PURE__ */ new Set();
			for (const [address, vertex] of this.addressMapping.sheetEntries(sheetId)) if (vertex instanceof ArrayFormulaVertex) arrays.add(vertex);
			else this.setCellEmpty(address);
			for (const array of arrays.values()) this.setArrayEmpty(array);
			this.addStructuralNodesToChangeSet();
		}
		removeColumns(removedColumns) {
			this.stats.measure(StatType.ADJUSTING_GRAPH, () => {
				for (const [address, vertex] of this.addressMapping.entriesFromColumnsSpan(removedColumns)) {
					for (const adjacentNode of this.graph.adjacentNodes(vertex)) this.graph.markNodeAsDirty(adjacentNode);
					if (vertex instanceof ArrayFormulaVertex) if (vertex.isLeftCorner(address)) {
						this.shrinkArrayToCorner(vertex);
						this.arrayMapping.removeArray(vertex.getRange());
					} else continue;
					this.removeVertex(vertex);
				}
			});
			this.stats.measure(StatType.ADJUSTING_ADDRESS_MAPPING, () => {
				this.addressMapping.removeColumns(removedColumns);
			});
			const affectedArrays = this.stats.measure(StatType.ADJUSTING_RANGES, () => {
				const affectedRanges = this.truncateRanges(removedColumns, (address) => address.col);
				return this.getArrayVerticesRelatedToRanges(affectedRanges);
			});
			this.stats.measure(StatType.ADJUSTING_ARRAY_MAPPING, () => {
				return this.fixArraysAfterRemovingColumns(removedColumns.sheet, removedColumns.columnStart, removedColumns.numberOfColumns);
			});
			this.addStructuralNodesToChangeSet();
			return {
				affectedArrays,
				contentChanges: this.getAndClearContentChanges()
			};
		}
		addRows(addedRows) {
			this.stats.measure(StatType.ADJUSTING_ADDRESS_MAPPING, () => {
				this.addressMapping.addRows(addedRows.sheet, addedRows.rowStart, addedRows.numberOfRows);
			});
			const affectedArrays = this.stats.measure(StatType.ADJUSTING_RANGES, () => {
				const result = this.rangeMapping.moveAllRangesInSheetAfterAddingRows(addedRows.sheet, addedRows.rowStart, addedRows.numberOfRows);
				this.fixRangesWhenAddingRows(addedRows.sheet, addedRows.rowStart, addedRows.numberOfRows);
				return this.getArrayVerticesRelatedToRanges(result.verticesWithChangedSize);
			});
			this.stats.measure(StatType.ADJUSTING_ARRAY_MAPPING, () => {
				this.fixArraysAfterAddingRow(addedRows.sheet, addedRows.rowStart, addedRows.numberOfRows);
			});
			for (const vertex of this.addressMapping.verticesFromRowsSpan(addedRows)) this.graph.markNodeAsDirty(vertex);
			this.addStructuralNodesToChangeSet();
			return { affectedArrays };
		}
		addColumns(addedColumns) {
			this.stats.measure(StatType.ADJUSTING_ADDRESS_MAPPING, () => {
				this.addressMapping.addColumns(addedColumns.sheet, addedColumns.columnStart, addedColumns.numberOfColumns);
			});
			const affectedArrays = this.stats.measure(StatType.ADJUSTING_RANGES, () => {
				const result = this.rangeMapping.moveAllRangesInSheetAfterAddingColumns(addedColumns.sheet, addedColumns.columnStart, addedColumns.numberOfColumns);
				this.fixRangesWhenAddingColumns(addedColumns.sheet, addedColumns.columnStart, addedColumns.numberOfColumns);
				return this.getArrayVerticesRelatedToRanges(result.verticesWithChangedSize);
			});
			this.stats.measure(StatType.ADJUSTING_ARRAY_MAPPING, () => {
				return this.fixArraysAfterAddingColumn(addedColumns.sheet, addedColumns.columnStart, addedColumns.numberOfColumns);
			});
			for (const vertex of this.addressMapping.verticesFromColumnsSpan(addedColumns)) this.graph.markNodeAsDirty(vertex);
			this.addStructuralNodesToChangeSet();
			return {
				affectedArrays,
				contentChanges: this.getAndClearContentChanges()
			};
		}
		isThereSpaceForArray(arrayVertex) {
			const range = arrayVertex.getRangeOrUndef();
			if (range === void 0) return false;
			for (const address of range.addresses(this)) {
				const vertexUnderAddress = this.addressMapping.getCell(address);
				if (vertexUnderAddress !== void 0 && !(vertexUnderAddress instanceof EmptyCellVertex) && vertexUnderAddress !== arrayVertex) return false;
			}
			return true;
		}
		moveCells(sourceRange, toRight, toBottom, toSheet) {
			for (const sourceAddress of sourceRange.addressesWithDirection(toRight, toBottom, this)) {
				const targetAddress = simpleCellAddress(toSheet, sourceAddress.col + toRight, sourceAddress.row + toBottom);
				let sourceVertex = this.addressMapping.getCell(sourceAddress);
				const targetVertex = this.addressMapping.getCell(targetAddress);
				this.addressMapping.removeCell(sourceAddress);
				if (sourceVertex !== void 0) {
					this.graph.markNodeAsDirty(sourceVertex);
					this.addressMapping.setCell(targetAddress, sourceVertex);
					let emptyVertex = void 0;
					for (const adjacentNode of this.graph.adjacentNodes(sourceVertex)) if (adjacentNode instanceof RangeVertex && !sourceRange.containsRange(adjacentNode.range)) {
						emptyVertex = emptyVertex !== null && emptyVertex !== void 0 ? emptyVertex : this.fetchCellOrCreateEmpty(sourceAddress).vertex;
						this.graph.addEdge(emptyVertex, adjacentNode);
						this.graph.removeEdge(sourceVertex, adjacentNode);
					}
					if (emptyVertex) {
						this.graph.markNodeAsDirty(emptyVertex);
						this.addressMapping.setCell(sourceAddress, emptyVertex);
					}
				}
				if (targetVertex !== void 0) {
					if (sourceVertex === void 0) this.addressMapping.removeCell(targetAddress);
					for (const adjacentNode of this.graph.adjacentNodes(targetVertex)) {
						sourceVertex = sourceVertex !== null && sourceVertex !== void 0 ? sourceVertex : this.fetchCellOrCreateEmpty(targetAddress).vertex;
						this.graph.addEdge(sourceVertex, adjacentNode);
						this.graph.markNodeAsDirty(sourceVertex);
					}
					this.removeVertex(targetVertex);
				}
			}
			for (const rangeVertex of this.rangeMapping.rangeVerticesContainedInRange(sourceRange)) for (const adjacentNode of this.graph.adjacentNodes(rangeVertex)) if (adjacentNode instanceof RangeVertex && !sourceRange.containsRange(adjacentNode.range)) {
				this.graph.removeEdge(rangeVertex, adjacentNode);
				for (const address of rangeVertex.range.addresses(this)) {
					const { vertex, id } = this.fetchCellOrCreateEmpty(address);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, adjacentNode);
					this.addressMapping.setCell(address, vertex);
					this.graph.markNodeAsDirty(vertex);
				}
			}
			this.rangeMapping.moveRangesInsideSourceRange(sourceRange, toRight, toBottom, toSheet);
		}
		/**
		* Sets an array empty.
		* - removes all corresponding entries from address mapping
		* - reroutes the edges
		* - removes vertex from graph and cleans up its dependencies
		* - removes vertex from range mapping and array mapping
		*/
		setArrayEmpty(arrayVertex) {
			const arrayRange = AbsoluteCellRange.spanFrom(arrayVertex.getAddress(this.lazilyTransformingAstService), arrayVertex.width, arrayVertex.height);
			const dependentVertices = this.graph.adjacentNodes(arrayVertex);
			for (const address of arrayRange.addresses(this)) this.addressMapping.removeCell(address);
			for (const adjacentNode of dependentVertices.values()) {
				const nodeDependencies = collectAddressesDependentToRange(this.functionRegistry, adjacentNode, arrayVertex.getRange(), this.lazilyTransformingAstService, this);
				for (const address of nodeDependencies) {
					const { vertex, id } = this.fetchCellOrCreateEmpty(address);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, adjacentNode);
				}
				if (nodeDependencies.length > 0) this.graph.markNodeAsDirty(adjacentNode);
			}
			this.removeVertex(arrayVertex);
			this.arrayMapping.removeArray(arrayVertex.getRange());
		}
		addVertex(address, vertex) {
			this.graph.addNodeIfNotExists(vertex);
			this.addressMapping.setCell(address, vertex);
		}
		addArrayVertex(address, vertex) {
			this.graph.addNodeIfNotExists(vertex);
			this.setAddressMappingForArrayVertex(vertex, address);
		}
		/**
		* Iterator over all array formula nodes in the graph.
		*/
		*arrayFormulaNodes() {
			for (const vertex of this.graph.getNodes()) if (vertex instanceof ArrayFormulaVertex) yield vertex;
		}
		*entriesFromRowsSpan(rowsSpan) {
			yield* this.addressMapping.entriesFromRowsSpan(rowsSpan);
		}
		*entriesFromColumnsSpan(columnsSpan) {
			yield* this.addressMapping.entriesFromColumnsSpan(columnsSpan);
		}
		fetchCell(address) {
			return this.addressMapping.getCellOrThrow(address);
		}
		/**
		* Gets the cell vertex at the specified address.
		* @throws {NoSheetWithIdError} if sheet doesn't exist
		*/
		getCell(address) {
			return this.addressMapping.getCell(address, { throwIfSheetNotExists: true });
		}
		getCellValue(address) {
			if (this.isPlaceholder(address.sheet)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
			return this.addressMapping.getCellValue(address);
		}
		getRawValue(address) {
			if (this.isPlaceholder(address.sheet)) return null;
			return this.addressMapping.getRawValue(address);
		}
		getScalarValue(address) {
			if (this.isPlaceholder(address.sheet)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
			const value = this.addressMapping.getCellValue(address);
			if (value instanceof SimpleRangeValue) return new CellError(ErrorType.VALUE, ErrorMessage.ScalarExpected);
			return value;
		}
		existsEdge(fromNode, toNode) {
			return this.graph.existsEdge(fromNode, toNode);
		}
		getSheetId(sheetName) {
			return this.sheetMapping.getSheetIdOrThrowError(sheetName);
		}
		getSheetHeight(sheet) {
			return this.addressMapping.getSheetHeight(sheet);
		}
		getSheetWidth(sheet) {
			return this.addressMapping.getSheetWidth(sheet);
		}
		getArray(range) {
			return this.arrayMapping.getArray(range);
		}
		getRange(start, end) {
			return this.rangeMapping.getRangeVertex(start, end);
		}
		topSortWithScc() {
			return this.graph.topSortWithScc();
		}
		markAsVolatile(vertex) {
			this.graph.markNodeAsVolatile(vertex);
		}
		markAsDependentOnStructureChange(vertex) {
			this.graph.markNodeAsChangingWithStructure(vertex);
		}
		forceApplyPostponedTransformations() {
			for (const vertex of this.graph.getNodes()) if (vertex instanceof ScalarFormulaVertex) vertex.ensureRecentData(this.lazilyTransformingAstService);
		}
		*rawValuesFromRange(range) {
			for (const address of range.addresses(this)) {
				const value = this.getScalarValue(address);
				if (value !== EmptyValue) yield [getRawValue(value), address];
			}
		}
		computeListOfValuesInRange(range) {
			const values = [];
			for (const cellFromRange of range.addresses(this)) {
				const value = this.getScalarValue(cellFromRange);
				values.push(value);
			}
			return values;
		}
		shrinkArrayToCorner(array) {
			this.cleanAddressMappingUnderArray(array);
			for (const adjacentVertex of this.adjacentArrayVertices(array)) {
				let relevantDependencies;
				if (adjacentVertex instanceof FormulaVertex) relevantDependencies = this.formulaDirectDependenciesToArray(adjacentVertex, array);
				else relevantDependencies = this.rangeDirectDependenciesToArray(adjacentVertex, array);
				let dependentToCorner = false;
				for (const [address, vertex] of relevantDependencies) {
					if (array.isLeftCorner(address)) dependentToCorner = true;
					this.graph.addEdge(vertex, adjacentVertex);
					this.graph.markNodeAsDirty(vertex);
				}
				if (!dependentToCorner) this.graph.removeEdge(array, adjacentVertex);
			}
			this.graph.markNodeAsDirty(array);
		}
		isArrayInternalCell(address) {
			const vertex = this.getCell(address);
			return vertex instanceof ArrayFormulaVertex && !vertex.isLeftCorner(address);
		}
		getAndClearContentChanges() {
			const changes = this.changes;
			this.changes = ContentChanges.empty();
			return changes;
		}
		getAdjacentNodesAddresses(inputVertex) {
			const deps = this.graph.adjacentNodes(inputVertex);
			const ret = [];
			deps.forEach((vertex) => {
				if (vertex instanceof RangeVertex) ret.push(simpleCellRange(vertex.start, vertex.end));
				else if (vertex instanceof FormulaVertex) ret.push(vertex.getAddress(this.lazilyTransformingAstService));
			});
			return ret;
		}
		/**
		* Marks all cell vertices in the sheet as dirty.
		*/
		markAllCellsAsDirtyInSheet(sheetId) {
			const sheetCells = this.addressMapping.sheetEntries(sheetId);
			for (const [, vertex] of sheetCells) this.graph.markNodeAsDirty(vertex);
		}
		/**
		* Marks all range vertices in the sheet as dirty.
		*/
		markAllRangesAsDirtyInSheet(sheetId) {
			const sheetRanges = this.rangeMapping.rangesInSheet(sheetId);
			for (const vertex of sheetRanges) this.graph.markNodeAsDirty(vertex);
		}
		/**
		* For each range vertex in placeholderSheetToDelete:
		* - reroutes dependencies and dependents of range vertex to the corresponding vertex in sheetToKeep
		* - removes range vertex from graph and range mapping
		* - cleans up dependencies of the removed vertex
		*/
		mergeRangeVertices(sheetToKeep, placeholderSheetToDelete) {
			const rangeVertices = Array.from(this.rangeMapping.rangesInSheet(placeholderSheetToDelete));
			for (const vertexToDelete of rangeVertices) {
				if (!this.graph.hasNode(vertexToDelete)) continue;
				const start = vertexToDelete.start;
				const end = vertexToDelete.end;
				if (start.sheet !== placeholderSheetToDelete && end.sheet !== placeholderSheetToDelete) continue;
				const targetStart = simpleCellAddress(sheetToKeep, start.col, start.row);
				const targetEnd = simpleCellAddress(sheetToKeep, end.col, end.row);
				const vertexToKeep = this.rangeMapping.getRangeVertex(targetStart, targetEnd);
				if (vertexToKeep) {
					this.rerouteDependents(vertexToDelete, vertexToKeep);
					this.removeVertexAndRerouteDependencies(vertexToDelete, vertexToKeep);
					this.rangeMapping.removeVertexIfExists(vertexToDelete);
					this.graph.markNodeAsDirty(vertexToKeep);
				} else {
					this.rangeMapping.removeVertexIfExists(vertexToDelete);
					vertexToDelete.range.moveToSheet(sheetToKeep);
					this.rangeMapping.addOrUpdateVertex(vertexToDelete);
					this.graph.markNodeAsDirty(vertexToDelete);
				}
			}
		}
		/**
		* For each cell vertex in placeholderSheetToDelete:
		* - reroutes dependents of cell vertex to the corresponding vertex in sheetToKeep
		* - removes cell vertex from graph and address mapping
		* - cleans up dependencies of the removed vertex
		*/
		mergeCellVertices(sheetToKeep, placeholderSheetToDelete) {
			const cellVertices = Array.from(this.addressMapping.sheetEntries(placeholderSheetToDelete));
			for (const [addressToDelete, vertexToDelete] of cellVertices) {
				const addressToKeep = simpleCellAddress(sheetToKeep, addressToDelete.col, addressToDelete.row);
				const vertexToKeep = this.getCell(addressToKeep);
				if (vertexToKeep) {
					this.rerouteDependents(vertexToDelete, vertexToKeep);
					this.removeVertexAndCleanupDependencies(vertexToDelete);
					this.addressMapping.removeCell(addressToDelete);
					this.graph.markNodeAsDirty(vertexToKeep);
				} else {
					this.addressMapping.moveCell(addressToDelete, addressToKeep);
					this.graph.markNodeAsDirty(vertexToDelete);
				}
			}
		}
		/**
		* Checks if the given sheet ID refers to a placeholder sheet (doesn't exist but is referenced by other sheets)
		*/
		isPlaceholder(sheetId) {
			return sheetId !== NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS && !this.sheetMapping.hasSheetWithId(sheetId, { includePlaceholders: false });
		}
		exchangeGraphNode(oldNode, newNode) {
			this.graph.addNodeIfNotExists(newNode);
			const adjNodesStored = this.graph.adjacentNodes(oldNode);
			this.removeVertex(oldNode);
			adjNodesStored.forEach((adjacentNode) => {
				if (this.graph.hasNode(adjacentNode)) this.graph.addEdge(newNode, adjacentNode);
			});
		}
		setArray(range, vertex) {
			this.arrayMapping.setArray(range, vertex);
		}
		correctInfiniteRangesDependency(address) {
			const relevantInfiniteRanges = this.graph.getInfiniteRanges().filter((node) => node.range.addressInRange(address));
			if (relevantInfiniteRanges.length <= 0) return;
			const { vertex, id: maybeVertexId } = this.fetchCellOrCreateEmpty(address);
			const vertexId = maybeVertexId !== null && maybeVertexId !== void 0 ? maybeVertexId : vertex.idInGraph;
			if (vertexId === void 0) throw new Error("Vertex not found");
			relevantInfiniteRanges.forEach((node) => {
				this.graph.addEdge(vertexId, node);
			});
		}
		exchangeOrAddGraphNode(oldNode, newNode) {
			if (oldNode) this.exchangeGraphNode(oldNode, newNode);
			else this.graph.addNodeIfNotExists(newNode);
		}
		getArrayVerticesRelatedToRanges(ranges) {
			const arrayVertices = /* @__PURE__ */ new Set();
			ranges.forEach((range) => {
				if (!this.graph.hasNode(range)) return;
				this.graph.adjacentNodes(range).forEach((adjacentVertex) => {
					if (adjacentVertex instanceof ArrayFormulaVertex) arrayVertices.add(adjacentVertex);
				});
			});
			return arrayVertices;
		}
		correctInfiniteRangesDependenciesByRangeVertex(vertex) {
			this.graph.getInfiniteRanges().forEach((infiniteRangeVertex) => {
				const intersection = vertex.range.intersectionWith(infiniteRangeVertex.range);
				if (intersection === void 0) return;
				intersection.addresses(this).forEach((address) => {
					const { vertex, id } = this.fetchCellOrCreateEmpty(address);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, infiniteRangeVertex);
				});
			});
		}
		cleanAddressMappingUnderArray(vertex) {
			const arrayRange = vertex.getRange();
			for (const address of arrayRange.addresses(this)) {
				const oldValue = vertex.getArrayCellValue(address);
				if (this.getCell(address) === vertex) if (vertex.isLeftCorner(address)) this.changes.addChange(new CellError(ErrorType.REF), address, oldValue);
				else {
					this.addressMapping.removeCell(address);
					this.changes.addChange(EmptyValue, address, oldValue);
				}
				else this.changes.addChange(EmptyValue, address, oldValue);
			}
		}
		*formulaDirectDependenciesToArray(vertex, array) {
			var _a;
			const [, formulaDependencies] = (_a = this.formulaDependencyQuery(vertex)) !== null && _a !== void 0 ? _a : [];
			if (formulaDependencies === void 0) return;
			for (const dependency of formulaDependencies) {
				if (dependency instanceof NamedExpressionDependency || dependency instanceof AbsoluteCellRange) continue;
				if (array.getRange().addressInRange(dependency)) yield [dependency, this.fetchCellOrCreateEmpty(dependency).vertex];
			}
		}
		*rangeDirectDependenciesToArray(vertex, array) {
			const { restRange: range } = this.rangeMapping.findSmallerRange(vertex.range);
			for (const address of range.addresses(this)) if (array.getRange().addressInRange(address)) yield [address, this.fetchCellOrCreateEmpty(address).vertex];
		}
		*adjacentArrayVertices(vertex) {
			const adjacentNodes = this.graph.adjacentNodes(vertex);
			for (const item of adjacentNodes) if (item instanceof FormulaVertex || item instanceof RangeVertex) yield item;
		}
		addStructuralNodesToChangeSet() {
			this.graph.markChangingWithStructureNodesAsDirty();
		}
		fixRangesWhenAddingRows(sheet, row, numberOfRows) {
			const originalValues = Array.from(this.rangeMapping.rangesInSheet(sheet));
			for (const rangeVertex of originalValues) if (rangeVertex.range.includesRow(row + numberOfRows)) if (rangeVertex.bruteForce) {
				const addedSubrangeInThatRange = rangeVertex.range.rangeWithSameWidth(row, numberOfRows);
				for (const address of addedSubrangeInThatRange.addresses(this)) {
					const { vertex, id } = this.fetchCellOrCreateEmpty(address);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, rangeVertex);
				}
			} else {
				let currentRangeVertex = rangeVertex;
				let find = this.rangeMapping.findSmallerRange(currentRangeVertex.range);
				if (find.smallerRangeVertex !== void 0) continue;
				while (find.smallerRangeVertex === void 0) {
					const newRangeVertex = new RangeVertex(AbsoluteCellRange.spanFrom(currentRangeVertex.range.start, currentRangeVertex.range.width(), currentRangeVertex.range.height() - 1));
					this.rangeMapping.addOrUpdateVertex(newRangeVertex);
					this.graph.addNodeIfNotExists(newRangeVertex);
					const restRange = new AbsoluteCellRange(simpleCellAddress(currentRangeVertex.range.start.sheet, currentRangeVertex.range.start.col, currentRangeVertex.range.end.row), currentRangeVertex.range.end);
					this.addAllFromRange(restRange, currentRangeVertex);
					this.graph.addEdge(newRangeVertex, currentRangeVertex);
					currentRangeVertex = newRangeVertex;
					find = this.rangeMapping.findSmallerRange(currentRangeVertex.range);
				}
				this.graph.addEdge(find.smallerRangeVertex, currentRangeVertex);
				this.addAllFromRange(find.restRange, currentRangeVertex);
				this.graph.removeEdge(find.smallerRangeVertex, rangeVertex);
			}
		}
		addAllFromRange(range, rangeVertex) {
			for (const address of range.addresses(this)) {
				const { vertex, id } = this.fetchCellOrCreateEmpty(address);
				this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, rangeVertex);
			}
		}
		fixRangesWhenAddingColumns(sheet, column, numberOfColumns) {
			for (const rangeVertex of this.rangeMapping.rangesInSheet(sheet)) if (rangeVertex.range.includesColumn(column + numberOfColumns)) {
				let subrange;
				if (rangeVertex.bruteForce) subrange = rangeVertex.range.rangeWithSameHeight(column, numberOfColumns);
				else subrange = AbsoluteCellRange.spanFrom(simpleCellAddress(sheet, column, rangeVertex.range.end.row), numberOfColumns, 1);
				for (const address of subrange.addresses(this)) {
					const { vertex, id } = this.fetchCellOrCreateEmpty(address);
					this.graph.addEdge(id !== null && id !== void 0 ? id : vertex, rangeVertex);
				}
			}
		}
		exchangeOrAddFormulaVertex(vertex) {
			const address = vertex.getAddress(this.lazilyTransformingAstService);
			const range = AbsoluteCellRange.spanFrom(address, vertex.width, vertex.height);
			const oldNode = this.shrinkPossibleArrayAndGetCell(address);
			if (vertex instanceof ArrayFormulaVertex) this.setArray(range, vertex);
			this.exchangeOrAddGraphNode(oldNode, vertex);
			this.addressMapping.setCell(address, vertex);
			if (vertex instanceof ArrayFormulaVertex) {
				if (!this.isThereSpaceForArray(vertex)) return;
				for (const cellAddress of range.addresses(this)) {
					if (vertex.isLeftCorner(cellAddress)) continue;
					const old = this.getCell(cellAddress);
					this.exchangeOrAddGraphNode(old, vertex);
				}
			}
			for (const cellAddress of range.addresses(this)) this.addressMapping.setCell(cellAddress, vertex);
		}
		setAddressMappingForArrayVertex(vertex, formulaAddress) {
			this.addressMapping.setCell(formulaAddress, vertex);
			if (!(vertex instanceof ArrayFormulaVertex)) return;
			const range = AbsoluteCellRange.spanFromOrUndef(formulaAddress, vertex.width, vertex.height);
			if (range === void 0) return;
			this.setArray(range, vertex);
			if (!this.isThereSpaceForArray(vertex)) return;
			for (const address of range.addresses(this)) this.addressMapping.setCell(address, vertex);
		}
		truncateRanges(span, coordinate) {
			const { verticesToRemove, verticesToMerge, verticesWithChangedSize } = this.rangeMapping.truncateRanges(span, coordinate);
			for (const [existingVertex, mergedVertex] of verticesToMerge) {
				this.rerouteDependents(mergedVertex, existingVertex);
				this.removeVertexAndCleanupDependencies(mergedVertex);
			}
			for (const rangeVertex of verticesToRemove) this.removeVertexAndCleanupDependencies(rangeVertex);
			return verticesWithChangedSize;
		}
		fixArraysAfterAddingRow(sheet, rowStart, numberOfRows) {
			this.arrayMapping.moveArrayVerticesAfterRowByRows(sheet, rowStart, numberOfRows);
			if (rowStart <= 0) return;
			for (const [, array] of this.arrayMapping.arraysInRows(RowsSpan.fromRowStartAndEnd(sheet, rowStart - 1, rowStart - 1))) {
				const arrayRange = array.getRange();
				for (let col = arrayRange.start.col; col <= arrayRange.end.col; ++col) for (let row = rowStart; row <= arrayRange.end.row; ++row) {
					const destination = simpleCellAddress(sheet, col, row);
					const source = simpleCellAddress(sheet, col, row + numberOfRows);
					const value = array.getArrayCellValue(destination);
					this.addressMapping.moveCell(source, destination);
					this.changes.addChange(EmptyValue, source, value);
				}
			}
		}
		fixArraysAfterRemovingRows(sheet, rowStart, numberOfRows) {
			this.arrayMapping.moveArrayVerticesAfterRowByRows(sheet, rowStart, -numberOfRows);
			if (rowStart <= 0) return;
			for (const [, array] of this.arrayMapping.arraysInRows(RowsSpan.fromRowStartAndEnd(sheet, rowStart - 1, rowStart - 1))) if (this.isThereSpaceForArray(array)) for (const address of array.getRange().addresses(this)) this.addressMapping.setCell(address, array);
			else this.setNoSpaceIfArray(array);
		}
		fixArraysAfterAddingColumn(sheet, columnStart, numberOfColumns) {
			this.arrayMapping.moveArrayVerticesAfterColumnByColumns(sheet, columnStart, numberOfColumns);
			if (columnStart <= 0) return;
			for (const [, array] of this.arrayMapping.arraysInCols(ColumnsSpan.fromColumnStartAndEnd(sheet, columnStart - 1, columnStart - 1))) {
				const arrayRange = array.getRange();
				for (let row = arrayRange.start.row; row <= arrayRange.end.row; ++row) for (let col = columnStart; col <= arrayRange.end.col; ++col) {
					const destination = simpleCellAddress(sheet, col, row);
					const source = simpleCellAddress(sheet, col + numberOfColumns, row);
					const value = array.getArrayCellValue(destination);
					this.addressMapping.moveCell(source, destination);
					this.changes.addChange(EmptyValue, source, value);
				}
			}
		}
		fixArraysAfterRemovingColumns(sheet, columnStart, numberOfColumns) {
			this.arrayMapping.moveArrayVerticesAfterColumnByColumns(sheet, columnStart, -numberOfColumns);
			if (columnStart <= 0) return;
			for (const [, array] of this.arrayMapping.arraysInCols(ColumnsSpan.fromColumnStartAndEnd(sheet, columnStart - 1, columnStart - 1))) if (this.isThereSpaceForArray(array)) for (const address of array.getRange().addresses(this)) this.addressMapping.setCell(address, array);
			else this.setNoSpaceIfArray(array);
		}
		shrinkPossibleArrayAndGetCell(address) {
			const vertex = this.getCell(address);
			if (!(vertex instanceof ArrayFormulaVertex)) return vertex;
			this.setNoSpaceIfArray(vertex);
			return this.getCell(address);
		}
		setNoSpaceIfArray(vertex) {
			if (vertex instanceof ArrayFormulaVertex) {
				this.shrinkArrayToCorner(vertex);
				vertex.setNoSpace();
			}
		}
		/**
		* Removes a vertex from the graph and range mapping and cleans up its dependencies.
		*/
		removeVertex(vertex) {
			this.removeVertexAndCleanupDependencies(vertex);
			if (vertex instanceof RangeVertex) this.rangeMapping.removeVertexIfExists(vertex);
		}
		/**
		* Reroutes dependent vertices of source to target. Also removes the edge target -> source if it exists.
		*/
		rerouteDependents(source, target) {
			const dependents = this.graph.adjacentNodes(source);
			this.graph.removeEdgeIfExists(target, source);
			dependents.forEach((adjacentNode) => {
				if (this.graph.hasNode(adjacentNode)) this.graph.addEdge(target, adjacentNode);
			});
		}
		/**
		* Removes a vertex from graph and reroutes its dependencies to other vertex. Also removes the edge vertexToKeep -> vertexToDelete if it exists.
		*/
		removeVertexAndRerouteDependencies(vertexToDelete, vertexToKeep) {
			const dependencies = this.graph.removeNode(vertexToDelete);
			this.graph.removeEdgeIfExists(vertexToKeep, vertexToDelete);
			dependencies.forEach(([_, dependency]) => {
				if (this.graph.hasNode(dependency)) this.graph.addEdge(dependency, vertexToKeep);
			});
		}
		/**
		* Removes a vertex from graph and cleans up its dependencies.
		* Dependency clean up = remove all RangeVertex and EmptyCellVertex dependencies if no other vertex depends on them.
		* Also cleans up placeholder sheets that have no remaining vertices (not needed anymore)
		*/
		removeVertexAndCleanupDependencies(inputVertex) {
			const dependencies = new Set(this.graph.removeNode(inputVertex));
			const affectedSheets = /* @__PURE__ */ new Set();
			while (dependencies.size > 0) {
				const dependency = dependencies.values().next().value;
				dependencies.delete(dependency);
				const [address, vertex] = dependency;
				if (this.graph.hasNode(vertex) && this.graph.adjacentNodesCount(vertex) === 0) {
					if (vertex instanceof RangeVertex || vertex instanceof EmptyCellVertex) this.graph.removeNode(vertex).forEach((candidate) => dependencies.add(candidate));
					if (vertex instanceof RangeVertex) {
						this.rangeMapping.removeVertexIfExists(vertex);
						affectedSheets.add(vertex.sheet);
					} else if (vertex instanceof EmptyCellVertex && isSimpleCellAddress(address)) {
						this.addressMapping.removeCell(address);
						affectedSheets.add(address.sheet);
					}
				}
			}
			this.cleanupPlaceholderSheets(affectedSheets);
		}
		/**
		* Removes placeholder sheets that have no remaining vertices.
		*/
		cleanupPlaceholderSheets(sheetIds) {
			for (const sheetId of sheetIds) if (this.isPlaceholder(sheetId) && !this.addressMapping.hasAnyEntries(sheetId) && this.rangeMapping.getNumberOfRangesInSheet(sheetId) === 0) {
				this.sheetMapping.removeSheetIfExists(sheetId, { includePlaceholders: true });
				this.addressMapping.removeSheetIfExists(sheetId);
			}
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/EmptyCellVertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Represents singleton vertex bound to all empty cells
	*/
	var EmptyCellVertex = class extends CellVertex {
		constructor() {
			super();
		}
		/**
		* Retrieves cell value bound to that singleton
		*/
		getCellValue() {
			return EmptyValue;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/ValueCellVertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Represents vertex which keeps static cell value
	*/
	var ValueCellVertex = class extends CellVertex {
		/** Static cell value. */
		constructor(parsedValue, rawValue) {
			super();
			this.parsedValue = parsedValue;
			this.rawValue = rawValue;
		}
		getValues() {
			return {
				parsedValue: this.parsedValue,
				rawValue: this.rawValue
			};
		}
		setValues(values) {
			this.parsedValue = values.parsedValue;
			this.rawValue = values.rawValue;
		}
		/**
		* Returns cell value stored in vertex
		*/
		getCellValue() {
			return this.parsedValue;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/ParsingErrorVertex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Represents a cell that contains a parsing error.
	*/
	var ParsingErrorVertex = class extends CellVertex {
		/**
		* Constructor
		*/
		constructor(errors, rawInput) {
			super();
			this.errors = errors;
			this.rawInput = rawInput;
		}
		/**
		* Returns the value of the cell.
		*/
		getCellValue() {
			const firstNonemptyMessage = this.errors.map((error) => error.message).find((msg) => msg);
			return CellError.parsingError(firstNonemptyMessage);
		}
		/**
		* Returns the formula of the cell.
		*/
		getFormula() {
			return this.rawInput;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/AddressMapping/SparseStrategy.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Mapping from cell addresses to vertices
	*
	* Uses Map to store addresses, having minimal memory usage for sparse sheets but not necessarily constant set/lookup.
	*/
	var SparseStrategy = class {
		constructor(width, height) {
			this.width = width;
			this.height = height;
			/**
			* Map of Maps in which actual data is stored.
			*
			* Key of map in first level is column number.
			* Key of map in second level is row number.
			*/
			this.mapping = /* @__PURE__ */ new Map();
		}
		/** @inheritDoc */
		getCell(address) {
			var _a;
			return (_a = this.mapping.get(address.col)) === null || _a === void 0 ? void 0 : _a.get(address.row);
		}
		/** @inheritDoc */
		setCell(address, newVertex) {
			this.width = Math.max(this.width, address.col + 1);
			this.height = Math.max(this.height, address.row + 1);
			let colMapping = this.mapping.get(address.col);
			if (!colMapping) {
				colMapping = /* @__PURE__ */ new Map();
				this.mapping.set(address.col, colMapping);
			}
			colMapping.set(address.row, newVertex);
		}
		/** @inheritDoc */
		has(address) {
			var _a;
			return !!((_a = this.mapping.get(address.col)) === null || _a === void 0 ? void 0 : _a.get(address.row));
		}
		/** @inheritDoc */
		getHeight() {
			return this.height;
		}
		/** @inheritDoc */
		getWidth() {
			return this.width;
		}
		removeCell(address) {
			var _a;
			(_a = this.mapping.get(address.col)) === null || _a === void 0 || _a.delete(address.row);
		}
		addRows(row, numberOfRows) {
			this.mapping.forEach((rowMapping) => {
				const tmpMapping = /* @__PURE__ */ new Map();
				rowMapping.forEach((vertex, rowNumber) => {
					if (rowNumber >= row) {
						tmpMapping.set(rowNumber + numberOfRows, vertex);
						rowMapping.delete(rowNumber);
					}
				});
				tmpMapping.forEach((vertex, rowNumber) => {
					rowMapping.set(rowNumber, vertex);
				});
			});
			this.height += numberOfRows;
		}
		addColumns(column, numberOfColumns) {
			const tmpMapping = /* @__PURE__ */ new Map();
			this.mapping.forEach((rowMapping, colNumber) => {
				if (colNumber >= column) {
					tmpMapping.set(colNumber + numberOfColumns, rowMapping);
					this.mapping.delete(colNumber);
				}
			});
			tmpMapping.forEach((rowMapping, colNumber) => {
				this.mapping.set(colNumber, rowMapping);
			});
			this.width += numberOfColumns;
		}
		removeRows(removedRows) {
			this.mapping.forEach((rowMapping) => {
				const tmpMapping = /* @__PURE__ */ new Map();
				rowMapping.forEach((vertex, rowNumber) => {
					if (rowNumber >= removedRows.rowStart) {
						rowMapping.delete(rowNumber);
						if (rowNumber > removedRows.rowEnd) tmpMapping.set(rowNumber - removedRows.numberOfRows, vertex);
					}
				});
				tmpMapping.forEach((vertex, rowNumber) => {
					rowMapping.set(rowNumber, vertex);
				});
			});
			const rightmostRowRemoved = Math.min(this.height - 1, removedRows.rowEnd);
			const numberOfRowsRemoved = Math.max(0, rightmostRowRemoved - removedRows.rowStart + 1);
			this.height = Math.max(0, this.height - numberOfRowsRemoved);
		}
		removeColumns(removedColumns) {
			const tmpMapping = /* @__PURE__ */ new Map();
			this.mapping.forEach((rowMapping, colNumber) => {
				if (colNumber >= removedColumns.columnStart) {
					this.mapping.delete(colNumber);
					if (colNumber > removedColumns.columnEnd) tmpMapping.set(colNumber - removedColumns.numberOfColumns, rowMapping);
				}
			});
			tmpMapping.forEach((rowMapping, colNumber) => {
				this.mapping.set(colNumber, rowMapping);
			});
			const rightmostColumnRemoved = Math.min(this.width - 1, removedColumns.columnEnd);
			const numberOfColumnsRemoved = Math.max(0, rightmostColumnRemoved - removedColumns.columnStart + 1);
			this.width = Math.max(0, this.width - numberOfColumnsRemoved);
		}
		*getEntries(sheet) {
			for (const [colNumber, col] of this.mapping) for (const [rowNumber, value] of col) yield [simpleCellAddress(sheet, colNumber, rowNumber), value];
		}
		*verticesFromColumn(column) {
			const colMapping = this.mapping.get(column);
			if (colMapping === void 0) return;
			for (const [_, vertex] of colMapping) yield vertex;
		}
		*verticesFromRow(row) {
			for (const colMapping of this.mapping.values()) {
				const rowVertex = colMapping.get(row);
				if (rowVertex !== void 0) yield rowVertex;
			}
		}
		*verticesFromColumnsSpan(columnsSpan) {
			for (const column of columnsSpan.columns()) {
				const colMapping = this.mapping.get(column);
				if (colMapping === void 0) continue;
				for (const [_, vertex] of colMapping) yield vertex;
			}
		}
		*verticesFromRowsSpan(rowsSpan) {
			for (const colMapping of this.mapping.values()) for (const row of rowsSpan.rows()) {
				const rowVertex = colMapping.get(row);
				if (rowVertex !== void 0) yield rowVertex;
			}
		}
		*entriesFromRowsSpan(rowsSpan) {
			for (const [col, colMapping] of this.mapping.entries()) for (const row of rowsSpan.rows()) {
				const rowVertex = colMapping.get(row);
				if (rowVertex !== void 0) yield [simpleCellAddress(rowsSpan.sheet, col, row), rowVertex];
			}
		}
		*entriesFromColumnsSpan(columnsSpan) {
			for (const col of columnsSpan.columns()) {
				const colMapping = this.mapping.get(col);
				if (colMapping !== void 0) for (const [row, vertex] of colMapping.entries()) yield [simpleCellAddress(columnsSpan.sheet, col, row), vertex];
			}
		}
		*vertices() {
			for (const [_, col] of this.mapping) for (const [_, value] of col) if (value !== void 0) yield value;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/AddressMapping/DenseStrategy.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Mapping from cell addresses to vertices
	*
	* Uses Array to store addresses, having minimal memory usage for dense sheets and constant set/lookup.
	*/
	var DenseStrategy = class {
		/**
		* @param width - width of the stored sheet
		* @param height - height of the stored sheet
		*/
		constructor(width, height) {
			this.width = width;
			this.height = height;
			this.mapping = new Array(height);
			for (let i = 0; i < height; i++) this.mapping[i] = new Array(width);
		}
		/** @inheritDoc */
		getCell(address) {
			return this.getCellVertex(address.col, address.row);
		}
		/** @inheritDoc */
		setCell(address, newVertex) {
			this.width = Math.max(this.width, address.col + 1);
			this.height = Math.max(this.height, address.row + 1);
			if (!this.mapping[address.row]) this.mapping[address.row] = new Array(this.width);
			this.mapping[address.row][address.col] = newVertex;
		}
		/** @inheritDoc */
		has(address) {
			const row = this.mapping[address.row];
			if (!row) return false;
			return !!row[address.col];
		}
		/** @inheritDoc */
		getHeight() {
			return this.height;
		}
		/** @inheritDoc */
		getWidth() {
			return this.width;
		}
		removeCell(address) {
			if (this.mapping[address.row] !== void 0) delete this.mapping[address.row][address.col];
		}
		addRows(row, numberOfRows) {
			const newRows = [];
			for (let i = 0; i < numberOfRows; i++) newRows.push(new Array(this.width));
			this.mapping.splice(row, 0, ...newRows);
			this.height += numberOfRows;
		}
		addColumns(column, numberOfColumns) {
			for (let i = 0; i < this.height; i++) if (this.mapping[i] !== void 0) this.mapping[i].splice(column, 0, ...new Array(numberOfColumns));
			this.width += numberOfColumns;
		}
		removeRows(removedRows) {
			this.mapping.splice(removedRows.rowStart, removedRows.numberOfRows);
			const rightmostRowRemoved = Math.min(this.height - 1, removedRows.rowEnd);
			const numberOfRowsRemoved = Math.max(0, rightmostRowRemoved - removedRows.rowStart + 1);
			this.height = Math.max(0, this.height - numberOfRowsRemoved);
		}
		removeColumns(removedColumns) {
			for (let i = 0; i < this.height; i++) if (this.mapping[i] !== void 0) this.mapping[i].splice(removedColumns.columnStart, removedColumns.numberOfColumns);
			const rightmostColumnRemoved = Math.min(this.width - 1, removedColumns.columnEnd);
			const numberOfColumnsRemoved = Math.max(0, rightmostColumnRemoved - removedColumns.columnStart + 1);
			this.width = Math.max(0, this.width - numberOfColumnsRemoved);
		}
		*getEntries(sheet) {
			for (let y = 0; y < this.height; ++y) for (let x = 0; x < this.width; ++x) {
				const vertex = this.getCellVertex(x, y);
				if (vertex) yield [simpleCellAddress(sheet, x, y), vertex];
			}
		}
		*verticesFromColumn(column) {
			for (let y = 0; y < this.height; ++y) {
				const vertex = this.getCellVertex(column, y);
				if (vertex) yield vertex;
			}
		}
		*verticesFromRow(row) {
			for (let x = 0; x < this.width; ++x) {
				const vertex = this.getCellVertex(x, row);
				if (vertex) yield vertex;
			}
		}
		*verticesFromColumnsSpan(columnsSpan) {
			for (let x = columnsSpan.columnStart; x <= columnsSpan.columnEnd; ++x) for (let y = 0; y < this.height; ++y) {
				const vertex = this.getCellVertex(x, y);
				if (vertex) yield vertex;
			}
		}
		*verticesFromRowsSpan(rowsSpan) {
			for (let x = 0; x < this.width; ++x) for (let y = rowsSpan.rowStart; y <= rowsSpan.rowEnd; ++y) {
				const vertex = this.getCellVertex(x, y);
				if (vertex) yield vertex;
			}
		}
		*entriesFromRowsSpan(rowsSpan) {
			for (let x = 0; x < this.width; ++x) for (let y = rowsSpan.rowStart; y <= rowsSpan.rowEnd; ++y) {
				const vertex = this.getCellVertex(x, y);
				if (vertex) yield [simpleCellAddress(rowsSpan.sheet, x, y), vertex];
			}
		}
		*entriesFromColumnsSpan(columnsSpan) {
			for (let x = columnsSpan.columnStart; x <= columnsSpan.columnEnd; ++x) for (let y = 0; y < this.height; ++y) {
				const vertex = this.getCellVertex(x, y);
				if (vertex) yield [simpleCellAddress(columnsSpan.sheet, x, y), vertex];
			}
		}
		*vertices() {
			for (let y = 0; y < this.height; ++y) for (let x = 0; x < this.width; ++x) {
				const vertex = this.getCellVertex(x, y);
				if (vertex) yield vertex;
			}
		}
		getCellVertex(x, y) {
			var _a;
			return (_a = this.mapping[y]) === null || _a === void 0 ? void 0 : _a[x];
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Cell.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Possible errors returned by our interpreter.
	*/
	var ErrorType;
	(function(ErrorType) {
		/** Division by zero. */
		ErrorType["DIV_BY_ZERO"] = "DIV_BY_ZERO";
		/** Unknown function name. */
		ErrorType["NAME"] = "NAME";
		ErrorType["VALUE"] = "VALUE";
		ErrorType["NUM"] = "NUM";
		ErrorType["NA"] = "NA";
		/** Cyclic dependency. */
		ErrorType["CYCLE"] = "CYCLE";
		/** Wrong address reference. */
		ErrorType["REF"] = "REF";
		/** Array spill error. */
		ErrorType["SPILL"] = "SPILL";
		/** Invalid/missing licence error. */
		ErrorType["LIC"] = "LIC";
		/** Generic error */
		ErrorType["ERROR"] = "ERROR";
	})(ErrorType || (ErrorType = {}));
	var CellType;
	(function(CellType) {
		CellType["FORMULA"] = "FORMULA";
		CellType["VALUE"] = "VALUE";
		CellType["ARRAY"] = "ARRAY";
		CellType["EMPTY"] = "EMPTY";
		CellType["ARRAYFORMULA"] = "ARRAYFORMULA";
	})(CellType || (CellType = {}));
	var getCellType = (vertex, address) => {
		if (vertex instanceof ArrayFormulaVertex) if (vertex.isLeftCorner(address)) return CellType.ARRAYFORMULA;
		else return CellType.ARRAY;
		if (vertex instanceof ScalarFormulaVertex || vertex instanceof ParsingErrorVertex) return CellType.FORMULA;
		if (vertex instanceof ValueCellVertex) return CellType.VALUE;
		return CellType.EMPTY;
	};
	var CellValueNoNumber;
	(function(CellValueNoNumber) {
		CellValueNoNumber["EMPTY"] = "EMPTY";
		CellValueNoNumber["NUMBER"] = "NUMBER";
		CellValueNoNumber["STRING"] = "STRING";
		CellValueNoNumber["BOOLEAN"] = "BOOLEAN";
		CellValueNoNumber["ERROR"] = "ERROR";
	})(CellValueNoNumber || (CellValueNoNumber = {}));
	var CellValueJustNumber;
	(function(CellValueJustNumber) {
		CellValueJustNumber["NUMBER"] = "NUMBER";
	})(CellValueJustNumber || (CellValueJustNumber = {}));
	var CellValueType = Object.assign(Object.assign({}, CellValueNoNumber), CellValueJustNumber);
	var CellValueDetailedType = Object.assign(Object.assign({}, CellValueNoNumber), NumberType);
	var CellValueTypeOrd = (arg) => {
		switch (arg) {
			case CellValueType.EMPTY: return 0;
			case CellValueType.NUMBER: return 1;
			case CellValueType.STRING: return 2;
			case CellValueType.BOOLEAN: return 3;
			case CellValueType.ERROR: return 4;
		}
		throw new Error("Cell value not computed");
	};
	var getCellValueType = (cellValue) => {
		if (cellValue === EmptyValue) return CellValueType.EMPTY;
		if (cellValue instanceof CellError || cellValue instanceof SimpleRangeValue) return CellValueType.ERROR;
		if (typeof cellValue === "string") return CellValueType.STRING;
		else if (isExtendedNumber(cellValue)) return CellValueType.NUMBER;
		else if (typeof cellValue === "boolean") return CellValueType.BOOLEAN;
		throw new Error("Cell value not computed");
	};
	var getCellValueDetailedType = (cellValue) => {
		if (isExtendedNumber(cellValue)) return getTypeOfExtendedNumber(cellValue);
		else return getCellValueType(cellValue);
	};
	var getCellValueFormat = (cellValue) => {
		if (isExtendedNumber(cellValue)) return getFormatOfExtendedNumber(cellValue);
		else return;
	};
	var CellError = class CellError {
		constructor(type, message, root) {
			this.type = type;
			this.message = message;
			this.root = root;
		}
		/**
		* Returns a CellError with a given message.
		* @param {string} detailedMessage - message to be displayed
		*/
		static parsingError(detailedMessage) {
			return new CellError(ErrorType.ERROR, `${ErrorMessage.ParseError}${detailedMessage ? " " + detailedMessage : ""}`);
		}
		attachRootVertex(vertex) {
			if (this.root === void 0) return new CellError(this.type, this.message, vertex);
			else return this;
		}
	};
	var simpleRowAddress = (sheet, row) => ({
		sheet,
		row
	});
	var invalidSimpleRowAddress = (address) => address.row < 0;
	var simpleColumnAddress = (sheet, col) => ({
		sheet,
		col
	});
	var invalidSimpleColumnAddress = (address) => address.col < 0;
	var simpleCellAddress = (sheet, col, row) => ({
		sheet,
		col,
		row
	});
	/**
	* Checks if the column or row id is negative.
	*/
	var isColOrRowInvalid = (address) => address.col < 0 || address.row < 0;
	var movedSimpleCellAddress = (address, toSheet, toRight, toBottom) => {
		return simpleCellAddress(toSheet, address.col + toRight, address.row + toBottom);
	};
	var addressKey = (address) => `${address.sheet},${address.row},${address.col}`;
	/**
	* Checks if the object is a simple cell address.
	*/
	function isSimpleCellAddress(obj) {
		var _a, _b, _c;
		return obj && (typeof obj === "object" || typeof obj === "function") && typeof ((_a = obj) === null || _a === void 0 ? void 0 : _a.sheet) === "number" && typeof ((_b = obj) === null || _b === void 0 ? void 0 : _b.col) === "number" && typeof ((_c = obj) === null || _c === void 0 ? void 0 : _c.row) === "number";
	}
	var absoluteSheetReference = (address, baseAddress) => {
		var _a;
		return (_a = address.sheet) !== null && _a !== void 0 ? _a : baseAddress.sheet;
	};
	var equalSimpleCellAddress = (left, right) => {
		return left.sheet === right.sheet && left.col === right.col && left.row === right.row;
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/AbsoluteCellRange.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var WRONG_RANGE_SIZE = "AbsoluteCellRange: Wrong range size";
	/**
	* Type guard that checks if an object is a valid SimpleCellRange.
	* @param {unknown} val - Value to check
	* @returns {boolean} True if and only if the object is a valid SimpleCellRange
	*/
	function isSimpleCellRange(val) {
		if (val && (typeof val === "object" || typeof val === "function")) {
			const obj = val;
			return "start" in obj && isSimpleCellAddress(obj.start) && "end" in obj && isSimpleCellAddress(obj.end);
		} else return false;
	}
	var simpleCellRange = (start, end) => ({
		start,
		end
	});
	var AbsoluteCellRange = class AbsoluteCellRange {
		constructor(start, end) {
			if (start.sheet !== end.sheet) throw new SheetsNotEqual(start.sheet, end.sheet);
			this.start = simpleCellAddress(start.sheet, start.col, start.row);
			this.end = simpleCellAddress(end.sheet, end.col, end.row);
		}
		get sheet() {
			return this.start.sheet;
		}
		static fromSimpleCellAddresses(start, end) {
			if (start.sheet !== end.sheet) throw new SheetsNotEqual(start.sheet, end.sheet);
			const width = end.col - start.col;
			const height = end.row - start.row;
			if (Number.isFinite(height) && Number.isFinite(width)) return new AbsoluteCellRange(start, end);
			if (Number.isFinite(height)) return new AbsoluteRowRange(start.sheet, start.row, end.row);
			return new AbsoluteColumnRange(start.sheet, start.col, end.col);
		}
		static fromAst(ast, baseAddress) {
			if (ast.type === AstNodeType.CELL_RANGE) return AbsoluteCellRange.fromCellRange(ast, baseAddress);
			else if (ast.type === AstNodeType.COLUMN_RANGE) return AbsoluteColumnRange.fromColumnRange(ast, baseAddress);
			else return AbsoluteRowRange.fromRowRangeAst(ast, baseAddress);
		}
		static fromAstOrUndef(ast, baseAddress) {
			try {
				return AbsoluteCellRange.fromAst(ast, baseAddress);
			} catch (_e) {
				return;
			}
		}
		static fromCellRange(x, baseAddress) {
			return new AbsoluteCellRange(x.start.toSimpleCellAddress(baseAddress), x.end.toSimpleCellAddress(baseAddress));
		}
		static spanFrom(topLeftCorner, width, height) {
			const ret = AbsoluteCellRange.spanFromOrUndef(topLeftCorner, width, height);
			if (ret === void 0) throw new Error(WRONG_RANGE_SIZE);
			return ret;
		}
		static spanFromOrUndef(topLeftCorner, width, height) {
			if (!Number.isFinite(width) && Number.isFinite(height)) {
				if (topLeftCorner.col !== 0) return;
				return new AbsoluteRowRange(topLeftCorner.sheet, topLeftCorner.row, topLeftCorner.row + height - 1);
			} else if (!Number.isFinite(height) && Number.isFinite(width)) {
				if (topLeftCorner.row !== 0) return;
				return new AbsoluteColumnRange(topLeftCorner.sheet, topLeftCorner.col, topLeftCorner.col + width - 1);
			} else if (Number.isFinite(height) && Number.isFinite(width)) return new AbsoluteCellRange(topLeftCorner, simpleCellAddress(topLeftCorner.sheet, topLeftCorner.col + width - 1, topLeftCorner.row + height - 1));
		}
		static fromCoordinates(sheet, x1, y1, x2, y2) {
			return new AbsoluteCellRange(simpleCellAddress(sheet, x1, y1), simpleCellAddress(sheet, x2, y2));
		}
		isFinite() {
			return Number.isFinite(this.size());
		}
		doesOverlap(other) {
			if (this.start.sheet != other.start.sheet) return false;
			if (this.end.row < other.start.row || this.start.row > other.end.row) return false;
			if (this.end.col < other.start.col || this.start.col > other.end.col) return false;
			return true;
		}
		addressInRange(address) {
			if (this.sheet !== address.sheet) return false;
			return this.start.row <= address.row && this.end.row >= address.row && this.start.col <= address.col && this.end.col >= address.col;
		}
		columnInRange(address) {
			if (this.sheet !== address.sheet) return false;
			return this.start.col <= address.col && this.end.col >= address.col;
		}
		rowInRange(address) {
			if (this.sheet !== address.sheet) return false;
			return this.start.row <= address.row && this.end.row >= address.row;
		}
		containsRange(range) {
			return this.addressInRange(range.start) && this.addressInRange(range.end);
		}
		intersectionWith(other) {
			if (this.sheet !== other.start.sheet) return;
			const startRow = Math.max(this.start.row, other.start.row);
			const endRow = Math.min(this.end.row, other.end.row);
			const startCol = Math.max(this.start.col, other.start.col);
			const endCol = Math.min(this.end.col, other.end.col);
			if (startRow > endRow || startCol > endCol) return;
			return new AbsoluteCellRange(simpleCellAddress(this.sheet, startCol, startRow), simpleCellAddress(this.sheet, endCol, endRow));
		}
		includesRow(row) {
			return this.start.row < row && this.end.row >= row;
		}
		includesColumn(column) {
			return this.start.col < column && this.end.col >= column;
		}
		shiftByRows(numberOfRows) {
			this.start.row += numberOfRows;
			this.end.row += numberOfRows;
		}
		expandByRows(numberOfRows) {
			this.end.row += numberOfRows;
		}
		shiftByColumns(numberOfColumns) {
			this.start.col += numberOfColumns;
			this.end.col += numberOfColumns;
		}
		shifted(byCols, byRows) {
			return AbsoluteCellRange.spanFrom(simpleCellAddress(this.sheet, this.start.col + byCols, this.start.row + byRows), this.width(), this.height());
		}
		expandByColumns(numberOfColumns) {
			this.end.col += numberOfColumns;
		}
		moveToSheet(toSheet) {
			this.start.sheet = toSheet;
			this.end.sheet = toSheet;
		}
		removeSpan(span) {
			if (span instanceof RowsSpan) this.removeRows(span.start, span.end);
			else this.removeColumns(span.start, span.end);
		}
		shouldBeRemoved() {
			return this.width() <= 0 || this.height() <= 0;
		}
		rangeWithSameWidth(startRow, numberOfRows) {
			return AbsoluteCellRange.spanFrom(simpleCellAddress(this.sheet, this.start.col, startRow), this.width(), numberOfRows);
		}
		rangeWithSameHeight(startColumn, numberOfColumns) {
			return AbsoluteCellRange.spanFrom(simpleCellAddress(this.sheet, startColumn, this.start.row), numberOfColumns, this.height());
		}
		toString() {
			return `${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`;
		}
		width() {
			return this.end.col - this.start.col + 1;
		}
		height() {
			return this.end.row - this.start.row + 1;
		}
		size() {
			return this.height() * this.width();
		}
		arrayOfAddressesInRange() {
			const result = [];
			for (let y = 0; y < this.height(); ++y) {
				result[y] = [];
				for (let x = 0; x < this.width(); ++x) {
					const value = simpleCellAddress(this.sheet, this.start.col + x, this.start.row + y);
					result[y].push(value);
				}
			}
			return result;
		}
		withStart(newStart) {
			return new AbsoluteCellRange(newStart, this.end);
		}
		sameDimensionsAs(other) {
			return this.width() === other.width() && this.height() === other.height();
		}
		sameAs(other) {
			return equalSimpleCellAddress(this.start, other.start) && equalSimpleCellAddress(this.end, other.end);
		}
		addressesArrayMap(dependencyGraph, op) {
			const ret = [];
			let currentRow = this.start.row;
			while (currentRow <= this.effectiveEndRow(dependencyGraph)) {
				let currentColumn = this.start.col;
				const tmp = [];
				while (currentColumn <= this.effectiveEndColumn(dependencyGraph)) {
					tmp.push(op(simpleCellAddress(this.start.sheet, currentColumn, currentRow)));
					currentColumn++;
				}
				ret.push(tmp);
				currentRow++;
			}
			return ret;
		}
		addresses(dependencyGraph) {
			const ret = [];
			let currentRow = this.start.row;
			const limitRow = this.effectiveEndRow(dependencyGraph);
			const limitColumn = this.effectiveEndColumn(dependencyGraph);
			while (currentRow <= limitRow) {
				let currentColumn = this.start.col;
				while (currentColumn <= limitColumn) {
					ret.push(simpleCellAddress(this.start.sheet, currentColumn, currentRow));
					currentColumn++;
				}
				currentRow++;
			}
			return ret;
		}
		*addressesWithDirection(right, bottom, dependencyGraph) {
			if (right > 0) if (bottom > 0) {
				let currentRow = this.effectiveEndRow(dependencyGraph);
				while (currentRow >= this.start.row) {
					let currentColumn = this.effectiveEndColumn(dependencyGraph);
					while (currentColumn >= this.start.col) {
						yield simpleCellAddress(this.start.sheet, currentColumn, currentRow);
						currentColumn -= 1;
					}
					currentRow -= 1;
				}
			} else {
				let currentRow = this.start.row;
				while (currentRow <= this.effectiveEndRow(dependencyGraph)) {
					let currentColumn = this.effectiveEndColumn(dependencyGraph);
					while (currentColumn >= this.start.col) {
						yield simpleCellAddress(this.start.sheet, currentColumn, currentRow);
						currentColumn -= 1;
					}
					currentRow += 1;
				}
			}
			else if (bottom > 0) {
				let currentRow = this.effectiveEndRow(dependencyGraph);
				while (currentRow >= this.start.row) {
					let currentColumn = this.start.col;
					while (currentColumn <= this.effectiveEndColumn(dependencyGraph)) {
						yield simpleCellAddress(this.start.sheet, currentColumn, currentRow);
						currentColumn += 1;
					}
					currentRow -= 1;
				}
			} else {
				let currentRow = this.start.row;
				while (currentRow <= this.effectiveEndRow(dependencyGraph)) {
					let currentColumn = this.start.col;
					while (currentColumn <= this.effectiveEndColumn(dependencyGraph)) {
						yield simpleCellAddress(this.start.sheet, currentColumn, currentRow);
						currentColumn += 1;
					}
					currentRow += 1;
				}
			}
		}
		getAddress(col, row) {
			if (col < 0 || row < 0 || row > this.height() - 1 || col > this.width() - 1) throw Error("Index out of bound");
			return simpleCellAddress(this.start.sheet, this.start.col + col, this.start.row + row);
		}
		exceedsSheetSizeLimits(maxColumns, maxRows) {
			return this.end.col >= maxColumns || this.end.row >= maxRows;
		}
		effectiveEndColumn(_dependencyGraph) {
			return this.end.col;
		}
		effectiveEndRow(_dependencyGraph) {
			return this.end.row;
		}
		effectiveWidth(_dependencyGraph) {
			return this.width();
		}
		effectiveHeight(_dependencyGraph) {
			return this.height();
		}
		removeRows(rowStart, rowEnd) {
			if (rowStart > this.end.row) return;
			if (rowEnd < this.start.row) {
				const numberOfRows = rowEnd - rowStart + 1;
				return this.shiftByRows(-numberOfRows);
			}
			if (rowStart <= this.start.row) this.start.row = rowStart;
			this.end.row -= Math.min(rowEnd, this.end.row) - rowStart + 1;
		}
		removeColumns(columnStart, columnEnd) {
			if (columnStart > this.end.col) return;
			if (columnEnd < this.start.col) {
				const numberOfColumns = columnEnd - columnStart + 1;
				return this.shiftByColumns(-numberOfColumns);
			}
			if (columnStart <= this.start.col) this.start.col = columnStart;
			this.end.col -= Math.min(columnEnd, this.end.col) - columnStart + 1;
		}
	};
	var AbsoluteColumnRange = class AbsoluteColumnRange extends AbsoluteCellRange {
		constructor(sheet, columnStart, columnEnd) {
			super(simpleCellAddress(sheet, columnStart, 0), simpleCellAddress(sheet, columnEnd, Number.POSITIVE_INFINITY));
		}
		static fromColumnRange(x, baseAddress) {
			const start = x.start.toSimpleColumnAddress(baseAddress);
			const end = x.end.toSimpleColumnAddress(baseAddress);
			if (start.sheet !== end.sheet) throw new SheetsNotEqual(start.sheet, end.sheet);
			return new AbsoluteColumnRange(start.sheet, start.col, end.col);
		}
		shouldBeRemoved() {
			return this.width() <= 0;
		}
		shiftByRows(_numberOfRows) {}
		expandByRows(_numberOfRows) {}
		shifted(byCols, _byRows) {
			return new AbsoluteColumnRange(this.sheet, this.start.col + byCols, this.end.col + byCols);
		}
		rangeWithSameHeight(startColumn, numberOfColumns) {
			return new AbsoluteColumnRange(this.sheet, startColumn, startColumn + numberOfColumns - 1);
		}
		exceedsSheetSizeLimits(maxColumns, _maxRows) {
			return this.end.col >= maxColumns;
		}
		effectiveEndRow(dependencyGraph) {
			return this.effectiveHeight(dependencyGraph) - 1;
		}
		effectiveHeight(dependencyGraph) {
			return dependencyGraph.getSheetHeight(this.sheet);
		}
		removeRows(_rowStart, _rowEnd) {}
	};
	var AbsoluteRowRange = class AbsoluteRowRange extends AbsoluteCellRange {
		constructor(sheet, rowStart, rowEnd) {
			super(simpleCellAddress(sheet, 0, rowStart), simpleCellAddress(sheet, Number.POSITIVE_INFINITY, rowEnd));
		}
		static fromRowRangeAst(x, baseAddress) {
			const start = x.start.toSimpleRowAddress(baseAddress);
			const end = x.end.toSimpleRowAddress(baseAddress);
			if (start.sheet !== end.sheet) throw new SheetsNotEqual(start.sheet, end.sheet);
			return new AbsoluteRowRange(start.sheet, start.row, end.row);
		}
		shouldBeRemoved() {
			return this.height() <= 0;
		}
		shiftByColumns(_numberOfColumns) {}
		expandByColumns(_numberOfColumns) {}
		shifted(byCols, byRows) {
			return new AbsoluteRowRange(this.sheet, this.start.row + byRows, this.end.row + byRows);
		}
		rangeWithSameWidth(startRow, numberOfRows) {
			return new AbsoluteRowRange(this.sheet, startRow, startRow + numberOfRows - 1);
		}
		exceedsSheetSizeLimits(_maxColumns, maxRows) {
			return this.end.row >= maxRows;
		}
		effectiveEndColumn(dependencyGraph) {
			return this.effectiveWidth(dependencyGraph) - 1;
		}
		effectiveWidth(dependencyGraph) {
			return dependencyGraph.getSheetWidth(this.sheet);
		}
		removeColumns(_columnStart, _columnEnd) {}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/InterpreterState.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var InterpreterState = class {
		constructor(formulaAddress, arraysFlag, formulaVertex) {
			this.formulaAddress = formulaAddress;
			this.arraysFlag = arraysFlag;
			this.formulaVertex = formulaVertex;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/StringHelper.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function collatorFromConfig(config) {
		const sensitivity = config.caseSensitive ? config.accentSensitive ? "variant" : "case" : config.accentSensitive ? "accent" : "base";
		const caseFirst = config.caseFirst;
		const ignorePunctuation = config.ignorePunctuation;
		return new Intl.Collator(config.localeLang, {
			sensitivity,
			caseFirst,
			ignorePunctuation
		});
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/ArithmeticHelper.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var COMPLEX_NUMBER_SYMBOL = "i";
	var complexParsingRegexp = /^\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij]))\s*(([+-])\s*([+-]?)\s*(([\d\.,]+(e[+-]?\d+)?)\s*([ij]?)|([ij])))?$/;
	var ArithmeticHelper = class {
		constructor(config, dateTimeHelper, numberLiteralsHelper) {
			this.config = config;
			this.dateTimeHelper = dateTimeHelper;
			this.numberLiteralsHelper = numberLiteralsHelper;
			this.lt = (left, right) => {
				return this.compare(left, right) < 0;
			};
			this.leq = (left, right) => {
				return this.compare(left, right) <= 0;
			};
			this.gt = (left, right) => {
				return this.compare(left, right) > 0;
			};
			this.geq = (left, right) => {
				return this.compare(left, right) >= 0;
			};
			this.eq = (left, right) => {
				return this.compare(left, right) === 0;
			};
			this.neq = (left, right) => {
				return this.compare(left, right) !== 0;
			};
			this.pow = (left, right) => {
				return Math.pow(getRawValue(left), getRawValue(right));
			};
			this.addWithEpsilonRaw = (left, right) => {
				const ret = left + right;
				if (Math.abs(ret) < this.actualEps * Math.abs(left)) return 0;
				else return ret;
			};
			this.addWithEpsilon = (left, right) => {
				const typeOfResult = inferExtendedNumberTypeAdditive(left, right);
				return this.ExtendedNumberFactory(this.addWithEpsilonRaw(getRawValue(left), getRawValue(right)), typeOfResult);
			};
			this.unaryMinus = (arg) => {
				return cloneNumber(arg, -getRawValue(arg));
			};
			this.unaryPlus = (arg) => arg;
			this.unaryPercent = (arg) => {
				return new PercentNumber(getRawValue(arg) / 100);
			};
			this.concat = (left, right) => {
				return left.concat(right);
			};
			this.nonstrictadd = (left, right) => {
				if (left instanceof CellError) return left;
				else if (right instanceof CellError) return right;
				else if (typeof left === "number") if (typeof right === "number") return this.addWithEpsilonRaw(left, right);
				else return left;
				else if (typeof right === "number") return right;
				else return 0;
			};
			/**
			* Subtracts two numbers
			*
			* Implementation of subtracting which is used in interpreter.
			*
			* @param left - left operand of subtraction
			* @param right - right operand of subtraction
			* @param eps - precision of comparison
			*/
			this.subtract = (leftArg, rightArg) => {
				const typeOfResult = inferExtendedNumberTypeAdditive(leftArg, rightArg);
				const left = getRawValue(leftArg);
				let ret = left - getRawValue(rightArg);
				if (Math.abs(ret) < this.actualEps * Math.abs(left)) ret = 0;
				return this.ExtendedNumberFactory(ret, typeOfResult);
			};
			this.divide = (leftArg, rightArg) => {
				const left = getRawValue(leftArg);
				const right = getRawValue(rightArg);
				if (right === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				else {
					const typeOfResult = inferExtendedNumberTypeMultiplicative(leftArg, rightArg);
					return this.ExtendedNumberFactory(left / right, typeOfResult);
				}
			};
			this.multiply = (left, right) => {
				const typeOfResult = inferExtendedNumberTypeMultiplicative(left, right);
				return this.ExtendedNumberFactory(getRawValue(left) * getRawValue(right), typeOfResult);
			};
			this.manyToExactComplex = (args) => {
				const ret = [];
				for (const arg of args) if (arg instanceof CellError) return arg;
				else if (isExtendedNumber(arg) || typeof arg === "string") {
					const coerced = this.coerceScalarToComplex(arg);
					if (!(coerced instanceof CellError)) ret.push(coerced);
				}
				return ret;
			};
			this.coerceNumbersExactRanges = (args) => this.manyToNumbers(args, this.manyToExactNumbers);
			this.coerceNumbersCoerceRangesDropNulls = (args) => this.manyToNumbers(args, this.manyToCoercedNumbersDropNulls);
			this.manyToExactNumbers = (args) => {
				const ret = [];
				for (const arg of args) if (arg instanceof CellError) return arg;
				else if (isExtendedNumber(arg)) ret.push(getRawValue(arg));
				return ret;
			};
			this.manyToOnlyNumbersDropNulls = (args) => {
				const ret = [];
				for (const arg of args) if (arg instanceof CellError) return arg;
				else if (isExtendedNumber(arg)) ret.push(getRawValue(arg));
				else if (arg !== EmptyValue) return new CellError(ErrorType.VALUE, ErrorMessage.NumberExpected);
				return ret;
			};
			this.manyToCoercedNumbersDropNulls = (args) => {
				const ret = [];
				for (const arg of args) {
					if (arg instanceof CellError) return arg;
					if (arg === EmptyValue) continue;
					const coerced = this.coerceScalarToNumberOrError(arg);
					if (isExtendedNumber(coerced)) ret.push(getRawValue(coerced));
				}
				return ret;
			};
			this.collator = collatorFromConfig(config);
			this.actualEps = config.smartRounding ? config.precisionEpsilon : 0;
		}
		eqMatcherFunction(pattern) {
			const regexp = this.buildRegex(pattern);
			return (cellValue) => typeof cellValue === "string" && regexp.test(this.normalizeString(cellValue));
		}
		neqMatcherFunction(pattern) {
			const regexp = this.buildRegex(pattern);
			return (cellValue) => {
				return !(typeof cellValue === "string") || !regexp.test(this.normalizeString(cellValue));
			};
		}
		searchString(pattern, text) {
			var _a;
			const result = this.buildRegex(pattern, false).exec(text);
			return (_a = result === null || result === void 0 ? void 0 : result.index) !== null && _a !== void 0 ? _a : -1;
		}
		requiresRegex(pattern) {
			if (!this.config.useRegularExpressions && !this.config.useWildcards) return !this.config.matchWholeCell;
			for (let i = 0; i < pattern.length; i++) {
				const c = pattern.charAt(i);
				if (isWildcard(c) || this.config.useRegularExpressions && needsEscape(c)) return true;
			}
			return false;
		}
		floatCmp(leftArg, rightArg) {
			const left = getRawValue(leftArg);
			const right = getRawValue(rightArg);
			const mod = 1 + this.actualEps;
			if (right >= 0 && left * mod >= right && left <= right * mod) return 0;
			else if (right <= 0 && left * mod <= right && left >= right * mod) return 0;
			else if (left > right) return 1;
			else return -1;
		}
		coerceScalarToNumberOrError(arg) {
			var _a;
			if (arg instanceof CellError) return arg;
			return (_a = this.coerceToMaybeNumber(arg)) !== null && _a !== void 0 ? _a : new CellError(ErrorType.VALUE, ErrorMessage.NumberCoercion);
		}
		coerceToMaybeNumber(arg) {
			var _a;
			return (_a = this.coerceNonDateScalarToMaybeNumber(arg)) !== null && _a !== void 0 ? _a : typeof arg === "string" ? this.dateTimeHelper.dateStringToDateNumber(arg) : void 0;
		}
		coerceNonDateScalarToMaybeNumber(arg) {
			if (arg === EmptyValue) return 0;
			else if (typeof arg === "string") {
				if (arg === "") return 0;
				const maybePercentNumber = this.coerceStringToMaybePercentNumber(arg);
				if (maybePercentNumber !== void 0) return maybePercentNumber;
				const maybeCurrencyNumber = this.coerceStringToMaybeCurrencyNumber(arg);
				if (maybeCurrencyNumber !== void 0) return maybeCurrencyNumber;
				return this.numberLiteralsHelper.numericStringToMaybeNumber(arg.trim());
			} else if (isExtendedNumber(arg)) return arg;
			else if (typeof arg === "boolean") return Number(arg);
			else return;
		}
		coerceStringToMaybePercentNumber(input) {
			const trimmedInput = input.trim();
			if (trimmedInput.endsWith("%")) {
				const numOfPercents = trimmedInput.slice(0, trimmedInput.length - 1).trim();
				const parsedNumOfPercents = this.numberLiteralsHelper.numericStringToMaybeNumber(numOfPercents);
				if (parsedNumOfPercents !== void 0) return new PercentNumber(parsedNumOfPercents / 100);
			}
		}
		coerceStringToMaybeCurrencyNumber(input) {
			const matchedCurrency = this.currencyMatcher(input.trim());
			if (matchedCurrency !== void 0) {
				const [currencySymbol, currencyValue] = matchedCurrency;
				const parsedCurrencyValue = this.numberLiteralsHelper.numericStringToMaybeNumber(currencyValue);
				if (parsedCurrencyValue !== void 0) return new CurrencyNumber(parsedCurrencyValue, currencySymbol);
			}
		}
		currencyMatcher(token) {
			for (const currency of this.config.currencySymbol) {
				if (token.startsWith(currency)) return [currency, token.slice(currency.length).trim()];
				if (token.endsWith(currency)) return [currency, token.slice(0, token.length - currency.length).trim()];
			}
		}
		coerceComplexExactRanges(args) {
			const vals = [];
			for (const arg of args) if (arg instanceof SimpleRangeValue) vals.push(arg);
			else if (arg !== EmptyValue) {
				const coerced = this.coerceScalarToComplex(arg);
				if (coerced instanceof CellError) return coerced;
				else vals.push(coerced);
			}
			const expandedVals = [];
			for (const val of vals) if (val instanceof SimpleRangeValue) {
				const arr = this.manyToExactComplex(val.valuesFromTopLeftCorner());
				if (arr instanceof CellError) return arr;
				else expandedVals.push(...arr);
			} else expandedVals.push(val);
			return expandedVals;
		}
		coerceScalarToComplex(arg) {
			if (arg instanceof CellError) return arg;
			else if (arg === EmptyValue) return [0, 0];
			else if (isExtendedNumber(arg)) return [getRawValue(arg), 0];
			else if (typeof arg === "string") return this.coerceStringToComplex(arg);
			else return new CellError(ErrorType.NUM, ErrorMessage.ComplexNumberExpected);
		}
		ExtendedNumberFactory(value, typeFormat) {
			const { type, format } = typeFormat;
			switch (type) {
				case NumberType.NUMBER_RAW: return value;
				case NumberType.NUMBER_CURRENCY: return new CurrencyNumber(value, format !== null && format !== void 0 ? format : this.config.currencySymbol[0]);
				case NumberType.NUMBER_DATE: return new DateNumber(value, format);
				case NumberType.NUMBER_DATETIME: return new DateTimeNumber(value, format);
				case NumberType.NUMBER_TIME: return new TimeNumber(value, format);
				case NumberType.NUMBER_PERCENT: return new PercentNumber(value, format);
			}
		}
		buildRegex(pattern, matchWholeCell = true) {
			pattern = this.normalizeString(pattern);
			let regexpStr;
			let useWildcards = this.config.useWildcards;
			let useRegularExpressions = this.config.useRegularExpressions;
			if (useRegularExpressions) try {
				RegExp(pattern);
			} catch (e) {
				useRegularExpressions = false;
				useWildcards = false;
			}
			if (useRegularExpressions) regexpStr = escapeNoCharacters(pattern, this.config.caseSensitive);
			else if (useWildcards) regexpStr = escapeNonWildcards(pattern, this.config.caseSensitive);
			else regexpStr = escapeAllCharacters(pattern, this.config.caseSensitive);
			if (this.config.matchWholeCell && matchWholeCell) return RegExp("^(" + regexpStr + ")$");
			else return RegExp(regexpStr);
		}
		normalizeString(str) {
			if (!this.config.caseSensitive) str = str.toLowerCase();
			if (!this.config.accentSensitive) str = normalizeString(str, "nfd").replace(/[\u0300-\u036f]/g, "");
			return str;
		}
		compare(left, right) {
			if (typeof left === "string" || typeof right === "string") {
				const leftTmp = typeof left === "string" ? this.dateTimeHelper.dateStringToDateNumber(left) : left;
				const rightTmp = typeof right === "string" ? this.dateTimeHelper.dateStringToDateNumber(right) : right;
				if (isExtendedNumber(leftTmp) && isExtendedNumber(rightTmp)) return this.floatCmp(leftTmp, rightTmp);
			}
			if (left === EmptyValue) left = coerceEmptyToValue(right);
			else if (right === EmptyValue) right = coerceEmptyToValue(left);
			if (typeof left === "string" && typeof right === "string") return this.stringCmp(left, right);
			else if (typeof left === "boolean" && typeof right === "boolean") return numberCmp(coerceBooleanToNumber(left), coerceBooleanToNumber(right));
			else if (isExtendedNumber(left) && isExtendedNumber(right)) return this.floatCmp(left, right);
			else if (left === EmptyValue && right === EmptyValue) return 0;
			else return numberCmp(CellValueTypeOrd(getCellValueType(left)), CellValueTypeOrd(getCellValueType(right)));
		}
		stringCmp(left, right) {
			return this.collator.compare(left, right);
		}
		manyToNumbers(args, rangeFn) {
			const vals = [];
			for (const arg of args) if (arg instanceof SimpleRangeValue) vals.push(arg);
			else {
				const coerced = getRawValue(this.coerceScalarToNumberOrError(arg));
				if (coerced instanceof CellError) return coerced;
				else vals.push(coerced);
			}
			const expandedVals = [];
			for (const val of vals) if (val instanceof SimpleRangeValue) {
				const arr = rangeFn(val.valuesFromTopLeftCorner());
				if (arr instanceof CellError) return arr;
				else expandedVals.push(...arr);
			} else expandedVals.push(val);
			return expandedVals;
		}
		coerceStringToComplex(arg) {
			const match = complexParsingRegexp.exec(arg);
			if (match === null) return new CellError(ErrorType.NUM, ErrorMessage.ComplexNumberExpected);
			let val1;
			if (match[6] !== void 0) val1 = match[1] === "-" ? [0, -1] : [0, 1];
			else val1 = this.parseComplexToken(match[1] + match[3], match[5]);
			if (val1 instanceof CellError) return val1;
			if (match[8] === void 0) return val1;
			let val2;
			if (match[14] !== void 0) val2 = match[9] === "-" ? [0, -1] : [0, 1];
			else val2 = this.parseComplexToken(match[9] + match[11], match[13]);
			if (val2 instanceof CellError) return val2;
			if (match[5] !== "" || match[13] === "") return new CellError(ErrorType.NUM, ErrorMessage.ComplexNumberExpected);
			if (match[8] === "+") return [val1[0] + val2[0], val1[1] + val2[1]];
			else return [val1[0] - val2[0], val1[1] - val2[1]];
		}
		parseComplexToken(arg, mod) {
			const val = getRawValue(this.coerceNonDateScalarToMaybeNumber(arg));
			if (val === void 0) return new CellError(ErrorType.NUM, ErrorMessage.ComplexNumberExpected);
			if (mod === "") return [val, 0];
			else return [0, val];
		}
	};
	function coerceComplexToString([re, im], symb) {
		if (!isFinite(re) || !isFinite(im)) return new CellError(ErrorType.NUM, ErrorMessage.NaN);
		symb = symb !== null && symb !== void 0 ? symb : COMPLEX_NUMBER_SYMBOL;
		if (im === 0) return `${re}`;
		const imStr = `${im === -1 || im === 1 ? "" : Math.abs(im)}${symb}`;
		if (re === 0) return `${im < 0 ? "-" : ""}${imStr}`;
		return `${re}${im < 0 ? "-" : "+"}${imStr}`;
	}
	function coerceToRange(arg) {
		if (arg instanceof SimpleRangeValue) return arg;
		else return SimpleRangeValue.fromScalar(arg);
	}
	function coerceBooleanToNumber(arg) {
		return Number(arg);
	}
	function coerceEmptyToValue(arg) {
		if (typeof arg === "string") return "";
		else if (isExtendedNumber(arg)) return 0;
		else if (typeof arg === "boolean") return false;
		else return EmptyValue;
	}
	/**
	* Coerce scalar value to boolean if possible, or error if value is an error
	*
	* @param arg
	*/
	function coerceScalarToBoolean(arg) {
		if (arg instanceof CellError || typeof arg === "boolean") return arg;
		else if (arg === EmptyValue) return false;
		else if (isExtendedNumber(arg)) return getRawValue(arg) !== 0;
		else {
			const argUppered = arg.toUpperCase();
			if (argUppered === "TRUE") return true;
			else if (argUppered === "FALSE") return false;
			else if (argUppered === "") return false;
			else return;
		}
	}
	function coerceScalarToString(arg) {
		if (arg instanceof CellError || typeof arg === "string") return arg;
		else if (arg === EmptyValue) return "";
		else if (isExtendedNumber(arg)) return getRawValue(arg).toString();
		else return arg ? "TRUE" : "FALSE";
	}
	function zeroIfEmpty(arg) {
		return arg === EmptyValue ? 0 : arg;
	}
	function numberCmp(leftArg, rightArg) {
		const left = getRawValue(leftArg);
		const right = getRawValue(rightArg);
		if (left > right) return 1;
		else if (left < right) return -1;
		else return 0;
	}
	function isNumberOverflow(arg) {
		return isNaN(arg) || arg === Infinity || arg === -Infinity;
	}
	function fixNegativeZero(arg) {
		if (arg === 0) return 0;
		else return arg;
	}
	function isWildcard(c) {
		return ["*", "?"].includes(c);
	}
	var escapedCharacters = [
		"{",
		"}",
		"[",
		"]",
		"(",
		")",
		"<",
		">",
		"=",
		".",
		"+",
		"-",
		",",
		"\\",
		"$",
		"^",
		"!"
	];
	function needsEscape(c) {
		return escapedCharacters.includes(c);
	}
	function escapeNonWildcards(pattern, caseSensitive) {
		let str = "";
		for (let i = 0; i < pattern.length; i++) {
			const c = pattern.charAt(i);
			if (c === "~") {
				if (i == pattern.length - 1) {
					str += "~";
					continue;
				}
				const d = pattern.charAt(i + 1);
				if (isWildcard(d) || needsEscape(d)) {
					str += "\\" + d;
					i++;
				} else {
					str += d;
					i++;
				}
			} else if (isWildcard(c)) str += "." + c;
			else if (needsEscape(c)) str += "\\" + c;
			else if (caseSensitive) str += c;
			else str += c.toLowerCase();
		}
		return str;
	}
	function escapeAllCharacters(pattern, caseSensitive) {
		let str = "";
		for (let i = 0; i < pattern.length; i++) {
			const c = pattern.charAt(i);
			if (isWildcard(c) || needsEscape(c)) str += "\\" + c;
			else if (caseSensitive) str += c;
			else str += c.toLowerCase();
		}
		return str;
	}
	function escapeNoCharacters(pattern, caseSensitive) {
		let str = "";
		for (let i = 0; i < pattern.length; i++) {
			const c = pattern.charAt(i);
			if (isWildcard(c) || needsEscape(c)) str += c;
			else if (caseSensitive) str += c;
			else str += c.toLowerCase();
		}
		return str;
	}
	function inferExtendedNumberTypeAdditive(leftArg, rightArg) {
		const { type: leftType, format: leftFormat } = getTypeFormatOfExtendedNumber(leftArg);
		const { type: rightType, format: rightFormat } = getTypeFormatOfExtendedNumber(rightArg);
		if (leftType === NumberType.NUMBER_RAW) return {
			type: rightType,
			format: rightFormat
		};
		if (rightType === NumberType.NUMBER_RAW) return {
			type: leftType,
			format: leftFormat
		};
		if ((leftType === NumberType.NUMBER_DATETIME || leftType === NumberType.NUMBER_DATE) && (rightType === NumberType.NUMBER_DATETIME || rightType === NumberType.NUMBER_DATE)) return { type: NumberType.NUMBER_RAW };
		if (leftType === NumberType.NUMBER_TIME) {
			if (rightType === NumberType.NUMBER_DATE) return {
				type: NumberType.NUMBER_DATETIME,
				format: `${rightFormat} ${leftFormat}`
			};
			if (rightType === NumberType.NUMBER_DATETIME) return {
				type: NumberType.NUMBER_DATETIME,
				format: rightFormat
			};
		}
		if (rightType === NumberType.NUMBER_TIME) {
			if (leftType === NumberType.NUMBER_DATE) return {
				type: NumberType.NUMBER_DATETIME,
				format: `${leftFormat} ${rightFormat}`
			};
			if (leftType === NumberType.NUMBER_DATETIME) return {
				type: NumberType.NUMBER_DATETIME,
				format: leftFormat
			};
		}
		return {
			type: leftType,
			format: leftFormat
		};
	}
	function inferExtendedNumberTypeMultiplicative(leftArg, rightArg) {
		let { type: leftType, format: leftFormat } = getTypeFormatOfExtendedNumber(leftArg);
		let { type: rightType, format: rightFormat } = getTypeFormatOfExtendedNumber(rightArg);
		if (leftType === NumberType.NUMBER_PERCENT) {
			leftType = NumberType.NUMBER_RAW;
			leftFormat = void 0;
		}
		if (rightType === NumberType.NUMBER_PERCENT) {
			rightType = NumberType.NUMBER_RAW;
			rightFormat = void 0;
		}
		if (leftType === NumberType.NUMBER_RAW) return {
			type: rightType,
			format: rightFormat
		};
		if (rightType === NumberType.NUMBER_RAW) return {
			type: leftType,
			format: leftFormat
		};
		return { type: NumberType.NUMBER_RAW };
	}
	function forceNormalizeString(str) {
		return normalizeString(str.toLowerCase(), "nfd").replace(/[\u0300-\u036f]/g, "");
	}
	function coerceRangeToScalar(arg, state) {
		var _a;
		if (arg.isAdHoc()) return (_a = arg.data[0]) === null || _a === void 0 ? void 0 : _a[0];
		const range = arg.range;
		if (state.formulaAddress.sheet === range.sheet) {
			if (range.width() === 1) {
				const offset = state.formulaAddress.row - range.start.row;
				if (offset >= 0 && offset < range.height()) return arg.data[offset][0];
			} else if (range.height() === 1) {
				const offset = state.formulaAddress.col - range.start.col;
				if (offset >= 0 && offset < range.width()) return arg.data[0][offset];
			}
		}
	}
	function normalizeString(str, form) {
		return str.normalize(form.toUpperCase());
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/FunctionPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var FunctionArgumentType;
	(function(FunctionArgumentType) {
		/**
		* String type.
		*/
		FunctionArgumentType["STRING"] = "STRING";
		/**
		* Floating point type.
		*/
		FunctionArgumentType["NUMBER"] = "NUMBER";
		/**
		* Boolean type.
		*/
		FunctionArgumentType["BOOLEAN"] = "BOOLEAN";
		/**
		* Any non-range value.
		*/
		FunctionArgumentType["SCALAR"] = "SCALAR";
		/**
		* Any non-range, no-error type.
		*/
		FunctionArgumentType["NOERROR"] = "NOERROR";
		/**
		* Range type.
		*/
		FunctionArgumentType["RANGE"] = "RANGE";
		/**
		* Integer type.
		*/
		FunctionArgumentType["INTEGER"] = "INTEGER";
		/**
		* String representing complex number.
		*/
		FunctionArgumentType["COMPLEX"] = "COMPLEX";
		/**
		* Range or scalar.
		*/
		FunctionArgumentType["ANY"] = "ANY";
	})(FunctionArgumentType || (FunctionArgumentType = {}));
	/**
	* Abstract class representing interpreter function plugin.
	* Plugin may contain multiple functions. Each function should be of type {@link PluginFunctionType} and needs to be
	* included in {@link implementedFunctions}
	*/
	var FunctionPlugin = class {
		constructor(interpreter) {
			this.coerceScalarToNumberOrError = (arg) => this.arithmeticHelper.coerceScalarToNumberOrError(arg);
			/**
			* A method that should wrap the logic of every built-in function and custom function. It:
			* - Evaluates the function's arguments.
			* - Validates the number of arguments against the [`parameters` array](#function-options).
			* - Coerces the argument values to types set in the [`parameters` array](#argument-validation-options).
			* - Handles optional arguments and default values according to options set in the [`parameters` array](#argument-validation-options).
			* - Validates the function's arguments against the [argument validation options](#argument-validation-options).
			* - Duplicates the arguments according to the [`repeatLastArgs` option](#function-options).
			* - Handles the [array arithmetic mode](arrays.md#array-arithmetic-mode).
			* - Performs [function vectorization](arrays.md#passing-arrays-to-scalar-functions-vectorization).
			* - Performs [argument broadcasting](arrays.md#broadcasting).
			*/
			this.runFunction = (args, state, metadata, functionImplementation) => {
				const evaluatedArguments = this.evaluateArguments(args, state, metadata);
				const argumentValues = evaluatedArguments.map(([value, _]) => value);
				const argumentIgnorableFlags = evaluatedArguments.map(([_, ignorable]) => ignorable);
				const argumentMetadata = this.buildMetadataForEachArgumentValue(argumentValues.length, metadata);
				const isVectorizationOn = state.arraysFlag && !metadata.vectorizationForbidden;
				if (!this.isNumberOfArgumentValuesValid(argumentMetadata, argumentValues.length)) return new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber);
				const [resultArrayHeight, resultArrayWidth] = isVectorizationOn ? this.calculateSizeOfVectorizedResultArray(argumentValues, argumentMetadata) : [1, 1];
				if (resultArrayHeight === 1 && resultArrayWidth === 1) {
					const vectorizedArguments = this.vectorizeAndBroadcastArgumentsIfNecessary(isVectorizationOn, argumentValues, argumentMetadata, 0, 0);
					return this.calculateSingleCellOfResultArray(state, vectorizedArguments, argumentMetadata, argumentIgnorableFlags, functionImplementation, metadata.returnNumberType);
				}
				const resultArray = [...Array(resultArrayHeight).keys()].map((row) => [...Array(resultArrayWidth).keys()].map((col) => {
					const vectorizedArguments = this.vectorizeAndBroadcastArgumentsIfNecessary(isVectorizationOn, argumentValues, argumentMetadata, row, col);
					const result = this.calculateSingleCellOfResultArray(state, vectorizedArguments, argumentMetadata, argumentIgnorableFlags, functionImplementation, metadata.returnNumberType);
					if (result instanceof SimpleRangeValue) throw new Error("Function returning array cannot be vectorized.");
					return result;
				}));
				return SimpleRangeValue.onlyValues(resultArray);
			};
			this.runFunctionWithReferenceArgument = (args, state, metadata, noArgCallback, referenceCallback, nonReferenceCallback = () => new CellError(ErrorType.NA, ErrorMessage.CellRefExpected)) => {
				if (args.length === 0) return this.returnNumberWrapper(noArgCallback(), metadata.returnNumberType);
				else if (args.length > 1) return new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber);
				let arg = args[0];
				while (arg.type === AstNodeType.PARENTHESIS) arg = arg.expression;
				let cellReference;
				if (arg.type === AstNodeType.CELL_REFERENCE) cellReference = arg.reference.toSimpleCellAddress(state.formulaAddress);
				else if (arg.type === AstNodeType.CELL_RANGE || arg.type === AstNodeType.COLUMN_RANGE || arg.type === AstNodeType.ROW_RANGE) try {
					cellReference = AbsoluteCellRange.fromAst(arg, state.formulaAddress).start;
				} catch (e) {
					return new CellError(ErrorType.REF, ErrorMessage.CellRefExpected);
				}
				if (cellReference !== void 0) return this.returnNumberWrapper(referenceCallback(cellReference), metadata.returnNumberType);
				return this.runFunction(args, state, metadata, nonReferenceCallback);
			};
			this.interpreter = interpreter;
			this.dependencyGraph = interpreter.dependencyGraph;
			this.columnSearch = interpreter.columnSearch;
			this.config = interpreter.config;
			this.serialization = interpreter.serialization;
			this.arraySizePredictor = interpreter.arraySizePredictor;
			this.dateTimeHelper = interpreter.dateTimeHelper;
			this.arithmeticHelper = interpreter.arithmeticHelper;
		}
		evaluateAst(ast, state) {
			return this.interpreter.evaluateAst(ast, state);
		}
		arraySizeForAst(ast, state) {
			return this.arraySizePredictor.checkArraySizeForAst(ast, state);
		}
		listOfScalarValues(asts, state) {
			const ret = [];
			for (const argAst of asts) {
				const value = this.evaluateAst(argAst, state);
				if (value instanceof SimpleRangeValue) for (const scalarValue of value.valuesFromTopLeftCorner()) ret.push([scalarValue, true]);
				else ret.push([value, false]);
			}
			return ret;
		}
		coerceToType(arg, coercedType, state) {
			let ret;
			if (arg instanceof SimpleRangeValue) switch (coercedType.argumentType) {
				case FunctionArgumentType.RANGE:
				case FunctionArgumentType.ANY:
					ret = arg;
					break;
				default: {
					const coerce = coerceRangeToScalar(arg, state);
					if (coerce === void 0) return;
					arg = coerce;
				}
			}
			if (!(arg instanceof SimpleRangeValue)) switch (coercedType.argumentType) {
				case FunctionArgumentType.INTEGER:
				case FunctionArgumentType.NUMBER:
					const coerced = this.coerceScalarToNumberOrError(arg);
					if (!isExtendedNumber(coerced)) {
						ret = coerced;
						break;
					}
					const value = getRawValue(coerced);
					if (coercedType.maxValue !== void 0 && value > coercedType.maxValue) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
					if (coercedType.minValue !== void 0 && value < coercedType.minValue) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
					if (coercedType.lessThan !== void 0 && value >= coercedType.lessThan) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
					if (coercedType.greaterThan !== void 0 && value <= coercedType.greaterThan) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
					if (coercedType.argumentType === FunctionArgumentType.INTEGER && !Number.isInteger(value)) return new CellError(ErrorType.NUM, ErrorMessage.IntegerExpected);
					ret = coerced;
					break;
				case FunctionArgumentType.STRING:
					ret = coerceScalarToString(arg);
					break;
				case FunctionArgumentType.BOOLEAN:
					ret = coerceScalarToBoolean(arg);
					break;
				case FunctionArgumentType.SCALAR:
				case FunctionArgumentType.NOERROR:
				case FunctionArgumentType.ANY:
					ret = arg;
					break;
				case FunctionArgumentType.RANGE:
					if (arg instanceof CellError) return arg;
					ret = coerceToRange(arg);
					break;
				case FunctionArgumentType.COMPLEX: return this.arithmeticHelper.coerceScalarToComplex(getRawValue(arg));
			}
			if (coercedType.passSubtype || ret === void 0) return ret;
			else return getRawValue(ret);
		}
		calculateSingleCellOfResultArray(state, vectorizedArguments, argumentsMetadata, argumentIgnorableFlags, functionImplementation, returnNumberType) {
			const coercedArguments = this.coerceArgumentsToRequiredTypes(state, vectorizedArguments, argumentsMetadata, argumentIgnorableFlags);
			if (coercedArguments instanceof CellError) return coercedArguments;
			const functionCalculationResult = functionImplementation(...coercedArguments);
			return this.returnNumberWrapper(functionCalculationResult, returnNumberType);
		}
		coerceArgumentsToRequiredTypes(state, vectorizedArguments, argumentsMetadata, argumentIgnorableFlags) {
			const coercedArguments = [];
			for (let i = 0; i < argumentsMetadata.length; i++) {
				const argumentMetadata = argumentsMetadata[i];
				const argumentValue = vectorizedArguments[i] !== void 0 ? vectorizedArguments[i] : argumentMetadata === null || argumentMetadata === void 0 ? void 0 : argumentMetadata.defaultValue;
				if (argumentValue === void 0) {
					coercedArguments.push(void 0);
					continue;
				}
				const coercedValue = this.coerceToType(argumentValue, argumentMetadata, state);
				if (coercedValue === void 0 && !argumentIgnorableFlags[i]) return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
				if (coercedValue instanceof CellError && argumentMetadata.argumentType !== FunctionArgumentType.SCALAR) return coercedValue;
				coercedArguments.push(coercedValue);
			}
			return coercedArguments;
		}
		vectorizeAndBroadcastArgumentsIfNecessary(isVectorizationOn, argumentValues, argumentMetadata, row, col) {
			return argumentValues.map((value, i) => isVectorizationOn && this.isRangePassedAsAScalarArgument(value, argumentMetadata[i]) ? this.vectorizeAndBroadcastRangeArgument(value, row, col) : value);
		}
		vectorizeAndBroadcastRangeArgument(argumentValue, rowNum, colNum) {
			var _a;
			const targetRowNum = argumentValue.height() === 1 ? 0 : rowNum;
			const targetColNum = argumentValue.width() === 1 ? 0 : colNum;
			return (_a = argumentValue.data[targetRowNum]) === null || _a === void 0 ? void 0 : _a[targetColNum];
		}
		evaluateArguments(args, state, metadata) {
			return metadata.expandRanges ? this.listOfScalarValues(args, state) : args.map((ast) => [this.evaluateAst(ast, state), false]);
		}
		buildMetadataForEachArgumentValue(numberOfArgumentValuesPassed, metadata) {
			const argumentsMetadata = metadata.parameters ? [...metadata.parameters] : [];
			if (metadata.repeatLastArgs !== void 0 && Number.isInteger(metadata.repeatLastArgs) && metadata.repeatLastArgs > 0) while (numberOfArgumentValuesPassed > argumentsMetadata.length) argumentsMetadata.push(...argumentsMetadata.slice(argumentsMetadata.length - metadata.repeatLastArgs));
			return argumentsMetadata;
		}
		isNumberOfArgumentValuesValid(argumentsMetadata, numberOfArgumentValuesPassed) {
			if (numberOfArgumentValuesPassed > argumentsMetadata.length) return false;
			if (numberOfArgumentValuesPassed < argumentsMetadata.length) return argumentsMetadata.slice(numberOfArgumentValuesPassed).every((argMetadata) => (argMetadata === null || argMetadata === void 0 ? void 0 : argMetadata.optionalArg) || (argMetadata === null || argMetadata === void 0 ? void 0 : argMetadata.defaultValue) !== void 0);
			return true;
		}
		calculateSizeOfVectorizedResultArray(argumentValues, argumentMetadata) {
			const argumentsThatRequireVectorization = argumentValues.filter((value, i) => this.isRangePassedAsAScalarArgument(value, argumentMetadata[i]));
			return [Math.max(1, ...argumentsThatRequireVectorization.map((val) => val.height())), Math.max(1, ...argumentsThatRequireVectorization.map((val) => val.width()))];
		}
		isRangePassedAsAScalarArgument(argumentValue, argumentMetadata) {
			if (argumentValue == null || argumentMetadata == null) return false;
			return argumentValue instanceof SimpleRangeValue && ![FunctionArgumentType.RANGE, FunctionArgumentType.ANY].includes(argumentMetadata.argumentType);
		}
		metadata(name) {
			const params = this.constructor.implementedFunctions[name];
			if (params !== void 0) return params;
			throw new Error(`No metadata for function ${name}.`);
		}
		returnNumberWrapper(val, type, format) {
			if (type !== void 0 && isExtendedNumber(val)) return this.arithmeticHelper.ExtendedNumberFactory(getRawValue(val), {
				type,
				format
			});
			else return val;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/index.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	//#endregion
	//#region ../../node_modules/hyperformula/es/ArraySize.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ArraySize = class ArraySize {
		constructor(width, height, isRef = false) {
			this.width = width;
			this.height = height;
			this.isRef = isRef;
		}
		static error() {
			return new ArraySize(1, 1, true);
		}
		static scalar() {
			return new ArraySize(1, 1, false);
		}
		isScalar() {
			return this.width === 1 && this.height === 1 || this.isRef;
		}
	};
	function arraySizeForBinaryOp(leftArraySize, rightArraySize) {
		return new ArraySize(Math.max(leftArraySize.width, rightArraySize.width), Math.max(leftArraySize.height, rightArraySize.height));
	}
	function arraySizeForUnaryOp(arraySize) {
		return new ArraySize(arraySize.width, arraySize.height);
	}
	var ArraySizePredictor = class {
		constructor(config, functionRegistry) {
			this.config = config;
			this.functionRegistry = functionRegistry;
		}
		checkArraySize(ast, formulaAddress) {
			return this.checkArraySizeForAst(ast, {
				formulaAddress,
				arraysFlag: this.config.useArrayArithmetic
			});
		}
		checkArraySizeForAst(ast, state) {
			switch (ast.type) {
				case AstNodeType.FUNCTION_CALL: return this.checkArraySizeForFunction(ast, state);
				case AstNodeType.COLUMN_RANGE:
				case AstNodeType.ROW_RANGE:
				case AstNodeType.CELL_RANGE: {
					const range = AbsoluteCellRange.fromAstOrUndef(ast, state.formulaAddress);
					if (range === void 0) return ArraySize.error();
					else return new ArraySize(range.width(), range.height(), true);
				}
				case AstNodeType.ARRAY: {
					const heights = [];
					const widths = [];
					for (const row of ast.args) {
						const sizes = row.map((ast) => this.checkArraySizeForAst(ast, state));
						const h = Math.min(...sizes.map((size) => size.height));
						const w = sizes.reduce((total, size) => total + size.width, 0);
						heights.push(h);
						widths.push(w);
					}
					const height = heights.reduce((total, h) => total + h, 0);
					return new ArraySize(Math.min(...widths), height);
				}
				case AstNodeType.STRING:
				case AstNodeType.NUMBER: return ArraySize.scalar();
				case AstNodeType.CELL_REFERENCE: return new ArraySize(1, 1, true);
				case AstNodeType.DIV_OP:
				case AstNodeType.CONCATENATE_OP:
				case AstNodeType.EQUALS_OP:
				case AstNodeType.GREATER_THAN_OP:
				case AstNodeType.GREATER_THAN_OR_EQUAL_OP:
				case AstNodeType.LESS_THAN_OP:
				case AstNodeType.LESS_THAN_OR_EQUAL_OP:
				case AstNodeType.MINUS_OP:
				case AstNodeType.NOT_EQUAL_OP:
				case AstNodeType.PLUS_OP:
				case AstNodeType.POWER_OP:
				case AstNodeType.TIMES_OP: {
					const left = this.checkArraySizeForAst(ast.left, state);
					const right = this.checkArraySizeForAst(ast.right, state);
					if (!state.arraysFlag && (left.height > 1 || left.width > 1 || right.height > 1 || right.width > 1)) return ArraySize.error();
					return arraySizeForBinaryOp(left, right);
				}
				case AstNodeType.MINUS_UNARY_OP:
				case AstNodeType.PLUS_UNARY_OP:
				case AstNodeType.PERCENT_OP: {
					const val = this.checkArraySizeForAst(ast.value, state);
					if (!state.arraysFlag && (val.height > 1 || val.width > 1)) return ArraySize.error();
					return arraySizeForUnaryOp(val);
				}
				case AstNodeType.PARENTHESIS: return this.checkArraySizeForAst(ast.expression, state);
				case AstNodeType.EMPTY: return ArraySize.error();
				default: return ArraySize.error();
			}
		}
		checkArraySizeForFunction(ast, state) {
			const pluginArraySizeFunction = this.functionRegistry.getArraySizeFunction(ast.procedureName);
			if (pluginArraySizeFunction !== void 0) return pluginArraySizeFunction(ast, state);
			const metadata = this.functionRegistry.getMetadata(ast.procedureName);
			if (metadata === void 0 || metadata.expandRanges || !state.arraysFlag || metadata.vectorizationForbidden || metadata.parameters === void 0) return new ArraySize(1, 1);
			const subChecks = ast.args.map((arg) => {
				var _a;
				return this.checkArraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			});
			const argumentDefinitions = [...metadata.parameters];
			if (metadata.repeatLastArgs !== void 0 && argumentDefinitions.length < subChecks.length && (subChecks.length - argumentDefinitions.length) % metadata.repeatLastArgs !== 0) return ArraySize.error();
			while (argumentDefinitions.length < subChecks.length) {
				if (metadata.repeatLastArgs === void 0) return ArraySize.error();
				argumentDefinitions.push(...argumentDefinitions.slice(argumentDefinitions.length - metadata.repeatLastArgs));
			}
			let maxWidth = 1;
			let maxHeight = 1;
			for (let i = 0; i < subChecks.length; i++) if (argumentDefinitions[i].argumentType !== FunctionArgumentType.RANGE && argumentDefinitions[i].argumentType !== FunctionArgumentType.ANY) {
				maxHeight = Math.max(maxHeight, subChecks[i].height);
				maxWidth = Math.max(maxWidth, subChecks[i].width);
			}
			return new ArraySize(maxWidth, maxHeight);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/CellValue.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var DetailedCellError = class {
		constructor(error, value, address) {
			var _a;
			this.value = value;
			this.address = address;
			this.type = error.type;
			this.message = (_a = error.message) !== null && _a !== void 0 ? _a : "";
		}
		toString() {
			return this.value;
		}
		valueOf() {
			return this.value;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/ArgumentSanitization.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function configValueFromParam(inputValue, expectedType, paramName) {
		if (typeof inputValue === "undefined") return Config.defaultConfig[paramName];
		else if (typeof expectedType === "string") if (typeof inputValue === expectedType) return inputValue;
		else throw new ExpectedValueOfTypeError(expectedType, paramName);
		else if (expectedType.includes(inputValue)) return inputValue;
		else throw new ExpectedOneOfValuesError(expectedType.map((val) => `'${val}'`).join(" "), paramName);
	}
	function validateNumberToBeAtLeast(value, paramName, minimum) {
		if (value < minimum) throw new ConfigValueTooSmallError(paramName, minimum);
	}
	function validateNumberToBeAtMost(value, paramName, maximum) {
		if (value > maximum) throw new ConfigValueTooBigError(paramName, maximum);
	}
	function configValueFromParamCheck(inputValue, typeCheck, expectedType, paramName) {
		if (typeCheck(inputValue)) return inputValue;
		else if (typeof inputValue === "undefined") return Config.defaultConfig[paramName];
		else throw new ExpectedValueOfTypeError(expectedType, paramName);
	}
	function configCheckIfParametersNotInConflict(...params) {
		const valuesMap = /* @__PURE__ */ new Map();
		params.forEach((param) => {
			const names = valuesMap.get(param.value) || [];
			names.push(param.name);
			valuesMap.set(param.value, names);
		});
		const duplicates = [];
		for (const entry of valuesMap.values()) if (entry.length > 1) duplicates.push(entry);
		if (duplicates.length > 0) {
			duplicates.forEach((entry) => entry.sort());
			const paramNames = duplicates.map((entry) => `[${entry}]`).join("; ");
			throw new Error(`Config initialization failed. Parameters in conflict: ${paramNames}`);
		}
	}
	function validateArgToType(inputValue, expectedType, paramName) {
		if (typeof inputValue !== expectedType) throw new ExpectedValueOfTypeError(expectedType, paramName);
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/DateTimeDefault.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var TIME_FORMAT_SECONDS_ITEM_REGEXP = /* @__PURE__ */ new RegExp("^ss(\\.(s+|0+))?$");
	var QUICK_CHECK_REGEXP = /* @__PURE__ */ new RegExp("^[0-9/.\\-: ]+[ap]?m?$");
	var WHITESPACE_REGEXP = /* @__PURE__ */ new RegExp("\\s+");
	var DATE_SEPARATOR_REGEXP = /* @__PURE__ */ new RegExp("[ /.-]");
	var TIME_SEPARATOR = ":";
	var SECONDS_PRECISION = 1e3;
	var memoizedParseTimeFormat = memoize(parseTimeFormat);
	var memoizedParseDateFormat = memoize(parseDateFormat);
	/**
	* Parses a DateTime value from a string if the string matches the given date format and time format.
	*
	* Idea for more readable implementation:
	*   - divide string into parts by a regexp [date_regexp]? [time_regexp]? [ampm_regexp]?
	*   - start by finding the time part, because it is unambiguous '([0-9]+:[0-9:.]+ ?[ap]?m?)$', before it is the date part
	*   - OR split by spaces - last segment is ampm token, second to last is time (with or without ampm), rest is date
	* If applied:
	*   - date parsing might work differently after these changes but still according to the docs
	*   - make sure to test edge cases like timeFormats: ['hh', 'ss.ss'] etc, string: '01-01-2019 AM', 'PM'
	*/
	function defaultParseToDateTime(text, dateFormat, timeFormat) {
		if (dateFormat === void 0 && timeFormat === void 0) return;
		let dateTimeString = text.replace(WHITESPACE_REGEXP, " ").trim().toLowerCase();
		if (!doesItLookLikeADateTimeQuickCheck(dateTimeString)) return;
		let ampmToken = dateTimeString.substring(dateTimeString.length - 2);
		if (ampmToken === "am" || ampmToken === "pm") dateTimeString = dateTimeString.substring(0, dateTimeString.length - 2).trim();
		else {
			ampmToken = dateTimeString.substring(dateTimeString.length - 1);
			if (ampmToken === "a" || ampmToken === "p") dateTimeString = dateTimeString.substring(0, dateTimeString.length - 1).trim();
			else ampmToken = void 0;
		}
		const dateItems = dateTimeString.split(DATE_SEPARATOR_REGEXP);
		if (dateItems.length >= 2 && dateItems[dateItems.length - 2].includes(TIME_SEPARATOR)) {
			dateItems[dateItems.length - 2] = dateItems[dateItems.length - 2] + "." + dateItems[dateItems.length - 1];
			dateItems.pop();
		}
		const timeItems = dateItems[dateItems.length - 1].split(TIME_SEPARATOR);
		if (ampmToken !== void 0) timeItems.push(ampmToken);
		if (dateItems.length === 1) return defaultParseToTime(timeItems, timeFormat);
		if (timeItems.length === 1) return defaultParseToDate(dateItems, dateFormat);
		const parsedDate = defaultParseToDate(dateItems.slice(0, dateItems.length - 1), dateFormat);
		const parsedTime = defaultParseToTime(timeItems, timeFormat);
		if (parsedDate === void 0) return;
		else if (parsedTime === void 0) return;
		else return Object.assign(Object.assign({}, parsedDate), parsedTime);
	}
	/**
	* Parses a time value from a string if the string matches the given time format.
	*/
	function defaultParseToTime(timeItems, timeFormat) {
		var _a, _b, _c;
		if (timeFormat === void 0) return;
		const { itemsCount, hourItem, minuteItem, secondItem } = memoizedParseTimeFormat(timeFormat);
		let ampm = void 0;
		if (timeItems[timeItems.length - 1] === "am" || timeItems[timeItems.length - 1] === "a") {
			ampm = false;
			timeItems.pop();
		} else if (timeItems[timeItems.length - 1] === "pm" || timeItems[timeItems.length - 1] === "p") {
			ampm = true;
			timeItems.pop();
		}
		if (timeItems.length !== itemsCount) return;
		const secondsParsed = Number((_a = timeItems[secondItem]) !== null && _a !== void 0 ? _a : "0");
		if (!Number.isFinite(secondsParsed)) return;
		const seconds = Math.round(secondsParsed * SECONDS_PRECISION) / SECONDS_PRECISION;
		const minutes = Number((_b = timeItems[minuteItem]) !== null && _b !== void 0 ? _b : "0");
		if (!(Number.isFinite(minutes) && Number.isInteger(minutes))) return;
		const hoursParsed = Number((_c = timeItems[hourItem]) !== null && _c !== void 0 ? _c : "0");
		if (!(Number.isFinite(hoursParsed) && Number.isInteger(hoursParsed))) return;
		if (ampm !== void 0 && (hoursParsed < 0 || hoursParsed > 12)) return;
		return {
			hours: ampm !== void 0 ? hoursParsed % 12 + (ampm ? 12 : 0) : hoursParsed,
			minutes,
			seconds
		};
	}
	/**
	* Parses a date value from a string if the string matches the given date format.
	*/
	function defaultParseToDate(dateItems, dateFormat) {
		var _a;
		if (dateFormat === void 0) return;
		const { itemsCount, dayItem, monthItem, shortYearItem, longYearItem } = memoizedParseDateFormat(dateFormat);
		if (dateItems.length !== itemsCount) return;
		const day = Number(dateItems[dayItem]);
		if (!(Number.isFinite(day) && Number.isInteger(day))) return;
		const month = Number(dateItems[monthItem]);
		if (!(Number.isFinite(month) && Number.isInteger(month))) return;
		if (dateItems[longYearItem] && dateItems[shortYearItem]) return;
		const year = Number((_a = dateItems[longYearItem]) !== null && _a !== void 0 ? _a : dateItems[shortYearItem]);
		if (!(Number.isFinite(year) && Number.isInteger(year))) return;
		if (dateItems[longYearItem] && (year < 1e3 || year > 9999)) return;
		if (dateItems[shortYearItem] && (year < 0 || year > 99)) return;
		return {
			year,
			month,
			day
		};
	}
	/**
	* Parses a time format string into a format object.
	*/
	function parseTimeFormat(timeFormat) {
		const formatLowercase = timeFormat.toLowerCase().trim();
		const items = (formatLowercase.endsWith("am/pm") ? formatLowercase.substring(0, formatLowercase.length - 5) : formatLowercase.endsWith("a/p") ? formatLowercase.substring(0, timeFormat.length - 3) : formatLowercase).trim().split(TIME_SEPARATOR);
		return {
			itemsCount: items.length,
			hourItem: items.indexOf("hh"),
			minuteItem: items.indexOf("mm"),
			secondItem: items.findIndex((item) => TIME_FORMAT_SECONDS_ITEM_REGEXP.test(item))
		};
	}
	/**
	* Parses a date format string into a format object.
	*/
	function parseDateFormat(dateFormat) {
		const items = dateFormat.toLowerCase().trim().split(DATE_SEPARATOR_REGEXP);
		return {
			itemsCount: items.length,
			dayItem: items.indexOf("dd"),
			monthItem: items.indexOf("mm"),
			shortYearItem: items.indexOf("yy"),
			longYearItem: items.indexOf("yyyy")
		};
	}
	/**
	* If this function returns false, the string is not parsable as a date time. Otherwise, it might be.
	* This is a quick check that is used to avoid running the more expensive parsing operations.
	*/
	function doesItLookLikeADateTimeQuickCheck(text) {
		return QUICK_CHECK_REGEXP.test(text);
	}
	/**
	* Function memoization for improved performance.
	*/
	function memoize(fn) {
		const memoizedResults = {};
		return (arg) => {
			const memoizedResult = memoizedResults[arg];
			if (memoizedResult !== void 0) return memoizedResult;
			const result = fn(arg);
			memoizedResults[arg] = result;
			return result;
		};
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/DateTimeHelper.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var numDays = [
		31,
		28,
		31,
		30,
		31,
		30,
		31,
		31,
		30,
		31,
		30,
		31
	];
	var prefSumDays = [
		0,
		31,
		59,
		90,
		120,
		151,
		181,
		212,
		243,
		273,
		304,
		334
	];
	var SECONDS_PER_MINUTE = 60;
	var MINUTES_PER_HOUR = 60;
	var HOURS_PER_DAY = 24;
	function instanceOfSimpleDate(obj) {
		if (obj && (typeof obj === "object" || typeof obj === "function")) return "year" in obj && typeof obj.year === "number" && "month" in obj && typeof obj.month === "number" && "day" in obj && typeof obj.day === "number";
		else return false;
	}
	function instanceOfSimpleTime(obj) {
		if (obj && (typeof obj === "object" || typeof obj === "function")) return "hours" in obj && typeof obj.hours === "number" && "minutes" in obj && typeof obj.minutes === "number" && "seconds" in obj && typeof obj.seconds === "number";
		else return false;
	}
	var maxDate$1 = {
		year: 9999,
		month: 12,
		day: 31
	};
	var DateTimeHelper = class {
		constructor(config) {
			this.config = config;
			this.minDateAbsoluteValue = this.dateToNumberFromZero(config.nullDate);
			this.maxDateValue = this.dateToNumber(maxDate$1);
			this.leapYear1900 = config.leapYear1900;
			if (!this.leapYear1900 && 0 <= this.dateToNumber({
				year: 1900,
				month: 2,
				day: 28
			})) this.epochYearZero = this.numberToSimpleDate(2).year;
			else this.epochYearZero = this.numberToSimpleDate(1).year;
			this.parseDateTime = config.parseDateTime;
		}
		getWithinBounds(dayNumber) {
			return dayNumber <= this.maxDateValue && dayNumber >= 0 ? dayNumber : void 0;
		}
		dateStringToDateNumber(dateTimeString) {
			const { dateTime, dateFormat = "", timeFormat = "" } = this.parseDateTimeFromConfigFormats(dateTimeString);
			if (dateTime === void 0) return;
			if (instanceOfSimpleTime(dateTime)) if (instanceOfSimpleDate(dateTime)) return new DateTimeNumber(timeToNumber(dateTime) + this.dateToNumber(dateTime), dateFormat + " " + timeFormat);
			else return new TimeNumber(timeToNumber(dateTime), timeFormat);
			else if (instanceOfSimpleDate(dateTime)) return new DateNumber(this.dateToNumber(dateTime), dateFormat);
			else return 0;
		}
		parseDateTimeFromConfigFormats(dateTimeString) {
			return this.parseDateTimeFromFormats(dateTimeString, this.config.dateFormats, this.config.timeFormats);
		}
		getNullYear() {
			return this.config.nullYear;
		}
		getEpochYearZero() {
			return this.epochYearZero;
		}
		isValidDate(date) {
			if (isNaN(date.year) || isNaN(date.month) || isNaN(date.day)) return false;
			else if (date.day !== Math.round(date.day) || date.month !== Math.round(date.month) || date.year !== Math.round(date.year)) return false;
			else if (date.year < 1582) return false;
			else if (date.month < 1 || date.month > 12) return false;
			else if (date.day < 1) return false;
			else if (this.isLeapYear(date.year) && date.month === 2) return date.day <= 29;
			else return date.day <= numDays[date.month - 1];
		}
		dateToNumber(date) {
			return this.dateToNumberFromZero(date) - this.minDateAbsoluteValue;
		}
		relativeNumberToAbsoluteNumber(arg) {
			return arg + this.minDateAbsoluteValue - (this.leapYear1900 ? 1 : 0);
		}
		numberToSimpleDate(arg) {
			const dateNumber = Math.floor(arg) + this.minDateAbsoluteValue;
			let year = Math.floor(dateNumber / 365.2425);
			if (this.dateToNumberFromZero({
				year: year + 1,
				month: 1,
				day: 1
			}) <= dateNumber) year++;
			else if (this.dateToNumberFromZero({
				year: year - 1,
				month: 1,
				day: 1
			}) > dateNumber) year--;
			const dayOfYear = dateNumber - this.dateToNumberFromZero({
				year,
				month: 1,
				day: 1
			});
			const month = dayToMonth(dayOfYear - (this.isLeapYear(year) && dayOfYear >= 59 ? 1 : 0));
			const day = dayOfYear - prefSumDays[month] - (this.isLeapYear(year) && month > 1 ? 1 : 0);
			return {
				year,
				month: month + 1,
				day: day + 1
			};
		}
		numberToSimpleDateTime(arg) {
			const time = numberToSimpleTime(arg % 1);
			const carryDays = Math.floor(time.hours / HOURS_PER_DAY);
			time.hours = time.hours % HOURS_PER_DAY;
			const date = this.numberToSimpleDate(Math.floor(arg) + carryDays);
			return Object.assign(Object.assign({}, date), time);
		}
		leapYearsCount(year) {
			return Math.floor(year / 4) - Math.floor(year / 100) + Math.floor(year / 400) + (this.config.leapYear1900 && year >= 1900 ? 1 : 0);
		}
		daysInMonth(year, month) {
			if (this.isLeapYear(year) && month === 2) return 29;
			else return numDays[month - 1];
		}
		endOfMonth(date) {
			return {
				year: date.year,
				month: date.month,
				day: this.daysInMonth(date.year, date.month)
			};
		}
		toBasisUS(start, end) {
			if (start.day === 31) start.day = 30;
			if (start.day === 30 && end.day === 31) end.day = 30;
			if (start.month === 2 && start.day === this.daysInMonth(start.year, start.month)) {
				start.day = 30;
				if (end.month === 2 && end.day === this.daysInMonth(end.year, end.month)) end.day = 30;
			}
			return [start, end];
		}
		yearLengthForBasis(start, end) {
			if (start.year !== end.year) {
				if (start.year + 1 !== end.year || start.month < end.month || start.month === end.month && start.day < end.day) return (this.leapYearsCount(end.year) - this.leapYearsCount(start.year - 1)) / (end.year - start.year + 1) + 365;
				if (this.countLeapDays(end) !== this.countLeapDays({
					year: start.year,
					month: start.month,
					day: start.day - 1
				})) return 366;
				else return 365;
			}
			if (this.isLeapYear(start.year)) return 366;
			else return 365;
		}
		parseSingleFormat(dateString, dateFormat, timeFormat) {
			const dateTime = this.parseDateTime(dateString, dateFormat, timeFormat);
			if (instanceOfSimpleDate(dateTime)) {
				if (dateTime.year >= 0 && dateTime.year < 100) if (dateTime.year < this.getNullYear()) dateTime.year += 2e3;
				else dateTime.year += 1900;
				if (!this.isValidDate(dateTime)) return;
			}
			return dateTime;
		}
		parseDateTimeFromFormats(dateTimeString, dateFormats, timeFormats) {
			const dateFormatsArray = dateFormats.length === 0 ? [void 0] : dateFormats;
			const timeFormatsArray = timeFormats.length === 0 ? [void 0] : timeFormats;
			for (const dateFormat of dateFormatsArray) for (const timeFormat of timeFormatsArray) {
				const dateTime = this.parseSingleFormat(dateTimeString, dateFormat, timeFormat);
				if (dateTime !== void 0) return {
					dateTime,
					timeFormat,
					dateFormat
				};
			}
			return {};
		}
		countLeapDays(date) {
			if (date.month > 2 || date.month === 2 && date.day >= 29) return this.leapYearsCount(date.year);
			else return this.leapYearsCount(date.year - 1);
		}
		dateToNumberFromZero(date) {
			return 365 * date.year + prefSumDays[date.month - 1] + date.day - 1 + (date.month <= 2 ? this.leapYearsCount(date.year - 1) : this.leapYearsCount(date.year));
		}
		isLeapYear(year) {
			if (year % 4) return false;
			else if (year % 100) return true;
			else if (year % 400) return year === 1900 && this.config.leapYear1900;
			else return true;
		}
	};
	function dayToMonth(dayOfYear) {
		let month = 0;
		if (prefSumDays[month + 6] <= dayOfYear) month += 6;
		if (prefSumDays[month + 3] <= dayOfYear) month += 3;
		if (prefSumDays[month + 2] <= dayOfYear) month += 2;
		else if (prefSumDays[month + 1] <= dayOfYear) month += 1;
		return month;
	}
	function offsetMonth(date, offset) {
		const totalM = 12 * date.year + date.month - 1 + offset;
		return {
			year: Math.floor(totalM / 12),
			month: totalM % 12 + 1,
			day: date.day
		};
	}
	function truncateDayInMonth(date) {
		return {
			year: date.year,
			month: date.month,
			day: Math.min(date.day, numDays[date.month - 1])
		};
	}
	function roundToNearestSecond(arg) {
		return Math.round(arg * 3600 * 24) / (3600 * 24);
	}
	function roundToEpsilon(arg, epsilon = 1) {
		return Math.round(arg * epsilon) / epsilon;
	}
	function numberToSimpleTime(arg) {
		const argAsSeconds = arg * HOURS_PER_DAY * MINUTES_PER_HOUR * SECONDS_PER_MINUTE;
		const seconds = roundToEpsilon(argAsSeconds % SECONDS_PER_MINUTE, 1e5) % SECONDS_PER_MINUTE;
		const argAsMinutes = (argAsSeconds - seconds) / SECONDS_PER_MINUTE;
		const minutes = Math.round(argAsMinutes % MINUTES_PER_HOUR) % MINUTES_PER_HOUR;
		const argAsHours = (argAsMinutes - minutes) / MINUTES_PER_HOUR;
		return {
			hours: Math.round(argAsHours),
			minutes,
			seconds
		};
	}
	function timeToNumber(time) {
		return ((time.seconds / 60 + time.minutes) / 60 + time.hours) / 24;
	}
	function toBasisEU(date) {
		return {
			year: date.year,
			month: date.month,
			day: Math.min(30, date.day)
		};
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/DependencyGraph/AddressMapping/ChooseAddressMappingPolicy.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AlwaysDense = class {
		call() {
			return DenseStrategy;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/format/parser.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var dateFormatRegex = /(\\.|dd|DD|d|D|mm|MM|m|M|YYYY|YY|yyyy|yy|HH|hh|H|h|ss(\.(0+|s+))?|s|AM\/PM|am\/pm|A\/P|a\/p|\[mm]|\[MM]|\[hh]|\[HH])/g;
	var numberFormatRegex = /(\\.|[#0]+(\.[#0]*)?)/g;
	var TokenType;
	(function(TokenType) {
		TokenType["FORMAT"] = "FORMAT";
		TokenType["FREE_TEXT"] = "FREE_TEXT";
	})(TokenType || (TokenType = {}));
	function formatToken(type, value) {
		return {
			type,
			value
		};
	}
	var FormatExpressionType;
	(function(FormatExpressionType) {
		FormatExpressionType["DATE"] = "DATE";
		FormatExpressionType["NUMBER"] = "NUMBER";
		FormatExpressionType["STRING"] = "STRING";
	})(FormatExpressionType || (FormatExpressionType = {}));
	function matchDateFormat(str) {
		dateFormatRegex.lastIndex = 0;
		const tokens = [];
		let m;
		do {
			m = dateFormatRegex.exec(str);
			if (m !== null) tokens.push(m);
		} while (m);
		return tokens;
	}
	function matchNumberFormat(str) {
		numberFormatRegex.lastIndex = 0;
		const numberFormatToken = numberFormatRegex.exec(str);
		if (numberFormatToken !== null) return [numberFormatToken];
		else return [];
	}
	function createTokens(regexTokens, str) {
		const tokens = [];
		let start = 0;
		for (let i = 0; i < regexTokens.length; ++i) {
			const token = regexTokens[i];
			if (token.index !== start) {
				const beforeToken = str.substr(start, token.index - start);
				tokens.push(formatToken(TokenType.FREE_TEXT, beforeToken));
			}
			if (token[0].startsWith("\\")) tokens.push(formatToken(TokenType.FREE_TEXT, token[0]));
			else tokens.push(formatToken(TokenType.FORMAT, token[0]));
			start = token.index + token[0].length;
		}
		const lastToken = regexTokens[regexTokens.length - 1];
		if (lastToken.index + lastToken[0].length < str.length) {
			const afterLastToken = str.substr(lastToken.index + lastToken[0].length, str.length);
			tokens.push(formatToken(TokenType.FREE_TEXT, afterLastToken));
		}
		return tokens;
	}
	function parseForDateTimeFormat(str) {
		const dateFormatTokens = matchDateFormat(str);
		if (dateFormatTokens.every((elem) => isEscapeToken(elem))) return;
		else return {
			type: FormatExpressionType.DATE,
			tokens: createTokens(dateFormatTokens, str)
		};
	}
	function parseForNumberFormat(str) {
		const numberFormatTokens = matchNumberFormat(str);
		if (numberFormatTokens.every((elem) => isEscapeToken(elem))) return;
		else return {
			type: FormatExpressionType.NUMBER,
			tokens: createTokens(numberFormatTokens, str)
		};
	}
	function isEscapeToken(token) {
		return token[0].startsWith("\\");
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/format/format.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function format(value, formatArg, config, dateHelper) {
		const tryDateTime = config.stringifyDateTime(dateHelper.numberToSimpleDateTime(value), formatArg);
		if (tryDateTime !== void 0) return tryDateTime;
		const tryDuration = config.stringifyDuration(numberToSimpleTime(value), formatArg);
		if (tryDuration !== void 0) return tryDuration;
		const expression = parseForNumberFormat(formatArg);
		if (expression !== void 0) return numberFormat(expression.tokens, value);
		return formatArg;
	}
	function padLeft(number, size) {
		let result = `${number}`;
		while (result.length < size) result = "0" + result;
		return result;
	}
	function padRight(number, size) {
		let result = `${number}`;
		while (result.length < size) result = result + "0";
		return result;
	}
	function countChars(text, char) {
		return text.split(char).length - 1;
	}
	function numberFormat(tokens, value) {
		let result = "";
		for (let i = 0; i < tokens.length; ++i) {
			const token = tokens[i];
			if (token.type === TokenType.FREE_TEXT) {
				result += token.value;
				continue;
			}
			const tokenParts = token.value.split(".");
			const integerFormat = tokenParts[0];
			const decimalFormat = tokenParts[1] || "";
			const separator = tokenParts[1] ? "." : "";
			const valueParts = Number(value.toFixed(decimalFormat.length)).toString().split(".");
			let integerPart = valueParts[0] || "";
			let decimalPart = valueParts[1] || "";
			if (integerFormat.length > integerPart.length) {
				const padSizeInteger = countChars(integerFormat.substr(0, integerFormat.length - integerPart.length), "0");
				integerPart = padLeft(integerPart, padSizeInteger + integerPart.length);
			}
			const padSizeDecimal = countChars(decimalFormat.substr(decimalPart.length, decimalFormat.length - decimalPart.length), "0");
			decimalPart = padRight(decimalPart, padSizeDecimal + decimalPart.length);
			result += integerPart + separator + decimalPart;
		}
		return result;
	}
	function defaultStringifyDuration(time, formatArg) {
		const expression = parseForDateTimeFormat(formatArg);
		if (expression === void 0) return;
		const tokens = expression.tokens;
		let result = "";
		for (const token of tokens) {
			if (token.type === TokenType.FREE_TEXT) {
				result += token.value;
				continue;
			}
			switch (token.value.toLowerCase()) {
				case "h":
				case "hh":
					result += padLeft(time.hours, token.value.length);
					time.hours = 0;
					break;
				case "[hh]":
					result += padLeft(time.hours, token.value.length - 2);
					time.hours = 0;
					break;
				case "m":
				case "mm":
					result += padLeft(time.minutes, token.value.length);
					time.minutes = 0;
					break;
				case "[mm]":
					result += padLeft(time.minutes + 60 * time.hours, token.value.length - 2);
					time.minutes = 0;
					time.hours = 0;
					break;
				case "s":
				case "ss":
					result += padLeft(Math.floor(time.seconds), token.value.length);
					break;
				default:
					if (TIME_FORMAT_SECONDS_ITEM_REGEXP.test(token.value)) {
						const fractionOfSecondPrecision = Math.max(token.value.length - 3, 0);
						result += `${time.seconds < 10 ? "0" : ""}${Math.floor(time.seconds * Math.pow(10, fractionOfSecondPrecision)) / Math.pow(10, fractionOfSecondPrecision)}`;
						continue;
					}
					return;
			}
		}
		return result;
	}
	function defaultStringifyDateTime(dateTime, formatArg) {
		const expression = parseForDateTimeFormat(formatArg);
		if (expression === void 0) return;
		const tokens = expression.tokens;
		let result = "";
		let minutes = false;
		const ampm = tokens.some((token) => token.type === TokenType.FORMAT && (token.value === "a/p" || token.value === "A/P" || token.value === "am/pm" || token.value === "AM/PM"));
		for (let i = 0; i < tokens.length; i++) {
			const token = tokens[i];
			if (token.type === TokenType.FREE_TEXT) {
				result += token.value;
				continue;
			}
			switch (token.value.toLowerCase()) {
				case "h":
				case "hh":
					minutes = true;
					result += padLeft(ampm ? (dateTime.hours + 11) % 12 + 1 : dateTime.hours, token.value.length);
					break;
				case "d":
				case "dd":
					result += padLeft(dateTime.day, token.value.length);
					break;
				case "s":
				case "ss":
					result += padLeft(Math.floor(dateTime.seconds), token.value.length);
					break;
				case "m":
				case "mm":
					if (i + 1 < tokens.length && tokens[i + 1].value.startsWith(":")) minutes = true;
					if (minutes) result += padLeft(dateTime.minutes, token.value.length);
					else result += padLeft(dateTime.month, token.value.length);
					minutes = true;
					break;
				case "yy":
					result += padLeft(dateTime.year % 100, token.value.length);
					break;
				case "yyyy":
					result += dateTime.year;
					break;
				case "am/pm":
				case "a/p": {
					const [am, pm] = token.value.split("/");
					result += dateTime.hours < 12 ? am : pm;
					break;
				}
				default:
					if (TIME_FORMAT_SECONDS_ITEM_REGEXP.test(token.value)) {
						const fractionOfSecondPrecision = token.value.length - 3;
						result += `${dateTime.seconds < 10 ? "0" : ""}${Math.floor(dateTime.seconds * Math.pow(10, fractionOfSecondPrecision)) / Math.pow(10, fractionOfSecondPrecision)}`;
						continue;
					}
					return;
			}
		}
		return result;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/helpers/licenseKeyHelper.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var _rl = "length";
	var _hd = (v) => parseInt(v, 16);
	var _pi = (v) => parseInt(v, 10);
	var _nm = (v) => (v + "").replace(/\-/g, "");
	var _ss = (v, s, l) => v["substr"](s, l);
	var _cp = (v) => v["codePointAt"](0) - 65;
	function extractTime(v) {
		return _nm(v)[_rl] === 25 ? _hd(_ss(_nm(v), _hd("12"), _cp("F"))) / (_hd(_ss(_nm(v), _cp("C"), _cp("Y") >> 4)) || (~~![][_rl] << 3) + 1) : 0;
	}
	function checkKeySchema(v) {
		v = (v + "").replace(/\-/g, "");
		if (v[_rl] !== _cp("Z")) return false;
		let sp = 0;
		return [
			[0, _cp("G") + 1],
			[_cp("H"), _cp("H") - 1],
			[_cp("G") + _cp("H"), _cp("G")]
		].reduce((e, [a, b], c) => {
			e |= (_pi(`${_pi(_hd(_ss(v, ...[sp + a - (c === 0 ? 0 : 2), b + (!c ? 0 : 2)])) + (_hd(_ss(v, ...[sp + a + b, 2])) + []).padStart(2, "0"))}`) % 97 || 2) >> 1;
			sp += 2;
			return e;
		}, _cp("A")) === 0;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/helpers/licenseKeyValidator.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* List of all not valid messages which may occur.
	*/
	var consoleMessages = {
		invalid: () => "The license key for HyperFormula is invalid.",
		expired: ({ keyValidityDate }) => `The license key for HyperFormula expired on ${keyValidityDate}, and is not valid for the installed version.`,
		missing: () => "The license key for HyperFormula is missing."
	};
	var _notified = false;
	/**
	* Checks if the provided license key is grammatically valid or not expired.
	*
	* @param {string} licenseKey The license key to check.
	* @returns {LicenseKeyValidityState} Returns the checking state.
	*/
	function checkLicenseKeyValidity(licenseKey) {
		const messageDescriptor = {
			template: "missing",
			vars: {}
		};
		if (licenseKey === "gpl-v3" || licenseKey === "internal-use-in-handsontable") messageDescriptor.template = "valid";
		else if (typeof licenseKey === "string" && checkKeySchema(licenseKey)) {
			const [day, month, year] = "19/02/2026".split("/");
			const releaseDays = Math.floor((/* @__PURE__ */ new Date(`${month}/${day}/${year}`)).getTime() / 864e5);
			const keyValidityDays = extractTime(licenseKey);
			messageDescriptor.vars.keyValidityDate = formatDate(/* @__PURE__ */ new Date((keyValidityDays + 1) * 864e5));
			if (releaseDays > keyValidityDays) messageDescriptor.template = "expired";
			else messageDescriptor.template = "valid";
		} else if (licenseKey !== "") messageDescriptor.template = "invalid";
		if (!_notified && messageDescriptor.template !== "valid") {
			console.warn(consoleMessages[messageDescriptor.template](messageDescriptor.vars));
			_notified = true;
		}
		return messageDescriptor.template;
	}
	/**
	* Formats a Date instance to hard-coded format MMMM DD, YYYY.
	*
	* @param {Date} date The date to format.
	* @returns {string}
	*/
	function formatDate(date) {
		return `${[
			"January",
			"February",
			"March",
			"April",
			"May",
			"June",
			"July",
			"August",
			"September",
			"October",
			"November",
			"December"
		][date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/CellContentParser.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CellContent;
	(function(CellContent) {
		class Number {
			constructor(value) {
				this.value = value;
				this.value = cloneNumber(this.value, fixNegativeZero(getRawValue(this.value)));
			}
		}
		CellContent.Number = Number;
		class String {
			constructor(value) {
				this.value = value;
			}
		}
		CellContent.String = String;
		class Boolean {
			constructor(value) {
				this.value = value;
			}
		}
		CellContent.Boolean = Boolean;
		class Empty {
			static getSingletonInstance() {
				if (!Empty.instance) Empty.instance = new Empty();
				return Empty.instance;
			}
		}
		CellContent.Empty = Empty;
		class Formula {
			constructor(formula) {
				this.formula = formula;
			}
		}
		CellContent.Formula = Formula;
		class Error {
			constructor(errorType, message) {
				this.value = new CellError(errorType, message);
			}
		}
		CellContent.Error = Error;
	})(CellContent || (CellContent = {}));
	/**
	* Checks whether string looks like formula or not.
	*
	* @param text - formula
	*/
	function isFormula(text) {
		return text.startsWith("=");
	}
	function isBoolean(text) {
		const tl = text.toLowerCase();
		return tl === "true" || tl === "false";
	}
	function isError(text, errorMapping) {
		const upperCased = text.toUpperCase();
		return /#[A-Za-z0-9\/]+[?!]?/.test(upperCased) && Object.prototype.hasOwnProperty.call(errorMapping, upperCased);
	}
	var CellContentParser = class {
		constructor(config, dateHelper, numberLiteralsHelper) {
			this.config = config;
			this.dateHelper = dateHelper;
			this.numberLiteralsHelper = numberLiteralsHelper;
		}
		parse(content) {
			if (content === void 0 || content === null) return CellContent.Empty.getSingletonInstance();
			else if (typeof content === "number") if (isNumberOverflow(content)) return new CellContent.Error(ErrorType.NUM, ErrorMessage.ValueLarge);
			else return new CellContent.Number(content);
			else if (typeof content === "boolean") return new CellContent.Boolean(content);
			else if (content instanceof Date) {
				const val = this.dateHelper.dateToNumber({
					day: content.getDate(),
					month: content.getMonth() + 1,
					year: content.getFullYear()
				}) + timeToNumber({
					hours: content.getHours(),
					minutes: content.getMinutes(),
					seconds: content.getSeconds() + content.getMilliseconds() / 1e3
				});
				if (val < 0) return new CellContent.Error(ErrorType.NUM, ErrorMessage.DateBounds);
				if (val % 1 === 0) return new CellContent.Number(new DateNumber(val, "Date()"));
				else if (val < 1) return new CellContent.Number(new TimeNumber(val, "Date()"));
				else return new CellContent.Number(new DateTimeNumber(val, "Date()"));
			} else if (typeof content === "string") if (isBoolean(content)) return new CellContent.Boolean(content.toLowerCase() === "true");
			else if (isFormula(content)) return new CellContent.Formula(content);
			else if (isError(content, this.config.errorMapping)) return new CellContent.Error(this.config.errorMapping[content.toUpperCase()]);
			else {
				let trimmedContent = content.trim();
				let mode = 0;
				let currency;
				if (trimmedContent.endsWith("%")) {
					mode = 1;
					trimmedContent = trimmedContent.slice(0, trimmedContent.length - 1);
				} else {
					const res = this.currencyMatcher(trimmedContent);
					if (res !== void 0) {
						mode = 2;
						[currency, trimmedContent] = res;
					}
				}
				const val = this.numberLiteralsHelper.numericStringToMaybeNumber(trimmedContent);
				if (val !== void 0) {
					let parseAsNum;
					if (mode === 1) parseAsNum = new PercentNumber(val / 100);
					else if (mode === 2) parseAsNum = new CurrencyNumber(val, currency);
					else parseAsNum = val;
					return new CellContent.Number(parseAsNum);
				}
				const parsedDateNumber = this.dateHelper.dateStringToDateNumber(trimmedContent);
				if (parsedDateNumber !== void 0) return new CellContent.Number(parsedDateNumber);
				else return new CellContent.String(content.startsWith("'") ? content.slice(1) : content);
			}
			else throw new UnableToParseError(content);
		}
		currencyMatcher(token) {
			for (const currency of this.config.currencySymbol) {
				if (token.startsWith(currency)) return [currency, token.slice(currency.length)];
				if (token.endsWith(currency)) return [currency, token.slice(0, token.length - currency.length)];
			}
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/ClipboardOperations.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ClipboardOperationType;
	(function(ClipboardOperationType) {
		ClipboardOperationType[ClipboardOperationType["COPY"] = 0] = "COPY";
		ClipboardOperationType[ClipboardOperationType["CUT"] = 1] = "CUT";
	})(ClipboardOperationType || (ClipboardOperationType = {}));
	var ClipboardCellType;
	(function(ClipboardCellType) {
		ClipboardCellType[ClipboardCellType["VALUE"] = 0] = "VALUE";
		ClipboardCellType[ClipboardCellType["EMPTY"] = 1] = "EMPTY";
		ClipboardCellType[ClipboardCellType["FORMULA"] = 2] = "FORMULA";
		ClipboardCellType[ClipboardCellType["PARSING_ERROR"] = 3] = "PARSING_ERROR";
	})(ClipboardCellType || (ClipboardCellType = {}));
	var Clipboard = class {
		constructor(sourceLeftCorner, width, height, type, content) {
			this.sourceLeftCorner = sourceLeftCorner;
			this.width = width;
			this.height = height;
			this.type = type;
			this.content = content;
		}
		*getContent(leftCorner) {
			if (this.content === void 0) return;
			else for (let y = 0; y < this.height; ++y) for (let x = 0; x < this.width; ++x) yield [simpleCellAddress(leftCorner.sheet, leftCorner.col + x, leftCorner.row + y), this.content[y][x]];
		}
	};
	var ClipboardOperations = class {
		constructor(config, dependencyGraph, operations) {
			this.dependencyGraph = dependencyGraph;
			this.operations = operations;
			this.maxRows = config.maxRows;
			this.maxColumns = config.maxColumns;
		}
		cut(leftCorner, width, height) {
			this.clipboard = new Clipboard(leftCorner, width, height, ClipboardOperationType.CUT);
		}
		copy(leftCorner, width, height) {
			const content = [];
			for (let y = 0; y < height; ++y) {
				content[y] = [];
				for (let x = 0; x < width; ++x) {
					const clipboardCell = this.operations.getClipboardCell(simpleCellAddress(leftCorner.sheet, leftCorner.col + x, leftCorner.row + y));
					content[y].push(clipboardCell);
				}
			}
			this.clipboard = new Clipboard(leftCorner, width, height, ClipboardOperationType.COPY, content);
		}
		abortCut() {
			if (this.clipboard && this.clipboard.type === ClipboardOperationType.CUT) this.clear();
		}
		clear() {
			this.clipboard = void 0;
		}
		ensureItIsPossibleToCopyPaste(destinationLeftCorner) {
			if (this.clipboard === void 0) return;
			if (isColOrRowInvalid(destinationLeftCorner) || !this.dependencyGraph.sheetMapping.hasSheetWithId(destinationLeftCorner.sheet)) throw new InvalidArgumentsError("a valid target address.");
			const targetRange = AbsoluteCellRange.spanFrom(destinationLeftCorner, this.clipboard.width, this.clipboard.height);
			if (targetRange.exceedsSheetSizeLimits(this.maxColumns, this.maxRows)) throw new SheetSizeLimitExceededError();
			if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(targetRange)) throw new Error("It is not possible to paste onto an array");
		}
		isCutClipboard() {
			return this.clipboard !== void 0 && this.clipboard.type === ClipboardOperationType.CUT;
		}
		isCopyClipboard() {
			return this.clipboard !== void 0 && this.clipboard.type === ClipboardOperationType.COPY;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/Transformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var Transformer = class {
		performEagerTransformations(graph, parser) {
			for (const node of graph.arrayFormulaNodes()) {
				const [newAst, newAddress] = this.transformSingleAst(node.getFormula(graph.lazilyTransformingAstService), node.getAddress(graph.lazilyTransformingAstService));
				const cachedAst = parser.rememberNewAst(newAst);
				node.setFormula(cachedAst);
				node.setAddress(newAddress);
			}
		}
		transformSingleAst(ast, address) {
			return [this.transformAst(ast, address), this.fixNodeAddress(address)];
		}
		transformAst(ast, address) {
			switch (ast.type) {
				case AstNodeType.CELL_REFERENCE: return this.transformCellReferenceAst(ast, address);
				case AstNodeType.CELL_RANGE: return this.transformCellRangeAst(ast, address);
				case AstNodeType.COLUMN_RANGE: return this.transformColumnRangeAst(ast, address);
				case AstNodeType.ROW_RANGE: return this.transformRowRangeAst(ast, address);
				case AstNodeType.EMPTY:
				case AstNodeType.ERROR:
				case AstNodeType.NUMBER:
				case AstNodeType.NAMED_EXPRESSION:
				case AstNodeType.ERROR_WITH_RAW_INPUT:
				case AstNodeType.STRING: return ast;
				case AstNodeType.PERCENT_OP:
				case AstNodeType.MINUS_UNARY_OP:
				case AstNodeType.PLUS_UNARY_OP: return Object.assign(Object.assign({}, ast), { value: this.transformAst(ast.value, address) });
				case AstNodeType.FUNCTION_CALL: return Object.assign(Object.assign({}, ast), {
					procedureName: ast.procedureName,
					args: ast.args.map((arg) => this.transformAst(arg, address))
				});
				case AstNodeType.PARENTHESIS: return Object.assign(Object.assign({}, ast), { expression: this.transformAst(ast.expression, address) });
				case AstNodeType.ARRAY: return Object.assign(Object.assign({}, ast), { args: ast.args.map((row) => row.map((val) => this.transformAst(val, address))) });
				default: return Object.assign(Object.assign({}, ast), {
					left: this.transformAst(ast.left, address),
					right: this.transformAst(ast.right, address)
				});
			}
		}
		transformCellReferenceAst(ast, formulaAddress) {
			const newCellAddress = this.transformCellAddress(ast.reference, formulaAddress);
			if (newCellAddress instanceof CellAddress) return Object.assign(Object.assign({}, ast), { reference: newCellAddress });
			else if (newCellAddress === ErrorType.REF) return buildCellErrorAst(new CellError(ErrorType.REF));
			else return ast;
		}
		transformCellRangeAst(ast, formulaAddress) {
			const newRange = this.transformCellRange(ast.start, ast.end, formulaAddress);
			if (Array.isArray(newRange)) return Object.assign(Object.assign({}, ast), {
				start: newRange[0],
				end: newRange[1]
			});
			else if (newRange === ErrorType.REF) return buildCellErrorAst(new CellError(ErrorType.REF));
			else return ast;
		}
		transformColumnRangeAst(ast, formulaAddress) {
			const newRange = this.transformColumnRange(ast.start, ast.end, formulaAddress);
			if (Array.isArray(newRange)) return Object.assign(Object.assign({}, ast), {
				start: newRange[0],
				end: newRange[1]
			});
			else if (newRange === ErrorType.REF) return buildCellErrorAst(new CellError(ErrorType.REF));
			else return ast;
		}
		transformRowRangeAst(ast, formulaAddress) {
			const newRange = this.transformRowRange(ast.start, ast.end, formulaAddress);
			if (Array.isArray(newRange)) return Object.assign(Object.assign({}, ast), {
				start: newRange[0],
				end: newRange[1]
			});
			else if (newRange === ErrorType.REF) return buildCellErrorAst(new CellError(ErrorType.REF));
			else return ast;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/AddColumnsTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AddColumnsTransformer = class extends Transformer {
		constructor(columnsSpan) {
			super();
			this.columnsSpan = columnsSpan;
		}
		get sheet() {
			return this.columnsSpan.sheet;
		}
		isIrreversible() {
			return false;
		}
		transformRowRangeAst(ast, _formulaAddress) {
			return ast;
		}
		transformCellRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformRowRange(_start, _end, _formulaAddress) {
			throw Error("Not implemented");
		}
		transformColumnRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			const absoluteDependencySheet = absoluteSheetReference(dependencyAddress, formulaAddress);
			if (absoluteDependencySheet !== this.columnsSpan.sheet && formulaAddress.sheet !== this.columnsSpan.sheet) return false;
			const absolutizedDependencyAddress = dependencyAddress.toSimpleColumnAddress(formulaAddress);
			if (absoluteDependencySheet === this.columnsSpan.sheet && formulaAddress.sheet !== this.columnsSpan.sheet) if (this.columnsSpan.columnStart <= absolutizedDependencyAddress.col) return dependencyAddress.shiftedByColumns(this.columnsSpan.numberOfColumns);
			else return false;
			if (formulaAddress.sheet === this.columnsSpan.sheet && absoluteDependencySheet !== this.columnsSpan.sheet) {
				if (dependencyAddress.isColumnAbsolute()) return false;
				if (formulaAddress.col < this.columnsSpan.columnStart) return false;
				return dependencyAddress.shiftedByColumns(-this.columnsSpan.numberOfColumns);
			}
			if (dependencyAddress.isColumnAbsolute()) if (dependencyAddress.col < this.columnsSpan.columnStart) return false;
			else return dependencyAddress.shiftedByColumns(this.columnsSpan.numberOfColumns);
			else if (dependencyAddress.toSimpleColumnAddress(formulaAddress).col < this.columnsSpan.columnStart) if (formulaAddress.col < this.columnsSpan.columnStart) return false;
			else return dependencyAddress.shiftedByColumns(-this.columnsSpan.numberOfColumns);
			else if (formulaAddress.col < this.columnsSpan.columnStart) return dependencyAddress.shiftedByColumns(this.columnsSpan.numberOfColumns);
			else return false;
		}
		fixNodeAddress(address) {
			if (this.columnsSpan.sheet === address.sheet && this.columnsSpan.columnStart <= address.col) return Object.assign(Object.assign({}, address), { col: address.col + this.columnsSpan.numberOfColumns });
			else return address;
		}
		transformRange(start, end, formulaAddress) {
			const newStart = this.transformCellAddress(start, formulaAddress);
			const newEnd = this.transformCellAddress(end, formulaAddress);
			if (newStart === ErrorType.REF || newEnd === ErrorType.REF) return ErrorType.REF;
			else if (newStart || newEnd) return [newStart || start, newEnd || end];
			else return false;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/AddRowsTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AddRowsTransformer = class extends Transformer {
		constructor(rowsSpan) {
			super();
			this.rowsSpan = rowsSpan;
		}
		get sheet() {
			return this.rowsSpan.sheet;
		}
		isIrreversible() {
			return false;
		}
		transformColumnRangeAst(ast, _formulaAddress) {
			return ast;
		}
		transformCellRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformRowRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformColumnRange(_start, _end, _formulaAddress) {
			throw Error("Not implemented");
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			const absoluteDependencySheet = absoluteSheetReference(dependencyAddress, formulaAddress);
			if (absoluteDependencySheet !== this.rowsSpan.sheet && formulaAddress.sheet !== this.rowsSpan.sheet) return false;
			const absolutizedDependencyAddress = dependencyAddress.toSimpleRowAddress(formulaAddress);
			if (absoluteDependencySheet === this.rowsSpan.sheet && formulaAddress.sheet !== this.rowsSpan.sheet) if (this.rowsSpan.rowStart <= absolutizedDependencyAddress.row) return dependencyAddress.shiftedByRows(this.rowsSpan.numberOfRows);
			else return false;
			if (formulaAddress.sheet === this.rowsSpan.sheet && absoluteDependencySheet !== this.rowsSpan.sheet) {
				if (dependencyAddress.isRowAbsolute()) return false;
				if (formulaAddress.row < this.rowsSpan.rowStart) return false;
				return dependencyAddress.shiftedByRows(-this.rowsSpan.numberOfRows);
			}
			if (dependencyAddress.isRowAbsolute()) if (dependencyAddress.row < this.rowsSpan.rowStart) return false;
			else return dependencyAddress.shiftedByRows(this.rowsSpan.numberOfRows);
			else if (absolutizedDependencyAddress.row < this.rowsSpan.rowStart) if (formulaAddress.row < this.rowsSpan.rowStart) return false;
			else return dependencyAddress.shiftedByRows(-this.rowsSpan.numberOfRows);
			else if (formulaAddress.row < this.rowsSpan.rowStart) return dependencyAddress.shiftedByRows(this.rowsSpan.numberOfRows);
			else return false;
		}
		fixNodeAddress(address) {
			if (this.rowsSpan.sheet === address.sheet && this.rowsSpan.rowStart <= address.row) return Object.assign(Object.assign({}, address), { row: address.row + this.rowsSpan.numberOfRows });
			else return address;
		}
		transformRange(start, end, formulaAddress) {
			const newStart = this.transformCellAddress(start, formulaAddress);
			const newEnd = this.transformCellAddress(end, formulaAddress);
			if (newStart === ErrorType.REF || newEnd === ErrorType.REF) return ErrorType.REF;
			else if (newStart || newEnd) return [newStart || start, newEnd || end];
			else return false;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/CleanOutOfScopeDependenciesTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CleanOutOfScopeDependenciesTransformer = class extends Transformer {
		constructor(sheet) {
			super();
			this.sheet = sheet;
		}
		isIrreversible() {
			return true;
		}
		fixNodeAddress(address) {
			return address;
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			return dependencyAddress.isInvalid(formulaAddress) ? ErrorType.REF : false;
		}
		transformCellRange(start, end, formulaAddress) {
			return start.isInvalid(formulaAddress) || end.isInvalid(formulaAddress) ? ErrorType.REF : false;
		}
		transformColumnRange(start, end, formulaAddress) {
			return start.isInvalid(formulaAddress) || end.isInvalid(formulaAddress) ? ErrorType.REF : false;
		}
		transformRowRange(start, end, formulaAddress) {
			return start.isInvalid(formulaAddress) || end.isInvalid(formulaAddress) ? ErrorType.REF : false;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/MoveCellsTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var MoveCellsTransformer = class extends Transformer {
		constructor(sourceRange, toRight, toBottom, toSheet) {
			super();
			this.sourceRange = sourceRange;
			this.toRight = toRight;
			this.toBottom = toBottom;
			this.toSheet = toSheet;
			this.dependentFormulaTransformer = new DependentFormulaTransformer(sourceRange, toRight, toBottom, toSheet);
		}
		get sheet() {
			return this.sourceRange.sheet;
		}
		isIrreversible() {
			return true;
		}
		transformSingleAst(ast, address) {
			if (this.sourceRange.addressInRange(address)) return [this.transformAst(ast, address), this.fixNodeAddress(address)];
			else return this.dependentFormulaTransformer.transformSingleAst(ast, address);
		}
		fixNodeAddress(address) {
			return simpleCellAddress(this.toSheet, address.col + this.toRight, address.row + this.toBottom);
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			return this.transformAddress(dependencyAddress, formulaAddress);
		}
		transformCellRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformColumnRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformRowRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformAddress(dependencyAddress, formulaAddress) {
			const sourceRange = this.sourceRange;
			if (dependencyAddress instanceof CellAddress) {
				const absoluteDependencyAddress = dependencyAddress.toSimpleCellAddress(formulaAddress);
				if (sourceRange.addressInRange(absoluteDependencyAddress)) return dependencyAddress.shiftAbsoluteDimensions(this.toRight, this.toBottom);
			}
			return dependencyAddress.shiftRelativeDimensions(-this.toRight, -this.toBottom);
		}
		transformRange(start, end, formulaAddress) {
			const sourceRange = this.sourceRange;
			if (start instanceof CellAddress && end instanceof CellAddress) {
				const absoluteStart = start.toSimpleCellAddress(formulaAddress);
				const absoluteEnd = end.toSimpleCellAddress(formulaAddress);
				if (sourceRange.addressInRange(absoluteStart) && sourceRange.addressInRange(absoluteEnd)) return [start.shiftAbsoluteDimensions(this.toRight, this.toBottom), end.shiftAbsoluteDimensions(this.toRight, this.toBottom)];
			}
			return [start.shiftRelativeDimensions(-this.toRight, -this.toBottom), end.shiftRelativeDimensions(-this.toRight, -this.toBottom)];
		}
	};
	var DependentFormulaTransformer = class extends Transformer {
		constructor(sourceRange, toRight, toBottom, toSheet) {
			super();
			this.sourceRange = sourceRange;
			this.toRight = toRight;
			this.toBottom = toBottom;
			this.toSheet = toSheet;
		}
		get sheet() {
			return this.sourceRange.sheet;
		}
		isIrreversible() {
			return true;
		}
		fixNodeAddress(address) {
			return address;
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			if (this.shouldMove(dependencyAddress, formulaAddress)) return dependencyAddress.moved(this.toSheet, this.toRight, this.toBottom);
			return false;
		}
		transformCellRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformColumnRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformRowRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		shouldMove(dependencyAddress, formulaAddress) {
			if (dependencyAddress instanceof CellAddress) return this.sourceRange.addressInRange(dependencyAddress.toSimpleCellAddress(formulaAddress));
			else if (dependencyAddress instanceof RowAddress) return this.sourceRange.rowInRange(dependencyAddress.toSimpleRowAddress(formulaAddress)) && !this.sourceRange.isFinite();
			else return this.sourceRange.columnInRange(dependencyAddress.toSimpleColumnAddress(formulaAddress)) && !this.sourceRange.isFinite();
		}
		transformRange(start, end, formulaAddress) {
			const newStart = this.transformCellAddress(start, formulaAddress);
			const newEnd = this.transformCellAddress(end, formulaAddress);
			if (newStart && newEnd) return [newStart, newEnd];
			return false;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/RemoveColumnsTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RemoveColumnsTransformer = class extends Transformer {
		constructor(columnsSpan) {
			super();
			this.columnsSpan = columnsSpan;
		}
		get sheet() {
			return this.columnsSpan.sheet;
		}
		isIrreversible() {
			return true;
		}
		transformRowRangeAst(ast, _formulaAddress) {
			return ast;
		}
		transformCellRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformRowRange(_start, _end, _formulaAddress) {
			throw Error("Not implemented");
		}
		transformColumnRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			const absoluteDependencySheet = absoluteSheetReference(dependencyAddress, formulaAddress);
			if (this.columnsSpan.sheet !== formulaAddress.sheet && this.columnsSpan.sheet !== absoluteDependencySheet) return false;
			if (this.columnsSpan.sheet !== formulaAddress.sheet && this.columnsSpan.sheet === absoluteDependencySheet) {
				const absoluteDependencyAddress = dependencyAddress.toSimpleColumnAddress(formulaAddress);
				if (absoluteDependencyAddress.col < this.columnsSpan.columnStart) return false;
				else if (absoluteDependencyAddress.col > this.columnsSpan.columnEnd) return dependencyAddress.shiftedByColumns(-this.columnsSpan.numberOfColumns);
			}
			if (this.columnsSpan.sheet === formulaAddress.sheet && this.columnsSpan.sheet !== absoluteDependencySheet) {
				if (dependencyAddress.isColumnAbsolute()) return false;
				else if (formulaAddress.col < this.columnsSpan.columnStart) return false;
				else if (formulaAddress.col > this.columnsSpan.columnEnd) return dependencyAddress.shiftedByColumns(this.columnsSpan.numberOfColumns);
			}
			if (this.columnsSpan.sheet === formulaAddress.sheet && this.columnsSpan.sheet === absoluteDependencySheet) if (dependencyAddress.isColumnAbsolute()) {
				if (dependencyAddress.col < this.columnsSpan.columnStart) return false;
				else if (dependencyAddress.col > this.columnsSpan.columnEnd) return dependencyAddress.shiftedByColumns(-this.columnsSpan.numberOfColumns);
			} else {
				const absoluteDependencyAddress = dependencyAddress.toSimpleColumnAddress(formulaAddress);
				if (absoluteDependencyAddress.col < this.columnsSpan.columnStart) {
					if (formulaAddress.col < this.columnsSpan.columnStart) return false;
					else if (formulaAddress.col > this.columnsSpan.columnEnd) return dependencyAddress.shiftedByColumns(this.columnsSpan.numberOfColumns);
				} else if (absoluteDependencyAddress.col > this.columnsSpan.columnEnd) {
					if (formulaAddress.col < this.columnsSpan.columnStart) return dependencyAddress.shiftedByColumns(-this.columnsSpan.numberOfColumns);
					else if (formulaAddress.col > this.columnsSpan.columnEnd) return false;
				}
			}
			return ErrorType.REF;
		}
		fixNodeAddress(address) {
			if (this.columnsSpan.sheet === address.sheet && this.columnsSpan.columnStart <= address.col) return Object.assign(Object.assign({}, address), { col: address.col - this.columnsSpan.numberOfColumns });
			else return address;
		}
		transformRange(start, end, formulaAddress) {
			const startSheet = absoluteSheetReference(start, formulaAddress);
			let actualStart = start;
			let actualEnd = end;
			if (this.columnsSpan.sheet === startSheet) {
				const startSCA = start.toSimpleColumnAddress(formulaAddress);
				const endSCA = end.toSimpleColumnAddress(formulaAddress);
				if (this.columnsSpan.columnStart <= startSCA.col && this.columnsSpan.columnEnd >= endSCA.col) return ErrorType.REF;
				if (startSCA.col >= this.columnsSpan.columnStart && startSCA.col <= this.columnsSpan.columnEnd) actualStart = start.shiftedByColumns(this.columnsSpan.columnEnd - startSCA.col + 1);
				if (endSCA.col >= this.columnsSpan.columnStart && endSCA.col <= this.columnsSpan.columnEnd) actualEnd = end.shiftedByColumns(-(endSCA.col - this.columnsSpan.columnStart + 1));
			}
			const newStart = this.transformCellAddress(actualStart, formulaAddress);
			const newEnd = this.transformCellAddress(actualEnd, formulaAddress);
			if (newStart === false && newEnd === false) return [actualStart, actualEnd];
			else if (newStart === ErrorType.REF || newEnd === ErrorType.REF) throw Error("Cannot happen");
			else return [newStart || actualStart, newEnd || actualEnd];
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/RemoveRowsTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RemoveRowsTransformer = class extends Transformer {
		constructor(rowsSpan) {
			super();
			this.rowsSpan = rowsSpan;
		}
		get sheet() {
			return this.rowsSpan.sheet;
		}
		isIrreversible() {
			return true;
		}
		transformColumnRangeAst(ast, _formulaAddress) {
			return ast;
		}
		transformCellAddress(dependencyAddress, formulaAddress) {
			const absoluteDependencySheet = absoluteSheetReference(dependencyAddress, formulaAddress);
			if (this.rowsSpan.sheet !== formulaAddress.sheet && this.rowsSpan.sheet !== absoluteDependencySheet) return false;
			if (this.rowsSpan.sheet !== formulaAddress.sheet && this.rowsSpan.sheet === absoluteDependencySheet) {
				const absoluteDependencyAddress = dependencyAddress.toSimpleRowAddress(formulaAddress);
				if (absoluteDependencyAddress.row < this.rowsSpan.rowStart) return false;
				else if (absoluteDependencyAddress.row > this.rowsSpan.rowEnd) return dependencyAddress.shiftedByRows(-this.rowsSpan.numberOfRows);
			}
			if (this.rowsSpan.sheet === formulaAddress.sheet && this.rowsSpan.sheet !== absoluteDependencySheet) {
				if (dependencyAddress.isRowAbsolute()) return false;
				else if (formulaAddress.row < this.rowsSpan.rowStart) return false;
				else if (formulaAddress.row > this.rowsSpan.rowEnd) return dependencyAddress.shiftedByRows(this.rowsSpan.numberOfRows);
			}
			if (this.rowsSpan.sheet === formulaAddress.sheet && this.rowsSpan.sheet === absoluteDependencySheet) if (dependencyAddress.isRowAbsolute()) {
				if (dependencyAddress.row < this.rowsSpan.rowStart) return false;
				else if (dependencyAddress.row > this.rowsSpan.rowEnd) return dependencyAddress.shiftedByRows(-this.rowsSpan.numberOfRows);
			} else {
				const absoluteDependencyAddress = dependencyAddress.toSimpleRowAddress(formulaAddress);
				if (absoluteDependencyAddress.row < this.rowsSpan.rowStart) {
					if (formulaAddress.row < this.rowsSpan.rowStart) return false;
					else if (formulaAddress.row > this.rowsSpan.rowEnd) return dependencyAddress.shiftedByRows(this.rowsSpan.numberOfRows);
				} else if (absoluteDependencyAddress.row > this.rowsSpan.rowEnd) {
					if (formulaAddress.row < this.rowsSpan.rowStart) return dependencyAddress.shiftedByRows(-this.rowsSpan.numberOfRows);
					else if (formulaAddress.row > this.rowsSpan.rowEnd) return false;
				}
			}
			return ErrorType.REF;
		}
		transformCellRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformRowRange(start, end, formulaAddress) {
			return this.transformRange(start, end, formulaAddress);
		}
		transformColumnRange(_start, _end, _formulaAddress) {
			throw Error("Not implemented");
		}
		fixNodeAddress(address) {
			if (this.rowsSpan.sheet === address.sheet && this.rowsSpan.rowStart <= address.row) return Object.assign(Object.assign({}, address), { row: address.row - this.rowsSpan.numberOfRows });
			else return address;
		}
		transformRange(start, end, formulaAddress) {
			const startSheet = absoluteSheetReference(start, formulaAddress);
			let actualStart = start;
			let actualEnd = end;
			if (this.rowsSpan.sheet === startSheet) {
				const startSCA = start.toSimpleRowAddress(formulaAddress);
				const endSCA = end.toSimpleRowAddress(formulaAddress);
				if (this.rowsSpan.rowStart <= startSCA.row && this.rowsSpan.rowEnd >= endSCA.row) return ErrorType.REF;
				if (startSCA.row >= this.rowsSpan.rowStart && startSCA.row <= this.rowsSpan.rowEnd) actualStart = start.shiftedByRows(this.rowsSpan.rowEnd - startSCA.row + 1);
				if (endSCA.row >= this.rowsSpan.rowStart && endSCA.row <= this.rowsSpan.rowEnd) actualEnd = end.shiftedByRows(-(endSCA.row - this.rowsSpan.rowStart + 1));
			}
			const newStart = this.transformCellAddress(actualStart, formulaAddress);
			const newEnd = this.transformCellAddress(actualEnd, formulaAddress);
			if (newStart === false && newEnd === false) return [actualStart, actualEnd];
			else if (newStart === ErrorType.REF || newEnd === ErrorType.REF) return ErrorType.REF;
			else return [newStart || actualStart, newEnd || actualEnd];
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/RenameSheetTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Transformer that reassigns references from a merged sheet into the surviving sheet.
	*/
	var RenameSheetTransformer = class extends Transformer {
		constructor(sheetIdToKeep, sheetBeingMerged) {
			super();
			this.sheetIdToKeep = sheetIdToKeep;
			this.sheetBeingMerged = sheetBeingMerged;
		}
		/**
		* Returns id of sheet that survives merge operation.
		*
		* @returns {number} sheet identifier.
		*/
		get sheet() {
			return this.sheetIdToKeep;
		}
		/**
		* Sheet merge cannot be undone because original sheet id is lost.
		*
		* @returns {boolean} always true to indicate transformation irreversibility.
		*/
		isIrreversible() {
			return true;
		}
		/**
		* Updates cell address sheet when it points to merged sheet.
		*
		* @param {T} dependencyAddress - dependency address needing sheet update.
		* @param {SimpleCellAddress} _formulaAddress - location of formula (unused but required by base class).
		* @returns {T | false} updated address or false when nothing changes.
		*/
		transformCellAddress(dependencyAddress, _formulaAddress) {
			return this.updateSheetInAddress(dependencyAddress);
		}
		/**
		* Updates sheet for both ends of cell range.
		*
		* @param {CellAddress} start - start address of range.
		* @param {CellAddress} end - end address of range.
		* @param {SimpleCellAddress} _formulaAddress - formula location (unused).
		* @returns {[CellAddress, CellAddress] | false} updated range tuple or false when unchanged.
		*/
		transformCellRange(start, end, _formulaAddress) {
			return this.transformRange(start, end);
		}
		/**
		* Updates sheet for both ends of column range.
		*
		* @param {ColumnAddress} start - beginning column of range.
		* @param {ColumnAddress} end - ending column of range.
		* @param {SimpleCellAddress} _formulaAddress - formula location (unused).
		* @returns {[ColumnAddress, ColumnAddress] | false} updated column range or false.
		*/
		transformColumnRange(start, end, _formulaAddress) {
			return this.transformRange(start, end);
		}
		/**
		* Updates sheet for both ends of row range.
		*
		* @param {RowAddress} start - beginning row address.
		* @param {RowAddress} end - ending row address.
		* @param {SimpleCellAddress} _formulaAddress - formula location (unused).
		* @returns {[RowAddress, RowAddress] | false} updated row range or false.
		*/
		transformRowRange(start, end, _formulaAddress) {
			return this.transformRange(start, end);
		}
		/**
		* Node addresses are already absolute, so no change is needed.
		*
		* @param {SimpleCellAddress} address - node address to inspect.
		* @returns {SimpleCellAddress} original address unchanged.
		*/
		fixNodeAddress(address) {
			return address;
		}
		/**
		* Updates sheet identifier for both range ends if needed.
		*
		* @param {T} start - range start address.
		* @param {T} end - range end address.
		* @returns {[T, T] | false} tuple with updated addresses or false when no updates happen.
		*/
		transformRange(start, end) {
			const newStart = this.updateSheetInAddress(start);
			const newEnd = this.updateSheetInAddress(end);
			if (newStart || newEnd) return [newStart || start, newEnd || end];
			return false;
		}
		/**
		* Replaces sheet id in address when it points to merged sheet.
		*
		* @param {T} address - address to update.
		* @returns {T | false} address with new sheet id or false when no change occurs.
		*/
		updateSheetInAddress(address) {
			if (address.sheet === this.sheetBeingMerged) return address.withSheet(this.sheetIdToKeep);
			return false;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Operations.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RemoveRowsCommand = class {
		constructor(sheet, indexes) {
			this.sheet = sheet;
			this.indexes = indexes;
		}
		normalizedIndexes() {
			return normalizeRemovedIndexes(this.indexes);
		}
		rowsSpans() {
			return this.normalizedIndexes().map((normalizedIndex) => RowsSpan.fromNumberOfRows(this.sheet, normalizedIndex[0], normalizedIndex[1]));
		}
	};
	var AddRowsCommand = class {
		constructor(sheet, indexes) {
			this.sheet = sheet;
			this.indexes = indexes;
		}
		normalizedIndexes() {
			return normalizeAddedIndexes(this.indexes);
		}
		rowsSpans() {
			return this.normalizedIndexes().map((normalizedIndex) => RowsSpan.fromNumberOfRows(this.sheet, normalizedIndex[0], normalizedIndex[1]));
		}
	};
	var AddColumnsCommand = class {
		constructor(sheet, indexes) {
			this.sheet = sheet;
			this.indexes = indexes;
		}
		normalizedIndexes() {
			return normalizeAddedIndexes(this.indexes);
		}
		columnsSpans() {
			return this.normalizedIndexes().map((normalizedIndex) => ColumnsSpan.fromNumberOfColumns(this.sheet, normalizedIndex[0], normalizedIndex[1]));
		}
	};
	var RemoveColumnsCommand = class {
		constructor(sheet, indexes) {
			this.sheet = sheet;
			this.indexes = indexes;
		}
		normalizedIndexes() {
			return normalizeRemovedIndexes(this.indexes);
		}
		columnsSpans() {
			return this.normalizedIndexes().map((normalizedIndex) => ColumnsSpan.fromNumberOfColumns(this.sheet, normalizedIndex[0], normalizedIndex[1]));
		}
	};
	var Operations = class {
		constructor(config, dependencyGraph, columnSearch, cellContentParser, parser, stats, lazilyTransformingAstService, namedExpressions, arraySizePredictor) {
			this.dependencyGraph = dependencyGraph;
			this.columnSearch = columnSearch;
			this.cellContentParser = cellContentParser;
			this.parser = parser;
			this.stats = stats;
			this.lazilyTransformingAstService = lazilyTransformingAstService;
			this.namedExpressions = namedExpressions;
			this.arraySizePredictor = arraySizePredictor;
			this.changes = ContentChanges.empty();
			this.allocateNamedExpressionAddressSpace();
			this.maxColumns = config.maxColumns;
			this.maxRows = config.maxRows;
		}
		get sheetMapping() {
			return this.dependencyGraph.sheetMapping;
		}
		get addressMapping() {
			return this.dependencyGraph.addressMapping;
		}
		removeRows(cmd) {
			const rowsRemovals = [];
			for (const rowsToRemove of cmd.rowsSpans()) {
				const rowsRemoval = this.doRemoveRows(rowsToRemove);
				if (rowsRemoval) rowsRemovals.push(rowsRemoval);
			}
			return rowsRemovals;
		}
		addRows(cmd) {
			for (const addedRows of cmd.rowsSpans()) this.doAddRows(addedRows);
		}
		addColumns(cmd) {
			for (const addedColumns of cmd.columnsSpans()) this.doAddColumns(addedColumns);
		}
		removeColumns(cmd) {
			const columnsRemovals = [];
			for (const columnsToRemove of cmd.columnsSpans()) {
				const columnsRemoval = this.doRemoveColumns(columnsToRemove);
				if (columnsRemoval) columnsRemovals.push(columnsRemoval);
			}
			return columnsRemovals;
		}
		/**
		* Clears the sheet content.
		*/
		clearSheet(sheetId) {
			this.dependencyGraph.clearSheet(sheetId);
			this.columnSearch.removeSheet(sheetId);
		}
		/**
		* Adds a new sheet to the workbook.
		*/
		addSheet(name) {
			const sheetId = this.sheetMapping.addSheet(name);
			this.dependencyGraph.addSheet(sheetId);
			return {
				sheetName: this.sheetMapping.getSheetNameOrThrowError(sheetId),
				sheetId
			};
		}
		/**
		* Adds a sheet with a specific ID for redo operations.
		*/
		addSheetWithId(sheetId, name) {
			this.sheetMapping.addSheetWithId(sheetId, name);
			this.dependencyGraph.addSheet(sheetId);
		}
		/**
		* Adds a placeholder sheet with a specific ID for undo operations.
		* Used to restore previously merged placeholder sheets.
		*
		* Note: Unlike `addSheetWithId`, this does NOT call `dependencyGraph.addSheet()`
		* because placeholders don't need dirty marking or strategy changes - they only
		* need to exist in the mappings so formulas can reference them again.
		*/
		addPlaceholderSheetWithId(sheetId, name) {
			this.sheetMapping.addPlaceholderWithId(sheetId, name);
			this.addressMapping.addSheetStrategyPlaceholderIfNotExists(sheetId);
		}
		/**
		* Removes a sheet from the workbook.
		*/
		removeSheet(sheetId) {
			this.dependencyGraph.removeSheet(sheetId);
			this.columnSearch.removeSheet(sheetId);
			return this.namedExpressions.getAllNamedExpressionsForScope(sheetId).map((namedExpression) => this.removeNamedExpression(namedExpression.normalizeExpressionName(), sheetId));
		}
		/**
		* Removes a sheet from the workbook by name.
		*/
		removeSheetByName(sheetName) {
			const sheetId = this.sheetMapping.getSheetIdOrThrowError(sheetName);
			return this.removeSheet(sheetId);
		}
		/**
		* Renames a sheet in the workbook.
		*/
		renameSheet(sheetId, newName) {
			const { previousDisplayName, mergedWithPlaceholderSheet } = this.sheetMapping.renameSheet(sheetId, newName);
			let version;
			if (mergedWithPlaceholderSheet !== void 0) {
				this.dependencyGraph.mergeSheets(sheetId, mergedWithPlaceholderSheet);
				this.stats.measure(StatType.TRANSFORM_ASTS, () => {
					const transformation = new RenameSheetTransformer(sheetId, mergedWithPlaceholderSheet);
					transformation.performEagerTransformations(this.dependencyGraph, this.parser);
					version = this.lazilyTransformingAstService.addTransformation(transformation);
				});
			}
			return {
				previousDisplayName,
				version,
				mergedPlaceholderSheetId: mergedWithPlaceholderSheet
			};
		}
		moveRows(sheet, startRow, numberOfRows, targetRow) {
			const rowsToAdd = RowsSpan.fromNumberOfRows(sheet, targetRow, numberOfRows);
			this.lazilyTransformingAstService.beginCombinedMode(sheet);
			this.doAddRows(rowsToAdd);
			if (targetRow < startRow) startRow += numberOfRows;
			const startAddress = simpleCellAddress(sheet, 0, startRow);
			const targetAddress = simpleCellAddress(sheet, 0, targetRow);
			this.moveCells(startAddress, Number.POSITIVE_INFINITY, numberOfRows, targetAddress);
			const rowsToRemove = RowsSpan.fromNumberOfRows(sheet, startRow, numberOfRows);
			this.doRemoveRows(rowsToRemove);
			return this.lazilyTransformingAstService.commitCombinedMode();
		}
		moveColumns(sheet, startColumn, numberOfColumns, targetColumn) {
			const columnsToAdd = ColumnsSpan.fromNumberOfColumns(sheet, targetColumn, numberOfColumns);
			this.lazilyTransformingAstService.beginCombinedMode(sheet);
			this.doAddColumns(columnsToAdd);
			if (targetColumn < startColumn) startColumn += numberOfColumns;
			const startAddress = simpleCellAddress(sheet, startColumn, 0);
			const targetAddress = simpleCellAddress(sheet, targetColumn, 0);
			this.moveCells(startAddress, numberOfColumns, Number.POSITIVE_INFINITY, targetAddress);
			const columnsToRemove = ColumnsSpan.fromNumberOfColumns(sheet, startColumn, numberOfColumns);
			this.doRemoveColumns(columnsToRemove);
			return this.lazilyTransformingAstService.commitCombinedMode();
		}
		moveCells(sourceLeftCorner, width, height, destinationLeftCorner) {
			this.ensureItIsPossibleToMoveCells(sourceLeftCorner, width, height, destinationLeftCorner);
			const sourceRange = AbsoluteCellRange.spanFrom(sourceLeftCorner, width, height);
			const targetRange = AbsoluteCellRange.spanFrom(destinationLeftCorner, width, height);
			const toRight = destinationLeftCorner.col - sourceLeftCorner.col;
			const toBottom = destinationLeftCorner.row - sourceLeftCorner.row;
			const toSheet = destinationLeftCorner.sheet;
			const currentDataAtTarget = this.getRangeClipboardCells(targetRange);
			const valuesToRemove = this.dependencyGraph.rawValuesFromRange(targetRange);
			this.columnSearch.removeValues(valuesToRemove);
			const valuesToMove = this.dependencyGraph.rawValuesFromRange(sourceRange);
			this.columnSearch.moveValues(valuesToMove, toRight, toBottom, toSheet);
			let version = 0;
			this.stats.measure(StatType.TRANSFORM_ASTS, () => {
				const transformation = new MoveCellsTransformer(sourceRange, toRight, toBottom, toSheet);
				transformation.performEagerTransformations(this.dependencyGraph, this.parser);
				version = this.lazilyTransformingAstService.addTransformation(transformation);
			});
			this.dependencyGraph.moveCells(sourceRange, toRight, toBottom, toSheet);
			const addedGlobalNamedExpressions = this.updateNamedExpressionsForMovedCells(sourceLeftCorner, width, height, destinationLeftCorner);
			return {
				version,
				overwrittenCellsData: currentDataAtTarget,
				addedGlobalNamedExpressions
			};
		}
		setRowOrder(sheetId, rowMapping) {
			const buffer = [];
			let oldContent = [];
			for (const [source, target] of rowMapping) if (source !== target) {
				const rowRange = AbsoluteCellRange.spanFrom({
					sheet: sheetId,
					col: 0,
					row: source
				}, Infinity, 1);
				const row = this.getRangeClipboardCells(rowRange);
				oldContent = oldContent.concat(row);
				buffer.push(row.map(([{ sheet, col }, cell]) => [{
					sheet,
					col,
					row: target
				}, cell]));
			}
			buffer.forEach((row) => this.restoreClipboardCells(sheetId, row.values()));
			return oldContent;
		}
		setColumnOrder(sheetId, columnMapping) {
			const buffer = [];
			let oldContent = [];
			for (const [source, target] of columnMapping) if (source !== target) {
				const rowRange = AbsoluteCellRange.spanFrom({
					sheet: sheetId,
					col: source,
					row: 0
				}, 1, Infinity);
				const column = this.getRangeClipboardCells(rowRange);
				oldContent = oldContent.concat(column);
				buffer.push(column.map(([{ sheet, col: _col, row }, cell]) => [{
					sheet,
					col: target,
					row
				}, cell]));
			}
			buffer.forEach((column) => this.restoreClipboardCells(sheetId, column.values()));
			return oldContent;
		}
		addNamedExpression(expressionName, expression, sheetId, options) {
			const namedExpression = this.namedExpressions.addNamedExpression(expressionName, sheetId, options);
			this.storeNamedExpressionInCell(namedExpression.address, expression);
			this.adjustNamedExpressionEdges(namedExpression, expressionName, sheetId);
		}
		restoreNamedExpression(namedExpression, content, sheetId) {
			const expressionName = namedExpression.displayName;
			this.restoreCell(namedExpression.address, content);
			const restoredNamedExpression = this.namedExpressions.restoreNamedExpression(namedExpression, sheetId);
			this.adjustNamedExpressionEdges(restoredNamedExpression, expressionName, sheetId);
		}
		changeNamedExpressionExpression(expressionName, newExpression, sheetId, options) {
			const namedExpression = this.namedExpressions.namedExpressionForScope(expressionName, sheetId);
			if (!namedExpression) throw new NamedExpressionDoesNotExistError(expressionName);
			const oldNamedExpression = namedExpression.copy();
			namedExpression.options = options;
			const content = this.getClipboardCell(namedExpression.address);
			this.storeNamedExpressionInCell(namedExpression.address, newExpression);
			return [oldNamedExpression, content];
		}
		removeNamedExpression(expressionName, sheetId) {
			const namedExpression = this.namedExpressions.namedExpressionForScope(expressionName, sheetId);
			if (!namedExpression) throw new NamedExpressionDoesNotExistError(expressionName);
			this.namedExpressions.remove(namedExpression.displayName, sheetId);
			const content = this.getClipboardCell(namedExpression.address);
			if (sheetId !== void 0) {
				const globalNamedExpression = this.namedExpressions.workbookNamedExpressionOrPlaceholder(expressionName);
				this.dependencyGraph.exchangeNode(namedExpression.address, globalNamedExpression.address);
			} else this.dependencyGraph.setCellEmpty(namedExpression.address);
			return [namedExpression, content];
		}
		ensureItIsPossibleToMoveCells(sourceLeftCorner, width, height, destinationLeftCorner) {
			if (isColOrRowInvalid(sourceLeftCorner) || !(isPositiveInteger$1(width) && isPositiveInteger$1(height) || isRowOrColumnRange(sourceLeftCorner, width, height)) || isColOrRowInvalid(destinationLeftCorner) || !this.sheetMapping.hasSheetWithId(sourceLeftCorner.sheet) || !this.sheetMapping.hasSheetWithId(destinationLeftCorner.sheet)) throw new InvalidArgumentsError("a valid range of cells to move.");
			const sourceRange = AbsoluteCellRange.spanFrom(sourceLeftCorner, width, height);
			const targetRange = AbsoluteCellRange.spanFrom(destinationLeftCorner, width, height);
			if (targetRange.exceedsSheetSizeLimits(this.maxColumns, this.maxRows)) throw new SheetSizeLimitExceededError();
			if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(sourceRange)) throw new SourceLocationHasArrayError();
			if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(targetRange)) throw new TargetLocationHasArrayError();
		}
		restoreClipboardCells(sourceSheetId, cells) {
			const addedNamedExpressions = [];
			for (const [address, clipboardCell] of cells) {
				this.restoreCell(address, clipboardCell);
				if (clipboardCell.type === ClipboardCellType.FORMULA) {
					const { dependencies } = this.parser.fetchCachedResult(clipboardCell.hash);
					addedNamedExpressions.push(...this.updateNamedExpressionsForTargetAddress(sourceSheetId, address, dependencies));
				}
			}
			return addedNamedExpressions;
		}
		/**
		* Restores a single cell.
		*/
		restoreCell(address, clipboardCell) {
			switch (clipboardCell.type) {
				case ClipboardCellType.VALUE:
					this.setValueToCell(clipboardCell, address);
					break;
				case ClipboardCellType.FORMULA:
					this.setFormulaToCellFromCache(clipboardCell.hash, address);
					break;
				case ClipboardCellType.EMPTY:
					this.setCellEmpty(address);
					break;
				case ClipboardCellType.PARSING_ERROR:
					this.setParsingErrorToCell(clipboardCell.rawInput, clipboardCell.errors, address);
					break;
			}
		}
		getOldContent(address) {
			const vertex = this.dependencyGraph.getCell(address);
			if (vertex === void 0 || vertex instanceof EmptyCellVertex) return [address, { type: ClipboardCellType.EMPTY }];
			else if (vertex instanceof ValueCellVertex) return [address, Object.assign({ type: ClipboardCellType.VALUE }, vertex.getValues())];
			else if (vertex instanceof FormulaVertex) return [vertex.getAddress(this.lazilyTransformingAstService), {
				type: ClipboardCellType.FORMULA,
				hash: this.parser.computeHashFromAst(vertex.getFormula(this.lazilyTransformingAstService))
			}];
			else if (vertex instanceof ParsingErrorVertex) return [address, {
				type: ClipboardCellType.PARSING_ERROR,
				rawInput: vertex.rawInput,
				errors: vertex.errors
			}];
			throw Error("Trying to copy unsupported type");
		}
		getClipboardCell(address) {
			const vertex = this.dependencyGraph.getCell(address);
			if (vertex === void 0 || vertex instanceof EmptyCellVertex) return { type: ClipboardCellType.EMPTY };
			else if (vertex instanceof ValueCellVertex) return Object.assign({ type: ClipboardCellType.VALUE }, vertex.getValues());
			else if (vertex instanceof ArrayFormulaVertex) {
				const val = vertex.getArrayCellValue(address);
				if (val === EmptyValue) return { type: ClipboardCellType.EMPTY };
				return {
					type: ClipboardCellType.VALUE,
					parsedValue: val,
					rawValue: vertex.getArrayCellRawValue(address)
				};
			} else if (vertex instanceof ScalarFormulaVertex) return {
				type: ClipboardCellType.FORMULA,
				hash: this.parser.computeHashFromAst(vertex.getFormula(this.lazilyTransformingAstService))
			};
			else if (vertex instanceof ParsingErrorVertex) return {
				type: ClipboardCellType.PARSING_ERROR,
				rawInput: vertex.rawInput,
				errors: vertex.errors
			};
			throw Error("Trying to copy unsupported type");
		}
		getSheetClipboardCells(sheet) {
			const sheetHeight = this.dependencyGraph.getSheetHeight(sheet);
			const sheetWidth = this.dependencyGraph.getSheetWidth(sheet);
			const arr = new Array(sheetHeight);
			for (let i = 0; i < sheetHeight; i++) {
				arr[i] = new Array(sheetWidth);
				for (let j = 0; j < sheetWidth; j++) {
					const address = simpleCellAddress(sheet, j, i);
					arr[i][j] = this.getClipboardCell(address);
				}
			}
			return arr;
		}
		getRangeClipboardCells(range) {
			const result = [];
			for (const address of range.addresses(this.dependencyGraph)) result.push([address, this.getClipboardCell(address)]);
			return result;
		}
		setCellContent(address, newCellContent) {
			const parsedCellContent = this.cellContentParser.parse(newCellContent);
			const oldContent = this.getOldContent(address);
			if (parsedCellContent instanceof CellContent.Formula) {
				const parserResult = this.parser.parse(parsedCellContent.formula, address);
				const { ast, errors } = parserResult;
				if (errors.length > 0) this.setParsingErrorToCell(parsedCellContent.formula, errors, address);
				else try {
					const size = this.arraySizePredictor.checkArraySize(ast, address);
					if (size.width <= 0 || size.height <= 0) throw Error("Incorrect array size");
					this.setFormulaToCell(address, size, parserResult);
				} catch (error) {
					if (!error.message) throw error;
					const parsingError = {
						type: ParsingErrorType.InvalidRangeSize,
						message: "Invalid range size."
					};
					this.setParsingErrorToCell(parsedCellContent.formula, [parsingError], address);
				}
			} else if (parsedCellContent instanceof CellContent.Empty) this.setCellEmpty(address);
			else this.setValueToCell({
				parsedValue: parsedCellContent.value,
				rawValue: newCellContent
			}, address);
			return oldContent;
		}
		setSheetContent(sheetId, newSheetContent) {
			this.clearSheet(sheetId);
			for (let i = 0; i < newSheetContent.length; i++) for (let j = 0; j < newSheetContent[i].length; j++) {
				const address = simpleCellAddress(sheetId, j, i);
				this.setCellContent(address, newSheetContent[i][j]);
			}
		}
		/**
		* Sets cell content to an instance of parsing error.
		* Creates a ParsingErrorVertex and updates the dependency graph and column search index.
		*/
		setParsingErrorToCell(rawInput, errors, address) {
			this.removeCellValueFromColumnSearch(address);
			const vertex = new ParsingErrorVertex(errors, rawInput);
			const arrayChanges = this.dependencyGraph.setParsingErrorToCell(address, vertex);
			this.columnSearch.applyChanges(arrayChanges.getChanges());
			this.changes.addAll(arrayChanges);
			this.changes.addChange(vertex.getCellValue(), address);
		}
		/**
		* Sets cell content to a formula.
		* Creates a ScalarFormulaVertex and updates the dependency graph and column search index.
		*/
		setFormulaToCell(address, size, { ast, hasVolatileFunction, hasStructuralChangeFunction, dependencies }) {
			this.removeCellValueFromColumnSearch(address);
			const arrayChanges = this.dependencyGraph.setFormulaToCell(address, ast, absolutizeDependencies(dependencies, address), size, hasVolatileFunction, hasStructuralChangeFunction);
			this.columnSearch.applyChanges(arrayChanges.getChanges());
			this.changes.addAll(arrayChanges);
		}
		/**
		* Sets cell content to a value.
		* Creates a ValueCellVertex and updates the dependency graph and column search index.
		*/
		setValueToCell(value, address) {
			this.changeCellValueInColumnSearch(address, value.parsedValue);
			const arrayChanges = this.dependencyGraph.setValueToCell(address, value);
			this.columnSearch.applyChanges(arrayChanges.getChanges().filter((change) => !equalSimpleCellAddress(change.address, address)));
			this.changes.addAll(arrayChanges);
			this.changes.addChange(value.parsedValue, address);
		}
		/**
		* Sets cell content to an empty value.
		* Creates an EmptyCellVertex and updates the dependency graph and column search index.
		*/
		setCellEmpty(address) {
			if (this.dependencyGraph.isArrayInternalCell(address)) return;
			this.removeCellValueFromColumnSearch(address);
			const arrayChanges = this.dependencyGraph.setCellEmpty(address);
			this.columnSearch.applyChanges(arrayChanges.getChanges());
			this.changes.addAll(arrayChanges);
			this.changes.addChange(EmptyValue, address);
		}
		setFormulaToCellFromCache(formulaHash, address) {
			const { ast, hasVolatileFunction, hasStructuralChangeFunction, dependencies } = this.parser.fetchCachedResult(formulaHash);
			const absoluteDependencies = absolutizeDependencies(dependencies, address);
			const [cleanedAst] = new CleanOutOfScopeDependenciesTransformer(address.sheet).transformSingleAst(ast, address);
			this.parser.rememberNewAst(cleanedAst);
			const cleanedDependencies = filterDependenciesOutOfScope(absoluteDependencies);
			const size = this.arraySizePredictor.checkArraySize(ast, address);
			this.dependencyGraph.setFormulaToCell(address, cleanedAst, cleanedDependencies, size, hasVolatileFunction, hasStructuralChangeFunction);
		}
		/**
		* Returns true if row number is outside of given sheet.
		* @param {number} row - row number
		* @param {number} sheet - sheet ID number
		*/
		rowEffectivelyNotInSheet(row, sheet) {
			return row >= this.dependencyGraph.addressMapping.getSheetHeight(sheet);
		}
		getAndClearContentChanges() {
			const changes = this.changes;
			this.changes = ContentChanges.empty();
			return changes;
		}
		forceApplyPostponedTransformations() {
			this.dependencyGraph.forceApplyPostponedTransformations();
		}
		/**
		* Removes multiple rows from sheet. </br>
		* Does nothing if rows are outside of effective sheet size.
		* @param {RowsSpan} rowsToRemove - rows to remove
		*/
		doRemoveRows(rowsToRemove) {
			if (this.rowEffectivelyNotInSheet(rowsToRemove.rowStart, rowsToRemove.sheet)) return;
			const removedCells = [];
			for (const [address] of this.dependencyGraph.entriesFromRowsSpan(rowsToRemove)) removedCells.push({
				address,
				cellType: this.getClipboardCell(address)
			});
			const { affectedArrays, contentChanges } = this.dependencyGraph.removeRows(rowsToRemove);
			this.columnSearch.applyChanges(contentChanges.getChanges());
			let version = 0;
			this.stats.measure(StatType.TRANSFORM_ASTS, () => {
				const transformation = new RemoveRowsTransformer(rowsToRemove);
				transformation.performEagerTransformations(this.dependencyGraph, this.parser);
				version = this.lazilyTransformingAstService.addTransformation(transformation);
			});
			this.rewriteAffectedArrays(affectedArrays);
			return {
				version,
				removedCells,
				rowFrom: rowsToRemove.rowStart,
				rowCount: rowsToRemove.numberOfRows
			};
		}
		/**
		* Removes multiple columns from sheet. </br>
		* Does nothing if columns are outside of effective sheet size.
		* @param {ColumnsSpan} columnsToRemove - columns to remove
		*/
		doRemoveColumns(columnsToRemove) {
			if (this.columnEffectivelyNotInSheet(columnsToRemove.columnStart, columnsToRemove.sheet)) return;
			const removedCells = [];
			for (const [address] of this.dependencyGraph.entriesFromColumnsSpan(columnsToRemove)) removedCells.push({
				address,
				cellType: this.getClipboardCell(address)
			});
			const { affectedArrays, contentChanges } = this.dependencyGraph.removeColumns(columnsToRemove);
			this.columnSearch.applyChanges(contentChanges.getChanges());
			this.columnSearch.removeColumns(columnsToRemove);
			let version = 0;
			this.stats.measure(StatType.TRANSFORM_ASTS, () => {
				const transformation = new RemoveColumnsTransformer(columnsToRemove);
				transformation.performEagerTransformations(this.dependencyGraph, this.parser);
				version = this.lazilyTransformingAstService.addTransformation(transformation);
			});
			this.rewriteAffectedArrays(affectedArrays);
			return {
				version,
				removedCells,
				columnFrom: columnsToRemove.columnStart,
				columnCount: columnsToRemove.numberOfColumns
			};
		}
		/**
		* Add multiple rows to sheet. </br>
		* Does nothing if rows are outside of effective sheet size.
		* @param {RowsSpan} addedRows - rows to add
		*/
		doAddRows(addedRows) {
			if (this.rowEffectivelyNotInSheet(addedRows.rowStart, addedRows.sheet)) return;
			const { affectedArrays } = this.dependencyGraph.addRows(addedRows);
			this.stats.measure(StatType.TRANSFORM_ASTS, () => {
				const transformation = new AddRowsTransformer(addedRows);
				transformation.performEagerTransformations(this.dependencyGraph, this.parser);
				this.lazilyTransformingAstService.addTransformation(transformation);
			});
			this.rewriteAffectedArrays(affectedArrays);
		}
		rewriteAffectedArrays(affectedArrays) {
			for (const arrayVertex of affectedArrays.values()) {
				if (arrayVertex.array.size.isRef) continue;
				const ast = arrayVertex.getFormula(this.lazilyTransformingAstService);
				const address = arrayVertex.getAddress(this.lazilyTransformingAstService);
				const hash = this.parser.computeHashFromAst(ast);
				this.setFormulaToCellFromCache(hash, address);
			}
		}
		/**
		* Add multiple columns to sheet </br>
		* Does nothing if columns are outside of effective sheet size
		* @param {ColumnsSpan} addedColumns - object containing information about columns to add
		*/
		doAddColumns(addedColumns) {
			if (this.columnEffectivelyNotInSheet(addedColumns.columnStart, addedColumns.sheet)) return;
			const { affectedArrays, contentChanges } = this.dependencyGraph.addColumns(addedColumns);
			this.columnSearch.addColumns(addedColumns);
			this.columnSearch.applyChanges(contentChanges.getChanges());
			this.stats.measure(StatType.TRANSFORM_ASTS, () => {
				const transformation = new AddColumnsTransformer(addedColumns);
				transformation.performEagerTransformations(this.dependencyGraph, this.parser);
				this.lazilyTransformingAstService.addTransformation(transformation);
			});
			this.rewriteAffectedArrays(affectedArrays);
		}
		/**
		* Returns true if row number is outside of given sheet.
		* @param {number} column - row number
		* @param {number} sheet - sheet ID number
		*/
		columnEffectivelyNotInSheet(column, sheet) {
			return column >= this.dependencyGraph.addressMapping.getSheetWidth(sheet);
		}
		adjustNamedExpressionEdges(namedExpression, expressionName, sheetId) {
			if (sheetId === void 0) return;
			const { vertex: localVertex, id: maybeLocalVertexId } = this.dependencyGraph.fetchCellOrCreateEmpty(namedExpression.address);
			const localVertexId = maybeLocalVertexId !== null && maybeLocalVertexId !== void 0 ? maybeLocalVertexId : localVertex.idInGraph;
			const globalNamedExpression = this.namedExpressions.workbookNamedExpressionOrPlaceholder(expressionName);
			const { vertex: globalVertex, id: maybeGlobalVertexId } = this.dependencyGraph.fetchCellOrCreateEmpty(globalNamedExpression.address);
			const globalVertexId = maybeGlobalVertexId !== null && maybeGlobalVertexId !== void 0 ? maybeGlobalVertexId : globalVertex.idInGraph;
			for (const adjacentNode of this.dependencyGraph.graph.adjacentNodes(globalVertex)) if (adjacentNode instanceof ScalarFormulaVertex && adjacentNode.getAddress(this.lazilyTransformingAstService).sheet === sheetId) {
				const ast = adjacentNode.getFormula(this.lazilyTransformingAstService);
				const formulaAddress = adjacentNode.getAddress(this.lazilyTransformingAstService);
				const { dependencies } = this.parser.fetchCachedResultForAst(ast);
				for (const dependency of absolutizeDependencies(dependencies, formulaAddress)) if (dependency instanceof NamedExpressionDependency && dependency.name.toLowerCase() === namedExpression.displayName.toLowerCase()) {
					this.dependencyGraph.graph.removeEdgeIfExists(globalVertexId, adjacentNode);
					this.dependencyGraph.graph.addEdge(localVertexId, adjacentNode);
				}
			}
		}
		storeNamedExpressionInCell(address, expression) {
			const parsedCellContent = this.cellContentParser.parse(expression);
			if (parsedCellContent instanceof CellContent.Formula) {
				const parsingResult = this.parser.parse(parsedCellContent.formula, simpleCellAddress(-1, 0, 0));
				if (doesContainRelativeReferences(parsingResult.ast)) throw new NoRelativeAddressesAllowedError();
				const { ast, hasVolatileFunction, hasStructuralChangeFunction, dependencies } = parsingResult;
				this.dependencyGraph.setFormulaToCell(address, ast, absolutizeDependencies(dependencies, address), ArraySize.scalar(), hasVolatileFunction, hasStructuralChangeFunction);
			} else if (parsedCellContent instanceof CellContent.Empty) this.setCellEmpty(address);
			else this.setValueToCell({
				parsedValue: parsedCellContent.value,
				rawValue: expression
			}, address);
		}
		updateNamedExpressionsForMovedCells(sourceLeftCorner, width, height, destinationLeftCorner) {
			if (sourceLeftCorner.sheet === destinationLeftCorner.sheet) return [];
			const addedGlobalNamedExpressions = [];
			const targetRange = AbsoluteCellRange.spanFrom(destinationLeftCorner, width, height);
			for (const formulaAddress of targetRange.addresses(this.dependencyGraph)) {
				const vertex = this.addressMapping.getCell(formulaAddress, { throwIfCellNotExists: true });
				if (vertex instanceof ScalarFormulaVertex && formulaAddress.sheet !== sourceLeftCorner.sheet) {
					const ast = vertex.getFormula(this.lazilyTransformingAstService);
					const { dependencies } = this.parser.fetchCachedResultForAst(ast);
					addedGlobalNamedExpressions.push(...this.updateNamedExpressionsForTargetAddress(sourceLeftCorner.sheet, formulaAddress, dependencies));
				}
			}
			return addedGlobalNamedExpressions;
		}
		updateNamedExpressionsForTargetAddress(sourceSheet, targetAddress, dependencies) {
			if (sourceSheet === targetAddress.sheet) return [];
			const addedGlobalNamedExpressions = [];
			const vertex = this.addressMapping.getCellOrThrow(targetAddress);
			for (const namedExpressionDependency of absolutizeDependencies(dependencies, targetAddress)) {
				if (!(namedExpressionDependency instanceof NamedExpressionDependency)) continue;
				const expressionName = namedExpressionDependency.name;
				const sourceVertex = this.dependencyGraph.fetchNamedExpressionVertex(expressionName, sourceSheet).vertex;
				const targetScopeExpressionVertex = this.namedExpressions.isExpressionInScope(expressionName, targetAddress.sheet) ? this.dependencyGraph.fetchNamedExpressionVertex(expressionName, targetAddress.sheet).vertex : this.copyOrFetchGlobalNamedExpressionVertex(expressionName, sourceVertex, addedGlobalNamedExpressions);
				if (targetScopeExpressionVertex !== sourceVertex) {
					this.dependencyGraph.graph.removeEdgeIfExists(sourceVertex, vertex);
					this.dependencyGraph.graph.addEdge(targetScopeExpressionVertex, vertex);
				}
			}
			return addedGlobalNamedExpressions;
		}
		allocateNamedExpressionAddressSpace() {
			this.dependencyGraph.addressMapping.addSheetWithStrategy(NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS, new SparseStrategy(0, 0));
		}
		copyOrFetchGlobalNamedExpressionVertex(expressionName, sourceVertex, addedNamedExpressions) {
			let expression = this.namedExpressions.namedExpressionForScope(expressionName);
			if (expression === void 0) {
				expression = this.namedExpressions.addNamedExpression(expressionName);
				addedNamedExpressions.push(expression.normalizeExpressionName());
				if (sourceVertex instanceof ScalarFormulaVertex) {
					const { ast, hasVolatileFunction, hasStructuralChangeFunction, dependencies } = this.parser.fetchCachedResultForAst(sourceVertex.getFormula(this.lazilyTransformingAstService));
					this.dependencyGraph.setFormulaToCell(expression.address, ast, absolutizeDependencies(dependencies, expression.address), ArraySize.scalar(), hasVolatileFunction, hasStructuralChangeFunction);
				} else if (sourceVertex instanceof EmptyCellVertex) this.setCellEmpty(expression.address);
				else if (sourceVertex instanceof ValueCellVertex) this.setValueToCell(sourceVertex.getValues(), expression.address);
			}
			return this.dependencyGraph.fetchCellOrCreateEmpty(expression.address).vertex;
		}
		/**
		* Removes a cell value from the columnSearch index.
		* Ignores the non-computed formula vertices.
		*/
		removeCellValueFromColumnSearch(address) {
			if (this.isNotComputed(address)) return;
			const oldValue = this.dependencyGraph.getCellValue(address);
			this.columnSearch.remove(getRawValue(oldValue), address);
		}
		/**
		* Changes a cell value in the columnSearch index.
		* Ignores the non-computed formula vertices.
		*/
		changeCellValueInColumnSearch(address, newValue) {
			if (this.isNotComputed(address)) return;
			const oldValue = this.dependencyGraph.getCellValue(address);
			this.columnSearch.change(getRawValue(oldValue), getRawValue(newValue), address);
		}
		/**
		* Checks if the ScalarFormulaVertex or ArrayFormulaVertex at the given address is not computed.
		*/
		isNotComputed(address) {
			const vertex = this.dependencyGraph.getCell(address);
			if (!vertex) return false;
			return vertex instanceof FormulaVertex && !vertex.isComputed();
		}
	};
	function normalizeRemovedIndexes(indexes) {
		if (indexes.length <= 1) return indexes;
		const sorted = [...indexes].sort(([a], [b]) => a - b);
		const merged = sorted.reduce((acc, [startIndex, amount]) => {
			const previous = acc[acc.length - 1];
			const lastIndex = previous[0] + previous[1];
			if (startIndex <= lastIndex) previous[1] += Math.max(0, amount - (lastIndex - startIndex));
			else acc.push([startIndex, amount]);
			return acc;
		}, [sorted[0]]);
		let shift = 0;
		for (let i = 0; i < merged.length; ++i) {
			merged[i][0] -= shift;
			shift += merged[i][1];
		}
		return merged;
	}
	function normalizeAddedIndexes(indexes) {
		if (indexes.length <= 1) return indexes;
		const sorted = [...indexes].sort(([a], [b]) => a - b);
		const merged = sorted.reduce((acc, [startIndex, amount]) => {
			const previous = acc[acc.length - 1];
			if (startIndex === previous[0]) previous[1] = Math.max(previous[1], amount);
			else acc.push([startIndex, amount]);
			return acc;
		}, [sorted[0]]);
		let shift = 0;
		for (let i = 0; i < merged.length; ++i) {
			merged[i][0] += shift;
			shift += merged[i][1];
		}
		return merged;
	}
	function isPositiveInteger$1(n) {
		return Number.isInteger(n) && n > 0;
	}
	function isRowOrColumnRange(leftCorner, width, height) {
		return leftCorner.row === 0 && isPositiveInteger$1(width) && height === Number.POSITIVE_INFINITY || leftCorner.col === 0 && isPositiveInteger$1(height) && width === Number.POSITIVE_INFINITY;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/UndoRedo.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var BaseUndoEntry = class {};
	var RemoveRowsUndoEntry = class extends BaseUndoEntry {
		constructor(command, rowsRemovals) {
			super();
			this.command = command;
			this.rowsRemovals = rowsRemovals;
		}
		doUndo(undoRedo) {
			undoRedo.undoRemoveRows(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoRemoveRows(this);
		}
	};
	var MoveCellsUndoEntry = class extends BaseUndoEntry {
		constructor(sourceLeftCorner, width, height, destinationLeftCorner, overwrittenCellsData, addedGlobalNamedExpressions, version) {
			super();
			this.sourceLeftCorner = sourceLeftCorner;
			this.width = width;
			this.height = height;
			this.destinationLeftCorner = destinationLeftCorner;
			this.overwrittenCellsData = overwrittenCellsData;
			this.addedGlobalNamedExpressions = addedGlobalNamedExpressions;
			this.version = version;
		}
		doUndo(undoRedo) {
			undoRedo.undoMoveCells(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoMoveCells(this);
		}
	};
	var AddRowsUndoEntry = class extends BaseUndoEntry {
		constructor(command) {
			super();
			this.command = command;
		}
		doUndo(undoRedo) {
			undoRedo.undoAddRows(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoAddRows(this);
		}
	};
	var SetRowOrderUndoEntry = class extends BaseUndoEntry {
		constructor(sheetId, rowMapping, oldContent) {
			super();
			this.sheetId = sheetId;
			this.rowMapping = rowMapping;
			this.oldContent = oldContent;
		}
		doUndo(undoRedo) {
			undoRedo.undoSetRowOrder(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoSetRowOrder(this);
		}
	};
	var SetColumnOrderUndoEntry = class extends BaseUndoEntry {
		constructor(sheetId, columnMapping, oldContent) {
			super();
			this.sheetId = sheetId;
			this.columnMapping = columnMapping;
			this.oldContent = oldContent;
		}
		doUndo(undoRedo) {
			undoRedo.undoSetColumnOrder(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoSetColumnOrder(this);
		}
	};
	var SetSheetContentUndoEntry = class extends BaseUndoEntry {
		constructor(sheetId, oldSheetContent, newSheetContent) {
			super();
			this.sheetId = sheetId;
			this.oldSheetContent = oldSheetContent;
			this.newSheetContent = newSheetContent;
		}
		doUndo(undoRedo) {
			undoRedo.undoSetSheetContent(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoSetSheetContent(this);
		}
	};
	var MoveRowsUndoEntry = class extends BaseUndoEntry {
		constructor(sheet, startRow, numberOfRows, targetRow, version) {
			super();
			this.sheet = sheet;
			this.startRow = startRow;
			this.numberOfRows = numberOfRows;
			this.targetRow = targetRow;
			this.version = version;
			this.undoStart = this.startRow < this.targetRow ? this.targetRow - this.numberOfRows : this.targetRow;
			this.undoEnd = this.startRow > this.targetRow ? this.startRow + this.numberOfRows : this.startRow;
		}
		doUndo(undoRedo) {
			undoRedo.undoMoveRows(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoMoveRows(this);
		}
	};
	var MoveColumnsUndoEntry = class extends BaseUndoEntry {
		constructor(sheet, startColumn, numberOfColumns, targetColumn, version) {
			super();
			this.sheet = sheet;
			this.startColumn = startColumn;
			this.numberOfColumns = numberOfColumns;
			this.targetColumn = targetColumn;
			this.version = version;
			this.undoStart = this.startColumn < this.targetColumn ? this.targetColumn - this.numberOfColumns : this.targetColumn;
			this.undoEnd = this.startColumn > this.targetColumn ? this.startColumn + this.numberOfColumns : this.startColumn;
		}
		doUndo(undoRedo) {
			undoRedo.undoMoveColumns(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoMoveColumns(this);
		}
	};
	var AddColumnsUndoEntry = class extends BaseUndoEntry {
		constructor(command) {
			super();
			this.command = command;
		}
		doUndo(undoRedo) {
			undoRedo.undoAddColumns(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoAddColumns(this);
		}
	};
	var RemoveColumnsUndoEntry = class extends BaseUndoEntry {
		constructor(command, columnsRemovals) {
			super();
			this.command = command;
			this.columnsRemovals = columnsRemovals;
		}
		doUndo(undoRedo) {
			undoRedo.undoRemoveColumns(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoRemoveColumns(this);
		}
	};
	var AddSheetUndoEntry = class extends BaseUndoEntry {
		constructor(sheetName, sheetId) {
			super();
			this.sheetName = sheetName;
			this.sheetId = sheetId;
		}
		doUndo(undoRedo) {
			undoRedo.undoAddSheet(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoAddSheet(this);
		}
	};
	var RemoveSheetUndoEntry = class extends BaseUndoEntry {
		constructor(sheetName, sheetId, oldSheetContent, scopedNamedExpressions) {
			super();
			this.sheetName = sheetName;
			this.sheetId = sheetId;
			this.oldSheetContent = oldSheetContent;
			this.scopedNamedExpressions = scopedNamedExpressions;
		}
		doUndo(undoRedo) {
			undoRedo.undoRemoveSheet(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoRemoveSheet(this);
		}
	};
	/**
	* Undo entry for renaming a sheet.
	*
	* When renaming a sheet to a name that was previously referenced (but didn't exist),
	* a placeholder sheet gets merged into the renamed sheet. In this case:
	* - `version` contains the transformation version for restoring formulas during undo
	* - `mergedPlaceholderSheetId` contains the ID of the placeholder sheet that was merged
	*
	* When renaming to a name not previously referenced, both optional params are undefined.
	*/
	var RenameSheetUndoEntry = class extends BaseUndoEntry {
		constructor(sheetId, oldName, newName, version, mergedPlaceholderSheetId) {
			super();
			this.sheetId = sheetId;
			this.oldName = oldName;
			this.newName = newName;
			this.version = version;
			this.mergedPlaceholderSheetId = mergedPlaceholderSheetId;
		}
		doUndo(undoRedo) {
			undoRedo.undoRenameSheet(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoRenameSheet(this);
		}
	};
	var ClearSheetUndoEntry = class extends BaseUndoEntry {
		constructor(sheetId, oldSheetContent) {
			super();
			this.sheetId = sheetId;
			this.oldSheetContent = oldSheetContent;
		}
		doUndo(undoRedo) {
			undoRedo.undoClearSheet(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoClearSheet(this);
		}
	};
	var SetCellContentsUndoEntry = class extends BaseUndoEntry {
		constructor(cellContents) {
			super();
			this.cellContents = cellContents;
		}
		doUndo(undoRedo) {
			undoRedo.undoSetCellContents(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoSetCellContents(this);
		}
	};
	var PasteUndoEntry = class extends BaseUndoEntry {
		constructor(targetLeftCorner, oldContent, newContent, addedGlobalNamedExpressions) {
			super();
			this.targetLeftCorner = targetLeftCorner;
			this.oldContent = oldContent;
			this.newContent = newContent;
			this.addedGlobalNamedExpressions = addedGlobalNamedExpressions;
		}
		doUndo(undoRedo) {
			undoRedo.undoPaste(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoPaste(this);
		}
	};
	var AddNamedExpressionUndoEntry = class extends BaseUndoEntry {
		constructor(name, newContent, scope, options) {
			super();
			this.name = name;
			this.newContent = newContent;
			this.scope = scope;
			this.options = options;
		}
		doUndo(undoRedo) {
			undoRedo.undoAddNamedExpression(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoAddNamedExpression(this);
		}
	};
	var RemoveNamedExpressionUndoEntry = class extends BaseUndoEntry {
		constructor(namedExpression, content, scope) {
			super();
			this.namedExpression = namedExpression;
			this.content = content;
			this.scope = scope;
		}
		doUndo(undoRedo) {
			undoRedo.undoRemoveNamedExpression(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoRemoveNamedExpression(this);
		}
	};
	var ChangeNamedExpressionUndoEntry = class extends BaseUndoEntry {
		constructor(namedExpression, newContent, oldContent, scope, options) {
			super();
			this.namedExpression = namedExpression;
			this.newContent = newContent;
			this.oldContent = oldContent;
			this.scope = scope;
			this.options = options;
		}
		doUndo(undoRedo) {
			undoRedo.undoChangeNamedExpression(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoChangeNamedExpression(this);
		}
	};
	var BatchUndoEntry = class extends BaseUndoEntry {
		constructor() {
			super(...arguments);
			this.operations = [];
		}
		add(operation) {
			this.operations.push(operation);
		}
		*reversedOperations() {
			for (let i = this.operations.length - 1; i >= 0; i--) yield this.operations[i];
		}
		doUndo(undoRedo) {
			undoRedo.undoBatch(this);
		}
		doRedo(undoRedo) {
			undoRedo.redoBatch(this);
		}
	};
	var UndoRedo = class {
		constructor(config, operations) {
			this.operations = operations;
			this.oldData = /* @__PURE__ */ new Map();
			this.undoStack = [];
			this.redoStack = [];
			this.undoLimit = config.undoLimit;
		}
		saveOperation(operation) {
			if (this.batchUndoEntry !== void 0) this.batchUndoEntry.add(operation);
			else this.addUndoEntry(operation);
		}
		beginBatchMode() {
			this.batchUndoEntry = new BatchUndoEntry();
		}
		commitBatchMode() {
			if (this.batchUndoEntry === void 0) throw Error("Batch mode wasn't started");
			this.addUndoEntry(this.batchUndoEntry);
			this.batchUndoEntry = void 0;
		}
		storeDataForVersion(version, address, astHash) {
			if (!this.oldData.has(version)) this.oldData.set(version, []);
			this.oldData.get(version).push([address, astHash]);
		}
		clearRedoStack() {
			this.redoStack = [];
		}
		clearUndoStack() {
			this.undoStack = [];
		}
		isUndoStackEmpty() {
			return this.undoStack.length === 0;
		}
		isRedoStackEmpty() {
			return this.redoStack.length === 0;
		}
		undo() {
			const operation = this.undoStack.pop();
			if (!operation) throw Error("Attempted to undo without operation on stack");
			this.undoEntry(operation);
			this.redoStack.push(operation);
		}
		undoBatch(batchOperation) {
			for (const operation of batchOperation.reversedOperations()) this.undoEntry(operation);
		}
		undoRemoveRows(operation) {
			this.operations.forceApplyPostponedTransformations();
			const { command: { sheet }, rowsRemovals } = operation;
			for (let i = rowsRemovals.length - 1; i >= 0; --i) {
				const rowsRemoval = rowsRemovals[i];
				this.operations.addRows(new AddRowsCommand(sheet, [[rowsRemoval.rowFrom, rowsRemoval.rowCount]]));
				for (const { address, cellType } of rowsRemoval.removedCells) this.operations.restoreCell(address, cellType);
				this.restoreOldDataFromVersion(rowsRemoval.version - 1);
			}
		}
		undoRemoveColumns(operation) {
			this.operations.forceApplyPostponedTransformations();
			const { command: { sheet }, columnsRemovals } = operation;
			for (let i = columnsRemovals.length - 1; i >= 0; --i) {
				const columnsRemoval = columnsRemovals[i];
				this.operations.addColumns(new AddColumnsCommand(sheet, [[columnsRemoval.columnFrom, columnsRemoval.columnCount]]));
				for (const { address, cellType } of columnsRemoval.removedCells) this.operations.restoreCell(address, cellType);
				this.restoreOldDataFromVersion(columnsRemoval.version - 1);
			}
		}
		undoAddRows(operation) {
			const addedRowsSpans = operation.command.rowsSpans();
			for (let i = addedRowsSpans.length - 1; i >= 0; --i) {
				const addedRows = addedRowsSpans[i];
				this.operations.removeRows(new RemoveRowsCommand(operation.command.sheet, [[addedRows.rowStart, addedRows.numberOfRows]]));
			}
		}
		undoAddColumns(operation) {
			const addedColumnsSpans = operation.command.columnsSpans();
			for (let i = addedColumnsSpans.length - 1; i >= 0; --i) {
				const addedColumns = addedColumnsSpans[i];
				this.operations.removeColumns(new RemoveColumnsCommand(operation.command.sheet, [[addedColumns.columnStart, addedColumns.numberOfColumns]]));
			}
		}
		undoSetCellContents(operation) {
			for (const cellContentData of operation.cellContents) {
				const address = cellContentData.address;
				const [oldContentAddress, oldContent] = cellContentData.oldContent;
				if (!equalSimpleCellAddress(address, oldContentAddress)) this.operations.setCellEmpty(address);
				this.operations.restoreCell(oldContentAddress, oldContent);
			}
		}
		undoPaste(operation) {
			this.restoreOperationOldContent(operation.oldContent);
			for (const namedExpression of operation.addedGlobalNamedExpressions) this.operations.removeNamedExpression(namedExpression);
		}
		undoMoveRows(operation) {
			const { sheet } = operation;
			this.operations.moveRows(sheet, operation.undoStart, operation.numberOfRows, operation.undoEnd);
			this.restoreOldDataFromVersion(operation.version - 1);
		}
		undoMoveColumns(operation) {
			const { sheet } = operation;
			this.operations.moveColumns(sheet, operation.undoStart, operation.numberOfColumns, operation.undoEnd);
			this.restoreOldDataFromVersion(operation.version - 1);
		}
		undoMoveCells(operation) {
			this.operations.forceApplyPostponedTransformations();
			this.operations.moveCells(operation.destinationLeftCorner, operation.width, operation.height, operation.sourceLeftCorner);
			this.restoreOperationOldContent(operation.overwrittenCellsData);
			this.restoreOldDataFromVersion(operation.version - 1);
			for (const namedExpression of operation.addedGlobalNamedExpressions) this.operations.removeNamedExpression(namedExpression);
		}
		undoAddSheet(operation) {
			const { sheetName } = operation;
			this.operations.removeSheetByName(sheetName);
		}
		undoRemoveSheet(operation) {
			this.operations.forceApplyPostponedTransformations();
			const { oldSheetContent, sheetId, scopedNamedExpressions, sheetName } = operation;
			this.operations.addSheetWithId(sheetId, sheetName);
			for (let rowIndex = 0; rowIndex < oldSheetContent.length; rowIndex++) {
				const row = oldSheetContent[rowIndex];
				for (let col = 0; col < row.length; col++) {
					const cellType = row[col];
					const address = simpleCellAddress(sheetId, col, rowIndex);
					this.operations.restoreCell(address, cellType);
				}
			}
			for (const [namedexpression, content] of scopedNamedExpressions) this.operations.restoreNamedExpression(namedexpression, content, sheetId);
		}
		undoRenameSheet(operation) {
			this.operations.forceApplyPostponedTransformations();
			this.operations.renameSheet(operation.sheetId, operation.oldName);
			if (operation.mergedPlaceholderSheetId !== void 0 && operation.version !== void 0) {
				this.operations.addPlaceholderSheetWithId(operation.mergedPlaceholderSheetId, operation.newName);
				this.restoreOldDataFromVersion(operation.version - 1);
			}
		}
		undoClearSheet(operation) {
			const { oldSheetContent, sheetId } = operation;
			for (let rowIndex = 0; rowIndex < oldSheetContent.length; rowIndex++) {
				const row = oldSheetContent[rowIndex];
				for (let col = 0; col < row.length; col++) {
					const cellType = row[col];
					const address = simpleCellAddress(sheetId, col, rowIndex);
					this.operations.restoreCell(address, cellType);
				}
			}
		}
		undoSetSheetContent(operation) {
			const { oldSheetContent, sheetId } = operation;
			this.operations.clearSheet(sheetId);
			for (let rowIndex = 0; rowIndex < oldSheetContent.length; rowIndex++) {
				const row = oldSheetContent[rowIndex];
				for (let col = 0; col < row.length; col++) {
					const cellType = row[col];
					const address = simpleCellAddress(sheetId, col, rowIndex);
					this.operations.restoreCell(address, cellType);
				}
			}
		}
		undoAddNamedExpression(operation) {
			this.operations.removeNamedExpression(operation.name, operation.scope);
		}
		undoRemoveNamedExpression(operation) {
			this.operations.restoreNamedExpression(operation.namedExpression, operation.content, operation.scope);
		}
		undoChangeNamedExpression(operation) {
			this.operations.restoreNamedExpression(operation.namedExpression, operation.oldContent, operation.scope);
		}
		undoSetRowOrder(operation) {
			this.restoreOperationOldContent(operation.oldContent);
		}
		undoSetColumnOrder(operation) {
			this.restoreOperationOldContent(operation.oldContent);
		}
		redo() {
			const operation = this.redoStack.pop();
			if (!operation) throw Error("Attempted to redo without operation on stack");
			this.redoEntry(operation);
			this.undoStack.push(operation);
		}
		redoBatch(batchOperation) {
			for (const operation of batchOperation.operations) this.redoEntry(operation);
		}
		redoRemoveRows(operation) {
			this.operations.removeRows(operation.command);
		}
		redoMoveCells(operation) {
			this.operations.moveCells(operation.sourceLeftCorner, operation.width, operation.height, operation.destinationLeftCorner);
		}
		redoRemoveColumns(operation) {
			this.operations.removeColumns(operation.command);
		}
		redoPaste(operation) {
			const { targetLeftCorner, newContent } = operation;
			const height = newContent.length;
			const width = newContent[0].length;
			for (let y = 0; y < height; ++y) for (let x = 0; x < width; ++x) {
				const address = simpleCellAddress(targetLeftCorner.sheet, targetLeftCorner.col + x, targetLeftCorner.row + y);
				this.operations.restoreCell(address, newContent[y][x]);
			}
		}
		redoSetCellContents(operation) {
			for (const cellContentData of operation.cellContents) this.operations.setCellContent(cellContentData.address, cellContentData.newContent);
		}
		redoAddRows(operation) {
			this.operations.addRows(operation.command);
		}
		redoAddColumns(operation) {
			this.operations.addColumns(operation.command);
		}
		redoRemoveSheet(operation) {
			this.operations.removeSheetByName(operation.sheetName);
		}
		redoAddSheet(operation) {
			this.operations.addSheetWithId(operation.sheetId, operation.sheetName);
		}
		redoRenameSheet(operation) {
			this.operations.renameSheet(operation.sheetId, operation.newName);
		}
		redoMoveRows(operation) {
			this.operations.moveRows(operation.sheet, operation.startRow, operation.numberOfRows, operation.targetRow);
		}
		redoMoveColumns(operation) {
			this.operations.moveColumns(operation.sheet, operation.startColumn, operation.numberOfColumns, operation.targetColumn);
		}
		redoClearSheet(operation) {
			this.operations.clearSheet(operation.sheetId);
		}
		redoSetSheetContent(operation) {
			const { sheetId, newSheetContent } = operation;
			this.operations.setSheetContent(sheetId, newSheetContent);
		}
		redoAddNamedExpression(operation) {
			this.operations.addNamedExpression(operation.name, operation.newContent, operation.scope, operation.options);
		}
		redoRemoveNamedExpression(operation) {
			this.operations.removeNamedExpression(operation.namedExpression.displayName, operation.scope);
		}
		redoChangeNamedExpression(operation) {
			this.operations.changeNamedExpressionExpression(operation.namedExpression.displayName, operation.newContent, operation.scope, operation.options);
		}
		redoSetRowOrder(operation) {
			this.operations.setRowOrder(operation.sheetId, operation.rowMapping);
		}
		redoSetColumnOrder(operation) {
			this.operations.setColumnOrder(operation.sheetId, operation.columnMapping);
		}
		addUndoEntry(operation) {
			this.undoStack.push(operation);
			this.undoStack.splice(0, Math.max(0, this.undoStack.length - this.undoLimit));
		}
		undoEntry(operation) {
			operation.doUndo(this);
		}
		restoreOperationOldContent(oldContent) {
			for (const [address, clipboardCell] of oldContent) this.operations.restoreCell(address, clipboardCell);
		}
		redoEntry(operation) {
			operation.doRedo(this);
		}
		restoreOldDataFromVersion(version) {
			const oldDataToRestore = this.oldData.get(version) || [];
			for (const entryToRestore of oldDataToRestore) {
				const [address, hash] = entryToRestore;
				this.operations.setFormulaToCellFromCache(hash, address);
			}
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/CrudOperations.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CrudOperations = class {
		constructor(config, operations, undoRedo, clipboardOperations, dependencyGraph, columnSearch, parser, cellContentParser, lazilyTransformingAstService, namedExpressions) {
			this.operations = operations;
			this.undoRedo = undoRedo;
			this.clipboardOperations = clipboardOperations;
			this.dependencyGraph = dependencyGraph;
			this.columnSearch = columnSearch;
			this.parser = parser;
			this.cellContentParser = cellContentParser;
			this.lazilyTransformingAstService = lazilyTransformingAstService;
			this.namedExpressions = namedExpressions;
			this.maxRows = config.maxRows;
			this.maxColumns = config.maxColumns;
		}
		get sheetMapping() {
			return this.dependencyGraph.sheetMapping;
		}
		addRows(sheet, ...indexes) {
			const addRowsCommand = new AddRowsCommand(sheet, indexes);
			this.ensureItIsPossibleToAddRows(sheet, ...indexes);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			this.operations.addRows(addRowsCommand);
			this.undoRedo.saveOperation(new AddRowsUndoEntry(addRowsCommand));
		}
		removeRows(sheet, ...indexes) {
			const removeRowsCommand = new RemoveRowsCommand(sheet, indexes);
			this.ensureItIsPossibleToRemoveRows(sheet, ...indexes);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const rowsRemovals = this.operations.removeRows(removeRowsCommand);
			this.undoRedo.saveOperation(new RemoveRowsUndoEntry(removeRowsCommand, rowsRemovals));
		}
		addColumns(sheet, ...indexes) {
			const addColumnsCommand = new AddColumnsCommand(sheet, indexes);
			this.ensureItIsPossibleToAddColumns(sheet, ...indexes);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			this.operations.addColumns(addColumnsCommand);
			this.undoRedo.saveOperation(new AddColumnsUndoEntry(addColumnsCommand));
		}
		removeColumns(sheet, ...indexes) {
			const removeColumnsCommand = new RemoveColumnsCommand(sheet, indexes);
			this.ensureItIsPossibleToRemoveColumns(sheet, ...indexes);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const columnsRemovals = this.operations.removeColumns(removeColumnsCommand);
			this.undoRedo.saveOperation(new RemoveColumnsUndoEntry(removeColumnsCommand, columnsRemovals));
		}
		moveCells(sourceLeftCorner, width, height, destinationLeftCorner) {
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const { version, overwrittenCellsData, addedGlobalNamedExpressions } = this.operations.moveCells(sourceLeftCorner, width, height, destinationLeftCorner);
			this.undoRedo.saveOperation(new MoveCellsUndoEntry(sourceLeftCorner, width, height, destinationLeftCorner, overwrittenCellsData, addedGlobalNamedExpressions, version));
		}
		moveRows(sheet, startRow, numberOfRows, targetRow) {
			this.ensureItIsPossibleToMoveRows(sheet, startRow, numberOfRows, targetRow);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const version = this.operations.moveRows(sheet, startRow, numberOfRows, targetRow);
			this.undoRedo.saveOperation(new MoveRowsUndoEntry(sheet, startRow, numberOfRows, targetRow, version));
		}
		moveColumns(sheet, startColumn, numberOfColumns, targetColumn) {
			this.ensureItIsPossibleToMoveColumns(sheet, startColumn, numberOfColumns, targetColumn);
			this.undoRedo.clearRedoStack();
			const version = this.operations.moveColumns(sheet, startColumn, numberOfColumns, targetColumn);
			this.undoRedo.saveOperation(new MoveColumnsUndoEntry(sheet, startColumn, numberOfColumns, targetColumn, version));
		}
		cut(sourceLeftCorner, width, height) {
			this.clipboardOperations.cut(sourceLeftCorner, width, height);
		}
		ensureItIsPossibleToCopy(sourceLeftCorner, width, height) {
			if (!isPositiveInteger(width)) throw new InvalidArgumentsError("width to be positive integer.");
			if (!isPositiveInteger(height)) throw new InvalidArgumentsError("height to be positive integer.");
		}
		copy(sourceLeftCorner, width, height) {
			this.ensureItIsPossibleToCopy(sourceLeftCorner, width, height);
			this.clipboardOperations.copy(sourceLeftCorner, width, height);
		}
		paste(targetLeftCorner) {
			const clipboard = this.clipboardOperations.clipboard;
			if (clipboard === void 0) throw new NothingToPasteError();
			else if (this.clipboardOperations.isCutClipboard()) this.moveCells(clipboard.sourceLeftCorner, clipboard.width, clipboard.height, targetLeftCorner);
			else if (this.clipboardOperations.isCopyClipboard()) {
				this.clipboardOperations.ensureItIsPossibleToCopyPaste(targetLeftCorner);
				const targetRange = AbsoluteCellRange.spanFrom(targetLeftCorner, clipboard.width, clipboard.height);
				const oldContent = this.operations.getRangeClipboardCells(targetRange);
				this.undoRedo.clearRedoStack();
				const addedGlobalNamedExpressions = this.operations.restoreClipboardCells(clipboard.sourceLeftCorner.sheet, clipboard.getContent(targetLeftCorner));
				this.undoRedo.saveOperation(new PasteUndoEntry(targetLeftCorner, oldContent, clipboard.content, addedGlobalNamedExpressions));
			}
		}
		beginUndoRedoBatchMode() {
			this.undoRedo.beginBatchMode();
		}
		commitUndoRedoBatchMode() {
			this.undoRedo.commitBatchMode();
		}
		isClipboardEmpty() {
			return this.clipboardOperations.clipboard === void 0;
		}
		clearClipboard() {
			this.clipboardOperations.clear();
		}
		addSheet(name) {
			if (name !== void 0) this.ensureItIsPossibleToAddSheet(name);
			this.undoRedo.clearRedoStack();
			const { sheetName, sheetId } = this.operations.addSheet(name);
			this.undoRedo.saveOperation(new AddSheetUndoEntry(sheetName, sheetId));
			return sheetName;
		}
		removeSheet(sheetId) {
			this.ensureScopeIdIsValid(sheetId);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const originalName = this.sheetMapping.getSheetNameOrThrowError(sheetId);
			const oldSheetContent = this.operations.getSheetClipboardCells(sheetId);
			const scopedNamedExpressions = this.operations.removeSheet(sheetId);
			this.undoRedo.saveOperation(new RemoveSheetUndoEntry(originalName, sheetId, oldSheetContent, scopedNamedExpressions));
		}
		renameSheet(sheetId, newName) {
			this.ensureItIsPossibleToRenameSheet(sheetId, newName);
			const { previousDisplayName, version, mergedPlaceholderSheetId } = this.operations.renameSheet(sheetId, newName);
			if (previousDisplayName !== void 0) {
				this.undoRedo.clearRedoStack();
				this.undoRedo.saveOperation(new RenameSheetUndoEntry(sheetId, previousDisplayName, newName, version, mergedPlaceholderSheetId));
			}
			return previousDisplayName;
		}
		clearSheet(sheetId) {
			this.ensureScopeIdIsValid(sheetId);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const oldSheetContent = this.operations.getSheetClipboardCells(sheetId);
			this.operations.clearSheet(sheetId);
			this.undoRedo.saveOperation(new ClearSheetUndoEntry(sheetId, oldSheetContent));
		}
		setCellContents(topLeftCornerAddress, cellContents) {
			if (!(cellContents instanceof Array)) cellContents = [[cellContents]];
			else for (let i = 0; i < cellContents.length; i++) if (!(cellContents[i] instanceof Array)) throw new InvalidArgumentsError("an array of arrays or a raw cell value.");
			this.ensureItIsPossibleToChangeCellContents(topLeftCornerAddress, cellContents);
			this.undoRedo.clearRedoStack();
			const oldContents = [];
			for (let i = 0; i < cellContents.length; i++) for (let j = 0; j < cellContents[i].length; j++) {
				const address = {
					sheet: topLeftCornerAddress.sheet,
					row: topLeftCornerAddress.row + i,
					col: topLeftCornerAddress.col + j
				};
				const newContent = cellContents[i][j];
				this.clipboardOperations.abortCut();
				const oldContent = this.operations.setCellContent(address, newContent);
				oldContents.push({
					address,
					newContent,
					oldContent
				});
			}
			this.undoRedo.saveOperation(new SetCellContentsUndoEntry(oldContents));
		}
		setSheetContent(sheetId, values) {
			this.ensureScopeIdIsValid(sheetId);
			this.ensureItIsPossibleToChangeSheetContents(sheetId, values);
			validateAsSheet(values);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const oldSheetContent = this.operations.getSheetClipboardCells(sheetId);
			this.operations.setSheetContent(sheetId, values);
			this.undoRedo.saveOperation(new SetSheetContentUndoEntry(sheetId, oldSheetContent, values));
		}
		setRowOrder(sheetId, rowMapping) {
			this.validateSwapRowIndexes(sheetId, rowMapping);
			this.testRowOrderForArrays(sheetId, rowMapping);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const oldContent = this.operations.setRowOrder(sheetId, rowMapping);
			this.undoRedo.saveOperation(new SetRowOrderUndoEntry(sheetId, rowMapping, oldContent));
		}
		validateSwapRowIndexes(sheetId, rowMapping) {
			if (!this.sheetMapping.hasSheetWithId(sheetId)) throw new NoSheetWithIdError(sheetId);
			this.validateRowOrColumnMapping(sheetId, rowMapping, "row");
		}
		testColumnOrderForArrays(sheetId, columnMapping) {
			for (const [source, target] of columnMapping) if (source !== target) {
				const rowRange = AbsoluteCellRange.spanFrom({
					sheet: sheetId,
					col: source,
					row: 0
				}, 1, Infinity);
				if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(rowRange)) throw new SourceLocationHasArrayError();
			}
		}
		setColumnOrder(sheetId, columnMapping) {
			this.validateSwapColumnIndexes(sheetId, columnMapping);
			this.testColumnOrderForArrays(sheetId, columnMapping);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			const oldContent = this.operations.setColumnOrder(sheetId, columnMapping);
			this.undoRedo.saveOperation(new SetColumnOrderUndoEntry(sheetId, columnMapping, oldContent));
		}
		validateSwapColumnIndexes(sheetId, columnMapping) {
			if (!this.sheetMapping.hasSheetWithId(sheetId)) throw new NoSheetWithIdError(sheetId);
			this.validateRowOrColumnMapping(sheetId, columnMapping, "column");
		}
		testRowOrderForArrays(sheetId, rowMapping) {
			for (const [source, target] of rowMapping) if (source !== target) {
				const rowRange = AbsoluteCellRange.spanFrom({
					sheet: sheetId,
					col: 0,
					row: source
				}, Infinity, 1);
				if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(rowRange)) throw new SourceLocationHasArrayError();
			}
		}
		mappingFromOrder(sheetId, newOrder, rowOrColumn) {
			if (!this.sheetMapping.hasSheetWithId(sheetId)) throw new NoSheetWithIdError(sheetId);
			const limit = rowOrColumn === "row" ? this.dependencyGraph.getSheetHeight(sheetId) : this.dependencyGraph.getSheetWidth(sheetId);
			if (newOrder.length !== limit) throw new InvalidArgumentsError(`number of ${rowOrColumn}s provided to be sheet ${rowOrColumn === "row" ? "height" : "width"}.`);
			const ret = [];
			for (let i = 0; i < limit; i++) if (newOrder[i] !== i) ret.push([i, newOrder[i]]);
			return ret;
		}
		undo() {
			if (this.undoRedo.isUndoStackEmpty()) throw new NoOperationToUndoError();
			this.clipboardOperations.abortCut();
			this.undoRedo.undo();
		}
		redo() {
			if (this.undoRedo.isRedoStackEmpty()) throw new NoOperationToRedoError();
			this.clipboardOperations.abortCut();
			this.undoRedo.redo();
		}
		addNamedExpression(expressionName, expression, sheetId, options) {
			this.ensureItIsPossibleToAddNamedExpression(expressionName, expression, sheetId);
			this.operations.addNamedExpression(expressionName, expression, sheetId, options);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			this.undoRedo.saveOperation(new AddNamedExpressionUndoEntry(expressionName, expression, sheetId, options));
		}
		changeNamedExpressionExpression(expressionName, sheetId, newExpression, options) {
			this.ensureItIsPossibleToChangeNamedExpression(expressionName, newExpression, sheetId);
			const [oldNamedExpression, content] = this.operations.changeNamedExpressionExpression(expressionName, newExpression, sheetId, options);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			this.undoRedo.saveOperation(new ChangeNamedExpressionUndoEntry(oldNamedExpression, newExpression, content, sheetId, options));
		}
		removeNamedExpression(expressionName, sheetId) {
			this.ensureScopeIdIsValid(sheetId);
			const [namedExpression, content] = this.operations.removeNamedExpression(expressionName, sheetId);
			this.undoRedo.clearRedoStack();
			this.clipboardOperations.abortCut();
			this.undoRedo.saveOperation(new RemoveNamedExpressionUndoEntry(namedExpression, content, sheetId));
			return namedExpression;
		}
		ensureItIsPossibleToAddNamedExpression(expressionName, expression, sheetId) {
			this.ensureScopeIdIsValid(sheetId);
			this.ensureNamedExpressionNameIsValid(expressionName, sheetId);
			this.ensureNamedExpressionIsValid(expression);
		}
		ensureItIsPossibleToChangeNamedExpression(expressionName, expression, sheetId) {
			this.ensureScopeIdIsValid(sheetId);
			if (this.namedExpressions.namedExpressionForScope(expressionName, sheetId) === void 0) throw new NamedExpressionDoesNotExistError(expressionName);
			this.ensureNamedExpressionIsValid(expression);
		}
		isItPossibleToRemoveNamedExpression(expressionName, sheetId) {
			this.ensureScopeIdIsValid(sheetId);
			if (this.namedExpressions.namedExpressionForScope(expressionName, sheetId) === void 0) throw new NamedExpressionDoesNotExistError(expressionName);
		}
		ensureItIsPossibleToAddRows(sheet, ...indexes) {
			if (!this.sheetMapping.hasSheetWithId(sheet)) throw new NoSheetWithIdError(sheet);
			if (this.dependencyGraph.getSheetHeight(sheet) + indexes.map((index) => index[1]).reduce((a, b) => a + b, 0) > this.maxRows) throw new SheetSizeLimitExceededError();
			for (const [row, numberOfRowsToAdd] of indexes) if (!isNonnegativeInteger(row) || !isPositiveInteger(numberOfRowsToAdd)) throw new InvalidArgumentsError("row number to be nonnegative and number of rows to add to be positive.");
		}
		ensureItIsPossibleToRemoveRows(sheet, ...indexes) {
			for (const [rowStart, numberOfRows] of indexes) {
				const rowEnd = rowStart + numberOfRows - 1;
				if (!isNonnegativeInteger(rowStart) || !isNonnegativeInteger(rowEnd)) throw new InvalidArgumentsError("starting and ending row to be nonnegative.");
				if (rowEnd < rowStart) throw new InvalidArgumentsError("starting row to be smaller than the ending row.");
				if (!this.sheetMapping.hasSheetWithId(sheet)) throw new NoSheetWithIdError(sheet);
			}
		}
		ensureItIsPossibleToAddColumns(sheet, ...indexes) {
			if (!this.sheetMapping.hasSheetWithId(sheet)) throw new NoSheetWithIdError(sheet);
			if (this.dependencyGraph.getSheetWidth(sheet) + indexes.map((index) => index[1]).reduce((a, b) => a + b, 0) > this.maxColumns) throw new SheetSizeLimitExceededError();
			for (const [column, numberOfColumnsToAdd] of indexes) if (!isNonnegativeInteger(column) || !isPositiveInteger(numberOfColumnsToAdd)) throw new InvalidArgumentsError("column number to be nonnegative and number of columns to add to be positive.");
		}
		ensureItIsPossibleToRemoveColumns(sheet, ...indexes) {
			for (const [columnStart, numberOfColumns] of indexes) {
				const columnEnd = columnStart + numberOfColumns - 1;
				if (!isNonnegativeInteger(columnStart) || !isNonnegativeInteger(columnEnd)) throw new InvalidArgumentsError("starting and ending column to be nonnegative.");
				if (columnEnd < columnStart) throw new InvalidArgumentsError("starting column to be smaller than the ending column.");
				if (!this.sheetMapping.hasSheetWithId(sheet)) throw new NoSheetWithIdError(sheet);
			}
		}
		ensureItIsPossibleToMoveRows(sheet, startRow, numberOfRows, targetRow) {
			this.ensureItIsPossibleToAddRows(sheet, [targetRow, numberOfRows]);
			const sourceStart = simpleCellAddress(sheet, 0, startRow);
			const targetStart = simpleCellAddress(sheet, 0, targetRow);
			if (!this.sheetMapping.hasSheetWithId(sheet) || isColOrRowInvalid(sourceStart) || isColOrRowInvalid(targetStart) || !isPositiveInteger(numberOfRows) || targetRow <= startRow + numberOfRows && targetRow >= startRow) throw new InvalidArgumentsError("a valid range of rows to move.");
			const width = this.dependencyGraph.getSheetWidth(sheet);
			const sourceRange = AbsoluteCellRange.spanFrom(sourceStart, width, numberOfRows);
			if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(sourceRange)) throw new SourceLocationHasArrayError();
			if (targetRow > 0 && this.dependencyGraph.arrayMapping.isFormulaArrayInAllRows(RowsSpan.fromNumberOfRows(sheet, targetRow - 1, 2))) throw new TargetLocationHasArrayError();
		}
		ensureItIsPossibleToMoveColumns(sheet, startColumn, numberOfColumns, targetColumn) {
			this.ensureItIsPossibleToAddColumns(sheet, [targetColumn, numberOfColumns]);
			const sourceStart = simpleCellAddress(sheet, startColumn, 0);
			const targetStart = simpleCellAddress(sheet, targetColumn, 0);
			if (!this.sheetMapping.hasSheetWithId(sheet) || isColOrRowInvalid(sourceStart) || isColOrRowInvalid(targetStart) || !isPositiveInteger(numberOfColumns) || targetColumn <= startColumn + numberOfColumns && targetColumn >= startColumn) throw new InvalidArgumentsError("a valid range of columns to move.");
			const sheetHeight = this.dependencyGraph.getSheetHeight(sheet);
			const sourceRange = AbsoluteCellRange.spanFrom(sourceStart, numberOfColumns, sheetHeight);
			if (this.dependencyGraph.arrayMapping.isFormulaArrayInRange(sourceRange)) throw new SourceLocationHasArrayError();
			if (targetColumn > 0 && this.dependencyGraph.arrayMapping.isFormulaArrayInAllColumns(ColumnsSpan.fromNumberOfColumns(sheet, targetColumn - 1, 2))) throw new TargetLocationHasArrayError();
		}
		ensureItIsPossibleToAddSheet(name) {
			if (this.sheetMapping.hasSheetWithName(name)) throw new SheetNameAlreadyTakenError(name);
		}
		ensureItIsPossibleToRenameSheet(sheetId, name) {
			if (!this.sheetMapping.hasSheetWithId(sheetId)) throw new NoSheetWithIdError(sheetId);
			const existingSheetId = this.sheetMapping.getSheetId(name);
			if (existingSheetId !== void 0 && existingSheetId !== sheetId) throw new SheetNameAlreadyTakenError(name);
		}
		ensureItIsPossibleToChangeContent(address) {
			if (isColOrRowInvalid(address)) throw new InvalidAddressError(address);
			if (!this.sheetMapping.hasSheetWithId(address.sheet)) throw new NoSheetWithIdError(address.sheet);
		}
		ensureItIsPossibleToChangeCellContents(inputAddress, content) {
			const boundaries = findBoundaries(content);
			const targetRange = AbsoluteCellRange.spanFrom(inputAddress, boundaries.width, boundaries.height);
			this.ensureRangeInSizeLimits(targetRange);
			for (const address of targetRange.addresses(this.dependencyGraph)) this.ensureItIsPossibleToChangeContent(address);
		}
		ensureItIsPossibleToChangeSheetContents(sheetId, content) {
			const boundaries = findBoundaries(content);
			const targetRange = AbsoluteCellRange.spanFrom(simpleCellAddress(sheetId, 0, 0), boundaries.width, boundaries.height);
			this.ensureRangeInSizeLimits(targetRange);
		}
		ensureRangeInSizeLimits(range) {
			if (range.exceedsSheetSizeLimits(this.maxColumns, this.maxRows)) throw new SheetSizeLimitExceededError();
		}
		isThereSomethingToUndo() {
			return !this.undoRedo.isUndoStackEmpty();
		}
		isThereSomethingToRedo() {
			return !this.undoRedo.isRedoStackEmpty();
		}
		getAndClearContentChanges() {
			return this.operations.getAndClearContentChanges();
		}
		ensureScopeIdIsValid(scopeId) {
			if (scopeId !== void 0 && !this.sheetMapping.hasSheetWithId(scopeId)) throw new NoSheetWithIdError(scopeId);
		}
		validateRowOrColumnMapping(sheetId, rowMapping, rowOrColumn) {
			const limit = rowOrColumn === "row" ? this.dependencyGraph.getSheetHeight(sheetId) : this.dependencyGraph.getSheetWidth(sheetId);
			const sources = rowMapping.map(([a, _]) => a).sort((a, b) => a - b);
			const targets = rowMapping.map(([_, b]) => b).sort((a, b) => a - b);
			for (let i = 0; i < sources.length; i++) {
				if (!isNonnegativeInteger(sources[i]) || sources[i] >= limit) throw new InvalidArgumentsError(`${rowOrColumn} numbers to be nonnegative integers and less than sheet ${rowOrColumn === "row" ? "height" : "width"}.`);
				if (sources[i] === sources[i + 1]) throw new InvalidArgumentsError(`source ${rowOrColumn} numbers to be unique.`);
				if (sources[i] !== targets[i]) throw new InvalidArgumentsError(`target ${rowOrColumn} numbers to be permutation of source ${rowOrColumn} numbers.`);
			}
		}
		ensureNamedExpressionNameIsValid(expressionName, sheetId) {
			if (!this.namedExpressions.isNameValid(expressionName)) throw new NamedExpressionNameIsInvalidError(expressionName);
			if (!this.namedExpressions.isNameAvailable(expressionName, sheetId)) throw new NamedExpressionNameIsAlreadyTakenError(expressionName);
		}
		ensureNamedExpressionIsValid(expression) {
			const parsedExpression = this.cellContentParser.parse(expression);
			if (parsedExpression instanceof CellContent.Formula) {
				if (doesContainRelativeReferences(this.parser.parse(parsedExpression.formula, simpleCellAddress(-1, 0, 0)).ast)) throw new NoRelativeAddressesAllowedError();
			}
		}
	};
	function isPositiveInteger(x) {
		return Number.isInteger(x) && x > 0;
	}
	function isNonnegativeInteger(x) {
		return Number.isInteger(x) && x >= 0;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/Evaluator.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var Evaluator = class {
		constructor(config, stats, interpreter, lazilyTransformingAstService, dependencyGraph, columnSearch) {
			this.config = config;
			this.stats = stats;
			this.interpreter = interpreter;
			this.lazilyTransformingAstService = lazilyTransformingAstService;
			this.dependencyGraph = dependencyGraph;
			this.columnSearch = columnSearch;
		}
		run() {
			this.stats.start(StatType.TOP_SORT);
			const { sorted, cycled } = this.dependencyGraph.topSortWithScc();
			this.stats.end(StatType.TOP_SORT);
			this.stats.measure(StatType.EVALUATION, () => {
				this.recomputeFormulas(cycled, sorted);
			});
		}
		partialRun(vertices) {
			const changes = ContentChanges.empty();
			this.stats.measure(StatType.EVALUATION, () => {
				this.dependencyGraph.graph.getTopSortedWithSccSubgraphFrom(vertices, (vertex) => this.recomputeVertex(vertex, changes), (vertex) => this.processVertexOnCycle(vertex, changes));
			});
			return changes;
		}
		runAndForget(ast, address, dependencies) {
			const tmpRanges = [];
			for (const dep of absolutizeDependencies(dependencies, address)) if (dep instanceof AbsoluteCellRange) {
				const range = dep;
				if (this.dependencyGraph.getRange(range.start, range.end) === void 0) {
					const rangeVertex = new RangeVertex(range);
					this.dependencyGraph.rangeMapping.addOrUpdateVertex(rangeVertex);
					tmpRanges.push(rangeVertex);
				}
			}
			const ret = this.evaluateAstToCellValue(ast, new InterpreterState(address, this.config.useArrayArithmetic));
			tmpRanges.forEach((rangeVertex) => {
				this.dependencyGraph.rangeMapping.removeVertexIfExists(rangeVertex);
			});
			return ret;
		}
		/**
		* Recalculates the value of a single vertex assuming its dependencies have already been recalculated
		*/
		recomputeVertex(vertex, changes) {
			if (vertex instanceof FormulaVertex) {
				const currentValue = vertex.isComputed() ? vertex.getCellValue() : void 0;
				const newCellValue = this.recomputeFormulaVertexValue(vertex);
				if (newCellValue !== currentValue) {
					const address = vertex.getAddress(this.lazilyTransformingAstService);
					changes.addChange(newCellValue, address);
					this.columnSearch.change(getRawValue(currentValue), getRawValue(newCellValue), address);
					return true;
				}
				return false;
			} else if (vertex instanceof RangeVertex) {
				vertex.clearCache();
				return true;
			} else return true;
		}
		/**
		* Processes a vertex that is part of a cycle in dependency graph
		*/
		processVertexOnCycle(vertex, changes) {
			if (vertex instanceof RangeVertex) vertex.clearCache();
			else if (vertex instanceof FormulaVertex) {
				const address = vertex.getAddress(this.lazilyTransformingAstService);
				this.columnSearch.remove(getRawValue(vertex.valueOrUndef()), address);
				const error = new CellError(ErrorType.CYCLE, void 0, vertex);
				vertex.setCellValue(error);
				changes.addChange(error, address);
			}
		}
		/**
		* Recalculates formulas in the topological sort order
		*/
		recomputeFormulas(cycled, sorted) {
			cycled.forEach((vertex) => {
				if (vertex instanceof FormulaVertex) vertex.setCellValue(new CellError(ErrorType.CYCLE, void 0, vertex));
			});
			sorted.forEach((vertex) => {
				if (vertex instanceof FormulaVertex) {
					const newCellValue = this.recomputeFormulaVertexValue(vertex);
					const address = vertex.getAddress(this.lazilyTransformingAstService);
					this.columnSearch.add(getRawValue(newCellValue), address);
				} else if (vertex instanceof RangeVertex) vertex.clearCache();
			});
		}
		recomputeFormulaVertexValue(vertex) {
			const address = vertex.getAddress(this.lazilyTransformingAstService);
			if (vertex instanceof ArrayFormulaVertex && (vertex.array.size.isRef || !this.dependencyGraph.isThereSpaceForArray(vertex))) return vertex.setNoSpace();
			else {
				const formula = vertex.getFormula(this.lazilyTransformingAstService);
				const newCellValue = this.evaluateAstToCellValue(formula, new InterpreterState(address, this.config.useArrayArithmetic, vertex));
				return vertex.setCellValue(newCellValue);
			}
		}
		evaluateAstToCellValue(ast, state) {
			const interpreterValue = this.interpreter.evaluateAst(ast, state);
			if (interpreterValue instanceof SimpleRangeValue) return interpreterValue;
			else if (interpreterValue === EmptyValue && this.config.evaluateNullToZero) return 0;
			else return interpreterValue;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Exporter.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* A list of cells which values changed after the operation, their absolute addresses and new values.
	*/
	var ExportedCellChange = class {
		constructor(address, newValue) {
			this.address = address;
			this.newValue = newValue;
		}
		get col() {
			return this.address.col;
		}
		get row() {
			return this.address.row;
		}
		get sheet() {
			return this.address.sheet;
		}
		get value() {
			return this.newValue;
		}
	};
	var ExportedNamedExpressionChange = class {
		constructor(name, newValue) {
			this.name = name;
			this.newValue = newValue;
		}
	};
	var Exporter = class {
		constructor(config, namedExpressions, sheetMapping, lazilyTransformingService) {
			this.config = config;
			this.namedExpressions = namedExpressions;
			this.sheetMapping = sheetMapping;
			this.lazilyTransformingService = lazilyTransformingService;
		}
		exportChange(change) {
			const value = change.value;
			const address = change.address;
			if (address.sheet === NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS) {
				const namedExpression = this.namedExpressions.namedExpressionInAddress(address.row);
				if (!namedExpression) throw new Error("Missing named expression");
				return new ExportedNamedExpressionChange(namedExpression.displayName, this.exportScalarOrRange(value));
			} else if (value instanceof SimpleRangeValue) {
				const result = [];
				for (const [cellValue, cellAddress] of value.entriesFromTopLeftCorner(address)) result.push(new ExportedCellChange(cellAddress, this.exportValue(cellValue)));
				return result;
			} else return new ExportedCellChange(address, this.exportValue(value));
		}
		exportValue(value) {
			if (value instanceof SimpleRangeValue) return this.detailedError(new CellError(ErrorType.VALUE, ErrorMessage.ScalarExpected));
			else if (this.config.smartRounding && isExtendedNumber(value)) return this.cellValueRounding(getRawValue(value));
			else if (value instanceof CellError) return this.detailedError(value);
			else if (value === EmptyValue) return null;
			else return getRawValue(value);
		}
		exportScalarOrRange(value) {
			if (value instanceof SimpleRangeValue) return value.rawData().map((row) => row.map((v) => this.exportValue(v)));
			else return this.exportValue(value);
		}
		detailedError(error) {
			var _a, _b;
			let address = void 0;
			const originAddress = (_a = error.root) === null || _a === void 0 ? void 0 : _a.getAddress(this.lazilyTransformingService);
			if (originAddress !== void 0) if (originAddress.sheet === NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS) address = (_b = this.namedExpressions.namedExpressionInAddress(originAddress.row)) === null || _b === void 0 ? void 0 : _b.displayName;
			else address = simpleCellAddressToString(this.sheetMapping.getSheetNameOrThrowError.bind(this.sheetMapping), originAddress, -1);
			return new DetailedCellError(error, this.config.translationPackage.getErrorTranslation(error.type), address);
		}
		cellValueRounding(value) {
			if (value === 0) return value;
			const magnitudeMultiplierExponent = Math.floor(Math.log10(Math.abs(value)));
			const placesMultiplier = Math.pow(10, this.config.precisionRounding - magnitudeMultiplierExponent);
			if (value < 0) return -Math.round(-value * placesMultiplier) / placesMultiplier;
			else return Math.round(value * placesMultiplier) / placesMultiplier;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/GraphBuilder.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Service building the graph and mappings.
	*/
	var GraphBuilder = class {
		/**
		* Configures the building service.
		*/
		constructor(dependencyGraph, columnSearch, parser, cellContentParser, stats, arraySizePredictor) {
			this.dependencyGraph = dependencyGraph;
			this.columnSearch = columnSearch;
			this.parser = parser;
			this.cellContentParser = cellContentParser;
			this.stats = stats;
			this.arraySizePredictor = arraySizePredictor;
			this.buildStrategy = new SimpleStrategy(dependencyGraph, columnSearch, parser, stats, cellContentParser, arraySizePredictor);
		}
		/**
		* Builds graph.
		*/
		buildGraph(sheets, stats) {
			const dependencies = stats.measure(StatType.COLLECT_DEPENDENCIES, () => this.buildStrategy.run(sheets));
			this.dependencyGraph.getAndClearContentChanges();
			stats.measure(StatType.PROCESS_DEPENDENCIES, () => this.processDependencies(dependencies));
		}
		processDependencies(dependencies) {
			dependencies.forEach((cellDependencies, endVertex) => {
				this.dependencyGraph.processCellDependencies(cellDependencies, endVertex);
			});
		}
	};
	var SimpleStrategy = class {
		constructor(dependencyGraph, columnIndex, parser, stats, cellContentParser, arraySizePredictor) {
			this.dependencyGraph = dependencyGraph;
			this.columnIndex = columnIndex;
			this.parser = parser;
			this.stats = stats;
			this.cellContentParser = cellContentParser;
			this.arraySizePredictor = arraySizePredictor;
		}
		run(sheets) {
			const dependencies = /* @__PURE__ */ new Map();
			for (const sheetName in sheets) {
				const sheetId = this.dependencyGraph.getSheetId(sheetName);
				const sheet = sheets[sheetName];
				for (let i = 0; i < sheet.length; ++i) {
					const row = sheet[i];
					for (let j = 0; j < row.length; ++j) {
						const cellContent = row[j];
						const address = simpleCellAddress(sheetId, j, i);
						const parsedCellContent = this.cellContentParser.parse(cellContent);
						if (parsedCellContent instanceof CellContent.Formula) {
							const parseResult = this.stats.measure(StatType.PARSER, () => this.parser.parse(parsedCellContent.formula, address));
							if (parseResult.errors.length > 0) {
								this.shrinkArrayIfNeeded(address);
								const vertex = new ParsingErrorVertex(parseResult.errors, parsedCellContent.formula);
								this.dependencyGraph.addVertex(address, vertex);
							} else {
								this.shrinkArrayIfNeeded(address);
								const size = this.arraySizePredictor.checkArraySize(parseResult.ast, address);
								if (size.isScalar()) {
									const vertex = new ScalarFormulaVertex(parseResult.ast, address, 0);
									dependencies.set(vertex, absolutizeDependencies(parseResult.dependencies, address));
									this.dependencyGraph.addVertex(address, vertex);
									if (parseResult.hasVolatileFunction) this.dependencyGraph.markAsVolatile(vertex);
									if (parseResult.hasStructuralChangeFunction) this.dependencyGraph.markAsDependentOnStructureChange(vertex);
								} else {
									const vertex = new ArrayFormulaVertex(parseResult.ast, address, new ArraySize(size.width, size.height));
									dependencies.set(vertex, absolutizeDependencies(parseResult.dependencies, address));
									this.dependencyGraph.addArrayVertex(address, vertex);
								}
							}
						} else if (parsedCellContent instanceof CellContent.Empty) {} else {
							this.shrinkArrayIfNeeded(address);
							const vertex = new ValueCellVertex(parsedCellContent.value, cellContent);
							this.columnIndex.add(getRawValue(parsedCellContent.value), address);
							this.dependencyGraph.addVertex(address, vertex);
						}
					}
				}
			}
			return dependencies;
		}
		shrinkArrayIfNeeded(address) {
			const vertex = this.dependencyGraph.getCell(address);
			if (vertex instanceof ArrayFormulaVertex) this.dependencyGraph.shrinkArrayToCorner(vertex);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/VersionPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var LICENSE_STATUS_MAP = new Map([
		["gpl-v3", 1],
		["missing", 2],
		["invalid", 3],
		["expired", 4]
	]);
	var VersionPlugin = class extends FunctionPlugin {
		version(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("VERSION"), () => {
				const { licenseKeyValidityState: validityState, licenseKey } = this.config;
				let status;
				if (LICENSE_STATUS_MAP.has(licenseKey)) status = LICENSE_STATUS_MAP.get(licenseKey);
				else if (LICENSE_STATUS_MAP.has(validityState)) status = LICENSE_STATUS_MAP.get(validityState);
				else if (validityState === "valid") status = licenseKey.slice(-5);
				return `HyperFormula v${HyperFormula.version}, ${status}`;
			});
		}
	};
	VersionPlugin.implementedFunctions = { "VERSION": {
		method: "version",
		parameters: []
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/FunctionRegistry.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function validateAndReturnMetadataFromName(functionId, plugin) {
		var _a;
		let entry = plugin.implementedFunctions[functionId];
		const key = (_a = plugin.aliases) === null || _a === void 0 ? void 0 : _a[functionId];
		if (key !== void 0) {
			if (entry !== void 0) throw new AliasAlreadyExisting(functionId, plugin.name);
			entry = plugin.implementedFunctions[key];
		}
		if (entry === void 0) throw FunctionPluginValidationError.functionNotDeclaredInPlugin(functionId, plugin.name);
		return entry;
	}
	var FunctionRegistry = class FunctionRegistry {
		constructor(config) {
			this.config = config;
			this.functions = /* @__PURE__ */ new Map();
			this.arraySizeFunctions = /* @__PURE__ */ new Map();
			this.volatileFunctions = /* @__PURE__ */ new Set();
			this.arrayFunctions = /* @__PURE__ */ new Set();
			this.structuralChangeFunctions = /* @__PURE__ */ new Set();
			this.functionsWhichDoesNotNeedArgumentsToBeComputed = /* @__PURE__ */ new Set();
			this.functionsMetadata = /* @__PURE__ */ new Map();
			this.doesFunctionNeedArgumentToBeComputed = (functionId) => this.functionsWhichDoesNotNeedArgumentsToBeComputed.has(functionId);
			this.isFunctionVolatile = (functionId) => this.volatileFunctions.has(functionId);
			this.isArrayFunction = (functionId) => this.arrayFunctions.has(functionId);
			this.isFunctionDependentOnSheetStructureChange = (functionId) => this.structuralChangeFunctions.has(functionId);
			if (config.functionPlugins.length > 0) {
				this.instancePlugins = /* @__PURE__ */ new Map();
				for (const plugin of config.functionPlugins) FunctionRegistry.loadPluginFunctions(plugin, this.instancePlugins);
			} else this.instancePlugins = new Map(FunctionRegistry.plugins);
			for (const [functionId, plugin] of FunctionRegistry.protectedFunctions()) FunctionRegistry.loadFunctionUnprotected(plugin, functionId, this.instancePlugins);
			for (const [functionId, plugin] of this.instancePlugins.entries()) this.categorizeFunction(functionId, validateAndReturnMetadataFromName(functionId, plugin));
		}
		static registerFunctionPlugin(plugin, translations) {
			this.loadPluginFunctions(plugin, this.plugins);
			if (translations !== void 0) this.loadTranslations(translations);
		}
		static registerFunction(functionId, plugin, translations) {
			this.loadPluginFunction(plugin, functionId, this.plugins);
			if (translations !== void 0) this.loadTranslations(translations);
		}
		static unregisterFunction(functionId) {
			if (this.functionIsProtected(functionId)) throw ProtectedFunctionError.cannotUnregisterFunctionWithId(functionId);
			this.plugins.delete(functionId);
		}
		static unregisterFunctionPlugin(plugin) {
			for (const protectedPlugin of this.protectedPlugins()) if (protectedPlugin === plugin) throw ProtectedFunctionError.cannotUnregisterProtectedPlugin();
			for (const [functionId, registeredPlugin] of this.plugins.entries()) if (registeredPlugin === plugin) this.plugins.delete(functionId);
		}
		static unregisterAll() {
			this.plugins.clear();
		}
		static getRegisteredFunctionIds() {
			return [...Array.from(this.plugins.keys()), ...Array.from(this._protectedPlugins.keys())];
		}
		static getPlugins() {
			return Array.from(new Set(this.plugins.values()).values());
		}
		static getFunctionPlugin(functionId) {
			if (this.functionIsProtected(functionId)) return;
			else return this.plugins.get(functionId);
		}
		static functionIsProtected(functionId) {
			return this._protectedPlugins.has(functionId);
		}
		static loadTranslations(translations) {
			const registeredLanguages = new Set(HyperFormula.getRegisteredLanguagesCodes());
			Object.keys(translations).forEach((code) => {
				if (registeredLanguages.has(code)) HyperFormula.getLanguage(code).extendFunctions(translations[code]);
			});
		}
		static loadPluginFunctions(plugin, registry) {
			Object.keys(plugin.implementedFunctions).forEach((functionName) => {
				this.loadPluginFunction(plugin, functionName, registry);
			});
			if (plugin.aliases !== void 0) Object.keys(plugin.aliases).forEach((functionName) => {
				this.loadPluginFunction(plugin, functionName, registry);
			});
		}
		static loadPluginFunction(plugin, functionId, registry) {
			if (this.functionIsProtected(functionId)) throw ProtectedFunctionError.cannotRegisterFunctionWithId(functionId);
			else this.loadFunctionUnprotected(plugin, functionId, registry);
		}
		/**
		* Handles deprecated metadata properties.
		*/
		static handleDeprecatedMetadata(functionId, metadata) {
			if (metadata && metadata.arrayFunction !== void 0) {
				console.warn(`${functionId}: 'arrayFunction' parameter is deprecated since 3.1.0; Use 'enableArrayArithmeticForArguments' instead.`);
				metadata.enableArrayArithmeticForArguments = metadata.arrayFunction;
			}
			if (metadata && metadata.arraySizeMethod !== void 0) {
				console.warn(`${functionId}: 'arraySizeMethod' parameter is deprecated since 3.1.0; Use 'sizeOfResultArrayMethod' instead.`);
				metadata.sizeOfResultArrayMethod = metadata.arraySizeMethod;
			}
		}
		/**
		* Loads a function into the registry.
		*/
		static loadFunctionUnprotected(plugin, functionId, registry) {
			const metadata = validateAndReturnMetadataFromName(functionId, plugin);
			const methodName = metadata.method;
			this.handleDeprecatedMetadata(functionId, metadata);
			if (Object.prototype.hasOwnProperty.call(plugin.prototype, methodName)) registry.set(functionId, plugin);
			else throw FunctionPluginValidationError.functionMethodNotFound(methodName, plugin.name);
		}
		static *protectedFunctions() {
			for (const [functionId, plugin] of this._protectedPlugins) if (plugin !== void 0) yield [functionId, plugin];
		}
		static *protectedPlugins() {
			for (const [, plugin] of this._protectedPlugins) if (plugin !== void 0) yield plugin;
		}
		initializePlugins(interpreter) {
			const instances = [];
			for (const [functionId, plugin] of this.instancePlugins.entries()) {
				let foundPluginInstance = instances.find((pluginInstance) => pluginInstance instanceof plugin);
				if (foundPluginInstance === void 0) {
					foundPluginInstance = new plugin(interpreter);
					instances.push(foundPluginInstance);
				}
				const metadata = validateAndReturnMetadataFromName(functionId, plugin);
				const methodName = metadata.method;
				this.functions.set(functionId, [methodName, foundPluginInstance]);
				const arraySizeMethodName = metadata.sizeOfResultArrayMethod;
				if (arraySizeMethodName !== void 0) this.arraySizeFunctions.set(functionId, [arraySizeMethodName, foundPluginInstance]);
			}
		}
		getFunctionPlugin(functionId) {
			if (FunctionRegistry.functionIsProtected(functionId)) return;
			return this.instancePlugins.get(functionId);
		}
		getFunction(functionId) {
			const pluginEntry = this.functions.get(functionId);
			if (pluginEntry !== void 0 && this.config.translationPackage.isFunctionTranslated(functionId)) {
				const [pluginFunction, pluginInstance] = pluginEntry;
				return (ast, state) => pluginInstance[pluginFunction](ast, state);
			} else return;
		}
		getArraySizeFunction(functionId) {
			const pluginEntry = this.arraySizeFunctions.get(functionId);
			if (pluginEntry !== void 0 && this.config.translationPackage.isFunctionTranslated(functionId)) {
				const [pluginArraySizeFunction, pluginInstance] = pluginEntry;
				return (ast, state) => pluginInstance[pluginArraySizeFunction](ast, state);
			} else return;
		}
		getMetadata(functionId) {
			return this.functionsMetadata.get(functionId);
		}
		getPlugins() {
			const plugins = /* @__PURE__ */ new Set();
			for (const [functionId, plugin] of this.instancePlugins) if (!FunctionRegistry.functionIsProtected(functionId)) plugins.add(plugin);
			return Array.from(plugins);
		}
		getRegisteredFunctionIds() {
			return Array.from(this.functions.keys());
		}
		categorizeFunction(functionId, functionMetadata) {
			if (functionMetadata.isVolatile) this.volatileFunctions.add(functionId);
			if (functionMetadata.enableArrayArithmeticForArguments) this.arrayFunctions.add(functionId);
			if (functionMetadata.doesNotNeedArgumentsToBeComputed) this.functionsWhichDoesNotNeedArgumentsToBeComputed.add(functionId);
			if (functionMetadata.isDependentOnSheetStructureChange) this.structuralChangeFunctions.add(functionId);
			this.functionsMetadata.set(functionId, functionMetadata);
		}
	};
	FunctionRegistry.plugins = /* @__PURE__ */ new Map();
	FunctionRegistry._protectedPlugins = new Map([["VERSION", VersionPlugin], ["OFFSET", void 0]]);
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/Criterion.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CriterionType;
	(function(CriterionType) {
		CriterionType["GREATER_THAN"] = "GREATER_THAN";
		CriterionType["GREATER_THAN_OR_EQUAL"] = "GREATER_THAN_OR_EQUAL";
		CriterionType["LESS_THAN"] = "LESS_THAN";
		CriterionType["LESS_THAN_OR_EQUAL"] = "LESS_THAN_OR_EQUAL";
		CriterionType["NOT_EQUAL"] = "NOT_EQUAL";
		CriterionType["EQUAL"] = "EQUAL";
	})(CriterionType || (CriterionType = {}));
	var buildCriterion = (operator, value) => ({
		operator,
		value
	});
	var CriterionBuilder = class {
		constructor(config) {
			var _a, _b, _c, _d;
			this.trueString = (_b = (_a = config.translationPackage.getMaybeFunctionTranslation("TRUE")) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : "true";
			this.falseString = (_d = (_c = config.translationPackage.getMaybeFunctionTranslation("FALSE")) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : "false";
		}
		fromCellValue(raw, arithmeticHelper) {
			if (typeof raw !== "string" && typeof raw !== "boolean" && typeof raw !== "number") return;
			const criterion = this.parseCriterion(raw, arithmeticHelper);
			if (criterion === void 0) return;
			return {
				raw,
				lambda: buildCriterionLambda(criterion, arithmeticHelper)
			};
		}
		parseCriterion(criterion, arithmeticHelper) {
			if (typeof criterion === "number" || typeof criterion === "boolean") return buildCriterion(CriterionType.EQUAL, criterion);
			else if (typeof criterion === "string") {
				const regexResult = ANY_CRITERION_REGEX.exec(criterion);
				let criterionValue;
				let criterionType;
				if (regexResult) {
					criterionType = StrToCriterionType(regexResult[1]);
					criterionValue = regexResult[2];
				} else {
					criterionType = CriterionType.EQUAL;
					criterionValue = criterion;
				}
				const value = arithmeticHelper.coerceToMaybeNumber(criterionValue);
				const boolvalue = criterionValue.toLowerCase() === this.trueString ? true : criterionValue.toLowerCase() === this.falseString ? false : void 0;
				if (criterionType === void 0) return;
				if (criterionValue === "") return buildCriterion(criterionType, null);
				else if (value === void 0) {
					if (criterionType === CriterionType.EQUAL || criterionType === CriterionType.NOT_EQUAL) return buildCriterion(criterionType, boolvalue !== null && boolvalue !== void 0 ? boolvalue : criterionValue);
				} else return buildCriterion(criterionType, getRawValue(value));
			}
		}
	};
	var ANY_CRITERION_REGEX = /([<>=]+)(.*)/;
	function StrToCriterionType(str) {
		switch (str) {
			case ">": return CriterionType.GREATER_THAN;
			case ">=": return CriterionType.GREATER_THAN_OR_EQUAL;
			case "<": return CriterionType.LESS_THAN;
			case "<=": return CriterionType.LESS_THAN_OR_EQUAL;
			case "<>": return CriterionType.NOT_EQUAL;
			case "=": return CriterionType.EQUAL;
			default: return;
		}
	}
	var buildCriterionLambda = (criterion, arithmeticHelper) => {
		switch (criterion.operator) {
			case CriterionType.GREATER_THAN: if (typeof criterion.value === "number") return (cellValue) => typeof cellValue === "number" && arithmeticHelper.floatCmp(cellValue, criterion.value) > 0;
			else return (_cellValue) => false;
			case CriterionType.GREATER_THAN_OR_EQUAL: if (typeof criterion.value === "number") return (cellValue) => typeof cellValue === "number" && arithmeticHelper.floatCmp(cellValue, criterion.value) >= 0;
			else return (_cellValue) => false;
			case CriterionType.LESS_THAN: if (typeof criterion.value === "number") return (cellValue) => typeof cellValue === "number" && arithmeticHelper.floatCmp(cellValue, criterion.value) < 0;
			else return (_cellValue) => false;
			case CriterionType.LESS_THAN_OR_EQUAL: if (typeof criterion.value === "number") return (cellValue) => typeof cellValue === "number" && arithmeticHelper.floatCmp(cellValue, criterion.value) <= 0;
			else return (_cellValue) => false;
			case CriterionType.EQUAL: if (typeof criterion.value === "number") return (cellValue) => {
				if (typeof cellValue === "number") return arithmeticHelper.floatCmp(cellValue, criterion.value) === 0;
				else if (typeof cellValue === "string") {
					if (cellValue === "") return false;
					const val = arithmeticHelper.coerceToMaybeNumber(cellValue);
					if (val === void 0) return false;
					return arithmeticHelper.floatCmp(val, criterion.value) === 0;
				} else return false;
			};
			else if (typeof criterion.value === "string") return arithmeticHelper.eqMatcherFunction(criterion.value);
			else if (typeof criterion.value === "boolean") return (cellValue) => typeof cellValue === "boolean" && cellValue === criterion.value;
			else return (cellValue) => cellValue === EmptyValue;
			case CriterionType.NOT_EQUAL: if (typeof criterion.value === "number") return (cellValue) => {
				if (typeof cellValue === "number") return arithmeticHelper.floatCmp(cellValue, criterion.value) !== 0;
				else if (typeof cellValue === "string") {
					if (cellValue === "") return true;
					const val = arithmeticHelper.coerceToMaybeNumber(cellValue);
					if (val === void 0) return true;
					return arithmeticHelper.floatCmp(val, criterion.value) !== 0;
				} else return true;
			};
			else if (typeof criterion.value === "string") return arithmeticHelper.neqMatcherFunction(criterion.value);
			else if (typeof criterion.value === "boolean") return (cellValue) => typeof cellValue !== "boolean" || cellValue !== criterion.value;
			else return (cellValue) => cellValue !== EmptyValue;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/Interpreter.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var Interpreter = class {
		constructor(config, dependencyGraph, columnSearch, stats, arithmeticHelper, functionRegistry, namedExpressions, serialization, arraySizePredictor, dateTimeHelper) {
			this.config = config;
			this.dependencyGraph = dependencyGraph;
			this.columnSearch = columnSearch;
			this.stats = stats;
			this.arithmeticHelper = arithmeticHelper;
			this.functionRegistry = functionRegistry;
			this.namedExpressions = namedExpressions;
			this.serialization = serialization;
			this.arraySizePredictor = arraySizePredictor;
			this.dateTimeHelper = dateTimeHelper;
			this.equalOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.eq, arg1, arg2);
			this.notEqualOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.neq, arg1, arg2);
			this.greaterThanOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.gt, arg1, arg2);
			this.lessThanOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.lt, arg1, arg2);
			this.greaterThanOrEqualOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.geq, arg1, arg2);
			this.lessThanOrEqualOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.leq, arg1, arg2);
			this.concatOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.concat, coerceScalarToString(arg1), coerceScalarToString(arg2));
			this.plusOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.addWithEpsilon, this.arithmeticHelper.coerceScalarToNumberOrError(arg1), this.arithmeticHelper.coerceScalarToNumberOrError(arg2));
			this.minusOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.subtract, this.arithmeticHelper.coerceScalarToNumberOrError(arg1), this.arithmeticHelper.coerceScalarToNumberOrError(arg2));
			this.timesOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.multiply, this.arithmeticHelper.coerceScalarToNumberOrError(arg1), this.arithmeticHelper.coerceScalarToNumberOrError(arg2));
			this.powerOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.pow, this.arithmeticHelper.coerceScalarToNumberOrError(arg1), this.arithmeticHelper.coerceScalarToNumberOrError(arg2));
			this.divOp = (arg1, arg2) => binaryErrorWrapper(this.arithmeticHelper.divide, this.arithmeticHelper.coerceScalarToNumberOrError(arg1), this.arithmeticHelper.coerceScalarToNumberOrError(arg2));
			this.unaryMinusOp = (arg) => unaryErrorWrapper(this.arithmeticHelper.unaryMinus, this.arithmeticHelper.coerceScalarToNumberOrError(arg));
			this.percentOp = (arg) => unaryErrorWrapper(this.arithmeticHelper.unaryPercent, this.arithmeticHelper.coerceScalarToNumberOrError(arg));
			this.unaryPlusOp = (arg) => this.arithmeticHelper.unaryPlus(arg);
			this.functionRegistry.initializePlugins(this);
			this.criterionBuilder = new CriterionBuilder(config);
		}
		evaluateAst(ast, state) {
			let val = this.evaluateAstWithoutPostprocessing(ast, state);
			if (isExtendedNumber(val)) if (isNumberOverflow(getRawValue(val))) return new CellError(ErrorType.NUM, ErrorMessage.NaN);
			else val = cloneNumber(val, fixNegativeZero(getRawValue(val)));
			if (val instanceof SimpleRangeValue && val.height() === 1 && val.width() === 1) [[val]] = val.data;
			return wrapperForRootVertex(val, state.formulaVertex);
		}
		/**
		* Calculates cell value from formula abstract syntax tree
		*
		* @param {Ast} ast - abstract syntax tree of formula
		* @param {InterpreterState} state - interpreter state
		*/
		evaluateAstWithoutPostprocessing(ast, state) {
			switch (ast.type) {
				case AstNodeType.EMPTY: return EmptyValue;
				case AstNodeType.CELL_REFERENCE: {
					const address = ast.reference.toSimpleCellAddress(state.formulaAddress);
					if (isColOrRowInvalid(address)) return new CellError(ErrorType.REF, ErrorMessage.BadRef);
					if (!this.isSheetValid(ast.reference)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
					return this.dependencyGraph.getCellValue(address);
				}
				case AstNodeType.NUMBER:
				case AstNodeType.STRING: return ast.value;
				case AstNodeType.CONCATENATE_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.concatOp, leftResult, rightResult, state);
				}
				case AstNodeType.EQUALS_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.equalOp, leftResult, rightResult, state);
				}
				case AstNodeType.NOT_EQUAL_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.notEqualOp, leftResult, rightResult, state);
				}
				case AstNodeType.GREATER_THAN_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.greaterThanOp, leftResult, rightResult, state);
				}
				case AstNodeType.LESS_THAN_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.lessThanOp, leftResult, rightResult, state);
				}
				case AstNodeType.GREATER_THAN_OR_EQUAL_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.greaterThanOrEqualOp, leftResult, rightResult, state);
				}
				case AstNodeType.LESS_THAN_OR_EQUAL_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.lessThanOrEqualOp, leftResult, rightResult, state);
				}
				case AstNodeType.PLUS_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.plusOp, leftResult, rightResult, state);
				}
				case AstNodeType.MINUS_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.minusOp, leftResult, rightResult, state);
				}
				case AstNodeType.TIMES_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.timesOp, leftResult, rightResult, state);
				}
				case AstNodeType.POWER_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.powerOp, leftResult, rightResult, state);
				}
				case AstNodeType.DIV_OP: {
					const leftResult = this.evaluateAst(ast.left, state);
					const rightResult = this.evaluateAst(ast.right, state);
					return this.binaryRangeWrapper(this.divOp, leftResult, rightResult, state);
				}
				case AstNodeType.PLUS_UNARY_OP: {
					const result = this.evaluateAst(ast.value, state);
					return this.unaryRangeWrapper(this.unaryPlusOp, result, state);
				}
				case AstNodeType.MINUS_UNARY_OP: {
					const result = this.evaluateAst(ast.value, state);
					return this.unaryRangeWrapper(this.unaryMinusOp, result, state);
				}
				case AstNodeType.PERCENT_OP: {
					const result = this.evaluateAst(ast.value, state);
					return this.unaryRangeWrapper(this.percentOp, result, state);
				}
				case AstNodeType.FUNCTION_CALL: {
					if (this.config.licenseKeyValidityState !== "valid" && !FunctionRegistry.functionIsProtected(ast.procedureName)) return new CellError(ErrorType.LIC, ErrorMessage.LicenseKey(this.config.licenseKeyValidityState));
					const pluginFunction = this.functionRegistry.getFunction(ast.procedureName);
					if (pluginFunction !== void 0) return pluginFunction(ast, new InterpreterState(state.formulaAddress, state.arraysFlag || this.functionRegistry.isArrayFunction(ast.procedureName), state.formulaVertex));
					else return new CellError(ErrorType.NAME, ErrorMessage.FunctionName(ast.procedureName));
				}
				case AstNodeType.NAMED_EXPRESSION: {
					const namedExpression = this.namedExpressions.nearestNamedExpression(ast.expressionName, state.formulaAddress.sheet);
					if (namedExpression) return this.dependencyGraph.getCellValue(namedExpression.address);
					else return new CellError(ErrorType.NAME, ErrorMessage.NamedExpressionName(ast.expressionName));
				}
				case AstNodeType.CELL_RANGE: {
					if (!this.isSheetValid(ast.start) || !this.isSheetValid(ast.end)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
					if (!this.rangeSpansOneSheet(ast)) return new CellError(ErrorType.REF, ErrorMessage.RangeManySheets);
					const range = AbsoluteCellRange.fromCellRange(ast, state.formulaAddress);
					const arrayVertex = this.dependencyGraph.getArray(range);
					if (arrayVertex) {
						const array = arrayVertex.array;
						if (array instanceof NotComputedArray) throw new Error("Array should be already computed");
						else if (array instanceof CellError) return array;
						else if (array instanceof ArrayValue) return SimpleRangeValue.fromRange(array.raw(), range, this.dependencyGraph);
						else throw new Error("Unknown array");
					}
					return SimpleRangeValue.onlyRange(range, this.dependencyGraph);
				}
				case AstNodeType.COLUMN_RANGE: {
					if (!this.isSheetValid(ast.start) || !this.isSheetValid(ast.end)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
					if (!this.rangeSpansOneSheet(ast)) return new CellError(ErrorType.REF, ErrorMessage.RangeManySheets);
					const range = AbsoluteColumnRange.fromColumnRange(ast, state.formulaAddress);
					return SimpleRangeValue.onlyRange(range, this.dependencyGraph);
				}
				case AstNodeType.ROW_RANGE: {
					if (!this.isSheetValid(ast.start) || !this.isSheetValid(ast.end)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
					if (!this.rangeSpansOneSheet(ast)) return new CellError(ErrorType.REF, ErrorMessage.RangeManySheets);
					const range = AbsoluteRowRange.fromRowRangeAst(ast, state.formulaAddress);
					return SimpleRangeValue.onlyRange(range, this.dependencyGraph);
				}
				case AstNodeType.PARENTHESIS: return this.evaluateAst(ast.expression, state);
				case AstNodeType.ARRAY: {
					let totalWidth = void 0;
					const ret = [];
					for (const astRow of ast.args) {
						let rowHeight = void 0;
						const rowRet = [];
						for (const astIt of astRow) {
							const arr = coerceToRange(this.evaluateAst(astIt, state));
							const height = arr.height();
							if (rowHeight === void 0) {
								rowHeight = height;
								rowRet.push(...arr.data);
							} else if (rowHeight === height) for (let i = 0; i < height; i++) rowRet[i].push(...arr.data[i]);
							else return new CellError(ErrorType.REF, ErrorMessage.SizeMismatch);
						}
						const width = rowRet[0].length;
						if (totalWidth === void 0) {
							totalWidth = width;
							ret.push(...rowRet);
						} else if (totalWidth === width) ret.push(...rowRet);
						else return new CellError(ErrorType.REF, ErrorMessage.SizeMismatch);
					}
					return SimpleRangeValue.onlyValues(ret);
				}
				case AstNodeType.ERROR_WITH_RAW_INPUT:
				case AstNodeType.ERROR: return ast.error;
			}
		}
		/**
		* Sheet is valid if:
		* - sheet is undefined OR
		* - sheet is a named expressions store OR
		* - sheet exists in sheet mapping
		* - sheet is not a placeholder
		*/
		isSheetValid(address) {
			return address.sheet === void 0 || address.sheet === NamedExpressions.SHEET_FOR_WORKBOOK_EXPRESSIONS || this.dependencyGraph.sheetMapping.hasSheetWithId(address.sheet, { includePlaceholders: false });
		}
		rangeSpansOneSheet(ast) {
			return ast.start.sheet === ast.end.sheet;
		}
		unaryRangeWrapper(op, arg, state) {
			var _a;
			if (arg instanceof SimpleRangeValue && !state.arraysFlag) arg = (_a = coerceRangeToScalar(arg, state)) !== null && _a !== void 0 ? _a : new CellError(ErrorType.VALUE, ErrorMessage.ScalarExpected);
			if (arg instanceof CellError) return arg;
			if (arg instanceof SimpleRangeValue) {
				const newRaw = arg.data.map((row) => row.map(op));
				return SimpleRangeValue.onlyValues(newRaw);
			}
			return op(arg);
		}
		binaryRangeWrapper(op, arg1, arg2, state) {
			var _a, _b;
			if (arg1 instanceof SimpleRangeValue && !state.arraysFlag) arg1 = (_a = coerceRangeToScalar(arg1, state)) !== null && _a !== void 0 ? _a : new CellError(ErrorType.VALUE, ErrorMessage.ScalarExpected);
			if (arg1 instanceof CellError) return arg1;
			if (arg2 instanceof SimpleRangeValue && !state.arraysFlag) arg2 = (_b = coerceRangeToScalar(arg2, state)) !== null && _b !== void 0 ? _b : new CellError(ErrorType.VALUE, ErrorMessage.ScalarExpected);
			if (arg2 instanceof CellError) return arg2;
			if (arg1 instanceof SimpleRangeValue || arg2 instanceof SimpleRangeValue) {
				if (!(arg1 instanceof SimpleRangeValue)) if (arg2.isAdHoc()) {
					const raw2 = arg2.data;
					for (let i = 0; i < raw2.length; i++) for (let j = 0; j < raw2[0].length; j++) raw2[i][j] = op(arg1, raw2[i][j]);
					return SimpleRangeValue.onlyValues(raw2);
				} else arg1 = SimpleRangeValue.fromScalar(arg1);
				if (!(arg2 instanceof SimpleRangeValue)) if (arg1.isAdHoc()) {
					const raw1 = arg1.data;
					for (let i = 0; i < raw1.length; i++) for (let j = 0; j < raw1[0].length; j++) raw1[i][j] = op(raw1[i][j], arg2);
					return SimpleRangeValue.onlyValues(raw1);
				} else arg2 = SimpleRangeValue.fromScalar(arg2);
				if (arg1.width() === arg2.width() && arg1.height() === arg2.height()) {
					if (arg1.isAdHoc()) {
						const raw1 = arg1.data;
						const raw2 = arg2.data;
						for (let i = 0; i < raw1.length; i++) for (let j = 0; j < raw1[0].length; j++) raw1[i][j] = op(raw1[i][j], raw2[i][j]);
						return SimpleRangeValue.onlyValues(raw1);
					}
					if (arg2.isAdHoc()) {
						const raw1 = arg1.data;
						const raw2 = arg2.data;
						for (let i = 0; i < raw1.length; i++) for (let j = 0; j < raw1[0].length; j++) raw2[i][j] = op(raw1[i][j], raw2[i][j]);
						return SimpleRangeValue.onlyValues(raw2);
					}
				}
				const width = Math.max(arg1.width(), arg2.width());
				const height = Math.max(arg1.height(), arg2.height());
				const ret = Array(height);
				for (let i = 0; i < height; i++) ret[i] = Array(width);
				for (let i = 0; i < height; i++) {
					const i1 = arg1.height() !== 1 ? i : 0;
					const i2 = arg2.height() !== 1 ? i : 0;
					for (let j = 0; j < width; j++) {
						const j1 = arg1.width() !== 1 ? j : 0;
						const j2 = arg2.width() !== 1 ? j : 0;
						if (i1 < arg1.height() && i2 < arg2.height() && j1 < arg1.width() && j2 < arg2.width()) ret[i][j] = op(arg1.data[i1][j1], arg2.data[i2][j2]);
						else ret[i][j] = new CellError(ErrorType.NA);
					}
				}
				return SimpleRangeValue.onlyValues(ret);
			}
			return op(arg1, arg2);
		}
	};
	function unaryErrorWrapper(op, arg) {
		if (arg instanceof CellError) return arg;
		else return op(arg);
	}
	function binaryErrorWrapper(op, arg1, arg2) {
		if (arg1 instanceof CellError) return arg1;
		else if (arg2 instanceof CellError) return arg2;
		else return op(arg1, arg2);
	}
	function wrapperForRootVertex(val, vertex) {
		if (val instanceof CellError && vertex !== void 0) return val.attachRootVertex(vertex);
		return val;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/dependencyTransformers/CombinedTransformer.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CombinedTransformer = class {
		constructor(sheet) {
			this.sheet = sheet;
			this.transformations = [];
		}
		add(transformation) {
			this.transformations.push(transformation);
		}
		performEagerTransformations(graph, parser) {
			this.transformations.forEach((transformation) => transformation.performEagerTransformations(graph, parser));
		}
		transformSingleAst(ast, address) {
			let [transformedAst, transformedAddress] = [ast, address];
			this.transformations.forEach((transformation) => {
				[transformedAst, transformedAddress] = transformation.transformSingleAst(transformedAst, transformedAddress);
			});
			return [transformedAst, transformedAddress];
		}
		isIrreversible() {
			return true;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/LazilyTransformingAstService.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var LazilyTransformingAstService = class {
		constructor(stats) {
			this.stats = stats;
			this.transformations = [];
		}
		version() {
			return this.transformations.length;
		}
		addTransformation(transformation) {
			if (this.combinedTransformer !== void 0) this.combinedTransformer.add(transformation);
			else this.transformations.push(transformation);
			return this.version();
		}
		beginCombinedMode(sheet) {
			this.combinedTransformer = new CombinedTransformer(sheet);
		}
		commitCombinedMode() {
			if (this.combinedTransformer === void 0) throw Error("Combined mode wasn't started");
			this.transformations.push(this.combinedTransformer);
			this.combinedTransformer = void 0;
			return this.version();
		}
		applyTransformations(ast, address, version) {
			this.stats.start(StatType.TRANSFORM_ASTS_POSTPONED);
			for (let v = version; v < this.transformations.length; v++) {
				const transformation = this.transformations[v];
				if (transformation.isIrreversible()) {
					this.undoRedo.storeDataForVersion(v, address, this.parser.computeHashFromAst(ast));
					this.parser.rememberNewAst(ast);
				}
				const [newAst, newAddress] = transformation.transformSingleAst(ast, address);
				ast = newAst;
				address = newAddress;
			}
			const cachedAst = this.parser.rememberNewAst(ast);
			this.stats.end(StatType.TRANSFORM_ASTS_POSTPONED);
			return [
				cachedAst,
				address,
				this.transformations.length
			];
		}
		*getTransformationsFrom(version, filter) {
			for (let v = version; v < this.transformations.length; v++) {
				const transformation = this.transformations[v];
				if (!filter || filter(transformation)) yield transformation;
			}
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/binarySearch.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var NOT_FOUND$1 = -1;
	function findLastOccurrenceInOrderedRange(searchKey, range, { searchCoordinate, orderingDirection, ifNoMatch }, dependencyGraph) {
		const start = range.start[searchCoordinate];
		const end = searchCoordinate === "col" ? range.effectiveEndColumn(dependencyGraph) : range.effectiveEndRow(dependencyGraph);
		const getValueFromIndexFn = searchCoordinate === "col" ? (index) => getRawValue(dependencyGraph.getCellValue(simpleCellAddress(range.sheet, index, range.start.row))) : (index) => getRawValue(dependencyGraph.getCellValue(simpleCellAddress(range.sheet, range.start.col, index)));
		const compareFn = orderingDirection === "asc" ? (left, right) => compare(left, right) : (left, right) => -compare(left, right);
		const foundIndex = findLastMatchingIndex((index) => compareFn(searchKey, getValueFromIndexFn(index)) >= 0, start, end);
		const foundValue = getValueFromIndexFn(foundIndex);
		if (foundValue === searchKey) return foundIndex - start;
		if (ifNoMatch === "returnLowerBound") {
			if (foundIndex === NOT_FOUND$1) return orderingDirection === "asc" ? NOT_FOUND$1 : 0;
			if (typeof foundValue !== typeof searchKey) return NOT_FOUND$1;
			if (orderingDirection === "asc") return foundIndex - start;
			const nextIndex = foundIndex + 1;
			return nextIndex <= end ? nextIndex - start : NOT_FOUND$1;
		}
		if (ifNoMatch === "returnUpperBound") {
			if (foundIndex === NOT_FOUND$1) return orderingDirection === "asc" ? 0 : NOT_FOUND$1;
			if (typeof foundValue !== typeof searchKey) return NOT_FOUND$1;
			if (orderingDirection === "desc") return foundIndex - start;
			const nextIndex = foundIndex + 1;
			return nextIndex <= end ? nextIndex - start : NOT_FOUND$1;
		}
		return NOT_FOUND$1;
	}
	function findLastMatchingIndex(predicate, startRange, endRange) {
		let start = startRange;
		let end = endRange;
		while (start < end) {
			const pivot = Math.ceil((start + end) / 2);
			if (predicate(pivot)) start = pivot;
			else end = pivot - 1;
		}
		if (start === end && predicate(start)) return start;
		return NOT_FOUND$1;
	}
	function compare(left, right) {
		if (typeof left === typeof right) {
			if (left === EmptyValue) return 0;
			return left < right ? -1 : left > right ? 1 : 0;
		}
		if (left === EmptyValue) return -1;
		if (right === EmptyValue) return 1;
		if (right instanceof CellError) return -1;
		if (typeof left === "number" && typeof right === "string") return -1;
		if (typeof left === "number" && typeof right === "boolean") return -1;
		if (typeof left === "string" && typeof right === "number") return 1;
		if (typeof left === "string" && typeof right === "boolean") return -1;
		return 1;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/Lookup/AdvancedFind.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var NOT_FOUND = -1;
	var AdvancedFind = class {
		constructor(dependencyGraph) {
			this.dependencyGraph = dependencyGraph;
		}
		advancedFind(keyMatcher, rangeValue, { returnOccurrence } = { returnOccurrence: "first" }) {
			const range = rangeValue.range;
			const values = range === void 0 ? rangeValue.valuesFromTopLeftCorner() : this.dependencyGraph.computeListOfValuesInRange(range);
			const initialIterationIndex = returnOccurrence === "first" ? 0 : values.length - 1;
			const iterationCondition = returnOccurrence === "first" ? (i) => i < values.length : (i) => i >= 0;
			const incrementIndex = returnOccurrence === "first" ? (i) => i + 1 : (i) => i - 1;
			for (let i = initialIterationIndex; iterationCondition(i); i = incrementIndex(i)) if (keyMatcher(getRawValue(values[i]))) return i;
			return NOT_FOUND;
		}
		basicFind(searchKey, rangeValue, searchCoordinate, { ordering, ifNoMatch, returnOccurrence }) {
			const normalizedSearchKey = typeof searchKey === "string" ? forceNormalizeString(searchKey) : searchKey;
			const range = rangeValue.range;
			if (range === void 0) return this.findNormalizedValue(normalizedSearchKey, rangeValue.valuesFromTopLeftCorner(), ifNoMatch, returnOccurrence);
			if (ordering === "none") return this.findNormalizedValue(normalizedSearchKey, this.dependencyGraph.computeListOfValuesInRange(range), ifNoMatch, returnOccurrence);
			return findLastOccurrenceInOrderedRange(normalizedSearchKey, range, {
				searchCoordinate,
				orderingDirection: ordering,
				ifNoMatch
			}, this.dependencyGraph);
		}
		findNormalizedValue(searchKey, searchArray, ifNoMatch = "returnNotFound", returnOccurrence = "first") {
			const normalizedArray = searchArray.map(getRawValue).map((val) => typeof val === "string" ? forceNormalizeString(val) : val);
			if (ifNoMatch === "returnNotFound") return returnOccurrence === "first" ? normalizedArray.indexOf(searchKey) : normalizedArray.lastIndexOf(searchKey);
			const compareFn = ifNoMatch === "returnLowerBound" ? (left, right) => compare(left, right) : (left, right) => -compare(left, right);
			let bestValue = ifNoMatch === "returnLowerBound" ? -Infinity : Infinity;
			let bestIndex = NOT_FOUND;
			const initialIterationIndex = returnOccurrence === "first" ? 0 : normalizedArray.length - 1;
			const iterationCondition = returnOccurrence === "first" ? (i) => i < normalizedArray.length : (i) => i >= 0;
			const incrementIndex = returnOccurrence === "first" ? (i) => i + 1 : (i) => i - 1;
			for (let i = initialIterationIndex; iterationCondition(i); i = incrementIndex(i)) {
				const value = normalizedArray[i];
				if (value === searchKey) return i;
				if (compareFn(value, searchKey) > 0) continue;
				if (compareFn(bestValue, value) < 0) {
					bestValue = value;
					bestIndex = i;
				}
			}
			return bestIndex;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Lookup/ColumnBinarySearch.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ColumnBinarySearch = class extends AdvancedFind {
		constructor(dependencyGraph) {
			super(dependencyGraph);
			this.dependencyGraph = dependencyGraph;
		}
		add(value, address) {}
		remove(value, address) {}
		change(oldValue, newValue, address) {}
		applyChanges(contentChanges) {}
		addColumns(columnsSpan) {}
		removeColumns(columnsSpan) {}
		removeSheet(sheetId) {}
		moveValues(sourceRange, toRight, toBottom, toSheet) {}
		removeValues(range) {}
		find(searchKey, rangeValue, searchOptions) {
			return this.basicFind(searchKey, rangeValue, "row", searchOptions);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Lookup/ColumnIndex.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ColumnIndex = class ColumnIndex {
		constructor(dependencyGraph, config, stats) {
			this.dependencyGraph = dependencyGraph;
			this.config = config;
			this.stats = stats;
			this.index = /* @__PURE__ */ new Map();
			this.transformingService = this.dependencyGraph.lazilyTransformingAstService;
			this.binarySearchStrategy = new ColumnBinarySearch(dependencyGraph);
		}
		add(value, address) {
			if (value === EmptyValue || value instanceof CellError) return;
			else if (value instanceof SimpleRangeValue) for (const [arrayValue, cellAddress] of value.entriesFromTopLeftCorner(address)) this.addSingleCellValue(getRawValue(arrayValue), cellAddress);
			else this.addSingleCellValue(value, address);
		}
		remove(value, address) {
			if (value === void 0) return;
			if (value instanceof SimpleRangeValue) for (const [arrayValue, cellAddress] of value.entriesFromTopLeftCorner(address)) this.removeSingleValue(getRawValue(arrayValue), cellAddress);
			else this.removeSingleValue(value, address);
		}
		change(oldValue, newValue, address) {
			if (oldValue === newValue) return;
			this.remove(oldValue, address);
			this.add(newValue, address);
		}
		applyChanges(contentChanges) {
			for (const change of contentChanges) if (change.oldValue !== void 0) this.change(getRawValue(change.oldValue), getRawValue(change.value), change.address);
		}
		moveValues(sourceRange, toRight, toBottom, toSheet) {
			for (const [value, address] of sourceRange) {
				const targetAddress = movedSimpleCellAddress(address, toSheet, toRight, toBottom);
				this.remove(value, address);
				this.add(value, targetAddress);
			}
		}
		removeValues(range) {
			for (const [value, address] of range) this.remove(value, address);
		}
		find(searchKey, rangeValue, { ordering, ifNoMatch, returnOccurrence }) {
			if (returnOccurrence == null) returnOccurrence = ordering === "none" ? "first" : "last";
			const resultUsingColumnIndex = this.findUsingColumnIndex(searchKey, rangeValue, returnOccurrence);
			return resultUsingColumnIndex !== void 0 ? resultUsingColumnIndex : this.binarySearchStrategy.find(searchKey, rangeValue, {
				ordering,
				ifNoMatch,
				returnOccurrence
			});
		}
		findUsingColumnIndex(key, rangeValue, returnOccurrence) {
			const range = rangeValue.range;
			if (range === void 0) return;
			this.ensureRecentData(range.sheet, range.start.col, key);
			const columnMap = this.getColumnMap(range.sheet, range.start.col);
			if (!columnMap) return -1;
			const normalizedKey = typeof key === "string" ? forceNormalizeString(key) : key;
			const valueIndexForTheKey = columnMap.get(normalizedKey);
			if (!valueIndexForTheKey || !valueIndexForTheKey.index || valueIndexForTheKey.index.length === 0) return;
			const rowNumber = ColumnIndex.findRowBelongingToRange(valueIndexForTheKey, range, returnOccurrence);
			return rowNumber !== void 0 ? rowNumber - range.start.row : void 0;
		}
		static findRowBelongingToRange(valueIndex, range, returnOccurrence) {
			const start = range.start.row;
			const end = range.end.row;
			const positionInIndex = returnOccurrence === "first" ? findInOrderedArray(start, valueIndex.index, "upperBound") : findInOrderedArray(end, valueIndex.index, "lowerBound");
			if (positionInIndex === -1) return;
			const rowNumber = valueIndex.index[positionInIndex];
			return rowNumber >= start && rowNumber <= end ? rowNumber : void 0;
		}
		advancedFind(keyMatcher, range, options = { returnOccurrence: "first" }) {
			return this.binarySearchStrategy.advancedFind(keyMatcher, range, options);
		}
		addColumns(columnsSpan) {
			const sheetIndex = this.index.get(columnsSpan.sheet);
			if (!sheetIndex) return;
			sheetIndex.splice(columnsSpan.columnStart, 0, ...Array(columnsSpan.numberOfColumns));
		}
		removeColumns(columnsSpan) {
			const sheetIndex = this.index.get(columnsSpan.sheet);
			if (!sheetIndex) return;
			sheetIndex.splice(columnsSpan.columnStart, columnsSpan.numberOfColumns);
		}
		removeSheet(sheetId) {
			this.index.delete(sheetId);
		}
		getColumnMap(sheet, col) {
			if (!this.index.has(sheet)) this.index.set(sheet, []);
			const sheetMap = this.index.get(sheet);
			let columnMap = sheetMap[col];
			if (!columnMap) {
				columnMap = /* @__PURE__ */ new Map();
				sheetMap[col] = columnMap;
			}
			return columnMap;
		}
		getValueIndex(sheet, col, value) {
			const columnMap = this.getColumnMap(sheet, col);
			let index = this.getColumnMap(sheet, col).get(value);
			if (!index) {
				index = {
					version: this.transformingService.version(),
					index: []
				};
				columnMap.set(value, index);
			}
			return index;
		}
		ensureRecentData(sheet, col, value) {
			const valueIndex = this.getValueIndex(sheet, col, value);
			const actualVersion = this.transformingService.version();
			if (valueIndex.version === actualVersion) return;
			const relevantTransformations = this.transformingService.getTransformationsFrom(valueIndex.version, (transformation) => {
				return transformation.sheet === sheet && (transformation instanceof AddRowsTransformer || transformation instanceof RemoveRowsTransformer);
			});
			for (const transformation of relevantTransformations) if (transformation instanceof AddRowsTransformer) this.addRows(col, transformation.rowsSpan, value);
			else if (transformation instanceof RemoveRowsTransformer) this.removeRows(col, transformation.rowsSpan, value);
			valueIndex.version = actualVersion;
		}
		addSingleCellValue(value, address) {
			this.stats.measure(StatType.BUILD_COLUMN_INDEX, () => {
				this.ensureRecentData(address.sheet, address.col, value);
				if (typeof value === "string") value = forceNormalizeString(value);
				const valueIndex = this.getValueIndex(address.sheet, address.col, value);
				ColumnIndex.addValue(valueIndex, address.row);
			});
		}
		removeSingleValue(value, address) {
			this.stats.measure(StatType.BUILD_COLUMN_INDEX, () => {
				this.ensureRecentData(address.sheet, address.col, value);
				const columnMap = this.getColumnMap(address.sheet, address.col);
				if (typeof value === "string") value = forceNormalizeString(value);
				const valueIndex = columnMap.get(value);
				if (!valueIndex) return;
				const positionInIndex = findInOrderedArray(address.row, valueIndex.index);
				if (positionInIndex > -1) valueIndex.index.splice(positionInIndex, 1);
				if (valueIndex.index.length === 0) columnMap.delete(value);
				if (columnMap.size === 0) delete this.index.get(address.sheet)[address.col];
			});
		}
		addRows(col, rowsSpan, value) {
			const valueIndex = this.getValueIndex(rowsSpan.sheet, col, value);
			ColumnIndex.shiftRows(valueIndex, rowsSpan.rowStart, rowsSpan.numberOfRows);
		}
		removeRows(col, rowsSpan, value) {
			const valueIndex = this.getValueIndex(rowsSpan.sheet, col, value);
			ColumnIndex.removeRowsFromValues(valueIndex, rowsSpan);
			ColumnIndex.shiftRows(valueIndex, rowsSpan.rowEnd + 1, -rowsSpan.numberOfRows);
		}
		static addValue(valueIndex, rowNumber) {
			const rowIndex = findInOrderedArray(rowNumber, valueIndex.index, "lowerBound");
			if (!(valueIndex.index[rowIndex] === rowNumber)) valueIndex.index.splice(rowIndex + 1, 0, rowNumber);
		}
		static removeRowsFromValues(valueIndex, rowsSpan) {
			const start = findInOrderedArray(rowsSpan.rowStart, valueIndex.index, "upperBound");
			const end = findInOrderedArray(rowsSpan.rowEnd, valueIndex.index, "lowerBound");
			if (start > -1 && end > -1 && start <= end && valueIndex.index[start] <= rowsSpan.rowEnd) valueIndex.index.splice(start, end - start + 1);
		}
		static shiftRows(valueIndex, afterRow, numberOfRows) {
			const positionInIndex = findInOrderedArray(afterRow, valueIndex.index, "upperBound");
			if (positionInIndex === -1) return;
			for (let i = positionInIndex; i < valueIndex.index.length; ++i) valueIndex.index[i] += numberOfRows;
		}
	};
	function findInOrderedArray(key, values, handlingMisses = "upperBound") {
		let start = 0;
		let end = values.length - 1;
		while (start <= end) {
			const center = Math.floor((start + end) / 2);
			if (key > values[center]) start = center + 1;
			else if (key < values[center]) end = center - 1;
			else return center;
		}
		const foundIndex = handlingMisses === "lowerBound" ? end : start;
		return foundIndex >= 0 && foundIndex <= values.length ? foundIndex : -1;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/Lookup/SearchStrategy.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function buildColumnSearchStrategy(dependencyGraph, config, statistics) {
		if (config.useColumnIndex) return new ColumnIndex(dependencyGraph, config, statistics);
		else return new ColumnBinarySearch(dependencyGraph);
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/NumberLiteralHelper.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var NumberLiteralHelper = class {
		constructor(config) {
			this.config = config;
			const thousandSeparator = this.config.thousandSeparator === "." ? `\\${this.config.thousandSeparator}` : this.config.thousandSeparator;
			const decimalSeparator = this.config.decimalSeparator === "." ? `\\${this.config.decimalSeparator}` : this.config.decimalSeparator;
			this.numberPattern = new RegExp(`^([+-]?((${decimalSeparator}\\d+)|(\\d+(${thousandSeparator}\\d{3,})*(${decimalSeparator}\\d*)?)))([eE][+-]?\\d+)?$`);
			this.allThousandSeparatorsRegex = new RegExp(`${thousandSeparator}`, "g");
		}
		numericStringToMaybeNumber(input) {
			if (this.numberPattern.test(input)) {
				const num = this.numericStringToNumber(input);
				if (isNaN(num)) return;
				return num;
			}
		}
		numericStringToNumber(input) {
			const normalized = input.replace(this.allThousandSeparatorsRegex, "").replace(this.config.decimalSeparator, ".");
			return Number(normalized);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Serialization.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var Serialization = class Serialization {
		constructor(dependencyGraph, unparser, exporter) {
			this.dependencyGraph = dependencyGraph;
			this.unparser = unparser;
			this.exporter = exporter;
		}
		getCellHyperlink(address) {
			const formulaVertex = this.dependencyGraph.getCell(address);
			if (formulaVertex instanceof ScalarFormulaVertex) {
				const formula = formulaVertex.getFormula(this.dependencyGraph.lazilyTransformingAstService);
				if ("HYPERLINK" === formula.procedureName) return formula.hyperlink;
			}
		}
		getCellFormula(address, targetAddress) {
			const formulaVertex = this.dependencyGraph.getCell(address);
			if (formulaVertex instanceof ScalarFormulaVertex) {
				const formula = formulaVertex.getFormula(this.dependencyGraph.lazilyTransformingAstService);
				targetAddress = targetAddress !== null && targetAddress !== void 0 ? targetAddress : address;
				return this.unparser.unparse(formula, targetAddress);
			} else if (formulaVertex instanceof ArrayFormulaVertex) {
				const arrayVertexAddress = formulaVertex.getAddress(this.dependencyGraph.lazilyTransformingAstService);
				if (arrayVertexAddress.row !== address.row || arrayVertexAddress.col !== address.col || arrayVertexAddress.sheet !== address.sheet) return;
				targetAddress = targetAddress !== null && targetAddress !== void 0 ? targetAddress : address;
				const formula = formulaVertex.getFormula(this.dependencyGraph.lazilyTransformingAstService);
				if (formula !== void 0) return this.unparser.unparse(formula, targetAddress);
			} else if (formulaVertex instanceof ParsingErrorVertex) return formulaVertex.getFormula();
		}
		getCellSerialized(address, targetAddress) {
			var _a;
			return (_a = this.getCellFormula(address, targetAddress)) !== null && _a !== void 0 ? _a : this.getRawValue(address);
		}
		getCellValue(address) {
			return this.exporter.exportValue(this.dependencyGraph.getScalarValue(address));
		}
		getRawValue(address) {
			return this.dependencyGraph.getRawValue(address);
		}
		getSheetValues(sheet) {
			return this.genericSheetGetter(sheet, (arg) => this.getCellValue(arg));
		}
		getSheetFormulas(sheet) {
			return this.genericSheetGetter(sheet, (arg) => this.getCellFormula(arg));
		}
		genericSheetGetter(sheet, getter) {
			const sheetHeight = this.dependencyGraph.getSheetHeight(sheet);
			const sheetWidth = this.dependencyGraph.getSheetWidth(sheet);
			const arr = new Array(sheetHeight);
			for (let i = 0; i < sheetHeight; i++) {
				arr[i] = new Array(sheetWidth);
				for (let j = 0; j < sheetWidth; j++) {
					const address = simpleCellAddress(sheet, j, i);
					arr[i][j] = getter(address);
				}
				for (let j = sheetWidth - 1; j >= 0; j--) if (arr[i][j] === null || arr[i][j] === void 0) arr[i].pop();
				else break;
			}
			for (let i = sheetHeight - 1; i >= 0; i--) if (arr[i].length === 0) arr.pop();
			else break;
			return arr;
		}
		genericAllSheetsGetter(sheetGetter) {
			const result = {};
			for (const sheetName of this.dependencyGraph.sheetMapping.iterateSheetNames()) result[sheetName] = sheetGetter(this.dependencyGraph.sheetMapping.getSheetIdOrThrowError(sheetName));
			return result;
		}
		getSheetSerialized(sheet) {
			return this.genericSheetGetter(sheet, (arg) => this.getCellSerialized(arg));
		}
		getAllSheetsValues() {
			return this.genericAllSheetsGetter((arg) => this.getSheetValues(arg));
		}
		getAllSheetsFormulas() {
			return this.genericAllSheetsGetter((arg) => this.getSheetFormulas(arg));
		}
		getAllSheetsSerialized() {
			return this.genericAllSheetsGetter((arg) => this.getSheetSerialized(arg));
		}
		getAllNamedExpressionsSerialized() {
			const idMap = [];
			let id = 0;
			for (const sheetName of this.dependencyGraph.sheetMapping.iterateSheetNames()) {
				const sheetId = this.dependencyGraph.sheetMapping.getSheetIdOrThrowError(sheetName);
				idMap[sheetId] = id;
				id++;
			}
			return this.dependencyGraph.namedExpressions.getAllNamedExpressions().map((entry) => {
				return {
					name: entry.expression.displayName,
					expression: this.getCellSerialized(entry.expression.address),
					scope: entry.scope !== void 0 ? idMap[entry.scope] : void 0,
					options: entry.expression.options
				};
			});
		}
		withNewConfig(newConfig, namedExpressions) {
			const newUnparser = new Unparser(newConfig, this.dependencyGraph.sheetMapping, namedExpressions);
			return new Serialization(this.dependencyGraph, newUnparser, this.exporter);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/BuildEngineFactory.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var BuildEngineFactory = class {
		static buildFromSheets(sheets, configInput = {}, namedExpressions = []) {
			const config = new Config(configInput);
			return this.buildEngine(config, sheets, namedExpressions);
		}
		static buildFromSheet(sheet, configInput = {}, namedExpressions = []) {
			const config = new Config(configInput);
			const newsheetprefix = config.translationPackage.getUITranslation(UIElement.NEW_SHEET_PREFIX) + "1";
			return this.buildEngine(config, { [newsheetprefix]: sheet }, namedExpressions);
		}
		static buildEmpty(configInput = {}, namedExpressions = []) {
			return this.buildEngine(new Config(configInput), {}, namedExpressions);
		}
		static rebuildWithConfig(config, sheets, namedExpressions, stats) {
			return this.buildEngine(config, sheets, namedExpressions, stats);
		}
		static buildEngine(config, sheets = {}, inputNamedExpressions = [], stats = config.useStats ? new Statistics() : new EmptyStatistics()) {
			stats.start(StatType.BUILD_ENGINE_TOTAL);
			const namedExpressions = new NamedExpressions();
			const functionRegistry = new FunctionRegistry(config);
			const lazilyTransformingAstService = new LazilyTransformingAstService(stats);
			const dependencyGraph = DependencyGraph.buildEmpty(lazilyTransformingAstService, config, functionRegistry, namedExpressions, stats);
			const columnSearch = buildColumnSearchStrategy(dependencyGraph, config, stats);
			const sheetMapping = dependencyGraph.sheetMapping;
			const addressMapping = dependencyGraph.addressMapping;
			for (const sheetName in sheets) if (Object.prototype.hasOwnProperty.call(sheets, sheetName)) {
				const sheet = sheets[sheetName];
				validateAsSheet(sheet);
				const boundaries = findBoundaries(sheet);
				if (boundaries.height > config.maxRows || boundaries.width > config.maxColumns) throw new SheetSizeLimitExceededError();
				const sheetId = sheetMapping.addSheet(sheetName);
				addressMapping.addSheetAndSetStrategyBasedOnBoundaries(sheetId, boundaries, { throwIfSheetAlreadyExists: true });
			}
			const parser = new ParserWithCaching(config, functionRegistry, dependencyGraph.sheetReferenceRegistrar.ensureSheetRegistered.bind(dependencyGraph.sheetReferenceRegistrar));
			lazilyTransformingAstService.parser = parser;
			const unparser = new Unparser(config, sheetMapping, namedExpressions);
			const dateTimeHelper = new DateTimeHelper(config);
			const numberLiteralHelper = new NumberLiteralHelper(config);
			const arithmeticHelper = new ArithmeticHelper(config, dateTimeHelper, numberLiteralHelper);
			const cellContentParser = new CellContentParser(config, dateTimeHelper, numberLiteralHelper);
			const arraySizePredictor = new ArraySizePredictor(config, functionRegistry);
			const operations = new Operations(config, dependencyGraph, columnSearch, cellContentParser, parser, stats, lazilyTransformingAstService, namedExpressions, arraySizePredictor);
			const undoRedo = new UndoRedo(config, operations);
			lazilyTransformingAstService.undoRedo = undoRedo;
			const crudOperations = new CrudOperations(config, operations, undoRedo, new ClipboardOperations(config, dependencyGraph, operations), dependencyGraph, columnSearch, parser, cellContentParser, lazilyTransformingAstService, namedExpressions);
			const exporter = new Exporter(config, namedExpressions, sheetMapping, lazilyTransformingAstService);
			const serialization = new Serialization(dependencyGraph, unparser, exporter);
			const interpreter = new Interpreter(config, dependencyGraph, columnSearch, stats, arithmeticHelper, functionRegistry, namedExpressions, serialization, arraySizePredictor, dateTimeHelper);
			stats.measure(StatType.GRAPH_BUILD, () => {
				new GraphBuilder(dependencyGraph, columnSearch, parser, cellContentParser, stats, arraySizePredictor).buildGraph(sheets, stats);
			});
			inputNamedExpressions.forEach((entry) => {
				crudOperations.ensureItIsPossibleToAddNamedExpression(entry.name, entry.expression, entry.scope);
				crudOperations.operations.addNamedExpression(entry.name, entry.expression, entry.scope, entry.options);
			});
			const evaluator = new Evaluator(config, stats, interpreter, lazilyTransformingAstService, dependencyGraph, columnSearch);
			evaluator.run();
			stats.end(StatType.BUILD_ENGINE_TOTAL);
			return {
				config,
				stats,
				dependencyGraph,
				columnSearch,
				parser,
				unparser,
				cellContentParser,
				evaluator,
				lazilyTransformingAstService,
				crudOperations,
				exporter,
				namedExpressions,
				serialization,
				functionRegistry
			};
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Destroy.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function objectDestroy(object) {
		for (const [key, value] of Object.entries(object)) if (value instanceof Function) object[key] = postMortem(value);
		else delete object[key];
	}
	function postMortem(method) {
		return () => {
			throw new Error(`The "${method}" method cannot be called because this HyperFormula instance has been destroyed`);
		};
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/Emitter.mjs
	var import_tiny_emitter = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
		function E() {}
		E.prototype = {
			on: function(name, callback, ctx) {
				var e = this.e || (this.e = {});
				(e[name] || (e[name] = [])).push({
					fn: callback,
					ctx
				});
				return this;
			},
			once: function(name, callback, ctx) {
				var self = this;
				function listener() {
					self.off(name, listener);
					callback.apply(ctx, arguments);
				}
				listener._ = callback;
				return this.on(name, listener, ctx);
			},
			emit: function(name) {
				var data = [].slice.call(arguments, 1);
				var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
				var i = 0;
				var len = evtArr.length;
				for (; i < len; i++) evtArr[i].fn.apply(evtArr[i].ctx, data);
				return this;
			},
			off: function(name, callback) {
				var e = this.e || (this.e = {});
				var evts = e[name];
				var liveEvents = [];
				if (evts && callback) {
					for (var i = 0, len = evts.length; i < len; i++) if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]);
				}
				liveEvents.length ? e[name] = liveEvents : delete e[name];
				return this;
			}
		};
		module.exports = E;
		module.exports.TinyEmitter = E;
	})))();
	var Events;
	(function(Events) {
		Events["SheetAdded"] = "sheetAdded";
		Events["SheetRemoved"] = "sheetRemoved";
		Events["SheetRenamed"] = "sheetRenamed";
		Events["NamedExpressionAdded"] = "namedExpressionAdded";
		Events["NamedExpressionRemoved"] = "namedExpressionRemoved";
		Events["ValuesUpdated"] = "valuesUpdated";
		Events["EvaluationSuspended"] = "evaluationSuspended";
		Events["EvaluationResumed"] = "evaluationResumed";
	})(Events || (Events = {}));
	var Emitter = class extends import_tiny_emitter.TinyEmitter {
		emit(event, ...args) {
			super.emit(event, ...args);
			return this;
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/HyperFormula.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* This is a class for creating HyperFormula instance, all the following public methods
	* are related to this class.
	*
	* The instance can be created only by calling one of the static methods
	* `buildFromArray`, `buildFromSheets` or `buildEmpty` and should be disposed of with the
	* `destroy` method when it's no longer needed to free the resources.
	*
	* The instance can be seen as a workbook where worksheets can be created and
	* manipulated. They are organized within a widely known structure of columns and rows
	* which can be manipulated as well. The smallest possible data unit are the cells, which
	* may contain simple values or formulas to be calculated.
	*
	* All CRUD methods are called directly on HyperFormula instance and will trigger
	* corresponding lifecycle events. The events are marked accordingly, as well as thrown
	* errors, so they can be correctly handled.
	*/
	var HyperFormula = class HyperFormula {
		/**
		* Constructor
		*
		* @internal
		*/
		constructor(_config, _stats, _dependencyGraph, _columnSearch, _parser, _unparser, _cellContentParser, _evaluator, _lazilyTransformingAstService, _crudOperations, _exporter, _namedExpressions, _serialization, _functionRegistry) {
			this._config = _config;
			this._stats = _stats;
			this._dependencyGraph = _dependencyGraph;
			this._columnSearch = _columnSearch;
			this._parser = _parser;
			this._unparser = _unparser;
			this._cellContentParser = _cellContentParser;
			this._evaluator = _evaluator;
			this._lazilyTransformingAstService = _lazilyTransformingAstService;
			this._crudOperations = _crudOperations;
			this._exporter = _exporter;
			this._namedExpressions = _namedExpressions;
			this._serialization = _serialization;
			this._functionRegistry = _functionRegistry;
			this._emitter = new Emitter();
			this._evaluationSuspended = false;
		}
		/**
		* Returns all of HyperFormula's default [configuration options](/guide/configuration-options.md).
		*
		* @example
		* ```js
		* // returns all default configuration options
		* const defaultConfig = HyperFormula.defaultConfig;
		* ```
		*
		* @category Static Accessors
		*/
		static get defaultConfig() {
			return getDefaultConfig();
		}
		/**
		* Calls the `graph` method on the dependency graph.
		* Allows for executing `graph` directly, without a need to refer to `dependencyGraph`.
		*
		* @internal
		*/
		get graph() {
			return this.dependencyGraph.graph;
		}
		/**
		* Calls the `rangeMapping` method on the dependency graph.
		* Allows for executing `rangeMapping` directly, without a need to refer to `dependencyGraph`.
		*
		* @internal
		*/
		get rangeMapping() {
			return this.dependencyGraph.rangeMapping;
		}
		/**
		* Calls the `arrayMapping` method on the dependency graph.
		* Allows for executing `arrayMapping` directly, without a need to refer to `dependencyGraph`.
		*
		* @internal
		*/
		get arrayMapping() {
			return this.dependencyGraph.arrayMapping;
		}
		/**
		* Calls the `sheetMapping` method on the dependency graph.
		* Allows for executing `sheetMapping` directly, without a need to refer to `dependencyGraph`.
		*
		* @internal
		*/
		get sheetMapping() {
			return this.dependencyGraph.sheetMapping;
		}
		/**
		* Calls the `addressMapping` method on the dependency graph.
		* Allows for executing `addressMapping` directly, without a need to refer to `dependencyGraph`.
		*
		* @internal
		*/
		get addressMapping() {
			return this.dependencyGraph.addressMapping;
		}
		/** @internal */
		get dependencyGraph() {
			return this._dependencyGraph;
		}
		/** @internal */
		get evaluator() {
			return this._evaluator;
		}
		/** @internal */
		get columnSearch() {
			return this._columnSearch;
		}
		/** @internal */
		get lazilyTransformingAstService() {
			return this._lazilyTransformingAstService;
		}
		/**
		* Returns state of the validity of the license key.
		*
		* @internal
		*/
		get licenseKeyValidityState() {
			return this._config.licenseKeyValidityState;
		}
		/**
		* Builds the engine for a sheet from a two-dimensional array representation.
		* The engine is created with a single sheet.
		* Can be configured with the optional second parameter that represents a [[ConfigParams]].
		* If not specified, the engine will be built with the default configuration.
		*
		* @param {Sheet} sheet - two-dimensional array representation of sheet
		* @param {Partial<ConfigParams>} configInput - engine configuration
		* @param {SerializedNamedExpression[]} namedExpressions - starting named expressions
		*
		* @throws [[SheetSizeLimitExceededError]] when sheet size exceeds the limits
		* @throws [[InvalidArgumentsError]] when sheet is not an array of arrays
		* @throws [[FunctionPluginValidationError]] when plugin class definition is not consistent with metadata
		*
		* @example
		* ```js
		* // data represented as an array
		* const sheetData = [
		*  ['0', '=SUM(1, 2, 3)', '52'],
		*  ['=SUM(A1:C1)', '', '=A1'],
		*  ['2', '=SUM(A1:C1)', '=theUltimateQuestionOfLife'],
		* ];
		*
		* const namedExpressions = [
		*  {
		*    name: 'theUltimateQuestionOfLife',
		*    expression: '=42',
		*  },
		* ];
		*
		* // method with optional config parameter maxColumns
		* const hfInstance = HyperFormula.buildFromArray(sheetData, { maxColumns: 1000 }, namedExpressions);
		* ```
		*
		* @category Factories
		*/
		static buildFromArray(sheet, configInput = {}, namedExpressions = []) {
			return this.buildFromEngineState(BuildEngineFactory.buildFromSheet(sheet, configInput, namedExpressions));
		}
		/**
		* Builds the engine from an object containing multiple sheets with names.
		* The engine is created with one or more sheets.
		* Can be configured with the optional second parameter that represents a [[ConfigParams]].
		* If not specified the engine will be built with the default configuration.
		*
		* @param {Sheet} sheets - object with sheets definition
		* @param {Partial<ConfigParams>} configInput - engine configuration
		* @param {SerializedNamedExpression[]} namedExpressions - starting named expressions
		*
		* @throws [[SheetSizeLimitExceededError]] when sheet size exceeds the limits
		* @throws [[InvalidArgumentsError]] when any sheet is not an array of arrays
		* @throws [[FunctionPluginValidationError]] when plugin class definition is not consistent with metadata
		*
		* @example
		* ```js
		* // data represented as an object with sheets: Sheet1 and Sheet2
		* const sheetData = {
		*  'Sheet1': [
		*    ['1', '', '=Sheet2!$A1'],
		*    ['', '2', '=SUM(1, 2, 3)'],
		*    ['=Sheet2!$A2', '2', ''],
		*   ],
		*  'Sheet2': [
		*    ['', '4', '=Sheet1!$B1'],
		*    ['', '8', '=SUM(9, 3, 3)'],
		*    ['=Sheet1!$B1', '2', '=theUltimateQuestionOfLife'],
		*   ],
		* };
		*
		* const namedExpressions = [
		*  {
		*    name: 'theUltimateQuestionOfLife',
		*    expression: '=42',
		*  },
		* ];
		*
		* // method with optional config parameter useColumnIndex
		* const hfInstance = HyperFormula.buildFromSheets(sheetData, { useColumnIndex: true }, namedExpressions);
		* ```
		*
		* @category Factories
		*/
		static buildFromSheets(sheets, configInput = {}, namedExpressions = []) {
			return this.buildFromEngineState(BuildEngineFactory.buildFromSheets(sheets, configInput, namedExpressions));
		}
		/**
		* Builds an empty engine instance.
		* Can be configured with the optional parameter that represents a [[ConfigParams]].
		* If not specified the engine will be built with the default configuration.
		*
		* @param {Partial<ConfigParams>} configInput - engine configuration
		* @param {SerializedNamedExpression[]} namedExpressions - starting named expressions
		*
		* @example
		* ```js
		* const namedExpressions = [
		*  {
		*    name: 'theUltimateQuestionOfLife',
		*    expression: '=42',
		*  },
		* ];
		*
		* // build with no initial data and with optional config parameter maxColumns
		* const hfInstance = HyperFormula.buildEmpty({ maxColumns: 1000 }, namedExpressions);
		* ```
		*
		* @category Factories
		*/
		static buildEmpty(configInput = {}, namedExpressions = []) {
			return this.buildFromEngineState(BuildEngineFactory.buildEmpty(configInput, namedExpressions));
		}
		/**
		* Returns registered language from its code string.
		*
		* For more information, see the [Localizing functions guide](/guide/localizing-functions.md).
		*
		* @param {string} languageCode - code string of the translation package
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[LanguageNotRegisteredError]] when trying to retrieve not registered language
		*
		* @example
		* ```js
		* // return registered language
		* const language = HyperFormula.getLanguage('enGB');
		* ```
		*
		* @category Static Methods
		*/
		static getLanguage(languageCode) {
			validateArgToType(languageCode, "string", "languageCode");
			const val = this.registeredLanguages.get(languageCode);
			if (val === void 0) throw new LanguageNotRegisteredError();
			else return val;
		}
		/**
		* Registers language under given code string.
		*
		* For more information, see the [Localizing functions guide](/guide/localizing-functions.md).
		*
		* @param {string} languageCode - code string of the translation package
		* @param {RawTranslationPackage} languagePackage - translation package to be registered
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[ProtectedFunctionTranslationError]] when trying to register translation for protected function
		* @throws [[LanguageAlreadyRegisteredError]] when given language is already registered
		*
		* @example
		* ```js
		* // return registered language
		* HyperFormula.registerLanguage('enUS', enUS);
		* const engine = HyperFormula.buildEmpty({language: 'enUS'});
		* ```
		*
		* @category Static Methods
		*/
		static registerLanguage(languageCode, languagePackage) {
			validateArgToType(languageCode, "string", "languageCode");
			if (this.registeredLanguages.has(languageCode)) throw new LanguageAlreadyRegisteredError();
			else this.registeredLanguages.set(languageCode, buildTranslationPackage(languagePackage));
		}
		/**
		* Unregisters language that is registered under given code string.
		*
		* For more information, see the [Localizing functions guide](/guide/localizing-functions.md).
		*
		* @param {string} languageCode - code string of the translation package
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[LanguageNotRegisteredError]] when given language is not registered
		*
		* @example
		* ```js
		* // register the language for the instance
		* HyperFormula.registerLanguage('plPL', plPL);
		*
		* // unregister plPL
		* HyperFormula.unregisterLanguage('plPL');
		* ```
		*
		* @category Static Methods
		*/
		static unregisterLanguage(languageCode) {
			validateArgToType(languageCode, "string", "languageCode");
			if (this.registeredLanguages.has(languageCode)) this.registeredLanguages.delete(languageCode);
			else throw new LanguageNotRegisteredError();
		}
		/**
		* Returns all registered languages codes.
		*
		* @example
		* ```js
		* // should return all registered language codes: ['enGB', 'plPL']
		* const registeredLanguages = HyperFormula.getRegisteredLanguagesCodes();
		* ```
		*
		* @category Static Methods
		*/
		static getRegisteredLanguagesCodes() {
			return Array.from(this.registeredLanguages.keys());
		}
		/**
		* Registers all functions in a given plugin with optional translations.
		*
		* For more information, see the [Custom functions guide](/guide/custom-functions.md).
		*
		* Note: FunctionPlugins must be registered prior to the creation of HyperFormula instances in which they are used.
		* HyperFormula instances created prior to the registration of a FunctionPlugin are unable to access the FunctionPlugin.
		* Registering a FunctionPlugin with [[custom-functions]] requires the translations parameter.
		*
		* @param {FunctionPluginDefinition} plugin - plugin class
		* @param {FunctionTranslationsPackage} translations - optional package of function names translations
		*
		* @throws [[FunctionPluginValidationError]] when plugin class definition is not consistent with metadata
		* @throws [[ProtectedFunctionTranslationError]] when trying to register translation for protected function
		*
		* @example
		* ```js
		* // import your own plugin
		* import { MyExamplePlugin } from './file_with_your_plugin';
		*
		* // register the plugin
		* HyperFormula.registerFunctionPlugin(MyExamplePlugin);
		* ```
		*
		* @category Static Methods
		*/
		static registerFunctionPlugin(plugin, translations) {
			FunctionRegistry.registerFunctionPlugin(plugin, translations);
		}
		/**
		* Unregisters all functions defined in given plugin.
		*
		* For more information, see the [Custom functions guide](/guide/custom-functions.md).
		*
		* Note: This method does not affect the existing HyperFormula instances.
		*
		* @param {FunctionPluginDefinition} plugin - plugin class
		*
		* @example
		* ```js
		* // get the class of a plugin
		* const registeredPluginClass = HyperFormula.getFunctionPlugin('EXAMPLE');
		*
		* // unregister all functions defined in a plugin of ID 'EXAMPLE'
		* HyperFormula.unregisterFunctionPlugin(registeredPluginClass);
		* ```
		*
		* @category Static Methods
		*/
		static unregisterFunctionPlugin(plugin) {
			FunctionRegistry.unregisterFunctionPlugin(plugin);
		}
		/**
		* Registers a function with a given id if such exists in a plugin.
		*
		* For more information, see the [Custom functions guide](/guide/custom-functions.md).
		*
		* Note: This method does not affect the existing HyperFormula instances.
		*
		* @param {string} functionId - function id, e.g., 'SUMIF'
		* @param {FunctionPluginDefinition} plugin - plugin class
		* @param {FunctionTranslationsPackage} translations - translations for the function name
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[FunctionPluginValidationError]] when function with a given id does not exist in plugin or plugin class definition is not consistent with metadata
		* @throws [[ProtectedFunctionTranslationError]] when trying to register translation for protected function
		*
		* @example
		* ```js
		* // import your own plugin
		* import { MyExamplePlugin } from './file_with_your_plugin';
		*
		* // register a function
		* HyperFormula.registerFunction('EXAMPLE', MyExamplePlugin);
		* ```
		*
		* @category Static Methods
		*/
		static registerFunction(functionId, plugin, translations) {
			validateArgToType(functionId, "string", "functionId");
			FunctionRegistry.registerFunction(functionId, plugin, translations);
		}
		/**
		* Unregisters a function with a given id.
		*
		* For more information, see the [Custom functions guide](/guide/custom-functions.md).
		*
		* Note: This method does not affect the existing HyperFormula instances.
		*
		* @param {string} functionId - function id, e.g., 'SUMIF'
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* // import your own plugin
		* import { MyExamplePlugin } from './file_with_your_plugin';
		*
		* // register a function
		* HyperFormula.registerFunction('EXAMPLE', MyExamplePlugin);
		*
		* // unregister a function
		* HyperFormula.unregisterFunction('EXAMPLE');
		* ```
		*
		* @category Static Methods
		*/
		static unregisterFunction(functionId) {
			validateArgToType(functionId, "string", "functionId");
			FunctionRegistry.unregisterFunction(functionId);
		}
		/**
		* Clears function registry.
		*
		* Note: This method does not affect the existing HyperFormula instances.
		*
		* @example
		* ```js
		* HyperFormula.unregisterAllFunctions();
		* ```
		*
		* @category Static Methods
		*/
		static unregisterAllFunctions() {
			FunctionRegistry.unregisterAll();
		}
		/**
		* Returns translated names of all registered functions for a given language
		*
		* @param {string} code - language code
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* // return a list of function names registered for enGB
		* const allNames = HyperFormula.getRegisteredFunctionNames('enGB');
		* ```
		*
		* @category Static Methods
		*/
		static getRegisteredFunctionNames(code) {
			validateArgToType(code, "string", "code");
			const functionIds = FunctionRegistry.getRegisteredFunctionIds();
			return this.getLanguage(code).getFunctionTranslations(functionIds);
		}
		/**
		* Returns class of a plugin used by function with given id
		*
		* For more information, see the [Custom functions guide](/guide/custom-functions.md).
		*
		* @param {string} functionId - id of a function, e.g., 'SUMIF'
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* // import your own plugin
		* import { MyExamplePlugin } from './file_with_your_plugin';
		*
		* // register a plugin
		* HyperFormula.registerFunctionPlugin(MyExamplePlugin);
		*
		* // return the class of a given plugin
		* const myFunctionClass = HyperFormula.getFunctionPlugin('EXAMPLE');
		* ```
		*
		* @category Static Methods
		*/
		static getFunctionPlugin(functionId) {
			validateArgToType(functionId, "string", "functionId");
			return FunctionRegistry.getFunctionPlugin(functionId);
		}
		/**
		* Returns classes of all plugins registered in HyperFormula.
		*
		* @example
		* ```js
		* // return classes of all plugins
		* const allClasses = HyperFormula.getAllFunctionPlugins();
		* ```
		*
		* @category Static Methods
		*/
		static getAllFunctionPlugins() {
			return FunctionRegistry.getPlugins();
		}
		/**
		* @internal
		*/
		static buildFromEngineState(engine) {
			return new HyperFormula(engine.config, engine.stats, engine.dependencyGraph, engine.columnSearch, engine.parser, engine.unparser, engine.cellContentParser, engine.evaluator, engine.lazilyTransformingAstService, engine.crudOperations, engine.exporter, engine.namedExpressions, engine.serialization, engine.functionRegistry);
		}
		/**
		* Returns the cell value of a given address.
		* Applies rounding and post-processing.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[ExpectedValueOfTypeError]] when cellAddress is of incorrect type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2, 3)', '2'],
		* ]);
		*
		* // get value of A1 cell, should be '6'
		* const A1Value = hfInstance.getCellValue({ sheet: 0, col: 0, row: 0 });
		*
		* // get value of B1 cell, should be '2'
		* const B1Value = hfInstance.getCellValue({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellValue(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getCellValue(cellAddress);
		}
		/**
		* Returns a normalized formula string from the cell of a given address or `undefined` for an address that does not exist and empty values.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] when cellAddress is of incorrect type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2, 3)', '0'],
		* ]);
		*
		* // should return a normalized A1 cell formula: '=SUM(1, 2, 3)'
		* const A1Formula = hfInstance.getCellFormula({ sheet: 0, col: 0, row: 0 });
		*
		* // should return a normalized B1 cell formula: 'undefined'
		* const B1Formula = hfInstance.getCellFormula({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellFormula(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			return this._serialization.getCellFormula(cellAddress);
		}
		/**
		* Returns the `HYPERLINK` url for a cell of a given address or `undefined` for an address that does not exist or a cell that is not `HYPERLINK`
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] when cellAddress is of incorrect type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=HYPERLINK("https://hyperformula.handsontable.com/", "HyperFormula")', '0'],
		* ]);
		*
		* // should return url of 'HYPERLINK': https://hyperformula.handsontable.com/
		* const A1Hyperlink = hfInstance.getCellHyperlink({ sheet: 0, col: 0, row: 0 });
		*
		* // should return 'undefined' for a cell that is not 'HYPERLINK'
		* const B1Hyperlink = hfInstance.getCellHyperlink({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellHyperlink(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getCellHyperlink(cellAddress);
		}
		/**
		* Returns [[RawCellContent]] with a serialized content of the cell of a given address: either a cell formula, an explicit value, or an error.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[ExpectedValueOfTypeError]] when cellAddress is of incorrect type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2, 3)', '0'],
		* ]);
		*
		* // should return serialized content of A1 cell: '=SUM(1, 2, 3)'
		* const cellA1Serialized = hfInstance.getCellSerialized({ sheet: 0, col: 0, row: 0 });
		*
		* // should return serialized content of B1 cell: '0'
		* const cellB1Serialized = hfInstance.getCellSerialized({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellSerialized(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getCellSerialized(cellAddress);
		}
		/**
		* Returns an array of arrays of [[CellValue]] with values of all cells from [[Sheet]].
		* Applies rounding and post-processing.
		*
		* @param {number} sheetId - sheet ID number
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['0', '=SUM(1, 2, 3)', '=A1'],
		*  ['1', '=TEXT(A2, "0.0%")', '=C1'],
		*  ['2', '=SUM(A1:C1)', '=C1'],
		* ]);
		*
		* // should return all values of a sheet: [[0, 6, 0], [1, '1.0%', 0], [2, 6, 0]]
		* const sheetValues = hfInstance.getSheetValues(0);
		* ```
		*
		* @category Sheets
		*/
		getSheetValues(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getSheetValues(sheetId);
		}
		/**
		* Returns an array with normalized formula strings from [[Sheet]] or `undefined` for a cells that have no value.
		*
		* @param {SimpleCellAddress} sheetId - sheet ID number
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['0', '=SUM(1, 2, 3)', '=A1'],
		*  ['1', '=TEXT(A2, "0.0%")', '=C1'],
		*  ['2', '=SUM(A1:C1)', '=C1'],
		* ]);
		*
		* // should return all formulas of a sheet:
		* // [
		* //  [undefined, '=SUM(1, 2, 3)', '=A1'],
		* //  [undefined, '=TEXT(A2, "0.0%")', '=C1'],
		* //  [undefined, '=SUM(A1:C1)', '=C1'],
		* // ];
		* const sheetFormulas = hfInstance.getSheetFormulas(0);
		* ```
		*
		* @category Sheets
		*/
		getSheetFormulas(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			return this._serialization.getSheetFormulas(sheetId);
		}
		/**
		* Returns an array of arrays of [[RawCellContent]] with serialized content of cells from [[Sheet]], either a cell formula or an explicit value.
		*
		* @param {SimpleCellAddress} sheetId - sheet ID number
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['0', '=SUM(1, 2, 3)', '=A1'],
		*  ['1', '=TEXT(A2, "0.0%")', '=C1'],
		*  ['2', '=SUM(A1:C1)', '=C1'],
		* ]);
		*
		* // should return:
		* // [
		* //  ['0', '=SUM(1, 2, 3)', '=A1'],
		* //  ['1', '=TEXT(A2, "0.0%")', '=C1'],
		* //  ['2', '=SUM(A1:C1)', '=C1'],
		* // ];
		* const serializedContent = hfInstance.getSheetSerialized(0);
		* ```
		*
		* @category Sheets
		*/
		getSheetSerialized(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getSheetSerialized(sheetId);
		}
		/**
		* Returns a map containing dimensions of all sheets for the engine instance represented as a key-value pairs where keys are sheet IDs and dimensions are returned as numbers, width and height respectively.
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*   Sheet1: [
		*    ['1', '2', '=Sheet2!$A1'],
		*   ],
		*   Sheet2: [
		*    ['3'],
		*    ['4'],
		*   ],
		* });
		*
		* // should return the dimensions of all sheets:
		* // { Sheet1: { width: 3, height: 1 }, Sheet2: { width: 1, height: 2 } }
		* const allSheetsDimensions = hfInstance.getAllSheetsDimensions();
		* ```
		*
		* @category Sheets
		*/
		getAllSheetsDimensions() {
			return this._serialization.genericAllSheetsGetter((arg) => this.getSheetDimensions(arg));
		}
		/**
		* Returns dimensions of a specified sheet.
		* The sheet dimensions is represented with numbers: width and height.
		*
		* Note: Due to the memory optimizations, some of the empty bottom rows and rightmost columns are not counted to the dimensions.
		*
		* @param {number} sheetId - sheet ID number
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*    ['1', '2', '=Sheet2!$A1'],
		* ]);
		*
		* // should return provided sheet's dimensions: { width: 3, height: 1 }
		* const sheetDimensions = hfInstance.getSheetDimensions(0);
		* ```
		*
		* @category Sheets
		*/
		getSheetDimensions(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			return {
				width: this.dependencyGraph.getSheetWidth(sheetId),
				height: this.dependencyGraph.getSheetHeight(sheetId)
			};
		}
		/**
		* Returns values of all sheets in a form of an object which property keys are strings and values are 2D arrays of [[CellValue]].
		*
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '=A1+10', '3'],
		* ]);
		*
		* // should return all sheets values: { Sheet1: [ [ 1, 11, 3 ] ] }
		* const allSheetsValues = hfInstance.getAllSheetsValues();
		* ```
		*
		* @category Sheets
		*/
		getAllSheetsValues() {
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getAllSheetsValues();
		}
		/**
		* Returns formulas of all sheets in a form of an object which property keys are strings and values are 2D arrays of strings or possibly `undefined` when the call does not contain a formula.
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2', '=A1+10'],
		* ]);
		*
		* // should return only formulas: { Sheet1: [ [ undefined, undefined, '=A1+10' ] ] }
		* const allSheetsFormulas = hfInstance.getAllSheetsFormulas();
		* ```
		* @category Sheets
		*/
		getAllSheetsFormulas() {
			return this._serialization.getAllSheetsFormulas();
		}
		/**
		* Returns formulas or values of all sheets in a form of an object which property keys are strings and values are 2D arrays of [[RawCellContent]].
		*
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2', '=A1+10'],
		* ]);
		*
		* // should return all sheets serialized content: { Sheet1: [ [ 1, 2, '=A1+10' ] ] }
		* const allSheetsSerialized = hfInstance.getAllSheetsSerialized();
		* ```
		*
		* @category Sheets
		*/
		getAllSheetsSerialized() {
			this.ensureEvaluationIsNotSuspended();
			return this._serialization.getAllSheetsSerialized();
		}
		/**
		* Updates the config with given new metadata. It is an expensive operation, as it might trigger rebuilding the engine and recalculation of all formulas.
		*
		* For more information, see the [Configuration options guide](/guide/configuration-options.md).
		*
		* @param {Partial<ConfigParams>} newParams configuration options to be updated or added
		*
		* @throws [[ExpectedValueOfTypeError]] when some parameters of config are of wrong type (e.g., currencySymbol)
		* @throws [[ConfigValueEmpty]] when some parameters of config are of invalid value (e.g., currencySymbol)
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // add a config param, for example maxColumns,
		* // you can check the configuration with getConfig method
		* hfInstance.updateConfig({ maxColumns: 1000 });
		* ```
		*
		* @category Instance
		*/
		updateConfig(newParams) {
			if (Object.entries(newParams).every(([key, value]) => this._config[key] === value)) return;
			this.rebuildWithConfig(newParams);
		}
		/**
		* Returns current configuration of the engine instance.
		*
		* For more information, see the [Configuration options guide](/guide/configuration-options.md).
		*
		* @example
		* ```js
		* // should return all config metadata including default and those which were added
		* const hfConfig = hfInstance.getConfig();
		* ```
		*
		* @category Instance
		*/
		getConfig() {
			return this._config.getConfig();
		}
		/**
		* Rebuilds the HyperFormula instance preserving the current sheets data.
		*
		* @example
		* ```js
		* hfInstance.rebuildAndRecalculate();
		* ```
		*
		* @category Instance
		*/
		rebuildAndRecalculate() {
			this.rebuildWithConfig({});
		}
		/**
		* Returns a snapshot of computation time statistics.
		* It returns a map with key-value pairs where keys are enums for stat type and time (number).
		*
		* @internal
		*
		* @category Instance
		*/
		getStats() {
			return this._stats.snapshot();
		}
		/**
		* Undo the previous operation.
		*
		* For more information, see the [Undo-Redo guide](/guide/undo-redo.md).
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoOperationToUndoError]] when there is no operation running that can be undone
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		*  ['3', ''],
		* ]);
		*
		* // perform CRUD operation, for example remove the second row
		* hfInstance.removeRows(0, [1, 1]);
		*
		* // undo the operation, it should return the changes
		* const changes = hfInstance.undo();
		* ```
		*
		* @category Undo and Redo
		*/
		undo() {
			this._crudOperations.undo();
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Re-do recently undone operation.
		*
		* For more information, see the [Undo-Redo guide](/guide/undo-redo.md).
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoOperationToRedoError]] when there is no operation running that can be re-done
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		*  ['3'],
		* ]);
		*
		* // perform CRUD operation, for example remove the second row
		* hfInstance.removeRows(0, [1, 1]);
		*
		* // undo the operation, it should return previous values: [['1'], ['2'], ['3']]
		* hfInstance.undo();
		*
		* // do a redo, it should return the values after removing the second row: [['1'], ['3']]
		* const changes = hfInstance.redo();
		* ```
		*
		* @category Undo and Redo
		*/
		redo() {
			this._crudOperations.redo();
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Checks if there is at least one operation that can be undone.
		*
		* For more information, see the [Undo-Redo guide](/guide/undo-redo.md).
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		*  ['3'],
		* ]);
		*
		* // perform CRUD operation, for example remove the second row
		* hfInstance.removeRows(0, [1, 1]);
		*
		* // should return 'true', it is possible to undo last operation
		* // which is removing rows in this example
		* const isSomethingToUndo = hfInstance.isThereSomethingToUndo();
		* ```
		*
		* @category Undo and Redo
		*/
		isThereSomethingToUndo() {
			return this._crudOperations.isThereSomethingToUndo();
		}
		/**
		* Checks if there is at least one operation that can be re-done.
		*
		* For more information, see the [Undo-Redo guide](/guide/undo-redo.md).
		*
		* @example
		* ```js
		* hfInstance.undo();
		*
		* // when there is an action to redo, this returns 'true'
		* const isSomethingToRedo = hfInstance.isThereSomethingToRedo();
		* ```
		*
		* @category Undo and Redo
		*/
		isThereSomethingToRedo() {
			return this._crudOperations.isThereSomethingToRedo();
		}
		/**
		* Returns information whether it is possible to change the content in a rectangular area bounded by the box.
		* If returns `true`, doing [[setCellContents]] operation won't throw any errors.
		* Returns `false` if the address is invalid or the sheet does not exist.
		*
		* @param {SimpleCellAddress | SimpleCellRange} address - single cell or block of cells to check
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // top left corner
		* const address1 = { col: 0, row: 0, sheet: 0 };
		* // bottom right corner
		* const address2 = { col: 1, row: 0, sheet: 0 };
		*
		* // should return 'true' for this example, it is possible to set content of
		* // width 2, height 1 in the first row and column of sheet 0
		* const isSettable = hfInstance.isItPossibleToSetCellContents({ start: address1, end: address2 });
		* ```
		*
		* @category Cells
		*/
		isItPossibleToSetCellContents(address) {
			let range;
			if (isSimpleCellAddress(address)) range = new AbsoluteCellRange(address, address);
			else if (isSimpleCellRange(address)) range = new AbsoluteCellRange(address.start, address.end);
			else throw new ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange", "address");
			try {
				this._crudOperations.ensureRangeInSizeLimits(range);
				for (const it of range.addresses(this._dependencyGraph)) this._crudOperations.ensureItIsPossibleToChangeContent(it);
			} catch (e) {
				return false;
			}
			return true;
		}
		/**
		* Sets the content for a block of cells of a given coordinates.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {SimpleCellAddress} topLeftCornerAddress - top left corner of block of cells
		* @param {(RawCellContent[][]|RawCellContent)} cellContents - array with content
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when the value is not an array of arrays or a raw cell value
		* @throws [[SheetSizeLimitExceededError]] when performing this operation would result in sheet size limits exceeding
		* @throws [[ExpectedValueOfTypeError]] if topLeftCornerAddress argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2', '=A1'],
		* ]);
		*
		* // should set the content, returns:
		* // [{
		* //   address: { sheet: 0, col: 3, row: 0 },
		* //   newValue: 2,
		* // }]
		* const changes = hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
		* ```
		*
		* @category Cells
		*/
		setCellContents(topLeftCornerAddress, cellContents) {
			this._crudOperations.setCellContents(topLeftCornerAddress, cellContents);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Reorders rows of a sheet according to a source-target mapping.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {[number, number][]} rowMapping - array mapping original positions to final positions of rows
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when rowMapping does not define correct row permutation for some subset of rows of the given sheet
		* @throws [[SourceLocationHasArrayError]] when the selected position has array inside
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  [1],
		*  [2],
		*  [4, 5],
		* ]);
		*
		* // should set swap rows 0 and 2 in place, returns:
		* // [{
		* //   address: { sheet: 0, col: 0, row: 2 },
		* //   newValue: 1,
		* // },
		* // {
		* //   address: { sheet: 0, col: 1, row: 2 },
		* //   newValue: null,
		* // },
		* // {
		* //   address: { sheet: 0, col: 0, row: 0 },
		* //   newValue: 4,
		* // },
		* // {
		* //   address: { sheet: 0, col: 1, row: 0 },
		* //   newValue: 5,
		* // }]
		* const changes = hfInstance.swapRowIndexes(0, [[0, 2], [2, 0]]);
		* ```
		*
		* @category Rows
		*/
		swapRowIndexes(sheetId, rowMapping) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.setRowOrder(sheetId, rowMapping);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Checks if it is possible to reorder rows of a sheet according to a source-target mapping.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {[number, number][]} rowMapping - array mapping original positions to final positions of rows
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  [1],
		*  [2],
		*  [4, 5],
		* ]);
		*
		* // returns true
		* const isSwappable = hfInstance.isItPossibleToSwapRowIndexes(0, [[0, 2], [2, 0]]);
		*
		* // returns false
		* const isSwappable = hfInstance.isItPossibleToSwapRowIndexes(0, [[0, 1]]);
		* ```
		*
		* @category Rows
		*/
		isItPossibleToSwapRowIndexes(sheetId, rowMapping) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				this._crudOperations.validateSwapRowIndexes(sheetId, rowMapping);
				this._crudOperations.testRowOrderForArrays(sheetId, rowMapping);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Reorders rows of a sheet according to a permutation of 0-based indexes.
		* Parameter `newRowOrder` should have a form `[ newPositionForRow0, newPositionForRow1, newPositionForRow2, ... ]`.
		* This method might be used to [sort the rows of a sheet](../../guide/sorting-data.md).
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note: This method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {number[]} newRowOrder - permutation of rows; array length must match the number of rows returned by [getSheetDimensions()](#getsheetdimensions)
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when rowMapping does not define correct row permutation for some subset of rows of the given sheet
		* @throws [[SourceLocationHasArrayError]] when the selected position has array inside
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['A'],
		*  ['B'],
		*  ['C'],
		*  ['D']
		* ]);
		*
		* const newRowOrder = [0, 3, 2, 1]; // [ newPosForA, newPosForB, newPosForC, newPosForD ]
		*
		* const changes = hfInstance.setRowOrder(0, newRowOrder);
		*
		* // Sheet after this operation: [['A'], ['D'], ['C'], ['B']]
		* ```
		*
		* @category Rows
		*/
		setRowOrder(sheetId, newRowOrder) {
			validateArgToType(sheetId, "number", "sheetId");
			const mapping = this._crudOperations.mappingFromOrder(sheetId, newRowOrder, "row");
			return this.swapRowIndexes(sheetId, mapping);
		}
		/**
		* Checks if it is possible to reorder rows of a sheet according to a permutation.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {number[]} newRowOrder - permutation of rows
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  [1],
		*  [2],
		*  [4, 5],
		* ]);
		*
		* // returns true
		* hfInstance.isItPossibleToSetRowOrder(0, [2, 1, 0]);
		*
		* // returns false
		* hfInstance.isItPossibleToSetRowOrder(0, [2]);
		* ```
		*
		* @category Rows
		*/
		isItPossibleToSetRowOrder(sheetId, newRowOrder) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				const rowMapping = this._crudOperations.mappingFromOrder(sheetId, newRowOrder, "row");
				this._crudOperations.validateSwapRowIndexes(sheetId, rowMapping);
				this._crudOperations.testRowOrderForArrays(sheetId, rowMapping);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Reorders columns of a sheet according to a source-target mapping.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {[number, number][]} columnMapping - array mapping original positions to final positions of columns
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when columnMapping does not define correct column permutation for some subset of columns of the given sheet
		* @throws [[SourceLocationHasArrayError]] when the selected position has array inside
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  [1, 2, 4],
		*  [5]
		* ]);
		*
		* // should set swap columns 0 and 2 in place, returns:
		* // [{
		* //   address: { sheet: 0, col: 2, row: 0 },
		* //   newValue: 1,
		* // },
		* // {
		* //   address: { sheet: 0, col: 2, row: 1 },
		* //   newValue: 5,
		* // },
		* // {
		* //   address: { sheet: 0, col: 0, row: 0 },
		* //   newValue: 4,
		* // },
		* // {
		* //   address: { sheet: 0, col: 0, row: 1 },
		* //   newValue: null,
		* // }]
		* const changes = hfInstance.swapColumnIndexes(0, [[0, 2], [2, 0]]);
		* ```
		*
		* @category Columns
		*/
		swapColumnIndexes(sheetId, columnMapping) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.setColumnOrder(sheetId, columnMapping);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Checks if it is possible to reorder columns of a sheet according to a source-target mapping.
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  [1, 2, 4],
		*  [5]
		* ]);
		*
		* // returns true
		* hfInstance.isItPossibleToSwapColumnIndexes(0, [[0, 2], [2, 0]]);
		*
		* // returns false
		* hfInstance.isItPossibleToSwapColumnIndexes(0, [[0, 1]]);
		* ```
		*
		* @category Columns
		*/
		isItPossibleToSwapColumnIndexes(sheetId, columnMapping) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				this._crudOperations.validateSwapColumnIndexes(sheetId, columnMapping);
				this._crudOperations.testColumnOrderForArrays(sheetId, columnMapping);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Reorders columns of a sheet according to a permutation of 0-based indexes.
		* Parameter `newColumnOrder` should have a form `[ newPositionForColumn0, newPositionForColumn1, newPositionForColumn2, ... ]`.
		* This method might be used to [sort the columns of a sheet](../../guide/sorting-data.md).
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note: This method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {number[]} newColumnOrder - permutation of columns; array length must match the number of columns returned by [getSheetDimensions()](#getsheetdimensions)
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when columnMapping does not define correct column permutation for some subset of columns of the given sheet
		* @throws [[SourceLocationHasArrayError]] when the selected position has array inside
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   ['A', 'B', 'C', 'D']
		* ]);
		*
		* const newColumnOrder = [0, 3, 2, 1]; // [ newPosForA, newPosForB, newPosForC, newPosForD ]
		*
		* const changes = hfInstance.setColumnOrder(0, newColumnOrder);
		*
		* // Sheet after this operation: [['A', 'D', 'C', 'B']]
		* ```
		*
		* @category Columns
		*/
		setColumnOrder(sheetId, newColumnOrder) {
			validateArgToType(sheetId, "number", "sheetId");
			const mapping = this._crudOperations.mappingFromOrder(sheetId, newColumnOrder, "column");
			return this.swapColumnIndexes(sheetId, mapping);
		}
		/**
		* Checks if it is possible to reorder columns of a sheet according to a permutation.
		*
		* @param {number} sheetId - ID of a sheet to operate on
		* @param {number[]} newColumnOrder - permutation of columns
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  [1, 2, 4],
		*  [5]
		* ]);
		*
		* // returns true
		* hfInstance.isItPossibleToSetColumnOrder(0, [2, 1, 0]);
		*
		* // returns false
		* hfInstance.isItPossibleToSetColumnOrder(0, [1]);
		* ```
		*
		* @category Columns
		*/
		isItPossibleToSetColumnOrder(sheetId, newColumnOrder) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				const columnMapping = this._crudOperations.mappingFromOrder(sheetId, newColumnOrder, "column");
				this._crudOperations.validateSwapColumnIndexes(sheetId, columnMapping);
				this._crudOperations.testColumnOrderForArrays(sheetId, columnMapping);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Returns information whether it is possible to add rows into a specified position in a given sheet.
		* Checks against particular rules to ascertain that addRows can be called.
		* If returns `true`, doing [[addRows]] operation won't throw any errors.
		* Returns `false` if adding rows would exceed the sheet size limit or given arguments are invalid.
		*
		* @param {number} sheetId - sheet ID in which rows will be added
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format [row, amount], where row is a row number above which the rows will be added
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2', '3'],
		* ]);
		*
		* // should return 'true' for this example,
		* // it is possible to add one row in the second row of sheet 0
		* const isAddable = hfInstance.isItPossibleToAddRows(0, [1, 1]);
		* ```
		*
		* @category Rows
		*/
		isItPossibleToAddRows(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			const normalizedIndexes = normalizeAddedIndexes(indexes);
			try {
				this._crudOperations.ensureItIsPossibleToAddRows(sheetId, ...normalizedIndexes);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Adds multiple rows into a specified position in a given sheet.
		* Does nothing if rows are outside effective sheet size.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - sheet ID in which rows will be added
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format [row, amount], where row is a row number above which the rows will be added
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[SheetSizeLimitExceededError]] when performing this operation would result in sheet size limits exceeding
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		* ]);
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values
		* const changes = hfInstance.addRows(0, [0, 1]);
		* ```
		*
		* @category Rows
		*/
		addRows(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.addRows(sheetId, ...indexes);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to remove rows from a specified position in a given sheet.
		* Checks against particular rules to ascertain that removeRows can be called.
		* If returns `true`, doing [[removeRows]] operation won't throw any errors.
		* Returns `false` if given arguments are invalid.
		*
		* @param {number} sheetId - sheet ID from which rows will be removed
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format: [row, amount]
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		* ]);
		*
		* // should return 'true' for this example
		* // it is possible to remove one row from row 1 of sheet 0
		* const isRemovable = hfInstance.isItPossibleToRemoveRows(0, [1, 1]);
		* ```
		*
		* @category Rows
		*/
		isItPossibleToRemoveRows(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			const normalizedIndexes = normalizeRemovedIndexes(indexes);
			try {
				this._crudOperations.ensureItIsPossibleToRemoveRows(sheetId, ...normalizedIndexes);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Removes multiple rows from a specified position in a given sheet.
		* Does nothing if rows are outside the effective sheet size.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - sheet ID from which rows will be removed
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format: [row, amount]
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[InvalidArgumentsError]] when the given arguments are invalid
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		* ]);
		*
		* // should return: [{ sheet: 0, col: 1, row: 2, value: null }] for this example
		* const changes = hfInstance.removeRows(0, [1, 1]);
		* ```
		*
		* @category Rows
		*/
		removeRows(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.removeRows(sheetId, ...indexes);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to add columns into a specified position in a given sheet.
		* Checks against particular rules to ascertain that addColumns can be called.
		* If returns `true`, doing [[addColumns]] operation won't throw any errors.
		* Returns `false` if adding columns would exceed the sheet size limit or given arguments are invalid.
		*
		* @param {number} sheetId - sheet ID in which columns will be added
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format: [column, amount], where column is a column number from which new columns will be added
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // should return 'true' for this example,
		* // it is possible to add 1 column in sheet 0, at column 1
		* const isAddable = hfInstance.isItPossibleToAddColumns(0, [1, 1]);
		* ```
		*
		* @category Columns
		*/
		isItPossibleToAddColumns(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			const normalizedIndexes = normalizeAddedIndexes(indexes);
			try {
				this._crudOperations.ensureItIsPossibleToAddColumns(sheetId, ...normalizedIndexes);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Adds multiple columns into a specified position in a given sheet.
		* Does nothing if the columns are outside the effective sheet size.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - sheet ID in which columns will be added
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format: [column, amount], where column is a column number from which new columns will be added
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when the given arguments are invalid
		* @throws [[SheetSizeLimitExceededError]] when performing this operation would result in sheet size limits exceeding
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=RAND()', '42'],
		* ]);
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values, for this example:
		* // [{
		* //   address: { sheet: 0, col: 1, row: 0 },
		* //   newValue: 0.92754862796338,
		* // }]
		* const changes = hfInstance.addColumns(0, [0, 1]);
		* ```
		*
		* @category Columns
		*/
		addColumns(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.addColumns(sheetId, ...indexes);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to remove columns from a specified position in a given sheet.
		* Checks against particular rules to ascertain that removeColumns can be called.
		* If returns `true`, doing [[removeColumns]] operation won't throw any errors.
		* Returns `false` if given arguments are invalid.
		*
		* @param {number} sheetId - sheet ID from which columns will be removed
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format [column, amount]
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // should return 'true' for this example
		* // it is possible to remove one column, in place of the second column of sheet 0
		* const isRemovable = hfInstance.isItPossibleToRemoveColumns(0, [1, 1]);
		* ```
		*
		* @category Columns
		*/
		isItPossibleToRemoveColumns(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			const normalizedIndexes = normalizeRemovedIndexes(indexes);
			try {
				this._crudOperations.ensureItIsPossibleToRemoveColumns(sheetId, ...normalizedIndexes);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Removes multiple columns from a specified position in a given sheet.
		* Does nothing if columns are outside the effective sheet size.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - sheet ID from which columns will be removed
		* @param {ColumnRowIndex[]} indexes - non-contiguous indexes with format: [column, amount]
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when the given arguments are invalid
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['0', '=SUM(1, 2, 3)', '=A1'],
		* ]);
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values, in this example it will return:
		* // [{
		* //   address: { sheet: 0, col: 1, row: 0 },
		* //   newValue: { error: [CellError], value: '#REF!' },
		* // }]
		* const changes = hfInstance.removeColumns(0, [0, 1]);
		* ```
		*
		* @category Columns
		*/
		removeColumns(sheetId, ...indexes) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.removeColumns(sheetId, ...indexes);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to move cells to a specified position in a given sheet.
		* Checks against particular rules to ascertain that moveCells can be called.
		* If returns `true`, doing [[moveCells]] operation won't throw any errors.
		* Returns `false` if the operation might be disrupted and causes side effects by the fact that there is an array inside the selected columns, the target location includes an array or the provided address is invalid.
		*
		* @param {SimpleCellRange} source - range for a moved block
		* @param {SimpleCellAddress} destinationLeftCorner - upper left address of the target cell block
		*
		* @throws [[ExpectedValueOfTypeError]] if destinationLeftCorner, source, or any of basic type arguments are of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // choose the coordinates and assign them to variables
		* const source = { sheet: 0, col: 1, row: 0 };
		* const destination = { sheet: 0, col: 3, row: 0 };
		*
		* // should return 'true' for this example
		* // it is possible to move a block of width 1 and height 1
		* // from the corner: column 1 and row 0 of sheet 0
		* // into destination corner: column 3, row 0 of sheet 0
		* const isMovable = hfInstance.isItPossibleToMoveCells({ start: source, end: source }, destination);
		* ```
		* @category Cells
		*/
		isItPossibleToMoveCells(source, destinationLeftCorner) {
			if (!isSimpleCellAddress(destinationLeftCorner)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "destinationLeftCorner");
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			try {
				const range = new AbsoluteCellRange(source.start, source.end);
				this._crudOperations.operations.ensureItIsPossibleToMoveCells(range.start, range.width(), range.height(), destinationLeftCorner);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Moves the content of a cell block from source to the target location.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {SimpleCellRange} source - range for a moved block
		* @param {SimpleCellAddress} destinationLeftCorner - upper left address of the target cell block
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if destinationLeftCorner or source are of wrong type
		* @throws [[InvalidArgumentsError]] when the given arguments are invalid
		* @throws [[SheetSizeLimitExceededError]] when performing this operation would result in sheet size limits exceeding
		* @throws [[SourceLocationHasArrayError]] when the source location has array inside - array cannot be moved
		* @throws [[TargetLocationHasArrayError]] when the target location has array inside - cells cannot be replaced by the array
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=RAND()', '42'],
		* ]);
		*
		* // choose the coordinates and assign them to variables
		* const source = { sheet: 0, col: 1, row: 0 };
		* const destination = { sheet: 0, col: 3, row: 0 };
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values, for this example:
		* // [{
		* //   address: { sheet: 0, col: 0, row: 0 },
		* //   newValue: 0.93524248002062,
		* // }]
		* const changes = hfInstance.moveCells({ start: source, end: source }, destination);
		* ```
		*
		* @category Cells
		*/
		moveCells(source, destinationLeftCorner) {
			if (!isSimpleCellAddress(destinationLeftCorner)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "destinationLeftCorner");
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			const range = new AbsoluteCellRange(source.start, source.end);
			this._crudOperations.moveCells(range.start, range.width(), range.height(), destinationLeftCorner);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to move a particular number of rows to a specified position in a given sheet.
		* Checks against particular rules to ascertain that moveRows can be called.
		* If returns `true`, doing [[moveRows]] operation won't throw any errors.
		* Returns `false` if the operation might be disrupted and causes side effects by the fact that there is an array inside the selected rows, the target location includes an array or the provided address is invalid.
		*
		* @param {number} sheetId - a sheet number in which the operation will be performed
		* @param {number} startRow - number of the first row to move
		* @param {number} numberOfRows - number of rows to move
		* @param {number} targetRow - row number before which rows will be moved
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		* ]);
		*
		* // should return 'true' for this example
		* // it is possible to move one row from row 0 into row 2
		* const isMovable = hfInstance.isItPossibleToMoveRows(0, 0, 1, 2);
		* ```
		*
		* @category Rows
		*/
		isItPossibleToMoveRows(sheetId, startRow, numberOfRows, targetRow) {
			validateArgToType(sheetId, "number", "sheetId");
			validateArgToType(startRow, "number", "startRow");
			validateArgToType(numberOfRows, "number", "numberOfRows");
			validateArgToType(targetRow, "number", "targetRow");
			try {
				this._crudOperations.ensureItIsPossibleToMoveRows(sheetId, startRow, numberOfRows, targetRow);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Moves a particular number of rows to a specified position in a given sheet.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - a sheet number in which the operation will be performed
		* @param {number} startRow - number of the first row to move
		* @param {number} numberOfRows - number of rows to move
		* @param {number} targetRow - row number before which rows will be moved
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[InvalidArgumentsError]] when the given arguments are invalid
		* @throws [[SourceLocationHasArrayError]] when the source location has array inside - array cannot be moved
		* @throws [[TargetLocationHasArrayError]] when the target location has array inside - cells cannot be replaced by the array
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1'],
		*  ['2'],
		* ]);
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values
		* const changes = hfInstance.moveRows(0, 0, 1, 2);
		* ```
		*
		* @category Rows
		*/
		moveRows(sheetId, startRow, numberOfRows, targetRow) {
			validateArgToType(sheetId, "number", "sheetId");
			validateArgToType(startRow, "number", "startRow");
			validateArgToType(numberOfRows, "number", "numberOfRows");
			validateArgToType(targetRow, "number", "targetRow");
			this._crudOperations.moveRows(sheetId, startRow, numberOfRows, targetRow);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to move a particular number of columns to a specified position in a given sheet.
		* Checks against particular rules to ascertain that moveColumns can be called.
		* If returns `true`, doing [[moveColumns]] operation won't throw any errors.
		* Returns `false` if the operation might be disrupted and causes side effects by the fact that there is an array inside the selected columns, the target location includes an array or the provided address is invalid.
		*
		* @param {number} sheetId - a sheet number in which the operation will be performed
		* @param {number} startColumn - number of the first column to move
		* @param {number} numberOfColumns - number of columns to move
		* @param {number} targetColumn - column number before which columns will be moved
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // should return 'true' for this example
		* // it is possible to move one column from column 1 into column 2 of sheet 0
		* const isMovable = hfInstance.isItPossibleToMoveColumns(0, 1, 1, 2);
		* ```
		*
		* @category Columns
		*/
		isItPossibleToMoveColumns(sheetId, startColumn, numberOfColumns, targetColumn) {
			validateArgToType(sheetId, "number", "sheetId");
			validateArgToType(startColumn, "number", "startColumn");
			validateArgToType(numberOfColumns, "number", "numberOfColumns");
			validateArgToType(targetColumn, "number", "targetColumn");
			try {
				this._crudOperations.ensureItIsPossibleToMoveColumns(sheetId, startColumn, numberOfColumns, targetColumn);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Moves a particular number of columns to a specified position in a given sheet.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - a sheet number in which the operation will be performed
		* @param {number} startColumn - number of the first column to move
		* @param {number} numberOfColumns - number of columns to move
		* @param {number} targetColumn - column number before which columns will be moved
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[InvalidArgumentsError]] when the given arguments are invalid
		* @throws [[SourceLocationHasArrayError]] when the source location has array inside - array cannot be moved
		* @throws [[TargetLocationHasArrayError]] when the target location has array inside - cells cannot be replaced by the array
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2', '3', '=RAND()', '=SUM(A1:C1)'],
		* ]);
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values, for this example:
		* // [{
		* //   address: { sheet: 0, col: 1, row: 0 },
		* //   newValue: 0.16210054671639,
		* //  }, {
		* //   address: { sheet: 0, col: 4, row: 0 },
		* //   newValue: 6.16210054671639,
		* // }]
		* const changes = hfInstance.moveColumns(0, 1, 1, 2);
		* ```
		*
		* @category Columns
		*/
		moveColumns(sheetId, startColumn, numberOfColumns, targetColumn) {
			validateArgToType(sheetId, "number", "sheetId");
			validateArgToType(startColumn, "number", "startColumn");
			validateArgToType(numberOfColumns, "number", "numberOfColumns");
			validateArgToType(targetColumn, "number", "targetColumn");
			this._crudOperations.moveColumns(sheetId, startColumn, numberOfColumns, targetColumn);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Stores a copy of the cell block in internal clipboard for the further paste.
		* Returns the copied values for use in external clipboard.
		*
		* For more information, see the [Clipboard Operations guide](/guide/clipboard-operations.md).
		*
		* @param {SimpleCellRange} source - rectangle range to copy
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if source is of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   ['1', '2'],
		* ]);
		*
		* // it copies [ [ 2 ] ]
		* const clipboardContent = hfInstance.copy({
		*   start: { sheet: 0, col: 1, row: 0 },
		*   end: { sheet: 0, col: 1, row: 0 },
		* });
		* ```
		*
		* The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).
		*
		* @category Clipboard
		*/
		copy(source) {
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			const range = new AbsoluteCellRange(source.start, source.end);
			this._crudOperations.copy(range.start, range.width(), range.height());
			return this.getRangeValues(source);
		}
		/**
		* Stores information of the cell block in internal clipboard for further paste.
		* Calling [[paste]] right after this method is equivalent to call [[moveCells]].
		* Almost any CRUD operation called after this method will abort the cut operation.
		* Returns the cut values for use in external clipboard.
		*
		* For more information, see the [Clipboard Operations guide](/guide/clipboard-operations.md).
		*
		* @param {SimpleCellRange} source - rectangle range to cut
		*
		* @throws [[ExpectedValueOfTypeError]] if source is of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   ['1', '2'],
		* ]);
		*
		* // returns the values that were cut: [ [ 1 ] ]
		* const clipboardContent = hfInstance.cut({
		*   start: { sheet: 0, col: 0, row: 0 },
		*   end: { sheet: 0, col: 0, row: 0 },
		* });
		* ```
		*
		* The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).
		*
		* @category Clipboard
		*/
		cut(source) {
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			const range = new AbsoluteCellRange(source.start, source.end);
			this._crudOperations.cut(range.start, range.width(), range.height());
			return this.getRangeValues(source);
		}
		/**
		* When called after [[copy]] it pastes copied values and formulas into a cell block.
		* When called after [[cut]] it performs [[moveCells]] operation into the cell block.
		* Does nothing if the clipboard is empty.
		*
		* For more information, see the [Clipboard Operations guide](/guide/clipboard-operations.md).
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {SimpleCellAddress} targetLeftCorner - upper left address of the target cell block
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[SheetSizeLimitExceededError]] when performing this operation would result in sheet size limits exceeding
		* @throws [[NothingToPasteError]] when clipboard is empty
		* @throws [[TargetLocationHasArrayError]] when the selected target area has array inside
		* @throws [[ExpectedValueOfTypeError]] if targetLeftCorner is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   ['1', '2'],
		* ]);
		*
		* // [ [ 2 ] ] was copied
		* const clipboardContent = hfInstance.copy({
		*   start: { sheet: 0, col: 1, row: 0 },
		*   end: { sheet: 0, col: 1, row: 0 },
		* });
		*
		* // returns a list of modified cells: their absolute addresses and new values
		* const changes = hfInstance.paste({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).
		*
		* @category Clipboard
		*/
		paste(targetLeftCorner) {
			if (!isSimpleCellAddress(targetLeftCorner)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "targetLeftCorner");
			this.ensureEvaluationIsNotSuspended();
			this._crudOperations.paste(targetLeftCorner);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether there is something in the clipboard.
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // copy desired content
		* const clipboardContent = hfInstance.copy({
		*   start: { sheet: 0, col: 1, row: 0 },
		*   end: { sheet: 0, col: 1, row: 0 },
		* });
		*
		* // returns 'false', there is content in the clipboard
		* const isClipboardEmpty = hfInstance.isClipboardEmpty();
		* ```
		*
		* The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).
		*
		* @category Clipboard
		*/
		isClipboardEmpty() {
			return this._crudOperations.isClipboardEmpty();
		}
		/**
		* Clears the clipboard content.
		*
		* @example
		* ```js
		* // clears the clipboard, isClipboardEmpty() should return true if called afterwards
		* hfInstance.clearClipboard();
		* ```
		*
		* The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).
		*
		* @category Clipboard
		*/
		clearClipboard() {
			this._crudOperations.clearClipboard();
		}
		/**
		* Clears the redo stack in undoRedo history.
		*
		* For more information, see the [Undo-Redo guide](/guide/undo-redo.md).
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   ['1', '2', '3'],
		* ]);
		*
		* // do an operation, for example remove columns
		* hfInstance.removeColumns(0, [0, 1]);
		*
		* // undo the operation
		* hfInstance.undo();
		*
		* // redo the operation
		* hfInstance.redo();
		*
		* // clear the redo stack
		* hfInstance.clearRedoStack();
		* ```
		*
		* @category Undo and Redo
		*/
		clearRedoStack() {
			this._crudOperations.undoRedo.clearRedoStack();
		}
		/**
		* Clears the undo stack in undoRedo history.
		*
		* For more information, see the [Undo-Redo guide](/guide/undo-redo.md).
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   ['1', '2', '3'],
		* ]);
		*
		* // do an operation, for example remove columns
		* hfInstance.removeColumns(0, [0, 1]);
		*
		* // undo the operation
		* hfInstance.undo();
		*
		* // clear the undo stack
		* hfInstance.clearUndoStack();
		* ```
		*
		* @category Undo and Redo
		*/
		clearUndoStack() {
			this._crudOperations.undoRedo.clearUndoStack();
		}
		/**
		* Returns the cell content of a given range in a [[CellValue]][][] format.
		*
		* @param {SimpleCellRange} source - rectangular range
		*
		* @throws [[ExpectedValueOfTypeError]] if source is of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2)', '2', '10'],
		*  ['5', '6', '7'],
		*  ['40', '30', '20'],
		* ]);
		*
		*
		* // returns calculated cells content: [ [ 3, 2 ], [ 5, 6 ] ]
		* const rangeValues = hfInstance.getRangeValues({ start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 } });
		* ```
		*
		* @category Ranges
		*/
		getRangeValues(source) {
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			return new AbsoluteCellRange(source.start, source.end).arrayOfAddressesInRange().map((subarray) => subarray.map((address) => this.getCellValue(address)));
		}
		/**
		* Returns cell formulas in given range.
		*
		* @param {SimpleCellRange} source - rectangular range
		*
		* @throws [[ExpectedValueOfTypeError]] if source is of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2)', '2', '10'],
		*  ['5', '6', '7'],
		*  ['40', '30', '20'],
		* ]);
		*
		* // returns cell formulas of a given range only:
		* // [ [ '=SUM(1, 2)', undefined ], [ undefined, undefined ] ]
		* const rangeFormulas = hfInstance.getRangeFormulas({ start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 } });
		* ```
		*
		* @category Ranges
		*/
		getRangeFormulas(source) {
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			return new AbsoluteCellRange(source.start, source.end).arrayOfAddressesInRange().map((subarray) => subarray.map((address) => this.getCellFormula(address)));
		}
		/**
		* Returns serialized cells in given range.
		*
		* @param {SimpleCellRange} source - rectangular range
		*
		* @throws [[ExpectedValueOfTypeError]] if source is of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2)', '2', '10'],
		*  ['5', '6', '7'],
		*  ['40', '30', '20'],
		* ]);
		*
		* // should return serialized cell content for the given range:
		* // [ [ '=SUM(1, 2)', 2 ], [ 5, 6 ] ]
		* const rangeSerialized = hfInstance.getRangeSerialized({ start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 } });
		* ```
		*
		* @category Ranges
		*/
		getRangeSerialized(source) {
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			return new AbsoluteCellRange(source.start, source.end).arrayOfAddressesInRange().map((subarray) => subarray.map((address) => this.getCellSerialized(address)));
		}
		/**
		* Returns values to fill target range using source range, with properly extending the range using wrap-around heuristic.
		*
		* @param {SimpleCellRange} source of data
		* @param {SimpleCellRange} target range where data is intended to be put
		* @param {boolean} offsetsFromTarget if true, offsets are computed from target corner, otherwise from source corner
		*
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[ExpectedValueOfTypeError]] if source or target are of wrong type
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([[1, '=A1'], ['=$A$1', '2']]);
		*
		* // should return [['2', '=$A$1', '2'], ['=A3', 1, '=C3'], ['2', '=$A$1', '2']]
		* hfInstance.getFillRangeData( {start: {sheet: 0, row: 0, col: 0}, end: {sheet: 0, row: 1, col: 1}},
		* {start: {sheet: 0, row: 1, col: 1}, end: {sheet: 0, row: 3, col: 3}});
		* ```
		*
		* @category Ranges
		*/
		getFillRangeData(source, target, offsetsFromTarget = false) {
			if (!isSimpleCellRange(source)) throw new ExpectedValueOfTypeError("SimpleCellRange", "source");
			if (!isSimpleCellRange(target)) throw new ExpectedValueOfTypeError("SimpleCellRange", "target");
			const sourceRange = new AbsoluteCellRange(source.start, source.end);
			const targetRange = new AbsoluteCellRange(target.start, target.end);
			this.ensureEvaluationIsNotSuspended();
			return targetRange.arrayOfAddressesInRange().map((subarray) => subarray.map((address) => {
				const row = ((address.row - (offsetsFromTarget ? target : source).start.row) % sourceRange.height() + sourceRange.height()) % sourceRange.height() + source.start.row;
				const col = ((address.col - (offsetsFromTarget ? target : source).start.col) % sourceRange.width() + sourceRange.width()) % sourceRange.width() + source.start.col;
				return this._serialization.getCellSerialized({
					row,
					col,
					sheet: sourceRange.sheet
				}, address);
			}));
		}
		/**
		* Returns information whether it is possible to add a sheet to the engine.
		* Checks against particular rules to ascertain that addSheet can be called.
		* If returns `true`, doing [[addSheet]] operation won't throw any errors, and it is possible to add sheet with provided name.
		* Returns `false` if the chosen name is already used.
		*
		* @param {string} sheetName - sheet name, case-insensitive
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*   MySheet1: [ ['1'] ],
		*   MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'false' because 'MySheet2' already exists
		* const isAddable = hfInstance.isItPossibleToAddSheet('MySheet2');
		* ```
		*
		* @category Sheets
		*/
		isItPossibleToAddSheet(sheetName) {
			validateArgToType(sheetName, "string", "sheetName");
			try {
				this._crudOperations.ensureItIsPossibleToAddSheet(sheetName);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Adds a new sheet to the HyperFormula instance. Returns given or autogenerated name of a new sheet.
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {string} [sheetName] - if not specified, name is autogenerated
		*
		* @fires [[sheetAdded]] after the sheet was added
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[SheetNameAlreadyTakenError]] when sheet with a given name already exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'MySheet3'
		* const nameProvided = hfInstance.addSheet('MySheet3');
		*
		* // should return autogenerated 'Sheet4'
		* // because no name was provided and 3 other ones already exist
		* const generatedName = hfInstance.addSheet();
		* ```
		*
		* @category Sheets
		*/
		addSheet(sheetName) {
			if (sheetName !== void 0) validateArgToType(sheetName, "string", "sheetName");
			const addedSheetName = this._crudOperations.addSheet(sheetName);
			this.recomputeIfDependencyGraphNeedsIt();
			this._emitter.emit(Events.SheetAdded, addedSheetName);
			return addedSheetName;
		}
		/**
		* Returns information whether it is possible to remove sheet for the engine.
		* Returns `true` if the provided sheet exists, and therefore it can be removed, doing [[removeSheet]] operation won't throw any errors.
		* Returns `false` otherwise
		*
		* @param {number} sheetId - sheet ID.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'true' because sheet with ID 1 exists and is removable
		* const isRemovable = hfInstance.isItPossibleToRemoveSheet(1);
		* ```
		*
		* @category Sheets
		*/
		isItPossibleToRemoveSheet(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				this._crudOperations.ensureScopeIdIsValid(sheetId);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Removes a sheet
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - sheet ID.
		*
		* @fires [[sheetRemoved]] after the sheet was removed
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['=SUM(MySheet2!A1:A2)'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values, in this example it will return:
		* // [{
		* //   address: { sheet: 0, col: 0, row: 0 },
		* //   newValue: { error: [CellError], value: '#REF!' },
		* // }]
		* const changes = hfInstance.removeSheet(1);
		* ```
		*
		* @category Sheets
		*/
		removeSheet(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			const displayName = this.sheetMapping.getSheetName(sheetId);
			this._crudOperations.removeSheet(sheetId);
			const changes = this.recomputeIfDependencyGraphNeedsIt();
			this._emitter.emit(Events.SheetRemoved, displayName, changes);
			return changes;
		}
		/**
		* Returns information whether it is possible to clear a specified sheet.
		* If returns `true`, doing [[clearSheet]] operation won't throw any errors, provided sheet exists and its content can be cleared.
		* Returns `false` otherwise
		*
		* @param {number} sheetId - sheet ID.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'true' because 'MySheet2' exists and can be cleared
		* const isClearable = hfInstance.isItPossibleToClearSheet(1);
		* ```
		*
		* @category Sheets
		*/
		isItPossibleToClearSheet(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				this._crudOperations.ensureScopeIdIsValid(sheetId);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Clears the sheet content. Double-checks if the sheet exists.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - sheet ID.
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['=SUM(MySheet2!A1:A2)'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values, in this example it will return:
		* // [{
		* //   address: { sheet: 0, col: 0, row: 0 },
		* //   newValue: 0,
		* // }]
		* const changes = hfInstance.clearSheet(0);
		* ```
		*
		* @category Sheets
		*/
		clearSheet(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.clearSheet(sheetId);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to replace the sheet content.
		* If returns `true`, doing [[setSheetContent]] operation won't throw any errors, the provided sheet exists and then its content can be replaced.
		* Returns `false` otherwise
		*
		* @param {number} sheetId - sheet ID.
		* @param {RawCellContent[][]} values - array of new values
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'true' because sheet of ID 0 exists
		* // and the provided content can be placed in this sheet
		* const isReplaceable = hfInstance.isItPossibleToReplaceSheetContent(0, [['50'], ['60']]);
		* ```
		*
		* @category Sheets
		*/
		isItPossibleToReplaceSheetContent(sheetId, values) {
			validateArgToType(sheetId, "number", "sheetId");
			try {
				this._crudOperations.ensureScopeIdIsValid(sheetId);
				this._crudOperations.ensureItIsPossibleToChangeSheetContents(sheetId, values);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Replaces the sheet content with new values.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* @param {number} sheetId - sheet ID.
		* @param {RawCellContent[][]} values - array of new values
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[InvalidArgumentsError]] when values argument is not an array of arrays
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return a list of cells which values changed after the operation,
		* // their absolute addresses and new values
		* const changes = hfInstance.setSheetContent(0, [['50'], ['60']]);
		* ```
		*
		* @category Sheets
		*/
		setSheetContent(sheetId, values) {
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.setSheetContent(sheetId, values);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Computes the simple (absolute) address of a cell address, based on its string representation.
		* - If a sheet name is present in the string representation but is not present in the engine, returns `undefined`.
		* - If no sheet name is present in the string representation, uses `contextSheetId` as a sheet id in the returned address.
		*
		* For more information, see the [Cell references guide](/guide/cell-references.md).
		*
		* @param {string} cellAddress - string representation of cell address in A1 notation
		* @param {number} contextSheetId - sheet id used to construct the simple address in case of missing sheet name in `cellAddress` argument
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		* hfInstance.addSheet('Sheet0'); //sheetId = 0
		*
		* // returns { sheet: 42, col: 0, row: 0 }
		* const simpleCellAddress = hfInstance.simpleCellAddressFromString('A1', 42);
		*
		* // returns { sheet: 0, col: 0, row: 5 }
		* const simpleCellAddress = hfInstance.simpleCellAddressFromString('Sheet0!A6', 42);
		*
		* // returns { sheet: 0, col: 0, row: 5 }
		* const simpleCellAddress = hfInstance.simpleCellAddressFromString('Sheet0!$A$6', 42);
		*
		* // returns 'undefined', as there's no 'Sheet 2' in the HyperFormula instance
		* const simpleCellAddress = hfInstance.simpleCellAddressFromString('Sheet2!A6', 42);
		* ```
		*
		* @category Helpers
		*/
		simpleCellAddressFromString(cellAddress, contextSheetId) {
			validateArgToType(cellAddress, "string", "cellAddress");
			validateArgToType(contextSheetId, "number", "sheetId");
			return simpleCellAddressFromString(this.sheetMapping.getSheetId.bind(this.sheetMapping), cellAddress, contextSheetId);
		}
		/**
		* Computes simple (absolute) address of a cell range based on its string representation.
		* If sheet name is present in string representation but not present in the engine, returns `undefined`.
		*
		* For more information, see the [Cell references guide](/guide/cell-references.md).
		*
		* @param {string} cellRange - string representation of cell range in A1 notation
		* @param {number} contextSheetId - sheet id used to construct the simple address in case of missing sheet name in `cellRange` argument
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		* hfInstance.addSheet('Sheet0'); //sheetId = 0
		*
		* // should return { start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 0 } }
		* const simpleCellAddress = hfInstance.simpleCellRangeFromString('A1:A2', 0);
		* ```
		*
		* @category Helpers
		*/
		simpleCellRangeFromString(cellRange, contextSheetId) {
			validateArgToType(cellRange, "string", "cellRange");
			validateArgToType(contextSheetId, "number", "sheetId");
			return simpleCellRangeFromString(this.sheetMapping.getSheetId.bind(this.sheetMapping), cellRange, contextSheetId);
		}
		/**
		* Computes string representation of an absolute address in A1 notation. If `cellAddress.sheet` is not present in the engine, returns `undefined`.
		*
		* For more information, see the [Cell references guide](/guide/cell-references.md).
		*
		* @param {SimpleCellAddress} cellAddress - object representation of an absolute address
		* @param {object | number} optionsOrContextSheetId - options object or number used as context sheet id to construct the string address (see examples)
		*
		* @throws [[ExpectedValueOfTypeError]] if its arguments are of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		* hfInstance.addSheet('Sheet0'); //sheetId = 0
		* const addr = { sheet: 0, col: 1, row: 1 };
		*
		* // should return 'B2'
		* const A1Notation = hfInstance.simpleCellAddressToString(addr);
		*
		* // should return 'B2'
		* const A1Notation = hfInstance.simpleCellAddressToString(addr, { includeSheetName: false });
		*
		* // should return 'Sheet0!B2'
		* const A1Notation = hfInstance.simpleCellAddressToString(addr, { includeSheetName: true });
		*
		* // should return 'B2' as context sheet id is the same as addr.sheet
		* const A1Notation = hfInstance.simpleCellAddressToString(addr, 0);
		*
		* // should return 'Sheet0!B2' as context sheet id is different from addr.sheet
		* const A1Notation = hfInstance.simpleCellAddressToString(addr, 42);
		* ```
		*
		* @category Helpers
		*/
		simpleCellAddressToString(cellAddress, optionsOrContextSheetId = {}) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			const contextSheetId = typeof optionsOrContextSheetId === "number" ? optionsOrContextSheetId : optionsOrContextSheetId.includeSheetName ? cellAddress.sheet + 1 : cellAddress.sheet;
			return simpleCellAddressToString(this.sheetMapping.getSheetNameOrThrowError.bind(this.sheetMapping), cellAddress, contextSheetId);
		}
		/**
		* Computes string representation of an absolute range in A1 notation.
		* Returns `undefined` if:
		* - `cellRange` is not a valid range,
		* - `cellRange.start.sheet` and `cellRange.start.end` are different,
		* - `cellRange.start.sheet` is not present in the engine,
		* - `cellRange.start.end` is not present in the engine.
		*
		* Note: This method is useful only for cell ranges; does not work with column ranges and row ranges.
		*
		* For more information, see the [Cell references guide](/guide/cell-references.md).
		*
		* @param {SimpleCellRange} cellRange - object representation of an absolute range
		* @param {object | number} optionsOrContextSheetId - options object or number used as context sheet id to construct the string address (see examples)
		*
		* @throws [[ExpectedValueOfTypeError]] if its arguments are of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		* hfInstance.addSheet('Sheet0'); //sheetId = 0
		* const range = { start: { sheet: 0, col: 1, row: 1 }, end: { sheet: 0, col: 2, row: 1 } };
		*
		* // should return 'B2:C2'
		* const A1Notation = hfInstance.simpleCellRangeToString(range);
		*
		* // should return 'B2:C2'
		* const A1Notation = hfInstance.simpleCellRangeToString(range, { includeSheetName: false });
		*
		* // should return 'Sheet0!B2:C2'
		* const A1Notation = hfInstance.simpleCellRangeToString(range, { includeSheetName: true });
		*
		* // should return 'B2:C2' as context sheet id is the same as range.start.sheet and range.end.sheet
		* const A1Notation = hfInstance.simpleCellRangeToString(range, 0);
		*
		* // should return 'Sheet0!B2:C2' as context sheet id is different from range.start.sheet and range.end.sheet
		* const A1Notation = hfInstance.simpleCellRangeToString(range, 42);
		* ```
		*
		* @category Helpers
		*/
		simpleCellRangeToString(cellRange, optionsOrContextSheetId = {}) {
			if (!isSimpleCellRange(cellRange)) throw new ExpectedValueOfTypeError("SimpleCellRange", "cellRange");
			const contextSheetId = typeof optionsOrContextSheetId === "number" ? optionsOrContextSheetId : optionsOrContextSheetId.includeSheetName ? cellRange.start.sheet + cellRange.end.sheet + 1 : cellRange.start.sheet;
			return simpleCellRangeToString(this.sheetMapping.getSheetNameOrThrowError.bind(this.sheetMapping), cellRange, contextSheetId);
		}
		/**
		* Returns all the out-neighbors in the [dependency graph](../../guide/dependency-graph.md) for a given cell address or range. Including:
		* - All cells with formulas that contain the given cell address or range
		* - Some of the ranges that contain the given cell address or range
		*
		* The exact result depends on the optimizations applied by the HyperFormula to the dependency graph, some of which are described in the section ["Optimizations for large ranges"](../../guide/dependency-graph.md#optimizations-for-large-ranges).
		*
		* The returned array includes also named expression dependents. They are represented as cell references with sheet ID `-1`.
		*
		* @param {SimpleCellAddress | SimpleCellRange} address - object representation of an absolute address or range of addresses
		*
		* @throws [[ExpectedValueOfTypeError]] if address is not [[SimpleCellAddress]] or [[SimpleCellRange]]
		* @throws [[SheetsNotEqual]] if range provided has distinct sheet numbers for start and end
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray( [ ['1', '=A1', '=A1+B1'] ] );
		*
		* hfInstance.getCellDependents({ sheet: 0, col: 0, row: 0});
		* // returns [{ sheet: 0, col: 1, row: 0}, { sheet: 0, col: 2, row: 0}]
		* ```
		*
		* @category Helpers
		*/
		getCellDependents(address) {
			let vertex;
			if (isSimpleCellAddress(address)) vertex = this._dependencyGraph.addressMapping.getCell(address);
			else if (isSimpleCellRange(address)) vertex = this._dependencyGraph.rangeMapping.getRangeVertex(address.start, address.end);
			else throw new ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange", address);
			if (vertex === void 0) return [];
			return this._dependencyGraph.getAdjacentNodesAddresses(vertex);
		}
		/**
		* Returns all the in-neighbors in the [dependency graph](../../guide/dependency-graph.md) for a given cell address or range. In particular:
		* - If the argument is a single cell, `getCellPrecedents()` returns all cells and ranges contained in that cell's formula.
		* - If the argument is a range of cells, `getCellPrecedents()` returns some of the cell addresses and smaller ranges contained in that range (but not all of them). The exact result depends on the optimizations applied by the HyperFormula to the dependency graph, some of which are described in the section ["Optimizations for large ranges"](../../guide/dependency-graph.md#optimizations-for-large-ranges).
		*
		* The returned array includes also named expression precedents. They are represented as cell references with sheet ID `-1`.
		*
		* @param {SimpleCellAddress | SimpleCellRange} address - object representation of an absolute address or range of addresses
		*
		* @throws [[ExpectedValueOfTypeError]] if address is of wrong type
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray( [ ['1', '=A1', '=A1+B1'] ] );
		*
		* hfInstance.getCellPrecedents({ sheet: 0, col: 2, row: 0});
		* // returns [{ sheet: 0, col: 0, row: 0}, { sheet: 0, col: 1, row: 0}]
		* ```
		*
		* @category Helpers
		*/
		getCellPrecedents(address) {
			let vertex;
			if (isSimpleCellAddress(address)) vertex = this._dependencyGraph.addressMapping.getCell(address);
			else if (isSimpleCellRange(address)) vertex = this._dependencyGraph.rangeMapping.getRangeVertex(address.start, address.end);
			else throw new ExpectedValueOfTypeError("SimpleCellAddress | SimpleCellRange", address);
			if (vertex === void 0) return [];
			return this._dependencyGraph.dependencyQueryAddresses(vertex);
		}
		/**
		* Returns a unique sheet name assigned to the sheet of a given ID or `undefined` if the there is no sheet with a given ID.
		*
		* @param {number} sheetId - ID of the sheet, for which we want to retrieve name
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'MySheet2' as this sheet is the second one
		* const sheetName = hfInstance.getSheetName(1);
		* ```
		*
		* @category Sheets
		*/
		getSheetName(sheetId) {
			validateArgToType(sheetId, "number", "sheetId");
			return this.sheetMapping.getSheetName(sheetId);
		}
		/**
		* List all sheet names.
		* Returns an array of sheet names as strings.
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // should return all sheets names: ['MySheet1', 'MySheet2']
		* const sheetNames = hfInstance.getSheetNames();
		* ```
		*
		* @category Sheets
		*/
		getSheetNames() {
			return this.sheetMapping.getSheetNames();
		}
		/**
		* Returns a unique sheet ID assigned to the sheet with a given name or `undefined` if the sheet does not exist.
		*
		* @param {string} sheetName - name of the sheet, for which we want to retrieve ID, case-insensitive.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*   MySheet1: [ ['1'] ],
		*   MySheet2: [ ['10'] ],
		* });
		*
		* // should return '0' because 'MySheet1' is of ID '0'
		* const sheetID = hfInstance.getSheetId('MySheet1');
		* ```
		*
		* @category Sheets
		*/
		getSheetId(sheetName) {
			validateArgToType(sheetName, "string", "sheetName");
			return this.sheetMapping.getSheetId(sheetName);
		}
		/**
		* Returns `true` whether sheet with a given name exists. The method accepts sheet name to be checked.
		*
		* @param {string} sheetName - name of the sheet, case-insensitive.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*   MySheet1: [ ['1'] ],
		*   MySheet2: [ ['10'] ],
		* });
		*
		* // should return 'true' since 'MySheet1' exists
		* const sheetExist = hfInstance.doesSheetExist('MySheet1');
		* ```
		*
		* @category Sheets
		*/
		doesSheetExist(sheetName) {
			validateArgToType(sheetName, "string", "sheetName");
			return this.sheetMapping.hasSheetWithName(sheetName);
		}
		/**
		* Returns the type of a cell at a given address.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(A2:A3)', '2'],
		* ]);
		*
		* // should return 'FORMULA', the cell of given coordinates is of this type
		* const cellA1Type = hfInstance.getCellType({ sheet: 0, col: 0, row: 0 });
		*
		* // should return 'VALUE', the cell of given coordinates is of this type
		* const cellB1Type = hfInstance.getCellType({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellType(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			return getCellType(this.dependencyGraph.getCell(cellAddress), cellAddress);
		}
		/**
		* Returns `true` if the specified cell contains a simple value.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(A2:A3)', '2'],
		* ]);
		*
		* // should return 'true' since the selected cell contains a simple value
		* const isA1Simple = hfInstance.doesCellHaveSimpleValue({ sheet: 0, col: 0, row: 0 });
		*
		* // should return 'false' since the selected cell does not contain a simple value
		* const isB1Simple = hfInstance.doesCellHaveSimpleValue({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		doesCellHaveSimpleValue(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			return this.getCellType(cellAddress) === CellType.VALUE;
		}
		/**
		* Returns `true` if the specified cell contains a formula.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(A2:A3)', '2'],
		* ]);
		*
		* // should return 'true' since the A1 cell contains a formula
		* const A1Formula = hfInstance.doesCellHaveFormula({ sheet: 0, col: 0, row: 0 });
		*
		* // should return 'false' since the B1 cell does not contain a formula
		* const B1NoFormula = hfInstance.doesCellHaveFormula({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		doesCellHaveFormula(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			const cellType = this.getCellType(cellAddress);
			return cellType === CellType.FORMULA || cellType === CellType.ARRAYFORMULA;
		}
		/**
		* Returns`true` if the specified cell is empty.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*   [null, '1'],
		* ]);
		*
		* // should return 'true', cell of provided coordinates is empty
		* const isEmpty = hfInstance.isCellEmpty({ sheet: 0, col: 0, row: 0 });
		*
		* // should return 'false', cell of provided coordinates is not empty
		* const isNotEmpty = hfInstance.isCellEmpty({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		isCellEmpty(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			return this.getCellType(cellAddress) === CellType.EMPTY;
		}
		/**
		* Returns `true` if a given cell is a part of an array.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*    ['{=TRANSPOSE(B1:B1)}'],
		* ]);
		*
		* // should return 'true', cell of provided coordinates is a part of an array
		* const isPartOfArray = hfInstance.isCellPartOfArray({ sheet: 0, col: 0, row: 0 });
		* ```
		*
		* @category Cells
		*/
		isCellPartOfArray(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			const cellType = this.getCellType(cellAddress);
			return cellType === CellType.ARRAY || cellType === CellType.ARRAYFORMULA;
		}
		/**
		* Returns type of the cell value of a given address.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* For more information, see the [Types of values guide](/guide/types-of-values.md).
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['=SUM(1, 2, 3)', '2'],
		* ]);
		*
		* // should return 'NUMBER', cell value type of provided coordinates is a number
		* const cellValue = hfInstance.getCellValueType({ sheet: 0, col: 1, row: 0 });
		*
		* // should return 'NUMBER', cell value type of provided coordinates is a number
		* const cellValue = hfInstance.getCellValueType({ sheet: 0, col: 0, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellValueType(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			this.ensureEvaluationIsNotSuspended();
			return getCellValueType(this.dependencyGraph.getCellValue(cellAddress));
		}
		/**
		* Returns detailed type of the cell value of a given address.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* For more information, see the [Types of values guide](/guide/types-of-values.md).
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1%', '1$'],
		* ]);
		*
		* // should return 'NUMBER_PERCENT', cell value type of provided coordinates is a number with a format inference percent.
		* const cellType = hfInstance.getCellValueDetailedType({ sheet: 0, col: 0, row: 0 });
		*
		* // should return 'NUMBER_CURRENCY', cell value type of provided coordinates is a number with a format inference currency.
		* const cellType = hfInstance.getCellValueDetailedType({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellValueDetailedType(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			this.ensureEvaluationIsNotSuspended();
			return getCellValueDetailedType(this.dependencyGraph.getCellValue(cellAddress));
		}
		/**
		* Returns auxiliary format information of the cell value of a given address.
		* The method accepts cell coordinates as object with column, row and sheet numbers.
		*
		* @param {SimpleCellAddress} cellAddress - cell coordinates
		*
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[EvaluationSuspendedError]] when the evaluation is suspended
		* @throws [[ExpectedValueOfTypeError]] if cellAddress is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1$', '1'],
		* ]);
		*
		* // should return '$', cell value type of provided coordinates is a number with a format inference currency, parsed as using '$' as currency.
		* const cellFormat = hfInstance.getCellValueFormat({ sheet: 0, col: 0, row: 0 });
		*
		* // should return undefined, cell value type of provided coordinates is a number with no format information.
		* const cellFormat = hfInstance.getCellValueFormat({ sheet: 0, col: 1, row: 0 });
		* ```
		*
		* @category Cells
		*/
		getCellValueFormat(cellAddress) {
			if (!isSimpleCellAddress(cellAddress)) throw new ExpectedValueOfTypeError("SimpleCellAddress", "cellAddress");
			this.ensureEvaluationIsNotSuspended();
			return getCellValueFormat(this.dependencyGraph.getCellValue(cellAddress));
		}
		/**
		* Returns the number of existing sheets.
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['1', '2'],
		* ]);
		*
		* // should return the number of sheets which is '1'
		* const sheetsCount = hfInstance.countSheets();
		* ```
		*
		* @category Sheets
		*/
		countSheets() {
			return this.sheetMapping.numberOfSheets();
		}
		/**
		* Returns information whether it is possible to rename sheet.
		* Returns `true` if the sheet with provided id exists and new name is available
		* Returns `false` if sheet cannot be renamed
		*
		* @param {number} sheetId - a sheet number
		* @param {string} newName - a name of the sheet to be given
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*   MySheet1: [ ['1'] ],
		*   MySheet2: [ ['10'] ],
		* });
		*
		* // returns true
		* hfInstance.isItPossibleToRenameSheet(0, 'MySheet0');
		* ```
		*
		* @category Sheets
		*/
		isItPossibleToRenameSheet(sheetId, newName) {
			validateArgToType(sheetId, "number", "sheetId");
			validateArgToType(newName, "string", "newName");
			try {
				this._crudOperations.ensureItIsPossibleToRenameSheet(sheetId, newName);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Renames a specified sheet.
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {number} sheetId - a sheet ID
		* @param {string} newName - a name of the sheet to be given, if is the same as the old one the method does nothing
		*
		* @fires [[sheetRenamed]] after the sheet was renamed
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] when the given sheet ID does not exist
		* @throws [[SheetNameAlreadyTakenError]] when the provided sheet name already exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*   MySheet1: [ ['1'] ],
		*   MySheet2: [ ['10'] ],
		* });
		*
		* // renames the sheet 'MySheet1'
		* hfInstance.renameSheet(0, 'MySheet0');
		* ```
		*
		* @category Sheets
		*/
		renameSheet(sheetId, newName) {
			validateArgToType(sheetId, "number", "sheetId");
			validateArgToType(newName, "string", "newName");
			const oldName = this._crudOperations.renameSheet(sheetId, newName);
			this.recomputeIfDependencyGraphNeedsIt();
			if (oldName !== void 0) this._emitter.emit(Events.SheetRenamed, oldName, newName);
		}
		/**
		* Runs the provided callback as a single [batch operation](../../guide/batch-operations.md) and returns the changed cells.
		*
		* Returns [an array of cells whose values changed as a result of all batched operations](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {() => void} batchOperations - a function with operations to be performed
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		* @fires [[evaluationSuspended]] always
		* @fires [[evaluationResumed]] after the recomputation of necessary values
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // multiple operations in a single callback will trigger evaluation only once
		* // and only one set of changes is returned as a combined result of all
		* // the operations that were triggered within the callback
		* const changes = hfInstance.batch(() => {
		*  hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
		*  hfInstance.setCellContents({ col: 4, row: 0, sheet: 0 }, [['=A1']]);
		* });
		* ```
		*
		* @category Batch
		*/
		batch(batchOperations) {
			this.suspendEvaluation();
			this._crudOperations.beginUndoRedoBatchMode();
			try {
				batchOperations();
			} catch (e) {
				this._crudOperations.commitUndoRedoBatchMode();
				this.resumeEvaluation();
				throw e;
			}
			this._crudOperations.commitUndoRedoBatchMode();
			return this.resumeEvaluation();
		}
		/**
		* Suspends the dependency graph recalculation to start a [batch operation](../../guide/batch-operations.md).
		* It allows optimizing the performance.
		* With this method, multiple CRUD operations can be done without triggering recalculation after every operation.
		* Suspending evaluation should result in an overall faster calculation compared to recalculating after each operation separately.
		* To resume the evaluation use [[resumeEvaluation]].
		*
		* @fires [[evaluationSuspended]] always
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // similar to batch() but operations are not within a callback,
		* // one method suspends the recalculation
		* // the second will resume calculations and return the changes
		*
		* // suspend the evaluation with this method
		* hfInstance.suspendEvaluation();
		*
		* // perform operations
		* hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
		* hfInstance.setSheetContent(1, [['50'], ['60']]);
		*
		* // use resumeEvaluation to resume
		* const changes = hfInstance.resumeEvaluation();
		* ```
		*
		* @category Batch
		*/
		suspendEvaluation() {
			this._evaluationSuspended = true;
			this._emitter.emit(Events.EvaluationSuspended);
		}
		/**
		* Resumes the dependency graph recalculation that was [suspended](../../guide/batch-operations.md) with [[suspendEvaluation]].
		* It also triggers the recalculation and returns [an array of cells whose values changed as a result of all batched operations](/guide/basic-operations.md#changes-array).
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		* @fires [[evaluationResumed]] after the recomputation of necessary values
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  MySheet1: [ ['1'] ],
		*  MySheet2: [ ['10'] ],
		* });
		*
		* // similar to batch() but operations are not within a callback,
		* // one method suspends the recalculation
		* // the second will resume calculations and return the changes
		*
		* // first, suspend the evaluation
		* hfInstance.suspendEvaluation();
		*
		* // perform operations
		* hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
		* hfInstance.setSheetContent(1, [['50'], ['60']]);
		*
		* // resume the evaluation
		* const changes = hfInstance.resumeEvaluation();
		* ```
		*
		* @category Batch
		*/
		resumeEvaluation() {
			this._evaluationSuspended = false;
			const changes = this.recomputeIfDependencyGraphNeedsIt();
			this._emitter.emit(Events.EvaluationResumed, changes);
			return changes;
		}
		/**
		* Checks if the dependency graph recalculation process is [suspended](../../guide/batch-operations.md) or not.
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // suspend the evaluation
		* hfInstance.suspendEvaluation();
		*
		* // between suspendEvaluation() and resumeEvaluation()
		* // or inside batch() callback it will return 'true', otherwise 'false'
		* const isEvaluationSuspended = hfInstance.isEvaluationSuspended();
		*
		* const changes = hfInstance.resumeEvaluation();
		* ```
		*
		* @category Batch
		*/
		isEvaluationSuspended() {
			return this._evaluationSuspended;
		}
		/**
		* Returns information whether it is possible to add named expression into a specific scope.
		* Checks against particular rules to ascertain that addNamedExpression can be called.
		* If returns `true`, doing [[addNamedExpression]] operation won't throw any errors.
		* Returns `false` if the operation might be disrupted.
		*
		* @param {string} expressionName - a name of the expression to be added
		* @param {RawCellContent} expression - the expression
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // should return 'true' for this example,
		* // it is possible to add named expression to global scope
		* const isAddable = hfInstance.isItPossibleToAddNamedExpression('prettyName', '=Sheet1!$A$1+100');
		* ```
		*
		* @category Named Expressions
		*/
		isItPossibleToAddNamedExpression(expressionName, expression, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			try {
				this._crudOperations.ensureItIsPossibleToAddNamedExpression(expressionName, expression, scope);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Adds a specified named expression.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {string} expressionName - a name of the expression to be added
		* @param {RawCellContent} expression - the expression
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		* @param {NamedExpressionOptions?} options - additional metadata related to named expression
		*
		* @fires [[namedExpressionAdded]] always, unless [[batch]] mode is used
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NamedExpressionNameIsAlreadyTakenError]] when the named-expression name is not available.
		* @throws [[NamedExpressionNameIsInvalidError]] when the named-expression name is not valid
		* @throws [[NoRelativeAddressesAllowedError]] when the named-expression formula contains relative references
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add own expression, scope limited to 'Sheet1' (sheetId=0), the method should return a list of cells which values
		* // changed after the operation, their absolute addresses and new values
		* // for this example:
		* // [{
		* //   name: 'prettyName',
		* //   newValue: 142,
		* // }]
		* const changes = hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);
		* ```
		*
		* @category Named Expressions
		*/
		addNamedExpression(expressionName, expression, scope, options) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			this._crudOperations.addNamedExpression(expressionName, expression, scope, options);
			const changes = this.recomputeIfDependencyGraphNeedsIt();
			this._emitter.emit(Events.NamedExpressionAdded, expressionName, changes);
			return changes;
		}
		/**
		* Gets specified named expression value.
		* Returns a [[CellValue]] or undefined if the given named expression does not exist.
		*
		* For more information, see the [Named expressions guide](/guide/named-expressions.md).
		*
		* @param {string} expressionName - expression name, case-insensitive.
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression, only 'Sheet1' (sheetId=0) considered as it is the scope
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 'Sheet1');
		*
		* // returns the calculated value of a passed named expression, '142' for this example
		* const myFormula = hfInstance.getNamedExpressionValue('prettyName', 'Sheet1');
		* ```
		*
		* @category Named Expressions
		*/
		getNamedExpressionValue(expressionName, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			this.ensureEvaluationIsNotSuspended();
			this._crudOperations.ensureScopeIdIsValid(scope);
			const namedExpression = this._namedExpressions.namedExpressionForScope(expressionName, scope);
			if (namedExpression) return this._serialization.getCellValue(namedExpression.address);
			else return;
		}
		/**
		* Returns a normalized formula string for given named expression, or `undefined` for a named expression that does not exist or does not hold a formula.
		*
		* For more information, see the [Named expressions guide](/guide/named-expressions.md).
		*
		* @param {string} expressionName - expression name, case-insensitive.
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression in 'Sheet1' (sheetId=0)
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);
		*
		* // returns a normalized formula string corresponding to the passed name from 'Sheet1' (sheetId=0),
		* // '=Sheet1!A1+100' for this example
		* const myFormula = hfInstance.getNamedExpressionFormula('prettyName', 0);
		* ```
		*
		* @category Named Expressions
		*/
		getNamedExpressionFormula(expressionName, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			this._crudOperations.ensureScopeIdIsValid(scope);
			const namedExpression = this._namedExpressions.namedExpressionForScope(expressionName, scope);
			if (namedExpression === void 0) return;
			else return this._serialization.getCellFormula(namedExpression.address);
		}
		/**
		* Returns a named expression, or `undefined` for a named expression that does not exist or does not hold a formula.
		*
		* For more information, see the [Named expressions guide](/guide/named-expressions.md).
		*
		* @param {string} expressionName - expression name, case-insensitive.
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression in 'Sheet1' (sheetId=0)
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);
		*
		* // returns a named expression that corresponds to the passed name from 'Sheet1' (sheetId=0)
		* // for this example, returns:
		* // {name: 'prettyName', expression: '=Sheet1!$A$1+100', options: undefined, scope: 0}
		* const myFormula = hfInstance.getNamedExpression('prettyName', 0);
		*
		* // for a named expression that doesn't exist, returns 'undefined':
		* const myFormulaTwo = hfInstance.getNamedExpression('uglyName', 0);
		* ```
		*
		* @category Named Expressions
		*/
		getNamedExpression(expressionName, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			const namedExpression = this._namedExpressions.namedExpressionForScope(expressionName, scope);
			if (namedExpression === void 0) return;
			return {
				name: expressionName,
				scope,
				expression: this._serialization.getCellFormula(namedExpression.address),
				options: namedExpression.options
			};
		}
		/**
		* Returns information whether it is possible to change named expression in a specific scope.
		* Checks against particular rules to ascertain that changeNamedExpression can be called.
		* If returns `true`, doing [[changeNamedExpression]] operation won't throw any errors.
		* Returns `false` if the operation might be disrupted.
		*
		* @param {string} expressionName - an expression name, case-insensitive.
		* @param {RawCellContent} newExpression - a new expression
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');
		*
		* // should return 'true' for this example,
		* // it is possible to change named expression
		* const isAddable = hfInstance.isItPossibleToChangeNamedExpression('prettyName', '=Sheet1!$A$1+100');
		* ```
		*
		* @category Named Expressions
		*/
		isItPossibleToChangeNamedExpression(expressionName, newExpression, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			try {
				this._crudOperations.ensureItIsPossibleToChangeNamedExpression(expressionName, newExpression, scope);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Changes a given named expression to a specified formula.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {string} expressionName - an expression name, case-insensitive.
		* @param {RawCellContent} newExpression - a new expression
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		* @param {NamedExpressionOptions?} options - additional metadata related to named expression
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NamedExpressionDoesNotExistError]] when the given expression does not exist.
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		* @throws [[ArrayFormulasNotSupportedError]] when the named expression formula is an array formula
		* @throws [[NoRelativeAddressesAllowedError]] when the named expression formula contains relative references
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression, scope limited to 'Sheet1' (sheetId=0)
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);
		*
		* // change the named expression
		* const changes = hfInstance.changeNamedExpression('prettyName', '=Sheet1!$A$1+200');
		* ```
		*
		* @category Named Expressions
		*/
		changeNamedExpression(expressionName, newExpression, scope, options) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			this._crudOperations.changeNamedExpressionExpression(expressionName, scope, newExpression, options);
			return this.recomputeIfDependencyGraphNeedsIt();
		}
		/**
		* Returns information whether it is possible to remove named expression from a specific scope.
		* Checks against particular rules to ascertain that removeNamedExpression can be called.
		* If returns `true`, doing [[removeNamedExpression]] operation won't throw any errors.
		* Returns `false` if the operation might be disrupted.
		*
		* @param {string} expressionName - an expression name, case-insensitive.
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');
		*
		* // should return 'true' for this example,
		* // it is possible to change named expression
		* const isAddable = hfInstance.isItPossibleToRemoveNamedExpression('prettyName');
		* ```
		*
		* @category Named Expressions
		*/
		isItPossibleToRemoveNamedExpression(expressionName, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			try {
				this._crudOperations.isItPossibleToRemoveNamedExpression(expressionName, scope);
				return true;
			} catch (e) {
				return false;
			}
		}
		/**
		* Removes a named expression.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @param {string} expressionName - expression name, case-insensitive.
		* @param {number?} scope - scope definition, `sheetId` for local scope or `undefined` for global scope
		*
		* @fires [[namedExpressionRemoved]] after the expression was removed
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NamedExpressionDoesNotExistError]] when the given expression does not exist.
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		* ]);
		*
		* // add a named expression
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);
		*
		* // remove the named expression
		* const changes = hfInstance.removeNamedExpression('prettyName', 0);
		* ```
		*
		* @category Named Expressions
		*/
		removeNamedExpression(expressionName, scope) {
			validateArgToType(expressionName, "string", "expressionName");
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			const removedNamedExpression = this._crudOperations.removeNamedExpression(expressionName, scope);
			if (removedNamedExpression) {
				const changes = this.recomputeIfDependencyGraphNeedsIt();
				this._emitter.emit(Events.NamedExpressionRemoved, removedNamedExpression.displayName, changes);
				return changes;
			} else return [];
		}
		/**
		* Lists named expressions.
		* - If scope parameter is provided, returns an array of expression names defined for this scope.
		* - If scope parameter is undefined, returns an array of global expression names.
		*
		* For more information, see the [Named expressions guide](/guide/named-expressions.md).
		*
		* @param {number?} scope - scope of the named expressions, `sheetId` for local scope or `undefined` for global scope
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NoSheetWithIdError]] if no sheet with given sheetId exists
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		*  ['50'],
		*  ['60'],
		* ]);
		*
		* // add two named expressions and one scoped
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');
		* hfInstance.addNamedExpression('anotherPrettyName', '=Sheet1!$A$2+100');
		* hfInstance.addNamedExpression('alsoPrettyName', '=Sheet1!$A$3+100', 0);
		*
		* // list the expressions, should return: ['prettyName', 'anotherPrettyName'] for this example
		* const listOfExpressions = hfInstance.listNamedExpressions();
		*
		*  // list the expressions, should return: ['alsoPrettyName'] for this example
		* const listOfExpressions = hfInstance.listNamedExpressions(0);
		* ```
		*
		* @category Named Expressions
		*/
		listNamedExpressions(scope) {
			if (scope !== void 0) validateArgToType(scope, "number", "scope");
			this._crudOperations.ensureScopeIdIsValid(scope);
			return this._namedExpressions.getAllNamedExpressionsNamesInScope(scope);
		}
		/**
		* Returns all named expressions serialized.
		*
		* For more information, see the [Named expressions guide](/guide/named-expressions.md).
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		*  ['50'],
		*  ['60'],
		* ]);
		*
		* // add two named expressions and one scoped
		* hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');
		* hfInstance.addNamedExpression('anotherPrettyName', '=Sheet1!$A$2+100');
		* hfInstance.addNamedExpression('prettyName3', '=Sheet1!$A$3+100', 0);
		*
		* // get all expressions serialized
		* // should return:
		* // [
		* // {name: 'prettyName', expression: '=Sheet1!$A$1+100', options: undefined, scope: undefined},
		* // {name: 'anotherPrettyName', expression: '=Sheet1!$A$2+100', options: undefined, scope: undefined},
		* // {name: 'alsoPrettyName', expression: '=Sheet1!$A$3+100', options: undefined, scope: 0}
		* // ]
		* const allExpressions = hfInstance.getAllNamedExpressionsSerialized();
		* ```
		*
		* @category Named Expressions
		*/
		getAllNamedExpressionsSerialized() {
			return this._serialization.getAllNamedExpressionsSerialized();
		}
		/**
		* Parses and then unparses a formula.
		* Returns a normalized formula (e.g., restores the original capitalization of sheet names, function names, cell addresses, and named expressions).
		*
		* @param {string} formulaString - a formula in a proper format - it must start with "="
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		* @throws [[NotAFormulaError]] when the provided string is not a valid formula, i.e., does not start with "="
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromArray([
		*  ['42'],
		*  ['50'],
		* ]);
		*
		* // returns '=Sheet1!$A$1+10'
		* const normalizedFormula = hfInstance.normalizeFormula('=SHEET1!$A$1+10');
		*
		* // returns '=3*$A$1'
		* const normalizedFormula = hfInstance.normalizeFormula('=3*$a$1');
		* ```
		*
		* @category Helpers
		*/
		normalizeFormula(formulaString) {
			validateArgToType(formulaString, "string", "formulaString");
			const { ast, address } = this.extractTemporaryFormula(formulaString);
			if (ast === void 0) throw new NotAFormulaError();
			return this._unparser.unparse(ast, address);
		}
		/**
		* Calculates fire-and-forget formula, returns the calculated value.
		*
		* @param {string} formulaString - A formula in a proper format, starting with `=`.
		* @param {number} sheetId - The ID of a sheet in context of which the formula gets evaluated.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type arguments is of wrong type.
		* @throws [[NotAFormulaError]] when the provided string is not a valid formula (i.e., doesn't start with `=`).
		* @throws [[NoSheetWithIdError]] when the provided `sheetID` doesn't exist.
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildFromSheets({
		*  Sheet1: [['58']],
		*  Sheet2: [['1', '2', '3'], ['4', '5', '6']]
		* });
		*
		* // returns the calculated formula's value
		* // for this example, returns `68`
		* const calculatedFormula = hfInstance.calculateFormula('=A1+10', 0);
		*
		* // for this example, returns [['11', '12', '13'], ['14', '15', '16']]
		* const calculatedFormula = hfInstance.calculateFormula('=A1:B3+10', 1);
		* ```
		*
		* @category Helpers
		*/
		calculateFormula(formulaString, sheetId) {
			validateArgToType(formulaString, "string", "formulaString");
			validateArgToType(sheetId, "number", "sheetId");
			this._crudOperations.ensureScopeIdIsValid(sheetId);
			const { ast, address, dependencies } = this.extractTemporaryFormula(formulaString, sheetId);
			if (ast === void 0) throw new NotAFormulaError();
			const internalCellValue = this.evaluator.runAndForget(ast, address, dependencies);
			return this._exporter.exportScalarOrRange(internalCellValue);
		}
		/**
		* Return a list of named expressions used by a formula.
		*
		* @param {string} formulaString - A formula in a proper format, starting with `=`.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type arguments is of wrong type.
		* @throws [[NotAFormulaError]] when the provided string is not a valid formula (i.e., doesn't start with `=`).
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // returns a list of named expressions used by a formula
		* // for this example, returns ['foo', 'bar']
		* const namedExpressions = hfInstance.getNamedExpressionsFromFormula('=foo+bar*2');
		* ```
		*
		* @category Helpers
		*/
		getNamedExpressionsFromFormula(formulaString) {
			validateArgToType(formulaString, "string", "formulaString");
			const { ast, dependencies } = this.extractTemporaryFormula(formulaString);
			if (ast === void 0) throw new NotAFormulaError();
			const namedExpressionDependencies = dependencies.filter((dep) => dep instanceof NamedExpressionDependency).map((namedExpr) => namedExpr.name);
			return [...new Set(namedExpressionDependencies)];
		}
		/**
		* Validates the formula.
		* If the provided string starts with "=" and is a parsable formula, the method returns `true`.
		* The validation is purely grammatical: the method doesn't verify if the formula can be calculated or not.
		*
		* @param {string} formulaString -  a formula in a proper format - it must start with "="
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* // checks if the given string is a valid formula, should return 'true' for this example
		* const isFormula = hfInstance.validateFormula('=SUM(1, 2)');
		* ```
		*
		* @category Helpers
		*/
		validateFormula(formulaString) {
			validateArgToType(formulaString, "string", "formulaString");
			const { ast } = this.extractTemporaryFormula(formulaString);
			return ast !== void 0;
		}
		/**
		* Returns translated names of all functions registered in this instance of HyperFormula
		* according to the language set in the configuration
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // return translated names of all functions, assign to a variable
		* const allNames = hfInstance.getRegisteredFunctionNames();
		* ```
		*
		* @category Custom Functions
		*/
		getRegisteredFunctionNames() {
			return HyperFormula.getLanguage(this._config.language).getFunctionTranslations(this._functionRegistry.getRegisteredFunctionIds());
		}
		/**
		* Returns class of a plugin used by function with given id
		*
		* For more information, see the [Custom functions guide](/guide/custom-functions.md).
		*
		* @param {string} functionId - id of a function, e.g., 'SUMIF'
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* // import your own plugin
		* import { MyExamplePlugin } from './file_with_your_plugin';
		*
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // register a plugin
		* HyperFormula.registerFunctionPlugin(MyExamplePlugin);
		*
		* // get the plugin
		* const myPlugin = hfInstance.getFunctionPlugin('EXAMPLE');
		* ```
		*
		* @category Custom Functions
		*/
		getFunctionPlugin(functionId) {
			validateArgToType(functionId, "string", "functionId");
			return this._functionRegistry.getFunctionPlugin(functionId);
		}
		/**
		* Returns classes of all plugins registered in this instance of HyperFormula
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // return classes of all plugins registered, assign to a variable
		* const allNames = hfInstance.getAllFunctionPlugins();
		* ```
		*
		* @category Custom Functions
		*/
		getAllFunctionPlugins() {
			return this._functionRegistry.getPlugins();
		}
		/**
		* Interprets number as a date + time.
		*
		* For more information, see the [Date and time handling guide](/guide/date-and-time-handling.md).
		*
		* @param {number} inputNumber - number of days since nullDate, should be non-negative, fractions are interpreted as hours/minutes/seconds.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // pass the number of days since nullDate
		* // the method should return formatted date and time, for this example:
		* // {year: 2020, month: 1, day: 15, hours: 2, minutes: 24, seconds: 0}
		* const dateTimeFromNumber = hfInstance.numberToDateTime(43845.1);
		*
		* ```
		*
		* @category Helpers
		*/
		numberToDateTime(inputNumber) {
			validateArgToType(inputNumber, "number", "val");
			return this._evaluator.interpreter.dateTimeHelper.numberToSimpleDateTime(inputNumber);
		}
		/**
		* Interprets number as a date.
		*
		* For more information, see the [Date and time handling guide](/guide/date-and-time-handling.md).
		*
		* @param {number} inputNumber - number of days since nullDate, should be non-negative, fractions are ignored.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // pass the number of days since nullDate
		* // the method should return formatted date, for this example:
		* // {year: 2020, month: 1, day: 15}
		* const dateFromNumber = hfInstance.numberToDate(43845);
		* ```
		*
		* @category Helpers
		*/
		numberToDate(inputNumber) {
			validateArgToType(inputNumber, "number", "val");
			return this._evaluator.interpreter.dateTimeHelper.numberToSimpleDate(inputNumber);
		}
		/**
		* Interprets number as a time (hours/minutes/seconds).
		*
		* For more information, see the [Date and time handling guide](/guide/date-and-time-handling.md).
		*
		* @param {number} inputNumber - time in 24h units.
		*
		* @throws [[ExpectedValueOfTypeError]] if any of its basic type argument is of wrong type
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // pass a number to be interpreted as a time
		* // should return {hours: 26, minutes: 24} for this example
		* const timeFromNumber = hfInstance.numberToTime(1.1);
		* ```
		*
		* @category Helpers
		*/
		numberToTime(inputNumber) {
			validateArgToType(inputNumber, "number", "val");
			return numberToSimpleTime(inputNumber);
		}
		/**
		* Subscribes to an event.
		* For the list of all available events, see [[Listeners]].
		*
		* @param {Event} event the name of the event to subscribe to
		* @param {Listener} listener to be called when event is emitted
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // subscribe to a 'sheetAdded', pass a simple handler
		* hfInstance.on('sheetAdded', ( ) => { console.log('foo') });
		*
		* // add a sheet to trigger an event,
		* // console should print 'foo' after each time sheet is added in this example
		* hfInstance.addSheet('FooBar');
		* ```
		*
		* @category Events
		*/
		on(event, listener) {
			this._emitter.on(event, listener);
		}
		/**
		* Subscribes to an event once.
		* For the list of all available events, see [[Listeners]].
		*
		* @param {Event} event the name of the event to subscribe to
		* @param {Listener} listener to be called when event is emitted
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // subscribe to a 'sheetAdded', pass a simple handler
		* hfInstance.once('sheetAdded', ( ) => { console.log('foo') });
		*
		* // call addSheet twice,
		* // console should print 'foo' only once when the sheet is added in this example
		* hfInstance.addSheet('FooBar');
		* hfInstance.addSheet('FooBaz');
		* ```
		*
		* @category Events
		*/
		once(event, listener) {
			this._emitter.once(event, listener);
		}
		/**
		* Unsubscribes from an event or from all events.
		* For the list of all available events, see [[Listeners]].
		*
		* @param {Event} event the name of the event to subscribe to
		* @param {Listener} listener to be called when event is emitted
		*
		* @example
		* ```js
		* const hfInstance = HyperFormula.buildEmpty();
		*
		* // define a simple function to be called upon emitting an event
		* const handler = ( ) => { console.log('baz') }
		*
		* // subscribe to a 'sheetAdded', pass the handler
		* hfInstance.on('sheetAdded', handler);
		*
		* // add a sheet to trigger an event,
		* // console should print 'baz' each time a sheet is added
		* hfInstance.addSheet('FooBar');
		*
		* // unsubscribe from a 'sheetAdded'
		* hfInstance.off('sheetAdded', handler);
		*
		* // add a sheet, the console should not print anything
		* hfInstance.addSheet('FooBaz');
		* ```
		*
		* @category Events
		*/
		off(event, listener) {
			this._emitter.off(event, listener);
		}
		/**
		* Destroys instance of HyperFormula.
		*
		* @example
		* ```js
		* // destroys the instance
		* hfInstance.destroy();
		* ```
		*
		* @category Instance
		*/
		destroy() {
			objectDestroy(this);
		}
		/**
		* Throws an error if evaluation is suspended.
		*
		* @internal
		*/
		ensureEvaluationIsNotSuspended() {
			if (this._evaluationSuspended) throw new EvaluationSuspendedError();
		}
		/**
		* Parses a formula string and extracts its AST and dependencies.
		*
		* @internal
		*/
		extractTemporaryFormula(formulaString, sheetId = 1) {
			const parsedCellContent = this._cellContentParser.parse(formulaString);
			const address = {
				sheet: sheetId,
				col: 0,
				row: 0
			};
			if (!(parsedCellContent instanceof CellContent.Formula)) return {
				address,
				dependencies: []
			};
			const { ast, errors, dependencies } = this._parser.parse(parsedCellContent.formula, address);
			if (errors.length > 0) return {
				address,
				dependencies: []
			};
			return {
				ast,
				address,
				dependencies
			};
		}
		/**
		* Rebuilds the engine with new configuration.
		*/
		rebuildWithConfig(newParams) {
			const newConfig = this._config.mergeConfig(newParams);
			const configNewLanguage = this._config.mergeConfig({ language: newParams.language });
			const serializedSheets = this._serialization.withNewConfig(configNewLanguage, this._namedExpressions).getAllSheetsSerialized();
			const serializedNamedExpressions = this._serialization.getAllNamedExpressionsSerialized();
			const newEngine = BuildEngineFactory.rebuildWithConfig(newConfig, serializedSheets, serializedNamedExpressions, this._stats);
			this._config = newEngine.config;
			this._stats = newEngine.stats;
			this._dependencyGraph = newEngine.dependencyGraph;
			this._columnSearch = newEngine.columnSearch;
			this._parser = newEngine.parser;
			this._unparser = newEngine.unparser;
			this._cellContentParser = newEngine.cellContentParser;
			this._evaluator = newEngine.evaluator;
			this._lazilyTransformingAstService = newEngine.lazilyTransformingAstService;
			this._crudOperations = newEngine.crudOperations;
			this._exporter = newEngine.exporter;
			this._namedExpressions = newEngine.namedExpressions;
			this._serialization = newEngine.serialization;
			this._functionRegistry = newEngine.functionRegistry;
		}
		/**
		* Runs a recomputation starting from recently changed vertices.
		*
		* Returns [an array of cells whose values changed as a result of this operation](/guide/basic-operations.md#changes-array).
		*
		* Note that this method may trigger dependency graph recalculation.
		*
		* @fires [[valuesUpdated]] if recalculation was triggered by this change
		*/
		recomputeIfDependencyGraphNeedsIt() {
			if (!this._evaluationSuspended) {
				const changes = this._crudOperations.getAndClearContentChanges();
				const verticesToRecomputeFrom = this.dependencyGraph.verticesToRecompute();
				this.dependencyGraph.clearDirtyVertices();
				if (verticesToRecomputeFrom.length > 0) changes.addAll(this.evaluator.partialRun(verticesToRecomputeFrom));
				const exportedChanges = changes.exportChanges(this._exporter);
				if (!changes.isEmpty()) this._emitter.emit(Events.ValuesUpdated, exportedChanges);
				return exportedChanges;
			} else return [];
		}
	};
	/**
	* Version of the HyperFormula.
	*
	* @category Static Properties
	*/
	HyperFormula.version = "3.2.0";
	/**
	* Latest build date.
	*
	* @category Static Properties
	*/
	HyperFormula.buildDate = "19/02/2026 12:14:46";
	/**
	* A release date.
	*
	* @category Static Properties
	*/
	HyperFormula.releaseDate = "19/02/2026";
	/**
	* When using the UMD build, this property contains all available languages to use with the [registerLanguage](#registerlanguage) method.
	*
	* For more information, see the [Localizing functions](/guide/localizing-functions.md) guide.
	*
	* @category Static Properties
	*/
	HyperFormula.languages = {};
	HyperFormula.registeredLanguages = /* @__PURE__ */ new Map();
	//#endregion
	//#region ../../node_modules/hyperformula/es/Config.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var privatePool = /* @__PURE__ */ new WeakMap();
	var Config = class Config {
		constructor(options = {}, showDeprecatedWarns = true) {
			const { accentSensitive, caseSensitive, caseFirst, chooseAddressMappingPolicy, context, currencySymbol, dateFormats, decimalSeparator, evaluateNullToZero, functionArgSeparator, functionPlugins, ignorePunctuation, leapYear1900, localeLang, language, ignoreWhiteSpace, licenseKey, matchWholeCell, arrayColumnSeparator, arrayRowSeparator, maxRows, maxColumns, nullYear, nullDate, parseDateTime, precisionEpsilon, precisionRounding, stringifyDateTime, stringifyDuration, smartRounding, timeFormats, thousandSeparator, useArrayArithmetic, useStats, undoLimit, useColumnIndex, useRegularExpressions, useWildcards } = options;
			if (showDeprecatedWarns) Config.warnDeprecatedOptions(options);
			this.useArrayArithmetic = configValueFromParam(useArrayArithmetic, "boolean", "useArrayArithmetic");
			this.accentSensitive = configValueFromParam(accentSensitive, "boolean", "accentSensitive");
			this.caseSensitive = configValueFromParam(caseSensitive, "boolean", "caseSensitive");
			this.caseFirst = configValueFromParam(caseFirst, [
				"upper",
				"lower",
				"false"
			], "caseFirst");
			this.ignorePunctuation = configValueFromParam(ignorePunctuation, "boolean", "ignorePunctuation");
			this.chooseAddressMappingPolicy = chooseAddressMappingPolicy !== null && chooseAddressMappingPolicy !== void 0 ? chooseAddressMappingPolicy : Config.defaultConfig.chooseAddressMappingPolicy;
			this.dateFormats = [...configValueFromParamCheck(dateFormats, Array.isArray, "array", "dateFormats")];
			this.timeFormats = [...configValueFromParamCheck(timeFormats, Array.isArray, "array", "timeFormats")];
			this.functionArgSeparator = configValueFromParam(functionArgSeparator, "string", "functionArgSeparator");
			this.decimalSeparator = configValueFromParam(decimalSeparator, [".", ","], "decimalSeparator");
			this.language = configValueFromParam(language, "string", "language");
			this.ignoreWhiteSpace = configValueFromParam(ignoreWhiteSpace, ["standard", "any"], "ignoreWhiteSpace");
			this.licenseKey = configValueFromParam(licenseKey, "string", "licenseKey");
			this.thousandSeparator = configValueFromParam(thousandSeparator, [
				"",
				",",
				" ",
				"."
			], "thousandSeparator");
			this.arrayColumnSeparator = configValueFromParam(arrayColumnSeparator, [",", ";"], "arrayColumnSeparator");
			this.arrayRowSeparator = configValueFromParam(arrayRowSeparator, [";", "|"], "arrayRowSeparator");
			this.localeLang = configValueFromParam(localeLang, "string", "localeLang");
			this.functionPlugins = [...functionPlugins !== null && functionPlugins !== void 0 ? functionPlugins : Config.defaultConfig.functionPlugins];
			this.smartRounding = configValueFromParam(smartRounding, "boolean", "smartRounding");
			this.evaluateNullToZero = configValueFromParam(evaluateNullToZero, "boolean", "evaluateNullToZero");
			this.nullYear = configValueFromParam(nullYear, "number", "nullYear");
			validateNumberToBeAtLeast(this.nullYear, "nullYear", 0);
			validateNumberToBeAtMost(this.nullYear, "nullYear", 100);
			this.precisionRounding = configValueFromParam(precisionRounding, "number", "precisionRounding");
			validateNumberToBeAtLeast(this.precisionRounding, "precisionRounding", 0);
			this.precisionEpsilon = configValueFromParam(precisionEpsilon, "number", "precisionEpsilon");
			validateNumberToBeAtLeast(this.precisionEpsilon, "precisionEpsilon", 0);
			this.useColumnIndex = configValueFromParam(useColumnIndex, "boolean", "useColumnIndex");
			this.useStats = configValueFromParam(useStats, "boolean", "useStats");
			this.parseDateTime = configValueFromParam(parseDateTime, "function", "parseDateTime");
			this.stringifyDateTime = configValueFromParam(stringifyDateTime, "function", "stringifyDateTime");
			this.stringifyDuration = configValueFromParam(stringifyDuration, "function", "stringifyDuration");
			this.translationPackage = HyperFormula.getLanguage(this.language);
			this.errorMapping = this.translationPackage.buildErrorMapping();
			this.nullDate = configValueFromParamCheck(nullDate, instanceOfSimpleDate, "IDate", "nullDate");
			this.leapYear1900 = configValueFromParam(leapYear1900, "boolean", "leapYear1900");
			this.undoLimit = configValueFromParam(undoLimit, "number", "undoLimit");
			this.useRegularExpressions = configValueFromParam(useRegularExpressions, "boolean", "useRegularExpressions");
			this.useWildcards = configValueFromParam(useWildcards, "boolean", "useWildcards");
			this.matchWholeCell = configValueFromParam(matchWholeCell, "boolean", "matchWholeCell");
			validateNumberToBeAtLeast(this.undoLimit, "undoLimit", 0);
			this.maxRows = configValueFromParam(maxRows, "number", "maxRows");
			validateNumberToBeAtLeast(this.maxRows, "maxRows", 1);
			this.maxColumns = configValueFromParam(maxColumns, "number", "maxColumns");
			this.currencySymbol = this.setupCurrencySymbol(currencySymbol);
			validateNumberToBeAtLeast(this.maxColumns, "maxColumns", 1);
			this.context = context;
			privatePool.set(this, { licenseKeyValidityState: checkLicenseKeyValidity(this.licenseKey) });
			configCheckIfParametersNotInConflict({
				value: this.decimalSeparator,
				name: "decimalSeparator"
			}, {
				value: this.functionArgSeparator,
				name: "functionArgSeparator"
			}, {
				value: this.thousandSeparator,
				name: "thousandSeparator"
			});
			configCheckIfParametersNotInConflict({
				value: this.arrayRowSeparator,
				name: "arrayRowSeparator"
			}, {
				value: this.arrayColumnSeparator,
				name: "arrayColumnSeparator"
			});
		}
		setupCurrencySymbol(currencySymbol) {
			const valueAfterCheck = [...configValueFromParamCheck(currencySymbol, Array.isArray, "array", "currencySymbol")];
			valueAfterCheck.forEach((val) => {
				if (typeof val !== "string") throw new ExpectedValueOfTypeError("string[]", "currencySymbol");
				if (val === "") throw new ConfigValueEmpty("currencySymbol");
			});
			return valueAfterCheck;
		}
		/**
		* Proxied property to its private counterpart. This makes the property
		* as accessible as the other Config options but without ability to change the value.
		*
		* @internal
		*/
		get licenseKeyValidityState() {
			return privatePool.get(this).licenseKeyValidityState;
		}
		getConfig() {
			return getFullConfigFromPartial(this);
		}
		mergeConfig(init) {
			const mergedConfig = Object.assign({}, this.getConfig(), init);
			Config.warnDeprecatedOptions(init);
			return new Config(mergedConfig, false);
		}
		static warnDeprecatedOptions(options) {}
		static warnDeprecatedIfUsed(inputValue, paramName, fromVersion, replacementName) {
			if (inputValue !== void 0) if (replacementName === void 0) console.warn(`${paramName} option is deprecated since ${fromVersion}`);
			else console.warn(`${paramName} option is deprecated since ${fromVersion}, please use ${replacementName}`);
		}
	};
	Config.defaultConfig = {
		accentSensitive: false,
		currencySymbol: ["$"],
		caseSensitive: false,
		caseFirst: "lower",
		context: void 0,
		chooseAddressMappingPolicy: new AlwaysDense(),
		dateFormats: ["DD/MM/YYYY", "DD/MM/YY"],
		decimalSeparator: ".",
		evaluateNullToZero: false,
		functionArgSeparator: ",",
		functionPlugins: [],
		ignorePunctuation: false,
		language: "enGB",
		ignoreWhiteSpace: "standard",
		licenseKey: "",
		leapYear1900: false,
		localeLang: "en",
		matchWholeCell: true,
		arrayColumnSeparator: ",",
		arrayRowSeparator: ";",
		maxRows: 4e4,
		maxColumns: 18278,
		nullYear: 30,
		nullDate: {
			year: 1899,
			month: 12,
			day: 30
		},
		parseDateTime: defaultParseToDateTime,
		precisionEpsilon: 1e-13,
		precisionRounding: 10,
		smartRounding: true,
		stringifyDateTime: defaultStringifyDateTime,
		stringifyDuration: defaultStringifyDuration,
		timeFormats: ["hh:mm", "hh:mm:ss.sss"],
		thousandSeparator: "",
		undoLimit: 20,
		useRegularExpressions: false,
		useWildcards: true,
		useColumnIndex: false,
		useStats: false,
		useArrayArithmetic: false
	};
	function getFullConfigFromPartial(partialConfig) {
		var _a;
		const ret = {};
		for (const key in Config.defaultConfig) {
			const val = (_a = partialConfig[key]) !== null && _a !== void 0 ? _a : Config.defaultConfig[key];
			if (Array.isArray(val)) ret[key] = [...val];
			else ret[key] = val;
		}
		return ret;
	}
	function getDefaultConfig() {
		return getFullConfigFromPartial({});
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/i18n/languages/enGB.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var dictionary$1 = {
		errors: {
			CYCLE: "#CYCLE!",
			DIV_BY_ZERO: "#DIV/0!",
			ERROR: "#ERROR!",
			NA: "#N/A",
			NAME: "#NAME?",
			NUM: "#NUM!",
			REF: "#REF!",
			SPILL: "#SPILL!",
			VALUE: "#VALUE!"
		},
		functions: {
			FILTER: "FILTER",
			ADDRESS: "ADDRESS",
			"ARRAY_CONSTRAIN": "ARRAY_CONSTRAIN",
			ARRAYFORMULA: "ARRAYFORMULA",
			ABS: "ABS",
			ACOS: "ACOS",
			ACOSH: "ACOSH",
			ACOT: "ACOT",
			ACOTH: "ACOTH",
			AND: "AND",
			ARABIC: "ARABIC",
			ASIN: "ASIN",
			ASINH: "ASINH",
			ATAN2: "ATAN2",
			ATAN: "ATAN",
			ATANH: "ATANH",
			AVERAGE: "AVERAGE",
			AVERAGEA: "AVERAGEA",
			AVERAGEIF: "AVERAGEIF",
			BASE: "BASE",
			BIN2DEC: "BIN2DEC",
			BIN2HEX: "BIN2HEX",
			BIN2OCT: "BIN2OCT",
			BITAND: "BITAND",
			BITLSHIFT: "BITLSHIFT",
			BITOR: "BITOR",
			BITRSHIFT: "BITRSHIFT",
			BITXOR: "BITXOR",
			CEILING: "CEILING",
			CHAR: "CHAR",
			CHOOSE: "CHOOSE",
			CLEAN: "CLEAN",
			CODE: "CODE",
			COLUMN: "COLUMN",
			COLUMNS: "COLUMNS",
			CONCATENATE: "CONCATENATE",
			CORREL: "CORREL",
			COS: "COS",
			COSH: "COSH",
			COT: "COT",
			COTH: "COTH",
			COUNT: "COUNT",
			COUNTA: "COUNTA",
			COUNTBLANK: "COUNTBLANK",
			COUNTIF: "COUNTIF",
			COUNTIFS: "COUNTIFS",
			COUNTUNIQUE: "COUNTUNIQUE",
			CSC: "CSC",
			CSCH: "CSCH",
			CUMIPMT: "CUMIPMT",
			CUMPRINC: "CUMPRINC",
			DATE: "DATE",
			DATEDIF: "DATEDIF",
			DATEVALUE: "DATEVALUE",
			DAY: "DAY",
			DAYS360: "DAYS360",
			DAYS: "DAYS",
			DB: "DB",
			DDB: "DDB",
			DEC2BIN: "DEC2BIN",
			DEC2HEX: "DEC2HEX",
			DEC2OCT: "DEC2OCT",
			DECIMAL: "DECIMAL",
			DEGREES: "DEGREES",
			DELTA: "DELTA",
			DOLLARDE: "DOLLARDE",
			DOLLARFR: "DOLLARFR",
			EDATE: "EDATE",
			EFFECT: "EFFECT",
			EOMONTH: "EOMONTH",
			ERF: "ERF",
			ERFC: "ERFC",
			EVEN: "EVEN",
			EXACT: "EXACT",
			EXP: "EXP",
			FALSE: "FALSE",
			FIND: "FIND",
			FORMULATEXT: "FORMULATEXT",
			FV: "FV",
			FVSCHEDULE: "FVSCHEDULE",
			HEX2BIN: "HEX2BIN",
			HEX2DEC: "HEX2DEC",
			HEX2OCT: "HEX2OCT",
			HLOOKUP: "HLOOKUP",
			HOUR: "HOUR",
			HYPERLINK: "HYPERLINK",
			IF: "IF",
			IFERROR: "IFERROR",
			IFNA: "IFNA",
			IFS: "IFS",
			INDEX: "INDEX",
			INT: "INT",
			INTERVAL: "INTERVAL",
			IPMT: "IPMT",
			IRR: "IRR",
			ISBINARY: "ISBINARY",
			ISBLANK: "ISBLANK",
			ISERR: "ISERR",
			ISERROR: "ISERROR",
			ISEVEN: "ISEVEN",
			ISFORMULA: "ISFORMULA",
			ISLOGICAL: "ISLOGICAL",
			ISNA: "ISNA",
			ISNONTEXT: "ISNONTEXT",
			ISNUMBER: "ISNUMBER",
			ISODD: "ISODD",
			ISOWEEKNUM: "ISOWEEKNUM",
			ISPMT: "ISPMT",
			ISREF: "ISREF",
			ISTEXT: "ISTEXT",
			LEFT: "LEFT",
			LEN: "LEN",
			LN: "LN",
			LOG10: "LOG10",
			LOG: "LOG",
			LOWER: "LOWER",
			MATCH: "MATCH",
			MAX: "MAX",
			MAXA: "MAXA",
			MAXIFS: "MAXIFS",
			MAXPOOL: "MAXPOOL",
			MEDIAN: "MEDIAN",
			MEDIANPOOL: "MEDIANPOOL",
			MID: "MID",
			MIN: "MIN",
			MINA: "MINA",
			MINIFS: "MINIFS",
			MINUTE: "MINUTE",
			MIRR: "MIRR",
			MMULT: "MMULT",
			MOD: "MOD",
			MONTH: "MONTH",
			N: "N",
			NA: "NA",
			NETWORKDAYS: "NETWORKDAYS",
			"NETWORKDAYS.INTL": "NETWORKDAYS.INTL",
			NOMINAL: "NOMINAL",
			NOT: "NOT",
			NOW: "NOW",
			NPER: "NPER",
			NPV: "NPV",
			OCT2BIN: "OCT2BIN",
			OCT2DEC: "OCT2DEC",
			OCT2HEX: "OCT2HEX",
			ODD: "ODD",
			OFFSET: "OFFSET",
			OR: "OR",
			PI: "PI",
			PMT: "PMT",
			PDURATION: "PDURATION",
			PRODUCT: "PRODUCT",
			POWER: "POWER",
			PPMT: "PPMT",
			PROPER: "PROPER",
			PV: "PV",
			RADIANS: "RADIANS",
			RAND: "RAND",
			RATE: "RATE",
			REPLACE: "REPLACE",
			REPT: "REPT",
			RIGHT: "RIGHT",
			ROMAN: "ROMAN",
			ROUND: "ROUND",
			ROUNDDOWN: "ROUNDDOWN",
			ROUNDUP: "ROUNDUP",
			ROW: "ROW",
			ROWS: "ROWS",
			RRI: "RRI",
			SEARCH: "SEARCH",
			SEC: "SEC",
			SECH: "SECH",
			SECOND: "SECOND",
			SHEET: "SHEET",
			SHEETS: "SHEETS",
			SIN: "SIN",
			SINH: "SINH",
			SLN: "SLN",
			SPLIT: "SPLIT",
			SQRT: "SQRT",
			STDEVA: "STDEVA",
			"STDEV.P": "STDEV.P",
			STDEVPA: "STDEVPA",
			"STDEV.S": "STDEV.S",
			SUBSTITUTE: "SUBSTITUTE",
			SUBTOTAL: "SUBTOTAL",
			SUM: "SUM",
			SUMIF: "SUMIF",
			SUMIFS: "SUMIFS",
			SUMPRODUCT: "SUMPRODUCT",
			SUMSQ: "SUMSQ",
			SWITCH: "SWITCH",
			SYD: "SYD",
			T: "T",
			TAN: "TAN",
			TANH: "TANH",
			TBILLEQ: "TBILLEQ",
			TBILLPRICE: "TBILLPRICE",
			TBILLYIELD: "TBILLYIELD",
			TEXT: "TEXT",
			TIME: "TIME",
			TIMEVALUE: "TIMEVALUE",
			TODAY: "TODAY",
			TRANSPOSE: "TRANSPOSE",
			TRIM: "TRIM",
			TRUE: "TRUE",
			TRUNC: "TRUNC",
			UNICHAR: "UNICHAR",
			UNICODE: "UNICODE",
			UPPER: "UPPER",
			VALUE: "VALUE",
			VARA: "VARA",
			"VAR.P": "VAR.P",
			VARPA: "VARPA",
			"VAR.S": "VAR.S",
			VLOOKUP: "VLOOKUP",
			WEEKDAY: "WEEKDAY",
			WEEKNUM: "WEEKNUM",
			WORKDAY: "WORKDAY",
			"WORKDAY.INTL": "WORKDAY.INTL",
			XNPV: "XNPV",
			XOR: "XOR",
			XLOOKUP: "XLOOKUP",
			YEAR: "YEAR",
			YEARFRAC: "YEARFRAC",
			"HF.ADD": "HF.ADD",
			"HF.CONCAT": "HF.CONCAT",
			"HF.DIVIDE": "HF.DIVIDE",
			"HF.EQ": "HF.EQ",
			"HF.GT": "HF.GT",
			"HF.GTE": "HF.GTE",
			"HF.LT": "HF.LT",
			"HF.LTE": "HF.LTE",
			"HF.MINUS": "HF.MINUS",
			"HF.MULTIPLY": "HF.MULTIPLY",
			"HF.NE": "HF.NE",
			"HF.POW": "HF.POW",
			"HF.UMINUS": "HF.UMINUS",
			"HF.UNARY_PERCENT": "HF.UNARY_PERCENT",
			"HF.UPLUS": "HF.UPLUS",
			VARP: "VARP",
			VAR: "VAR",
			STDEVP: "STDEVP",
			STDEV: "STDEV",
			"EXPON.DIST": "EXPON.DIST",
			FISHER: "FISHER",
			FISHERINV: "FISHERINV",
			GAMMA: "GAMMA",
			"GAMMA.DIST": "GAMMA.DIST",
			GAMMALN: "GAMMALN",
			"GAMMALN.PRECISE": "GAMMALN.PRECISE",
			"GAMMA.INV": "GAMMA.INV",
			GAUSS: "GAUSS",
			FACT: "FACT",
			FACTDOUBLE: "FACTDOUBLE",
			COMBIN: "COMBIN",
			COMBINA: "COMBINA",
			GCD: "GCD",
			LCM: "LCM",
			MROUND: "MROUND",
			MULTINOMIAL: "MULTINOMIAL",
			QUOTIENT: "QUOTIENT",
			RANDBETWEEN: "RANDBETWEEN",
			SERIESSUM: "SERIESSUM",
			SIGN: "SIGN",
			SQRTPI: "SQRTPI",
			SUMX2MY2: "SUMX2MY2",
			SUMX2PY2: "SUMX2PY2",
			SUMXMY2: "SUMXMY2",
			"EXPONDIST": "EXPONDIST",
			GAMMADIST: "GAMMADIST",
			GAMMAINV: "GAMMAINV",
			"BETA.DIST": "BETA.DIST",
			BETADIST: "BETADIST",
			"BETA.INV": "BETA.INV",
			BETAINV: "BETAINV",
			"BINOM.DIST": "BINOM.DIST",
			BINOMDIST: "BINOMDIST",
			"BINOM.INV": "BINOM.INV",
			BESSELI: "BESSELI",
			BESSELJ: "BESSELJ",
			BESSELK: "BESSELK",
			BESSELY: "BESSELY",
			"CHISQ.DIST": "CHISQ.DIST",
			"CHISQ.DIST.RT": "CHISQ.DIST.RT",
			"CHISQ.INV": "CHISQ.INV",
			"CHISQ.INV.RT": "CHISQ.INV.RT",
			CHIDIST: "CHIDIST",
			CHIINV: "CHIINV",
			"F.DIST": "F.DIST",
			"F.DIST.RT": "F.DIST.RT",
			"F.INV": "F.INV",
			"F.INV.RT": "F.INV.RT",
			FDIST: "FDIST",
			FINV: "FINV",
			WEIBULL: "WEIBULL",
			"WEIBULL.DIST": "WEIBULL.DIST",
			POISSON: "POISSON",
			"POISSON.DIST": "POISSON.DIST",
			"HYPGEOM.DIST": "HYPGEOM.DIST",
			HYPGEOMDIST: "HYPGEOMDIST",
			"T.DIST": "T.DIST",
			"T.DIST.2T": "T.DIST.2T",
			"T.DIST.RT": "T.DIST.RT",
			"T.INV": "T.INV",
			"T.INV.2T": "T.INV.2T",
			TDIST: "TDIST",
			TINV: "TINV",
			LOGINV: "LOGINV",
			"LOGNORM.DIST": "LOGNORM.DIST",
			"LOGNORM.INV": "LOGNORM.INV",
			LOGNORMDIST: "LOGNORMDIST",
			"NORM.DIST": "NORM.DIST",
			"NORM.INV": "NORM.INV",
			"NORM.S.DIST": "NORM.S.DIST",
			"NORM.S.INV": "NORM.S.INV",
			NORMDIST: "NORMDIST",
			NORMINV: "NORMINV",
			NORMSDIST: "NORMSDIST",
			NORMSINV: "NORMSINV",
			PHI: "PHI",
			"NEGBINOM.DIST": "NEGBINOM.DIST",
			"NEGBINOMDIST": "NEGBINOMDIST",
			COMPLEX: "COMPLEX",
			IMABS: "IMABS",
			IMAGINARY: "IMAGINARY",
			IMARGUMENT: "IMARGUMENT",
			IMCONJUGATE: "IMCONJUGATE",
			IMCOS: "IMCOS",
			IMCOSH: "IMCOSH",
			IMCOT: "IMCOT",
			IMCSC: "IMCSC",
			IMCSCH: "IMCSCH",
			IMDIV: "IMDIV",
			IMEXP: "IMEXP",
			IMLN: "IMLN",
			IMLOG10: "IMLOG10",
			IMLOG2: "IMLOG2",
			IMPOWER: "IMPOWER",
			IMPRODUCT: "IMPRODUCT",
			IMREAL: "IMREAL",
			IMSEC: "IMSEC",
			IMSECH: "IMSECH",
			IMSIN: "IMSIN",
			IMSINH: "IMSINH",
			IMSQRT: "IMSQRT",
			IMSUB: "IMSUB",
			IMSUM: "IMSUM",
			IMTAN: "IMTAN",
			LARGE: "LARGE",
			SMALL: "SMALL",
			AVEDEV: "AVEDEV",
			CONFIDENCE: "CONFIDENCE",
			"CONFIDENCE.NORM": "CONFIDENCE.NORM",
			"CONFIDENCE.T": "CONFIDENCE.T",
			DEVSQ: "DEVSQ",
			GEOMEAN: "GEOMEAN",
			HARMEAN: "HARMEAN",
			CRITBINOM: "CRITBINOM",
			"COVARIANCE.P": "COVARIANCE.P",
			"COVARIANCE.S": "COVARIANCE.S",
			"COVAR": "COVAR",
			PEARSON: "PEARSON",
			RSQ: "RSQ",
			STANDARDIZE: "STANDARDIZE",
			"Z.TEST": "Z.TEST",
			ZTEST: "ZTEST",
			"F.TEST": "F.TEST",
			FTEST: "FTEST",
			STEYX: "STEYX",
			SLOPE: "SLOPE",
			"CHISQ.TEST": "CHISQ.TEST",
			CHITEST: "CHITEST",
			"T.TEST": "T.TEST",
			TTEST: "TTEST",
			SKEW: "SKEW",
			"SKEW.P": "SKEW.P",
			WEIBULLDIST: "WEIBULLDIST",
			VARS: "VARS",
			TINV2T: "TINV2T",
			TDISTRT: "TDISTRT",
			TDIST2T: "TDIST2T",
			STDEVS: "STDEVS",
			FINVRT: "FINVRT",
			FDISTRT: "FDISTRT",
			CHIDISTRT: "CHIDISTRT",
			CHIINVRT: "CHIINVRT",
			COVARIANCEP: "COVARIANCEP",
			COVARIANCES: "COVARIANCES",
			LOGNORMINV: "LOGNORMINV",
			POISSONDIST: "POISSONDIST",
			SKEWP: "SKEWP",
			"CEILING.MATH": "CEILING.MATH",
			FLOOR: "FLOOR",
			"FLOOR.MATH": "FLOOR.MATH",
			"CEILING.PRECISE": "CEILING.PRECISE",
			"FLOOR.PRECISE": "FLOOR.PRECISE",
			"ISO.CEILING": "ISO.CEILING"
		},
		langCode: "enGB",
		ui: { NEW_SHEET_PREFIX: "Sheet" }
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/AddressPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AbsStyle;
	(function(AbsStyle) {
		AbsStyle[AbsStyle["FullyAbsolute"] = 1] = "FullyAbsolute";
		AbsStyle[AbsStyle["RowAbsoluteColRelative"] = 2] = "RowAbsoluteColRelative";
		AbsStyle[AbsStyle["RowRelativeColAbsolute"] = 3] = "RowRelativeColAbsolute";
		AbsStyle[AbsStyle["FullyRelative"] = 4] = "FullyRelative";
	})(AbsStyle || (AbsStyle = {}));
	var AddressPlugin = class extends FunctionPlugin {
		verifyAddressArguments(row, col, abs, useA1Style) {
			if (useA1Style) {
				if (row < 1 || col < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
			} else if (AbsStyle.FullyAbsolute == abs) {
				if (row < 1 || col < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
			} else if (AbsStyle.RowAbsoluteColRelative == abs) {
				if (row < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
			} else if (AbsStyle.RowRelativeColAbsolute == abs) {
				if (col < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
			}
		}
		address(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ADDRESS"), (row, col, abs, useA1Style, sheetName) => {
				const argumentError = this.verifyAddressArguments(row, col, abs, useA1Style);
				if (argumentError !== void 0) return argumentError;
				const colLetter = columnIndexToLabel(col - 1);
				let sheetPrefix = "";
				if (sheetName !== void 0 && sheetName !== null) sheetPrefix = `${sheetName}!`;
				const r1c1ColSegment = col == 0 ? "C" : `C[${col}]`;
				const r1c1RowSegment = row == 0 ? "R" : `R[${row}]`;
				if (AbsStyle.FullyRelative == abs) return useA1Style ? `${sheetPrefix}${colLetter}${row}` : `${sheetPrefix}${r1c1RowSegment}${r1c1ColSegment}`;
				else if (AbsStyle.RowRelativeColAbsolute == abs) return useA1Style ? `${sheetPrefix}$${colLetter}${row}` : `${sheetPrefix}${r1c1RowSegment}C${col}`;
				else if (AbsStyle.RowAbsoluteColRelative == abs) return useA1Style ? `${sheetPrefix}${colLetter}$${row}` : `${sheetPrefix}R${row}${r1c1ColSegment}`;
				return useA1Style ? `${sheetPrefix}$${colLetter}$${row}` : `${sheetPrefix}R${row}C${col}`;
			});
		}
	};
	AddressPlugin.implementedFunctions = { "ADDRESS": {
		method: "address",
		parameters: [
			{ argumentType: FunctionArgumentType.NUMBER },
			{ argumentType: FunctionArgumentType.NUMBER },
			{
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				defaultValue: 1,
				minValue: 1,
				maxValue: 4
			},
			{
				argumentType: FunctionArgumentType.BOOLEAN,
				optionalArg: true,
				defaultValue: true
			},
			{
				argumentType: FunctionArgumentType.STRING,
				optionalArg: true
			}
		]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/ArrayPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ArrayPlugin = class extends FunctionPlugin {
		arrayformula(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ARRAYFORMULA"), (value) => value);
		}
		arrayformulaArraySize(ast, state) {
			if (ast.args.length !== 1) return ArraySize.error();
			const metadata = this.metadata("ARRAYFORMULA");
			return ast.args.map((arg) => {
				var _a;
				return this.arraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			})[0];
		}
		arrayconstrain(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ARRAY_CONSTRAIN"), (range, numRows, numCols) => {
				numRows = Math.min(numRows, range.height());
				numCols = Math.min(numCols, range.width());
				const data = range.data;
				const ret = [];
				for (let i = 0; i < numRows; i++) ret.push(data[i].slice(0, numCols));
				return SimpleRangeValue.onlyValues(ret);
			});
		}
		arrayconstrainArraySize(ast, state) {
			if (ast.args.length !== 3) return ArraySize.error();
			const metadata = this.metadata("ARRAY_CONSTRAIN");
			let { height, width } = ast.args.map((arg) => {
				var _a;
				return this.arraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			})[0];
			if (ast.args[1].type === AstNodeType.NUMBER) height = Math.min(height, ast.args[1].value);
			if (ast.args[2].type === AstNodeType.NUMBER) width = Math.min(width, ast.args[2].value);
			if (height < 1 || width < 1 || !Number.isInteger(height) || !Number.isInteger(width)) return ArraySize.error();
			return new ArraySize(width, height);
		}
		filter(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FILTER"), (rangeVals, ...rangeFilters) => {
				for (const filter of rangeFilters) if (rangeVals.width() !== filter.width() || rangeVals.height() !== filter.height()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				if (rangeVals.width() > 1 && rangeVals.height() > 1) return new CellError(ErrorType.NA, ErrorMessage.WrongDimension);
				const vals = rangeVals.data;
				const ret = [];
				for (let i = 0; i < rangeVals.height(); i++) {
					const row = [];
					for (let j = 0; j < rangeVals.width(); j++) {
						let ok = true;
						for (const filter of rangeFilters) if (coerceScalarToBoolean(filter.data[i][j]) !== true) {
							ok = false;
							break;
						}
						if (ok) row.push(vals[i][j]);
					}
					if (row.length > 0) ret.push(row);
				}
				if (ret.length > 0) return SimpleRangeValue.onlyValues(ret);
				else return new CellError(ErrorType.NA, ErrorMessage.EmptyRange);
			});
		}
		filterArraySize(ast, state) {
			if (ast.args.length <= 1) return ArraySize.error();
			const metadata = this.metadata("FILTER");
			const subChecks = ast.args.map((arg) => {
				var _a;
				return this.arraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			});
			return new ArraySize(Math.max(...subChecks.map((val) => val.width)), Math.max(...subChecks.map((val) => val.height)));
		}
	};
	ArrayPlugin.implementedFunctions = {
		"ARRAYFORMULA": {
			method: "arrayformula",
			sizeOfResultArrayMethod: "arrayformulaArraySize",
			enableArrayArithmeticForArguments: true,
			parameters: [{ argumentType: FunctionArgumentType.ANY }]
		},
		"ARRAY_CONSTRAIN": {
			method: "arrayconstrain",
			sizeOfResultArrayMethod: "arrayconstrainArraySize",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1
				}
			],
			vectorizationForbidden: true
		},
		"FILTER": {
			method: "filter",
			sizeOfResultArrayMethod: "filterArraySize",
			enableArrayArithmeticForArguments: true,
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }],
			repeatLastArgs: 1
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/AbsPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AbsPlugin = class extends FunctionPlugin {
		abs(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ABS"), Math.abs);
		}
	};
	AbsPlugin.implementedFunctions = { "ABS": {
		method: "abs",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/BitShiftPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var MAX_48BIT_INTEGER = 0xffffffffffff;
	var SHIFT_MIN_POSITIONS = -53;
	var SHIFT_MAX_POSITIONS = 53;
	var BitShiftPlugin = class extends FunctionPlugin {
		bitlshift(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BITLSHIFT"), shiftLeft);
		}
		bitrshift(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BITRSHIFT"), shiftRight);
		}
	};
	BitShiftPlugin.implementedFunctions = {
		"BITLSHIFT": {
			method: "bitlshift",
			parameters: [{
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.INTEGER,
				minValue: SHIFT_MIN_POSITIONS,
				maxValue: SHIFT_MAX_POSITIONS
			}]
		},
		"BITRSHIFT": {
			method: "bitrshift",
			parameters: [{
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.INTEGER,
				minValue: SHIFT_MIN_POSITIONS,
				maxValue: SHIFT_MAX_POSITIONS
			}]
		}
	};
	function shiftLeft(value, positions) {
		if (positions < 0) return shiftRight(value, -positions);
		else return validate(value * Math.pow(2, positions));
	}
	function shiftRight(value, positions) {
		if (positions < 0) return shiftLeft(value, -positions);
		else return validate(Math.floor(value / Math.pow(2, positions)));
	}
	function validate(result) {
		if (result > MAX_48BIT_INTEGER) return new CellError(ErrorType.NUM, ErrorMessage.BitshiftLong);
		else return result;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/BitwiseLogicOperationsPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var BitwiseLogicOperationsPlugin = class extends FunctionPlugin {
		bitand(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BITAND"), (left, right) => left & right);
		}
		bitor(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BITOR"), (left, right) => left | right);
		}
		bitxor(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BITXOR"), (left, right) => left ^ right);
		}
	};
	BitwiseLogicOperationsPlugin.implementedFunctions = {
		"BITAND": {
			method: "bitand",
			parameters: [{
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}]
		},
		"BITOR": {
			method: "bitor",
			parameters: [{
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}]
		},
		"BITXOR": {
			method: "bitxor",
			parameters: [{
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 0
			}]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/BooleanPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing boolean functions
	*/
	var BooleanPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to TRUE()
		*
		* Returns the logical true
		*
		* @param ast
		* @param state
		*/
		literalTrue(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TRUE"), () => true);
		}
		/**
		* Corresponds to FALSE()
		*
		* Returns the logical false
		*
		* @param ast
		* @param state
		*/
		literalFalse(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FALSE"), () => false);
		}
		/**
		* Corresponds to IF(expression, value_if_true, value_if_false)
		*
		* Returns value specified as second argument if expression is true and third argument if expression is false
		*
		* @param ast
		* @param state
		*/
		conditionalIf(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IF"), (condition, arg2, arg3) => {
				return condition ? arg2 : arg3;
			});
		}
		/**
		* Implementation for the IFS function. Returns the value that corresponds to the first true condition.
		*
		* @param ast
		* @param state
		*/
		ifs(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IFS"), (...args) => {
				for (let idx = 0; idx < args.length; idx += 2) if (args[idx]) return args[idx + 1];
				return new CellError(ErrorType.NA, ErrorMessage.NoConditionMet);
			});
		}
		/**
		* Corresponds to AND(expression1, [expression2, ...])
		*
		* Returns true if all of the provided arguments are logically true, and false if any of it is logically false
		*
		* @param ast
		* @param state
		*/
		and(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("AND"), (...args) => args.filter((arg) => arg !== void 0).every((arg) => !!arg));
		}
		/**
		* Corresponds to OR(expression1, [expression2, ...])
		*
		* Returns true if any of the provided arguments are logically true, and false otherwise
		*
		* @param ast
		* @param state
		*/
		or(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("OR"), (...args) => args.filter((arg) => arg !== void 0).some((arg) => arg));
		}
		not(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NOT"), (arg) => !arg);
		}
		xor(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("XOR"), (...args) => {
				let cnt = 0;
				args.filter((arg) => arg !== void 0).forEach((arg) => {
					if (arg) cnt++;
				});
				return cnt % 2 === 1;
			});
		}
		switch(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SWITCH"), (selector, ...args) => {
				const n = args.length;
				let i = 0;
				for (; i + 1 < n; i += 2) {
					if (args[i] instanceof CellError) continue;
					if (this.arithmeticHelper.eq(selector, args[i])) return args[i + 1];
				}
				if (i < n) return args[i];
				else return new CellError(ErrorType.NA, ErrorMessage.NoDefault);
			});
		}
		iferror(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IFERROR"), (arg1, arg2) => {
				if (arg1 instanceof CellError) return arg2;
				else return arg1;
			});
		}
		ifna(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IFNA"), (arg1, arg2) => {
				if (arg1 instanceof CellError && arg1.type === ErrorType.NA) return arg2;
				else return arg1;
			});
		}
		choose(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHOOSE"), (selector, ...args) => {
				if (selector > args.length) return new CellError(ErrorType.NUM, ErrorMessage.Selector);
				return args[selector - 1];
			});
		}
	};
	BooleanPlugin.implementedFunctions = {
		"TRUE": {
			method: "literalTrue",
			parameters: []
		},
		"FALSE": {
			method: "literalFalse",
			parameters: []
		},
		"IF": {
			method: "conditionalIf",
			parameters: [
				{ argumentType: FunctionArgumentType.BOOLEAN },
				{
					argumentType: FunctionArgumentType.SCALAR,
					passSubtype: true
				},
				{
					argumentType: FunctionArgumentType.SCALAR,
					defaultValue: false,
					passSubtype: true
				}
			]
		},
		"IFS": {
			method: "ifs",
			parameters: [{ argumentType: FunctionArgumentType.BOOLEAN }, {
				argumentType: FunctionArgumentType.SCALAR,
				passSubtype: true
			}],
			repeatLastArgs: 2
		},
		"AND": {
			method: "and",
			parameters: [{ argumentType: FunctionArgumentType.BOOLEAN }],
			repeatLastArgs: 1,
			expandRanges: true
		},
		"OR": {
			method: "or",
			parameters: [{ argumentType: FunctionArgumentType.BOOLEAN }],
			repeatLastArgs: 1,
			expandRanges: true
		},
		"XOR": {
			method: "xor",
			parameters: [{ argumentType: FunctionArgumentType.BOOLEAN }],
			repeatLastArgs: 1,
			expandRanges: true
		},
		"NOT": {
			method: "not",
			parameters: [{ argumentType: FunctionArgumentType.BOOLEAN }]
		},
		"SWITCH": {
			method: "switch",
			parameters: [
				{ argumentType: FunctionArgumentType.NOERROR },
				{
					argumentType: FunctionArgumentType.SCALAR,
					passSubtype: true
				},
				{
					argumentType: FunctionArgumentType.SCALAR,
					passSubtype: true
				}
			],
			repeatLastArgs: 1
		},
		"IFERROR": {
			method: "iferror",
			parameters: [{
				argumentType: FunctionArgumentType.SCALAR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.SCALAR,
				passSubtype: true
			}]
		},
		"IFNA": {
			method: "ifna",
			parameters: [{
				argumentType: FunctionArgumentType.SCALAR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.SCALAR,
				passSubtype: true
			}]
		},
		"CHOOSE": {
			method: "choose",
			parameters: [{
				argumentType: FunctionArgumentType.INTEGER,
				minValue: 1
			}, {
				argumentType: FunctionArgumentType.SCALAR,
				passSubtype: true
			}],
			repeatLastArgs: 1
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/CharPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CharPlugin = class extends FunctionPlugin {
		char(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHAR"), (value) => {
				if (value < 1 || value >= 256) return new CellError(ErrorType.VALUE, ErrorMessage.CharacterCodeBounds);
				return String.fromCharCode(Math.trunc(value));
			});
		}
		unichar(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHAR"), (value) => {
				if (value < 1 || value >= 1114112) return new CellError(ErrorType.VALUE, ErrorMessage.CharacterCodeBounds);
				return String.fromCodePoint(Math.trunc(value));
			});
		}
	};
	CharPlugin.implementedFunctions = {
		"CHAR": {
			method: "char",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"UNICHAR": {
			method: "unichar",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/CodePlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var CodePlugin = class extends FunctionPlugin {
		code(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CODE"), (value) => {
				if (value.length === 0) return new CellError(ErrorType.VALUE, ErrorMessage.EmptyString);
				return value.charCodeAt(0);
			});
		}
		unicode(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("UNICODE"), (value) => {
				var _a;
				return (_a = value.codePointAt(0)) !== null && _a !== void 0 ? _a : new CellError(ErrorType.VALUE, ErrorMessage.EmptyString);
			});
		}
	};
	CodePlugin.implementedFunctions = {
		"CODE": {
			method: "code",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"UNICODE": {
			method: "unicode",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/CountBlankPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing MEDIAN function
	*/
	var CountBlankPlugin = class extends FunctionPlugin {
		countblank(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COUNTBLANK"), (...args) => {
				let counter = 0;
				args.forEach((arg) => {
					if (arg === EmptyValue) counter++;
				});
				return counter;
			});
		}
	};
	CountBlankPlugin.implementedFunctions = { "COUNTBLANK": {
		method: "countblank",
		parameters: [{ argumentType: FunctionArgumentType.SCALAR }],
		repeatLastArgs: 1,
		expandRanges: true
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/CountUniquePlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing COUNTUNIQUE function
	*/
	var CountUniquePlugin = class extends FunctionPlugin {
		/**
		* Corresponds to COUNTUNIQUE(Number1, Number2, ...).
		*
		* Returns number of unique numbers from arguments
		*
		* @param ast
		* @param state
		*/
		countunique(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COUNTUNIQUE"), (...args) => {
				const valuesSet = /* @__PURE__ */ new Set();
				const errorsSet = /* @__PURE__ */ new Set();
				for (const scalarValue of args) if (scalarValue instanceof CellError) errorsSet.add(scalarValue.type);
				else if (scalarValue !== "") valuesSet.add(scalarValue);
				return valuesSet.size + errorsSet.size;
			});
		}
	};
	CountUniquePlugin.implementedFunctions = { "COUNTUNIQUE": {
		method: "countunique",
		parameters: [{ argumentType: FunctionArgumentType.SCALAR }],
		repeatLastArgs: 1,
		expandRanges: true
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/DateTimePlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing date-specific functions
	*/
	var DateTimePlugin = class extends FunctionPlugin {
		constructor() {
			super(...arguments);
			this.isoweeknumCore = (day) => {
				const absoluteDay = Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(day));
				const date = this.dateTimeHelper.numberToSimpleDate(day);
				const yearStart = this.dateTimeHelper.dateToNumber({
					year: date.year,
					month: 1,
					day: 1
				});
				const yearStartAbsolute = this.dateTimeHelper.relativeNumberToAbsoluteNumber(yearStart);
				const firstThursdayAbs = yearStartAbsolute + ((4 - yearStartAbsolute) % 7 + 7) % 7;
				const ret = Math.floor((absoluteDay - 1) / 7) - Math.floor((firstThursdayAbs - 1) / 7) + 1;
				if (ret === 0) return this.isoweeknumCore(day - 7) + 1;
				return ret;
			};
			this.days360Core = (startDate, endDate, mode) => {
				const start = this.dateTimeHelper.numberToSimpleDate(startDate);
				const end = this.dateTimeHelper.numberToSimpleDate(endDate);
				let nStart, nEnd;
				if (mode) {
					nStart = toBasisEU(start);
					nEnd = toBasisEU(end);
				} else [nStart, nEnd] = this.dateTimeHelper.toBasisUS(start, end);
				return 360 * (nEnd.year - nStart.year) + 30 * (nEnd.month - nStart.month) + nEnd.day - nStart.day;
			};
		}
		/**
		* Corresponds to DATE(year, month, day)
		*
		* Converts a provided year, month and day into date
		*
		* @param ast
		* @param state
		*/
		date(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DATE"), (year, month, day) => {
				const d = Math.trunc(day);
				let m = Math.trunc(month);
				let y = Math.trunc(year);
				if (y < this.dateTimeHelper.getEpochYearZero()) y += this.dateTimeHelper.getEpochYearZero();
				const delta = Math.floor((m - 1) / 12);
				y += delta;
				m -= delta * 12;
				const date = {
					year: y,
					month: m,
					day: 1
				};
				if (this.dateTimeHelper.isValidDate(date)) {
					let ret = this.dateTimeHelper.dateToNumber(date) + (d - 1);
					ret = this.dateTimeHelper.getWithinBounds(ret);
					if (ret === void 0) return new CellError(ErrorType.NUM, ErrorMessage.DateBounds);
					return ret;
				}
				return new CellError(ErrorType.VALUE, ErrorMessage.InvalidDate);
			});
		}
		time(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TIME"), (h, m, s) => {
				const ret = timeToNumber({
					hours: Math.trunc(h),
					minutes: Math.trunc(m),
					seconds: Math.trunc(s)
				});
				if (ret < 0) return new CellError(ErrorType.NUM, ErrorMessage.NegativeTime);
				return ret % 1;
			});
		}
		/**
		* Implementation for the EOMONTH function
		*/
		eomonth(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EOMONTH"), (dateNumber, numberOfMonthsToShift) => {
				const date = this.dateTimeHelper.numberToSimpleDate(dateNumber);
				let ret = this.dateTimeHelper.dateToNumber(this.dateTimeHelper.endOfMonth(offsetMonth(date, numberOfMonthsToShift)));
				ret = this.dateTimeHelper.getWithinBounds(ret);
				if (ret === void 0) return new CellError(ErrorType.NUM, ErrorMessage.DateBounds);
				return ret;
			});
		}
		day(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DAY"), (dateNumber) => this.dateTimeHelper.numberToSimpleDate(dateNumber).day);
		}
		days(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DAYS"), (endDate, startDate) => Math.trunc(endDate) - Math.trunc(startDate));
		}
		/**
		* Corresponds to MONTH(date)
		*
		* Returns the month of the year specified by a given date
		*
		* @param ast
		* @param state
		*/
		month(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MONTH"), (dateNumber) => this.dateTimeHelper.numberToSimpleDate(dateNumber).month);
		}
		/**
		* Corresponds to YEAR(date)
		*
		* Returns the year specified by a given date
		*
		* @param ast
		* @param state
		*/
		year(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("YEAR"), (dateNumber) => this.dateTimeHelper.numberToSimpleDate(dateNumber).year);
		}
		hour(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HOUR"), (timeNumber) => numberToSimpleTime(roundToNearestSecond(timeNumber) % 1).hours);
		}
		minute(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MINUTE"), (timeNumber) => numberToSimpleTime(roundToNearestSecond(timeNumber) % 1).minutes);
		}
		second(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SECOND"), (timeNumber) => numberToSimpleTime(roundToNearestSecond(timeNumber) % 1).seconds);
		}
		/**
		* Corresponds to TEXT(number, format)
		*
		* Tries to convert number to specified date format.
		*
		* @param ast
		* @param state
		*/
		text(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TEXT"), (numberRepresentation, formatArg) => format(numberRepresentation, formatArg, this.config, this.dateTimeHelper));
		}
		weekday(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("WEEKDAY"), (day, type) => {
				const absoluteDay = Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(day));
				if (type === 3) return (absoluteDay - 1) % 7;
				const offset = weekdayOffsets.get(type);
				if (offset === void 0) return new CellError(ErrorType.NUM, ErrorMessage.BadMode);
				return (absoluteDay - offset) % 7 + 1;
			});
		}
		weeknum(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("WEEKNUM"), (day, type) => {
				const absoluteDay = Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(day));
				const date = this.dateTimeHelper.numberToSimpleDate(day);
				const yearStart = this.dateTimeHelper.dateToNumber({
					year: date.year,
					month: 1,
					day: 1
				});
				const yearStartAbsolute = this.dateTimeHelper.relativeNumberToAbsoluteNumber(yearStart);
				if (type === 21) return this.isoweeknumCore(day);
				const offset = weekdayOffsets.get(type);
				if (offset === void 0) return new CellError(ErrorType.NUM, ErrorMessage.BadMode);
				return Math.floor((absoluteDay - offset) / 7) - Math.floor((yearStartAbsolute - offset) / 7) + 1;
			});
		}
		isoweeknum(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISOWEEKNUM"), this.isoweeknumCore);
		}
		datevalue(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DATEVALUE"), (date) => {
				const { dateTime } = this.dateTimeHelper.parseDateTimeFromConfigFormats(date);
				if (dateTime === void 0) return new CellError(ErrorType.VALUE, ErrorMessage.IncorrectDateTime);
				if (!instanceOfSimpleDate(dateTime)) return 0;
				return (instanceOfSimpleTime(dateTime) ? Math.trunc(timeToNumber(dateTime)) : 0) + this.dateTimeHelper.dateToNumber(dateTime);
			});
		}
		timevalue(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TIMEVALUE"), (date) => {
				const dateNumber = this.dateTimeHelper.dateStringToDateNumber(date);
				if (dateNumber === void 0) return new CellError(ErrorType.VALUE, ErrorMessage.IncorrectDateTime);
				return getRawValue(dateNumber) % 1;
			});
		}
		now(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NOW"), () => {
				const now = new Date(Date.now());
				return timeToNumber({
					hours: now.getHours(),
					minutes: now.getMinutes(),
					seconds: now.getSeconds()
				}) + this.dateTimeHelper.dateToNumber({
					year: now.getFullYear(),
					month: now.getMonth() + 1,
					day: now.getDate()
				});
			});
		}
		today(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TODAY"), () => {
				const now = new Date(Date.now());
				return this.dateTimeHelper.dateToNumber({
					year: now.getFullYear(),
					month: now.getMonth() + 1,
					day: now.getDate()
				});
			});
		}
		edate(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EDATE"), (dateNumber, delta) => {
				const newDate = truncateDayInMonth(offsetMonth(this.dateTimeHelper.numberToSimpleDate(dateNumber), delta));
				let ret = this.dateTimeHelper.dateToNumber(newDate);
				ret = this.dateTimeHelper.getWithinBounds(ret);
				if (ret === void 0) return new CellError(ErrorType.NUM, ErrorMessage.DateBounds);
				return ret;
			});
		}
		datedif(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DATEDIF"), (startDate, endDate, unit) => {
				if (startDate > endDate) return new CellError(ErrorType.NUM, ErrorMessage.StartEndDate);
				if (unit === "D") return Math.floor(endDate) - Math.floor(startDate);
				const start = this.dateTimeHelper.numberToSimpleDate(startDate);
				const end = this.dateTimeHelper.numberToSimpleDate(endDate);
				switch (unit) {
					case "M": return (end.year - start.year) * 12 + (end.month - start.month) - (end.day < start.day ? 1 : 0);
					case "YM": return (12 + (end.month - start.month) - (end.day < start.day ? 1 : 0)) % 12;
					case "Y": if (end.month > start.month || end.month === start.month && end.day >= start.day) return end.year - start.year;
					else return end.year - start.year - 1;
					case "MD": if (end.day >= start.day) return end.day - start.day;
					else {
						const m = end.month === 1 ? 12 : end.month - 1;
						const y = end.month === 1 ? end.year - 1 : end.year;
						return this.dateTimeHelper.daysInMonth(y, m) + end.day - start.day;
					}
					case "YD": if (end.month > start.month || end.month === start.month && end.day >= start.day) return Math.floor(endDate) - this.dateTimeHelper.dateToNumber({
						year: end.year,
						month: start.month,
						day: start.day
					});
					else return Math.floor(endDate) - Math.floor(startDate) - 365 * (end.year - start.year - 1) - this.dateTimeHelper.leapYearsCount(end.year - 1) + this.dateTimeHelper.leapYearsCount(start.year);
					default: return new CellError(ErrorType.NUM, ErrorMessage.BadMode);
				}
			});
		}
		days360(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DAYS360"), this.days360Core);
		}
		yearfrac(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("YEARFRAC"), (startDate, endDate, mode) => {
				startDate = Math.trunc(startDate);
				endDate = Math.trunc(endDate);
				if (startDate > endDate) [startDate, endDate] = [endDate, startDate];
				switch (mode) {
					case 0: return this.days360Core(startDate, endDate, false) / 360;
					case 1: return (endDate - startDate) / this.dateTimeHelper.yearLengthForBasis(this.dateTimeHelper.numberToSimpleDate(startDate), this.dateTimeHelper.numberToSimpleDate(endDate));
					case 2: return (endDate - startDate) / 360;
					case 3: return (endDate - startDate) / 365;
					case 4: return this.days360Core(startDate, endDate, true) / 360;
				}
				throw new Error("Should not be reachable.");
			});
		}
		interval(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("INTERVAL"), (arg) => {
				arg = Math.trunc(arg);
				const second = arg % 60;
				arg = Math.trunc(arg / 60);
				const minute = arg % 60;
				arg = Math.trunc(arg / 60);
				const hour = arg % 24;
				arg = Math.trunc(arg / 24);
				const day = arg % 30;
				arg = Math.trunc(arg / 30);
				const month = arg % 12;
				const year = Math.trunc(arg / 12);
				return "P" + (year > 0 ? `${year}Y` : "") + (month > 0 ? `${month}M` : "") + (day > 0 ? `${day}D` : "") + "T" + (hour > 0 ? `${hour}H` : "") + (minute > 0 ? `${minute}M` : "") + (second > 0 ? `${second}S` : "");
			});
		}
		networkdays(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NETWORKDAYS"), (start, end, holidays) => this.networkdayscore(start, end, 1, holidays));
		}
		networkdaysintl(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NETWORKDAYS.INTL"), (start, end, weekend, holidays) => this.networkdayscore(start, end, weekend, holidays));
		}
		workday(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("WORKDAY"), (start, end, holidays) => this.workdaycore(start, end, 1, holidays));
		}
		workdayintl(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("WORKDAY.INTL"), (start, end, weekend, holidays) => this.workdaycore(start, end, weekend, holidays));
		}
		networkdayscore(start, end, weekend, holidays) {
			start = Math.trunc(start);
			end = Math.trunc(end);
			let multiplier = 1;
			if (start > end) {
				[start, end] = [end, start];
				multiplier = -1;
			}
			const weekendPattern = computeWeekendPattern(weekend);
			if (weekendPattern instanceof CellError) return weekendPattern;
			const filteredHolidays = this.simpleRangeToFilteredHolidays(weekendPattern, holidays);
			if (filteredHolidays instanceof CellError) return filteredHolidays;
			return multiplier * this.countWorkdays(start, end, weekendPattern, filteredHolidays);
		}
		workdaycore(start, delta, weekend, holidays) {
			start = Math.trunc(start);
			delta = Math.trunc(delta);
			const weekendPattern = computeWeekendPattern(weekend);
			if (weekendPattern instanceof CellError) return weekendPattern;
			const filteredHolidays = this.simpleRangeToFilteredHolidays(weekendPattern, holidays);
			if (filteredHolidays instanceof CellError) return filteredHolidays;
			if (delta > 0) {
				let upper = 1;
				while (this.countWorkdays(start + 1, start + upper, weekendPattern, filteredHolidays) < delta) upper *= 2;
				let lower = 1;
				while (lower + 1 < upper) {
					const mid = Math.trunc((lower + upper) / 2);
					if (this.countWorkdays(start + 1, start + mid, weekendPattern, filteredHolidays) < delta) lower = mid;
					else upper = mid;
				}
				return start + upper;
			} else if (delta < 0) {
				delta *= -1;
				let upper = 1;
				while (this.countWorkdays(start - upper, start - 1, weekendPattern, filteredHolidays) < delta) upper *= 2;
				let lower = 1;
				while (lower + 1 < upper) {
					const mid = Math.trunc((lower + upper) / 2);
					if (this.countWorkdays(start - mid, start - 1, weekendPattern, filteredHolidays) < delta) lower = mid;
					else upper = mid;
				}
				return start - upper;
			} else return start;
		}
		countWorkdays(start, end, weekendPattern, sortedHolidays) {
			const absoluteEnd = Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(end));
			const absoluteStart = Math.floor(this.dateTimeHelper.relativeNumberToAbsoluteNumber(start));
			let ans = 0;
			for (let i = 0; i < 7; i++) if (weekendPattern.charAt(i) === "0") {
				ans += Math.floor((absoluteEnd + 6 - i) / 7);
				ans -= Math.floor((absoluteStart - 1 + 6 - i) / 7);
			}
			ans -= lowerBound(end + 1, sortedHolidays) - lowerBound(start, sortedHolidays);
			return ans;
		}
		simpleRangeToFilteredHolidays(weekendPattern, holidays) {
			var _a;
			const holidaysArr = (_a = holidays === null || holidays === void 0 ? void 0 : holidays.valuesFromTopLeftCorner()) !== null && _a !== void 0 ? _a : [];
			for (const val of holidaysArr) if (val instanceof CellError) return val;
			const processedHolidays = [];
			for (const val of holidaysArr) {
				if (val === EmptyValue) continue;
				if (isExtendedNumber(val)) processedHolidays.push(Math.trunc(getRawValue(val)));
				else return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
			}
			return [...new Set(processedHolidays)].sort((a, b) => a - b).filter((arg) => {
				const i = (this.dateTimeHelper.relativeNumberToAbsoluteNumber(arg) - 1) % 7;
				return weekendPattern.charAt(i) === "0";
			});
		}
	};
	DateTimePlugin.implementedFunctions = {
		"DATE": {
			method: "date",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			],
			returnNumberType: NumberType.NUMBER_DATE
		},
		"TIME": {
			method: "time",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			],
			returnNumberType: NumberType.NUMBER_TIME
		},
		"MONTH": {
			method: "month",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"YEAR": {
			method: "year",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"HOUR": {
			method: "hour",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"MINUTE": {
			method: "minute",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"SECOND": {
			method: "second",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"TEXT": {
			method: "text",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.STRING }]
		},
		"EOMONTH": {
			method: "eomonth",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, { argumentType: FunctionArgumentType.NUMBER }],
			returnNumberType: NumberType.NUMBER_DATE
		},
		"DAY": {
			method: "day",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"DAYS": {
			method: "days",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"WEEKDAY": {
			method: "weekday",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 1
			}]
		},
		"WEEKNUM": {
			method: "weeknum",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 1
			}]
		},
		"ISOWEEKNUM": {
			method: "isoweeknum",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"DATEVALUE": {
			method: "datevalue",
			parameters: [{ argumentType: FunctionArgumentType.STRING }],
			returnNumberType: NumberType.NUMBER_DATE
		},
		"TIMEVALUE": {
			method: "timevalue",
			parameters: [{ argumentType: FunctionArgumentType.STRING }],
			returnNumberType: NumberType.NUMBER_TIME
		},
		"NOW": {
			method: "now",
			parameters: [],
			isVolatile: true,
			returnNumberType: NumberType.NUMBER_DATETIME
		},
		"TODAY": {
			method: "today",
			parameters: [],
			isVolatile: true,
			returnNumberType: NumberType.NUMBER_DATE
		},
		"EDATE": {
			method: "edate",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, { argumentType: FunctionArgumentType.NUMBER }],
			returnNumberType: NumberType.NUMBER_DATE
		},
		"DAYS360": {
			method: "days360",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.BOOLEAN,
					defaultValue: false
				}
			]
		},
		"DATEDIF": {
			method: "datedif",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{ argumentType: FunctionArgumentType.STRING }
			]
		},
		"YEARFRAC": {
			method: "yearfrac",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					defaultValue: 0,
					minValue: 0,
					maxValue: 4
				}
			]
		},
		"INTERVAL": {
			method: "interval",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"NETWORKDAYS": {
			method: "networkdays",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.RANGE,
					optionalArg: true
				}
			]
		},
		"NETWORKDAYS.INTL": {
			method: "networkdaysintl",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NOERROR,
					defaultValue: 1
				},
				{
					argumentType: FunctionArgumentType.RANGE,
					optionalArg: true
				}
			]
		},
		"WORKDAY": {
			method: "workday",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.RANGE,
					optionalArg: true
				}
			]
		},
		"WORKDAY.INTL": {
			method: "workdayintl",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NOERROR,
					defaultValue: 1
				},
				{
					argumentType: FunctionArgumentType.RANGE,
					optionalArg: true
				}
			]
		}
	};
	/**
	* Returns i such that:
	* sortedArray[i-1] < val <= sortedArray[i]
	*
	*/
	function lowerBound(val, sortedArray) {
		if (sortedArray.length === 0) return 0;
		if (val <= sortedArray[0]) return 0;
		if (sortedArray[sortedArray.length - 1] < val) return sortedArray.length;
		let lower = 0;
		let upper = sortedArray.length - 1;
		while (lower + 1 < upper) {
			const mid = Math.floor((upper + lower) / 2);
			if (sortedArray[mid] >= val) upper = mid;
			else lower = mid;
		}
		return upper;
	}
	function computeWeekendPattern(weekend) {
		var _a;
		if (typeof weekend !== "number" && typeof weekend !== "string") return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
		if (typeof weekend === "string") if (weekend.length !== 7 || !/^(0|1)*$/.test(weekend) || weekend === "1111111") return new CellError(ErrorType.NUM, ErrorMessage.WeekendString);
		else return weekend;
		else return (_a = workdayPatterns.get(weekend)) !== null && _a !== void 0 ? _a : new CellError(ErrorType.NUM, ErrorMessage.BadMode);
	}
	var weekdayOffsets = new Map([
		[1, 0],
		[2, 1],
		[11, 1],
		[12, 2],
		[13, 3],
		[14, 4],
		[15, 5],
		[16, 6],
		[17, 0]
	]);
	var workdayPatterns = new Map([
		[1, "0000011"],
		[2, "1000001"],
		[3, "1100000"],
		[4, "0110000"],
		[5, "0011000"],
		[6, "0001100"],
		[7, "0000110"],
		[11, "0000001"],
		[12, "1000000"],
		[13, "0100000"],
		[14, "0010000"],
		[15, "0001000"],
		[16, "0000100"],
		[17, "0000010"]
	]);
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/DegreesPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var DegreesPlugin = class extends FunctionPlugin {
		degrees(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DEGREES"), (arg) => arg * (180 / Math.PI));
		}
	};
	DegreesPlugin.implementedFunctions = { "DEGREES": {
		method: "degrees",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/DeltaPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var DeltaPlugin = class extends FunctionPlugin {
		delta(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DELTA"), (left, right) => left === right ? 1 : 0);
		}
	};
	DeltaPlugin.implementedFunctions = { "DELTA": {
		method: "delta",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
			argumentType: FunctionArgumentType.NUMBER,
			defaultValue: 0
		}]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/ExpPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ExpPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to EXP(value)
		*
		* Calculates the exponent for basis e
		*
		* @param ast
		* @param state
		*/
		exp(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EXP"), Math.exp);
		}
	};
	ExpPlugin.implementedFunctions = { "EXP": {
		method: "exp",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/FinancialPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var FinancialPlugin = class extends FunctionPlugin {
		pmt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PMT"), pmtCore);
		}
		ipmt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IPMT"), ipmtCore);
		}
		ppmt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PPMT"), ppmtCore);
		}
		fv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FV"), fvCore);
		}
		cumipmt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CUMIPMT"), (rate, periods, value, start, end, type) => {
				if (start > end) return new CellError(ErrorType.NUM, ErrorMessage.EndStartPeriod);
				let acc = 0;
				for (let i = start; i <= end; i++) acc += ipmtCore(rate, i, periods, value, 0, type);
				return acc;
			});
		}
		cumprinc(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CUMPRINC"), (rate, periods, value, start, end, type) => {
				if (start > end) return new CellError(ErrorType.NUM, ErrorMessage.EndStartPeriod);
				let acc = 0;
				for (let i = start; i <= end; i++) acc += ppmtCore(rate, i, periods, value, 0, type);
				return acc;
			});
		}
		db(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DB"), (cost, salvage, life, period, month) => {
				if (month === 12 && period > life || period > life + 1) return new CellError(ErrorType.NUM, ErrorMessage.PeriodLong);
				if (salvage >= cost) return 0;
				const rate = Math.round((1 - Math.pow(salvage / cost, 1 / life)) * 1e3) / 1e3;
				const initial = cost * rate * month / 12;
				if (period === 1) return initial;
				let total = initial;
				for (let i = 0; i < period - 2; i++) total += (cost - total) * rate;
				if (period === life + 1) return (cost - total) * rate * (12 - month) / 12;
				return (cost - total) * rate;
			});
		}
		ddb(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DDB"), (cost, salvage, life, period, factor) => {
				if (period > life) return new CellError(ErrorType.NUM);
				let rate = factor / life;
				let oldValue;
				if (rate >= 1) {
					rate = 1;
					if (period === 1) oldValue = cost;
					else oldValue = 0;
				} else oldValue = cost * Math.pow(1 - rate, period - 1);
				const newValue = cost * Math.pow(1 - rate, period);
				return Math.max(oldValue - Math.max(salvage, newValue), 0);
			});
		}
		dollarde(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DOLLARDE"), (dollar, fraction) => {
				if (fraction < 1) return new CellError(ErrorType.DIV_BY_ZERO);
				fraction = Math.trunc(fraction);
				while (fraction > 10) fraction /= 10;
				return Math.trunc(dollar) + (dollar - Math.trunc(dollar)) * 10 / fraction;
			});
		}
		dollarfr(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DOLLARFR"), (dollar, fraction) => {
				if (fraction < 1) return new CellError(ErrorType.DIV_BY_ZERO);
				fraction = Math.trunc(fraction);
				while (fraction > 10) fraction /= 10;
				return Math.trunc(dollar) + (dollar - Math.trunc(dollar)) * fraction / 10;
			});
		}
		effect(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EFFECT"), (rate, periods) => {
				periods = Math.trunc(periods);
				return Math.pow(1 + rate / periods, periods) - 1;
			});
		}
		ispmt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISPMT"), (rate, period, periods, value) => {
				if (periods === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return value * rate * (period / periods - 1);
			});
		}
		nominal(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NOMINAL"), (rate, periods) => {
				periods = Math.trunc(periods);
				return (Math.pow(rate + 1, 1 / periods) - 1) * periods;
			});
		}
		nper(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NPER"), (rate, payment, present, future, type) => {
				if (rate === 0) {
					if (payment === 0) return new CellError(ErrorType.DIV_BY_ZERO);
					return (-present - future) / payment;
				}
				if (type) payment *= 1 + rate;
				return Math.log((payment - future * rate) / (present * rate + payment)) / Math.log(1 + rate);
			});
		}
		rate(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RATE"), (periods, payment, present, future, type, guess) => {
				if (guess <= -1) return new CellError(ErrorType.VALUE);
				const epsMax = 1e-7;
				const iterMax = 50;
				let rate = guess;
				type = type ? 1 : 0;
				for (let i = 0; i < iterMax; i++) {
					if (rate <= -1) return new CellError(ErrorType.NUM);
					let y;
					if (Math.abs(rate) < epsMax) y = present * (1 + periods * rate) + payment * (1 + rate * type) * periods + future;
					else {
						const f = Math.pow(1 + rate, periods);
						y = present * f + payment * (1 / rate + type) * (f - 1) + future;
					}
					if (Math.abs(y) < epsMax) return rate;
					let dy;
					if (Math.abs(rate) < epsMax) dy = present * periods + payment * type * periods;
					else {
						const f = Math.pow(1 + rate, periods);
						const df = periods * Math.pow(1 + rate, periods - 1);
						dy = present * df + payment * (1 / rate + type) * df + payment * (-1 / (rate * rate)) * (f - 1);
					}
					rate -= y / dy;
				}
				return new CellError(ErrorType.NUM);
			});
		}
		pv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PV"), (rate, periods, payment, future, type) => {
				type = type ? 1 : 0;
				if (rate === -1) if (periods === 0) return new CellError(ErrorType.NUM);
				else return new CellError(ErrorType.DIV_BY_ZERO);
				if (rate === 0) return -payment * periods - future;
				else return ((1 - Math.pow(1 + rate, periods)) * payment * (1 + rate * type) / rate - future) / Math.pow(1 + rate, periods);
			});
		}
		rri(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RRI"), (periods, present, future) => {
				if (present === 0 || future < 0 && present > 0 || future > 0 && present < 0) return new CellError(ErrorType.NUM);
				return Math.pow(future / present, 1 / periods) - 1;
			});
		}
		sln(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SLN"), (cost, salvage, life) => {
				if (life === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return (cost - salvage) / life;
			});
		}
		syd(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SYD"), (cost, salvage, life, period) => {
				if (period > life) return new CellError(ErrorType.NUM);
				return (cost - salvage) * (life - period + 1) * 2 / (life * (life + 1));
			});
		}
		tbilleq(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TBILLEQ"), (settlement, maturity, discount) => {
				settlement = Math.round(settlement);
				maturity = Math.round(maturity);
				if (settlement >= maturity) return new CellError(ErrorType.NUM);
				const startDate = this.dateTimeHelper.numberToSimpleDate(settlement);
				const endDate = this.dateTimeHelper.numberToSimpleDate(maturity);
				if (endDate.year > startDate.year + 1 || endDate.year === startDate.year + 1 && (endDate.month > startDate.month || endDate.month === startDate.month && endDate.day > startDate.day)) return new CellError(ErrorType.NUM);
				const denom = 360 - discount * (maturity - settlement);
				if (denom === 0) return 0;
				if (denom < 0) return new CellError(ErrorType.NUM);
				return 365 * discount / denom;
			});
		}
		tbillprice(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TBILLPRICE"), (settlement, maturity, discount) => {
				settlement = Math.round(settlement);
				maturity = Math.round(maturity);
				if (settlement >= maturity) return new CellError(ErrorType.NUM);
				const startDate = this.dateTimeHelper.numberToSimpleDate(settlement);
				const endDate = this.dateTimeHelper.numberToSimpleDate(maturity);
				if (endDate.year > startDate.year + 1 || endDate.year === startDate.year + 1 && (endDate.month > startDate.month || endDate.month === startDate.month && endDate.day > startDate.day)) return new CellError(ErrorType.NUM);
				const denom = 360 - discount * (maturity - settlement);
				if (denom === 0) return 0;
				if (denom < 0) return new CellError(ErrorType.NUM);
				return 100 * (1 - discount * (maturity - settlement) / 360);
			});
		}
		tbillyield(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TBILLYIELD"), (settlement, maturity, price) => {
				settlement = Math.round(settlement);
				maturity = Math.round(maturity);
				if (settlement >= maturity) return new CellError(ErrorType.NUM);
				const startDate = this.dateTimeHelper.numberToSimpleDate(settlement);
				const endDate = this.dateTimeHelper.numberToSimpleDate(maturity);
				if (endDate.year > startDate.year + 1 || endDate.year === startDate.year + 1 && (endDate.month > startDate.month || endDate.month === startDate.month && endDate.day > startDate.day)) return new CellError(ErrorType.NUM);
				return (100 - price) * 360 / (price * (maturity - settlement));
			});
		}
		fvschedule(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FVSCHEDULE"), (value, ratios) => {
				const vals = ratios.valuesFromTopLeftCorner();
				for (const val of vals) if (val instanceof CellError) return val;
				for (const val of vals) if (isExtendedNumber(val)) value *= 1 + getRawValue(val);
				else if (val !== EmptyValue) return new CellError(ErrorType.VALUE, ErrorMessage.NumberExpected);
				return value;
			});
		}
		npv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NPV"), (rate, ...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				return npvCore(rate, coerced);
			});
		}
		mirr(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MIRR"), (range, frate, rrate) => {
				const vals = this.arithmeticHelper.manyToExactNumbers(range.valuesFromTopLeftCorner());
				if (vals instanceof CellError) return vals;
				let posFlag = false;
				let negFlag = false;
				const posValues = [];
				const negValues = [];
				for (const val of vals) if (val > 0) {
					posFlag = true;
					posValues.push(val);
					negValues.push(0);
				} else if (val < 0) {
					negFlag = true;
					negValues.push(val);
					posValues.push(0);
				} else {
					negValues.push(0);
					posValues.push(0);
				}
				if (!posFlag || !negFlag) return new CellError(ErrorType.DIV_BY_ZERO);
				const n = vals.length;
				const nom = npvCore(rrate, posValues);
				if (nom instanceof CellError) return nom;
				const denom = npvCore(frate, negValues);
				if (denom instanceof CellError) return denom;
				return Math.pow(-nom * Math.pow(1 + rrate, n) / denom / (1 + frate), 1 / (n - 1)) - 1;
			});
		}
		pduration(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PDURATION"), (rate, pv, fv) => (Math.log(fv) - Math.log(pv)) / Math.log(1 + rate));
		}
		xnpv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("XNPV"), (rate, values, dates) => {
				const valArr = values.valuesFromTopLeftCorner();
				for (const val of valArr) if (typeof val !== "number") return new CellError(ErrorType.VALUE, ErrorMessage.NumberExpected);
				const valArrNum = valArr;
				const dateArr = dates.valuesFromTopLeftCorner();
				for (const date of dateArr) if (typeof date !== "number") return new CellError(ErrorType.VALUE, ErrorMessage.NumberExpected);
				const dateArrNum = dateArr;
				if (dateArrNum.length !== valArrNum.length) return new CellError(ErrorType.NUM, ErrorMessage.EqualLength);
				const n = dateArrNum.length;
				let ret = 0;
				if (dateArrNum[0] < 0) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
				for (let i = 0; i < n; i++) {
					dateArrNum[i] = Math.floor(dateArrNum[i]);
					if (dateArrNum[i] < dateArrNum[0]) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
					ret += valArrNum[i] / Math.pow(1 + rate, (dateArrNum[i] - dateArrNum[0]) / 365);
				}
				return ret;
			});
		}
		/**
		* Calculates the internal rate of return for a series of cash flows.
		* @param {ProcedureAst} ast - The AST node representing the function call.
		* @param {InterpreterState} state - The interpreter state.
		* @returns {InterpreterValue} The internal rate of return.
		*/
		irr(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IRR"), (range, guess) => {
				if (guess <= -1) return new CellError(ErrorType.VALUE);
				const vals = this.arithmeticHelper.manyToExactNumbers(range.valuesFromTopLeftCorner());
				if (vals instanceof CellError) return vals;
				const hasPositive = vals.some((val) => val > 0);
				const hasNegative = vals.some((val) => val < 0);
				if (!hasPositive || !hasNegative) return new CellError(ErrorType.NUM);
				return irrCore(vals, guess);
			});
		}
	};
	FinancialPlugin.implementedFunctions = {
		"PMT": {
			method: "pmt",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"IPMT": {
			method: "ipmt",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"PPMT": {
			method: "ppmt",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"FV": {
			method: "fv",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"CUMIPMT": {
			method: "cumipmt",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 0,
					maxValue: 1
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"CUMPRINC": {
			method: "cumprinc",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 0,
					maxValue: 1
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"DB": {
			method: "db",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1,
					maxValue: 12,
					defaultValue: 12
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"DDB": {
			method: "ddb",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					defaultValue: 2
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"DOLLARDE": {
			method: "dollarde",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"DOLLARFR": {
			method: "dollarfr",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"EFFECT": {
			method: "effect",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"ISPMT": {
			method: "ispmt",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			]
		},
		"NOMINAL": {
			method: "nominal",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"NPER": {
			method: "nper",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			]
		},
		"PV": {
			method: "pv",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"RATE": {
			method: "rate",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: .1
				}
			],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"RRI": {
			method: "rri",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"SLN": {
			method: "sln",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"SYD": {
			method: "syd",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"TBILLEQ": {
			method: "tbilleq",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"TBILLPRICE": {
			method: "tbillprice",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"TBILLYIELD": {
			method: "tbillyield",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"FVSCHEDULE": {
			method: "fvschedule",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.RANGE }],
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"NPV": {
			method: "npv",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1,
			returnNumberType: NumberType.NUMBER_CURRENCY
		},
		"MIRR": {
			method: "mirr",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			],
			returnNumberType: NumberType.NUMBER_PERCENT
		},
		"PDURATION": {
			method: "pduration",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			]
		},
		"XNPV": {
			method: "xnpv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: -1
				},
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.RANGE }
			]
		},
		"IRR": {
			method: "irr",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: .1
			}],
			returnNumberType: NumberType.NUMBER_PERCENT
		}
	};
	function pmtCore(rate, periods, present, future, type) {
		if (rate === 0) return (-present - future) / periods;
		else {
			const term = Math.pow(1 + rate, periods);
			return (future * rate + present * rate * term) * (type ? 1 / (1 + rate) : 1) / (1 - term);
		}
	}
	function ipmtCore(rate, period, periods, present, future, type) {
		const payment = pmtCore(rate, periods, present, future, type);
		if (period === 1) return rate * (type ? 0 : -present);
		else return rate * (type ? fvCore(rate, period - 2, payment, present, type) - payment : fvCore(rate, period - 1, payment, present, type));
	}
	function fvCore(rate, periods, payment, value, type) {
		if (rate === 0) return -value - payment * periods;
		else {
			const term = Math.pow(1 + rate, periods);
			return payment * (type ? 1 + rate : 1) * (1 - term) / rate - value * term;
		}
	}
	function ppmtCore(rate, period, periods, present, future, type) {
		return pmtCore(rate, periods, present, future, type) - ipmtCore(rate, period, periods, present, future, type);
	}
	function npvCore(rate, args) {
		let acc = 0;
		for (let i = args.length - 1; i >= 0; i--) {
			acc += args[i];
			if (rate === -1) if (acc === 0) continue;
			else return new CellError(ErrorType.DIV_BY_ZERO);
			acc /= 1 + rate;
		}
		return acc;
	}
	/**
	* Calculates IRR using Newton-Raphson method.
	* IRR is the rate r where: CF0 + CF1/(1+r) + CF2/(1+r)^2 + ... + CFn/(1+r)^n = 0
	*/
	function irrCore(values, guess) {
		const epsMax = 1e-10;
		const iterMax = 50;
		let rate = guess;
		for (let iter = 0; iter < iterMax; iter++) {
			let npv = 0;
			let dnpv = 0;
			for (let i = 0; i < values.length; i++) {
				const factor = Math.pow(1 + rate, i);
				if (!isFinite(factor) || factor === 0) return new CellError(ErrorType.NUM);
				npv += values[i] / factor;
				if (i > 0) dnpv -= i * values[i] / (factor * (1 + rate));
			}
			if (Math.abs(npv) < epsMax) return rate;
			if (Math.abs(dnpv) < epsMax) return new CellError(ErrorType.NUM);
			const newRate = rate - npv / dnpv;
			if (Math.abs(newRate - rate) < epsMax) return newRate;
			rate = newRate;
			if (!isFinite(rate) || rate <= -1) return new CellError(ErrorType.NUM);
		}
		return new CellError(ErrorType.NUM);
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/FormulaTextPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var FormulaTextPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to FORMULATEXT(value)
		*
		* Returns a formula in a given cell as a string.
		*
		* @param ast
		* @param state
		*/
		formulatext(ast, state) {
			return this.runFunctionWithReferenceArgument(ast.args, state, this.metadata("FORMULATEXT"), () => new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber), (cellReference) => {
				var _a;
				return (_a = this.serialization.getCellFormula(cellReference)) !== null && _a !== void 0 ? _a : new CellError(ErrorType.NA, ErrorMessage.Formula);
			});
		}
	};
	FormulaTextPlugin.implementedFunctions = { "FORMULATEXT": {
		method: "formulatext",
		parameters: [{ argumentType: FunctionArgumentType.NOERROR }],
		doesNotNeedArgumentsToBeComputed: true,
		isDependentOnSheetStructureChange: true,
		vectorizationForbidden: true
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/HyperlinkPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var HyperlinkPlugin = class extends FunctionPlugin {
		hyperlink(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HYPERLINK"), (url, linkLabel) => {
				ast.hyperlink = url;
				return linkLabel !== null && linkLabel !== void 0 ? linkLabel : url;
			});
		}
	};
	HyperlinkPlugin.implementedFunctions = { "HYPERLINK": {
		method: "hyperlink",
		parameters: [{ argumentType: FunctionArgumentType.STRING }, {
			argumentType: FunctionArgumentType.STRING,
			optionalArg: true
		}]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/InformationPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing information functions
	*/
	var InformationPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to ISBINARY(value)
		*
		* Returns true if provided value is a valid binary number
		*
		* @param ast
		* @param state
		*/
		isbinary(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISBINARY"), (arg) => /^[01]{1,10}$/.test(arg));
		}
		/**
		* Corresponds to ISERR(value)
		*
		* Returns true if provided value is an error except #N/A!
		*
		* @param ast
		* @param state
		*/
		iserr(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISERR"), (arg) => arg instanceof CellError && arg.type !== ErrorType.NA);
		}
		/**
		* Corresponds to ISERROR(value)
		*
		* Checks whether provided value is an error
		*
		* @param ast
		* @param state
		*/
		iserror(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISERROR"), (arg) => arg instanceof CellError);
		}
		/**
		* Corresponds to ISFORMULA(value)
		*
		* Checks whether referenced cell is a formula
		*
		* @param ast
		* @param state
		*/
		isformula(ast, state) {
			return this.runFunctionWithReferenceArgument(ast.args, state, this.metadata("ISFORMULA"), () => new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber), (reference) => {
				return this.dependencyGraph.addressMapping.getCell(reference) instanceof FormulaVertex;
			});
		}
		/**
		* Corresponds to ISBLANK(value)
		*
		* Checks whether provided cell reference is empty
		*
		* @param ast
		* @param state
		*/
		isblank(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISBLANK"), (arg) => arg === EmptyValue);
		}
		/**
		* Corresponds to ISNA(value)
		*
		* Returns true if provided value is #N/A! error
		*
		* @param ast
		* @param state
		*/
		isna(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISNA"), (arg) => arg instanceof CellError && arg.type == ErrorType.NA);
		}
		/**
		* Corresponds to ISNUMBER(value)
		*
		* Checks whether provided cell reference is a number
		*
		* @param ast
		* @param state
		*/
		isnumber(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISNUMBER"), isExtendedNumber);
		}
		/**
		* Corresponds to ISLOGICAL(value)
		*
		* Checks whether provided cell reference is of logical type
		*
		* @param ast
		* @param state
		*/
		islogical(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISLOGICAL"), (arg) => typeof arg === "boolean");
		}
		/**
		* Corresponds to ISREF(value)
		*
		* Returns true if provided value is #REF! error
		*
		* @param ast
		* @param state
		*/
		isref(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISREF"), (arg) => arg instanceof CellError && (arg.type == ErrorType.REF || arg.type == ErrorType.CYCLE));
		}
		/**
		* Corresponds to ISTEXT(value)
		*
		* Checks whether provided cell reference is of logical type
		*
		* @param ast
		* @param state
		*/
		istext(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISTEXT"), (arg) => typeof arg === "string");
		}
		/**
		* Corresponds to ISNONTEXT(value)
		*
		* Checks whether provided cell reference is of logical type
		*
		* @param ast
		* @param state
		*/
		isnontext(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISNONTEXT"), (arg) => !(typeof arg === "string"));
		}
		/**
		* Corresponds to COLUMN(reference)
		*
		* Returns column number of a reference or a formula cell if reference not provided
		*
		* @param ast
		* @param state
		*/
		column(ast, state) {
			return this.runFunctionWithReferenceArgument(ast.args, state, this.metadata("COLUMN"), () => state.formulaAddress.col + 1, (reference) => reference.col + 1);
		}
		/**
		* Corresponds to COLUMNS(range)
		*
		* Returns number of columns in provided range of cells
		*
		* @param ast
		* @param state
		*/
		columns(ast, state) {
			if (ast.args.length !== 1) return new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber);
			if (ast.args.some((astIt) => astIt.type === AstNodeType.EMPTY)) return new CellError(ErrorType.NUM, ErrorMessage.EmptyArg);
			let argAst = ast.args[0];
			while (argAst.type === AstNodeType.PARENTHESIS) argAst = argAst.expression;
			if (argAst.type === AstNodeType.CELL_RANGE || argAst.type === AstNodeType.COLUMN_RANGE) return argAst.end.col - argAst.start.col + 1;
			else if (argAst.type === AstNodeType.CELL_REFERENCE) return 1;
			else if (argAst.type === AstNodeType.ROW_RANGE) return this.config.maxColumns;
			else {
				const val = this.evaluateAst(argAst, state);
				if (val instanceof SimpleRangeValue) return val.width();
				else if (val instanceof CellError) return val;
				else return 1;
			}
		}
		/**
		* Corresponds to ROW(reference)
		*
		* Returns row number of a reference or a formula cell if reference not provided
		*
		* @param ast
		* @param state
		*/
		row(ast, state) {
			return this.runFunctionWithReferenceArgument(ast.args, state, this.metadata("ROW"), () => state.formulaAddress.row + 1, (reference) => reference.row + 1);
		}
		/**
		* Corresponds to ROWS(range)
		*
		* Returns number of rows in provided range of cells
		*
		* @param ast
		* @param state
		*/
		rows(ast, state) {
			if (ast.args.length !== 1) return new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber);
			if (ast.args.some((astIt) => astIt.type === AstNodeType.EMPTY)) return new CellError(ErrorType.NUM, ErrorMessage.EmptyArg);
			let argAst = ast.args[0];
			while (argAst.type === AstNodeType.PARENTHESIS) argAst = argAst.expression;
			if (argAst.type === AstNodeType.CELL_RANGE || argAst.type === AstNodeType.ROW_RANGE) return argAst.end.row - argAst.start.row + 1;
			else if (argAst.type === AstNodeType.CELL_REFERENCE) return 1;
			else if (argAst.type === AstNodeType.COLUMN_RANGE) return this.config.maxRows;
			else {
				const val = this.evaluateAst(argAst, state);
				if (val instanceof SimpleRangeValue) return val.height();
				else if (val instanceof CellError) return val;
				else return 1;
			}
		}
		/**
		* Corresponds to INDEX
		*
		* Returns specific position in 2d array.
		*
		* @param ast
		* @param state
		*/
		index(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("INDEX"), (rangeValue, row, col) => {
				var _a, _b, _c, _d, _e, _f;
				if (col < 1 || row < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
				if (col > rangeValue.width() || row > rangeValue.height()) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				return (_f = (_c = (_b = (_a = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue.data) === null || _a === void 0 ? void 0 : _a[row - 1]) === null || _b === void 0 ? void 0 : _b[col - 1]) !== null && _c !== void 0 ? _c : (_e = (_d = rangeValue === null || rangeValue === void 0 ? void 0 : rangeValue.data) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : new CellError(ErrorType.VALUE, ErrorMessage.CellRangeExpected);
			});
		}
		/**
		* Corresponds to NA()
		*
		* Returns #N/A!
		*
		* @param _ast
		* @param _state
		*/
		na(_ast, _state) {
			return new CellError(ErrorType.NA);
		}
		/**
		* Corresponds to SHEET(value)
		*
		* Returns sheet number of a given value or a formula sheet number if no argument is provided
		*
		* @param ast
		* @param state
		*/
		sheet(ast, state) {
			return this.runFunctionWithReferenceArgument(ast.args, state, this.metadata("SHEET"), () => state.formulaAddress.sheet + 1, (reference) => reference.sheet + 1, (value) => {
				const sheetNumber = this.dependencyGraph.sheetMapping.getSheetId(value);
				if (sheetNumber !== void 0) return sheetNumber + 1;
				else return new CellError(ErrorType.NA, ErrorMessage.SheetRef);
			});
		}
		/**
		* Corresponds to SHEETS(value)
		*
		* Returns number of sheet of a given reference or number of all sheets in workbook when no argument is provided.
		* It returns always 1 for a valid reference as 3D references are not supported.
		*
		* @param ast
		* @param state
		*/
		sheets(ast, state) {
			return this.runFunctionWithReferenceArgument(ast.args, state, this.metadata("SHEETS"), () => this.dependencyGraph.sheetMapping.numberOfSheets(), () => 1, () => new CellError(ErrorType.VALUE, ErrorMessage.CellRefExpected));
		}
	};
	InformationPlugin.implementedFunctions = {
		"COLUMN": {
			method: "column",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				optionalArg: true
			}],
			isDependentOnSheetStructureChange: true,
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		},
		"COLUMNS": {
			method: "columns",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }],
			isDependentOnSheetStructureChange: true,
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		},
		"ISBINARY": {
			method: "isbinary",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"ISERR": {
			method: "iserr",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISFORMULA": {
			method: "isformula",
			parameters: [{ argumentType: FunctionArgumentType.NOERROR }],
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		},
		"ISNA": {
			method: "isna",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISREF": {
			method: "isref",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }],
			vectorizationForbidden: true
		},
		"ISERROR": {
			method: "iserror",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISBLANK": {
			method: "isblank",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISNUMBER": {
			method: "isnumber",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISLOGICAL": {
			method: "islogical",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISTEXT": {
			method: "istext",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"ISNONTEXT": {
			method: "isnontext",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"INDEX": {
			method: "index",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				}
			]
		},
		"NA": {
			method: "na",
			parameters: []
		},
		"ROW": {
			method: "row",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				optionalArg: true
			}],
			isDependentOnSheetStructureChange: true,
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		},
		"ROWS": {
			method: "rows",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }],
			isDependentOnSheetStructureChange: true,
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		},
		"SHEET": {
			method: "sheet",
			parameters: [{ argumentType: FunctionArgumentType.STRING }],
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		},
		"SHEETS": {
			method: "sheets",
			parameters: [{ argumentType: FunctionArgumentType.STRING }],
			doesNotNeedArgumentsToBeComputed: true,
			vectorizationForbidden: true
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/IsEvenPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var IsEvenPlugin = class extends FunctionPlugin {
		iseven(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISEVEN"), (val) => val % 2 === 0);
		}
	};
	IsEvenPlugin.implementedFunctions = { "ISEVEN": {
		method: "iseven",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/IsOddPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var IsOddPlugin = class extends FunctionPlugin {
		isodd(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ISODD"), (val) => val % 2 === 1);
		}
	};
	IsOddPlugin.implementedFunctions = { "ISODD": {
		method: "isodd",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/LogarithmPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var LogarithmPlugin = class extends FunctionPlugin {
		log10(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LOG10"), Math.log10);
		}
		log(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LOG"), (arg, base) => Math.log(arg) / Math.log(base));
		}
		ln(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LN"), Math.log);
		}
	};
	LogarithmPlugin.implementedFunctions = {
		"LOG10": {
			method: "log10",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"LOG": {
			method: "log",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				greaterThan: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 10,
				greaterThan: 0
			}]
		},
		"LN": {
			method: "ln",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/MathConstantsPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var PI = parseFloat(Math.PI.toFixed(14));
	var MathConstantsPlugin = class extends FunctionPlugin {
		pi(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PI"), () => PI);
		}
		sqrtpi(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SQRTPI"), (arg) => Math.sqrt(PI * arg));
		}
	};
	MathConstantsPlugin.implementedFunctions = {
		"PI": {
			method: "pi",
			parameters: []
		},
		"SQRTPI": {
			method: "sqrtpi",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/MatrixPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function arraySizeForMultiplication(leftArraySize, rightArraySize) {
		return new ArraySize(rightArraySize.width, leftArraySize.height);
	}
	function arraySizeForPoolFunction(inputArray, windowSize, stride) {
		return new ArraySize(1 + (inputArray.width - windowSize) / stride, 1 + (inputArray.height - windowSize) / stride);
	}
	var MatrixPlugin = class extends FunctionPlugin {
		mmult(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MMULT"), (leftMatrix, rightMatrix) => {
				if (!leftMatrix.hasOnlyNumbers() || !rightMatrix.hasOnlyNumbers()) return new CellError(ErrorType.VALUE, ErrorMessage.NumberRange);
				if (rightMatrix.height() !== leftMatrix.width()) return new CellError(ErrorType.VALUE, ErrorMessage.ArrayDimensions);
				const outputSize = arraySizeForMultiplication(leftMatrix.size, rightMatrix.size);
				const result = this.createKernel(function(a, b, width) {
					let sum = 0;
					for (let i = 0; i < width; ++i) sum += a[this.thread.y][i] * b[i][this.thread.x];
					return sum;
				}, outputSize)(leftMatrix.rawNumbers(), rightMatrix.rawNumbers(), leftMatrix.width());
				return SimpleRangeValue.onlyNumbers(result);
			});
		}
		mmultArraySize(ast, state) {
			if (ast.args.length !== 2) return ArraySize.error();
			const metadata = this.metadata("MMULT");
			const [left, right] = ast.args.map((arg) => {
				var _a;
				return this.arraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			});
			return arraySizeForMultiplication(left, right);
		}
		maxpool(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MAXPOOL"), (matrix, windowSize, stride = windowSize) => {
				if (!matrix.hasOnlyNumbers()) return new CellError(ErrorType.VALUE, ErrorMessage.NumberRange);
				const outputSize = arraySizeForPoolFunction(matrix.size, windowSize, stride);
				const result = this.createKernel(function(a, windowSize, stride) {
					const leftCornerX = this.thread.x * stride;
					const leftCornerY = this.thread.y * stride;
					let currentMax = a[leftCornerY][leftCornerX];
					for (let i = 0; i < windowSize; i++) for (let j = 0; j < windowSize; j++) currentMax = Math.max(currentMax, a[leftCornerY + i][leftCornerX + j]);
					return currentMax;
				}, outputSize)(matrix.rawNumbers(), windowSize, stride);
				return SimpleRangeValue.onlyNumbers(result);
			});
		}
		medianpool(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MEDIANPOOL"), (matrix, windowSize, stride = windowSize) => {
				if (!matrix.hasOnlyNumbers()) return new CellError(ErrorType.VALUE, ErrorMessage.NumberRange);
				const outputSize = arraySizeForPoolFunction(matrix.size, windowSize, stride);
				const result = this.createKernel(function(a, windowSize, stride) {
					const leftCornerX = this.thread.x * stride;
					const leftCornerY = this.thread.y * stride;
					let currentMax = a[leftCornerY][leftCornerX];
					for (let i = 0; i < windowSize; i++) for (let j = 0; j < windowSize; j++) currentMax = Math.max(currentMax, a[leftCornerY + i][leftCornerX + j]);
					let currentMin = a[leftCornerY][leftCornerX];
					for (let i2 = 0; i2 < windowSize; i2++) for (let j2 = 0; j2 < windowSize; j2++) currentMin = Math.min(currentMin, a[leftCornerY + i2][leftCornerX + j2]);
					const numberOfElements = windowSize * windowSize;
					let leftEnd = currentMin;
					let rightEnd = currentMax;
					let result = 42;
					for (let iter = 0; iter < 32; iter++) {
						const medianGuess = (leftEnd + rightEnd) / 2;
						let medianGuessCount = 0;
						for (let i3 = 0; i3 < windowSize; i3++) for (let j3 = 0; j3 < windowSize; j3++) if (a[leftCornerY + i3][leftCornerX + j3] > medianGuess) medianGuessCount++;
						if (windowSize % 2 === 0) if (medianGuessCount === numberOfElements / 2) {
							result = medianGuess;
							break;
						} else if (medianGuessCount > numberOfElements / 2) leftEnd = medianGuess;
						else rightEnd = medianGuess;
						else if (medianGuessCount === (numberOfElements - 1) / 2) {
							result = medianGuess;
							break;
						} else if (medianGuessCount > (numberOfElements - 1) / 2) leftEnd = medianGuess;
						else rightEnd = medianGuess;
					}
					return result;
				}, outputSize)(matrix.rawNumbers(), windowSize, stride);
				return SimpleRangeValue.onlyNumbers(result);
			});
		}
		maxpoolArraySize(ast, state) {
			if (ast.args.length < 2 || ast.args.length > 3) return ArraySize.error();
			const metadata = this.metadata("MAXPOOL");
			const array = ast.args.map((arg) => {
				var _a;
				return this.arraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			})[0];
			const windowArg = ast.args[1];
			let window;
			if (windowArg.type === AstNodeType.NUMBER) window = windowArg.value;
			else window = 1;
			let stride = window;
			if (ast.args.length === 3) {
				const strideArg = ast.args[2];
				if (strideArg.type === AstNodeType.NUMBER) stride = strideArg.value;
				else stride = 1;
			}
			if (window > array.width || window > array.height || stride > window || (array.width - window) % stride !== 0 || (array.height - window) % stride !== 0) return ArraySize.error();
			return arraySizeForPoolFunction(array, window, stride);
		}
		medianpoolArraySize(ast, state) {
			return this.maxpoolArraySize(ast, state);
		}
		transpose(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TRANSPOSE"), (matrix) => {
				const input = matrix.rawData();
				const inputSize = matrix.size;
				const result = [];
				for (let i = 0; i < inputSize.width; ++i) {
					result[i] = [];
					for (let j = 0; j < inputSize.height; ++j) result[i][j] = input[j][i];
				}
				return SimpleRangeValue.onlyValues(result);
			});
		}
		transposeArraySize(ast, state) {
			if (ast.args.length !== 1) return ArraySize.error();
			const metadata = this.metadata("TRANSPOSE");
			const [size] = ast.args.map((arg) => {
				var _a;
				return this.arraySizeForAst(arg, new InterpreterState(state.formulaAddress, state.arraysFlag || ((_a = metadata === null || metadata === void 0 ? void 0 : metadata.enableArrayArithmeticForArguments) !== null && _a !== void 0 ? _a : false)));
			});
			return new ArraySize(size.height, size.width);
		}
		createKernel(kernel, outputSize) {
			return function(...args) {
				const result = [];
				for (let y = 0; y < outputSize.height; ++y) {
					result.push([]);
					for (let x = 0; x < outputSize.width; ++x) result[y][x] = kernel.apply({ thread: {
						x,
						y
					} }, args);
				}
				return result;
			};
		}
	};
	MatrixPlugin.implementedFunctions = {
		"MMULT": {
			method: "mmult",
			sizeOfResultArrayMethod: "mmultArraySize",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }],
			vectorizationForbidden: true
		},
		"TRANSPOSE": {
			method: "transpose",
			sizeOfResultArrayMethod: "transposeArraySize",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }],
			vectorizationForbidden: true
		},
		"MAXPOOL": {
			method: "maxpool",
			sizeOfResultArrayMethod: "maxpoolArraySize",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true
				}
			],
			vectorizationForbidden: true
		},
		"MEDIANPOOL": {
			method: "medianpool",
			sizeOfResultArrayMethod: "medianpoolArraySize",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true
				}
			],
			vectorizationForbidden: true
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/MedianPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing MEDIAN function
	*/
	var MedianPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to MEDIAN(Number1, Number2, ...).
		*
		* Returns a median of given numbers.
		*
		* @param ast
		* @param state
		*/
		median(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MEDIAN"), (...args) => {
				const values = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (values instanceof CellError) return values;
				if (values.length === 0) return new CellError(ErrorType.NUM, ErrorMessage.OneValue);
				values.sort((a, b) => a - b);
				if (values.length % 2 === 0) return (values[values.length / 2 - 1] + values[values.length / 2]) / 2;
				else return values[Math.floor(values.length / 2)];
			});
		}
		large(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LARGE"), (range, n) => {
				const vals = this.arithmeticHelper.manyToExactNumbers(range.valuesFromTopLeftCorner());
				if (vals instanceof CellError) return vals;
				vals.sort((a, b) => a - b);
				n = Math.trunc(n);
				if (n > vals.length) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				return vals[vals.length - n];
			});
		}
		small(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SMALL"), (range, n) => {
				const vals = this.arithmeticHelper.manyToExactNumbers(range.valuesFromTopLeftCorner());
				if (vals instanceof CellError) return vals;
				vals.sort((a, b) => a - b);
				n = Math.trunc(n);
				if (n > vals.length) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				return vals[n - 1];
			});
		}
	};
	MedianPlugin.implementedFunctions = {
		"MEDIAN": {
			method: "median",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"LARGE": {
			method: "large",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		},
		"SMALL": {
			method: "small",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/ModuloPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ModuloPlugin = class extends FunctionPlugin {
		mod(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MOD"), (dividend, divisor) => {
				if (divisor === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				else return dividend % divisor;
			});
		}
	};
	ModuloPlugin.implementedFunctions = { "MOD": {
		method: "mod",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/NumericAggregationPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function zeroForInfinite$1(value) {
		if (isExtendedNumber(value) && !Number.isFinite(getRawValue(value))) return 0;
		else return value;
	}
	var MomentsAggregate = class MomentsAggregate {
		constructor(sumsq, sum, count) {
			this.sumsq = sumsq;
			this.sum = sum;
			this.count = count;
		}
		static single(arg) {
			return new MomentsAggregate(arg * arg, arg, 1);
		}
		compose(other) {
			return new MomentsAggregate(this.sumsq + other.sumsq, this.sum + other.sum, this.count + other.count);
		}
		averageValue() {
			if (this.count > 0) return this.sum / this.count;
			else return;
		}
		varSValue() {
			if (this.count > 1) return (this.sumsq - this.sum * this.sum / this.count) / (this.count - 1);
			else return;
		}
		varPValue() {
			if (this.count > 0) return (this.sumsq - this.sum * this.sum / this.count) / this.count;
			else return;
		}
	};
	MomentsAggregate.empty = new MomentsAggregate(0, 0, 0);
	var NumericAggregationPlugin = class extends FunctionPlugin {
		constructor() {
			super(...arguments);
			this.addWithEpsilonRaw = (left, right) => this.arithmeticHelper.addWithEpsilonRaw(left, right);
		}
		/**
		* Corresponds to SUM(Number1, Number2, ...).
		*
		* Returns a sum of given numbers.
		*
		* @param ast
		* @param state
		*/
		sum(ast, state) {
			return this.doSum(ast.args, state);
		}
		sumsq(ast, state) {
			return this.reduce(ast.args, state, 0, "SUMSQ", this.addWithEpsilonRaw, (arg) => Math.pow(getRawValue(arg), 2), strictlyNumbers);
		}
		/**
		* Corresponds to MAX(Number1, Number2, ...).
		*
		* Returns a max of given numbers.
		*
		* @param ast
		* @param state
		*/
		max(ast, state) {
			return this.doMax(ast.args, state);
		}
		maxa(ast, state) {
			return zeroForInfinite$1(this.reduce(ast.args, state, Number.NEGATIVE_INFINITY, "MAXA", (left, right) => Math.max(left, right), getRawValue, numbersBooleans));
		}
		/**
		* Corresponds to MIN(Number1, Number2, ...).
		*
		* Returns a min of given numbers.
		*
		* @param ast
		* @param state
		*/
		min(ast, state) {
			return this.doMin(ast.args, state);
		}
		mina(ast, state) {
			return zeroForInfinite$1(this.reduce(ast.args, state, Number.POSITIVE_INFINITY, "MINA", (left, right) => Math.min(left, right), getRawValue, numbersBooleans));
		}
		count(ast, state) {
			return this.doCount(ast.args, state);
		}
		counta(ast, state) {
			return this.doCounta(ast.args, state);
		}
		average(ast, state) {
			return this.doAverage(ast.args, state);
		}
		averagea(ast, state) {
			var _a;
			const result = this.reduce(ast.args, state, MomentsAggregate.empty, "_AGGREGATE_A", (left, right) => left.compose(right), (arg) => MomentsAggregate.single(getRawValue(arg)), numbersBooleans);
			if (result instanceof CellError) return result;
			else return (_a = result.averageValue()) !== null && _a !== void 0 ? _a : new CellError(ErrorType.DIV_BY_ZERO);
		}
		vars(ast, state) {
			return this.doVarS(ast.args, state);
		}
		varp(ast, state) {
			return this.doVarP(ast.args, state);
		}
		vara(ast, state) {
			var _a;
			const result = this.reduceAggregateA(ast.args, state);
			if (result instanceof CellError) return result;
			else return (_a = result.varSValue()) !== null && _a !== void 0 ? _a : new CellError(ErrorType.DIV_BY_ZERO);
		}
		varpa(ast, state) {
			var _a;
			const result = this.reduceAggregateA(ast.args, state);
			if (result instanceof CellError) return result;
			else return (_a = result.varPValue()) !== null && _a !== void 0 ? _a : new CellError(ErrorType.DIV_BY_ZERO);
		}
		stdevs(ast, state) {
			return this.doStdevS(ast.args, state);
		}
		stdevp(ast, state) {
			return this.doStdevP(ast.args, state);
		}
		stdeva(ast, state) {
			const result = this.reduceAggregateA(ast.args, state);
			if (result instanceof CellError) return result;
			else {
				const val = result.varSValue();
				return val === void 0 ? new CellError(ErrorType.DIV_BY_ZERO) : Math.sqrt(val);
			}
		}
		stdevpa(ast, state) {
			const result = this.reduceAggregateA(ast.args, state);
			if (result instanceof CellError) return result;
			else {
				const val = result.varPValue();
				return val === void 0 ? new CellError(ErrorType.DIV_BY_ZERO) : Math.sqrt(val);
			}
		}
		product(ast, state) {
			return this.doProduct(ast.args, state);
		}
		subtotal(ast, state) {
			if (ast.args.length < 2) return new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber);
			const functionType = this.coerceToType(this.evaluateAst(ast.args[0], state), { argumentType: FunctionArgumentType.NUMBER }, state);
			const args = ast.args.slice(1);
			switch (functionType) {
				case 1:
				case 101: return this.doAverage(args, state);
				case 2:
				case 102: return this.doCount(args, state);
				case 3:
				case 103: return this.doCounta(args, state);
				case 4:
				case 104: return this.doMax(args, state);
				case 5:
				case 105: return this.doMin(args, state);
				case 6:
				case 106: return this.doProduct(args, state);
				case 7:
				case 107: return this.doStdevS(args, state);
				case 8:
				case 108: return this.doStdevP(args, state);
				case 9:
				case 109: return this.doSum(args, state);
				case 10:
				case 110: return this.doVarS(args, state);
				case 11:
				case 111: return this.doVarP(args, state);
				default: return new CellError(ErrorType.VALUE, ErrorMessage.BadMode);
			}
		}
		reduceAggregate(args, state) {
			return this.reduce(args, state, MomentsAggregate.empty, "_AGGREGATE", (left, right) => {
				return left.compose(right);
			}, (arg) => {
				return MomentsAggregate.single(getRawValue(arg));
			}, strictlyNumbers);
		}
		reduceAggregateA(args, state) {
			return this.reduce(args, state, MomentsAggregate.empty, "_AGGREGATE_A", (left, right) => {
				return left.compose(right);
			}, (arg) => {
				return MomentsAggregate.single(getRawValue(arg));
			}, numbersBooleans);
		}
		doAverage(args, state) {
			var _a;
			const result = this.reduceAggregate(args, state);
			if (result instanceof CellError) return result;
			else return (_a = result.averageValue()) !== null && _a !== void 0 ? _a : new CellError(ErrorType.DIV_BY_ZERO);
		}
		doVarS(args, state) {
			var _a;
			const result = this.reduceAggregate(args, state);
			if (result instanceof CellError) return result;
			else return (_a = result.varSValue()) !== null && _a !== void 0 ? _a : new CellError(ErrorType.DIV_BY_ZERO);
		}
		doVarP(args, state) {
			var _a;
			const result = this.reduceAggregate(args, state);
			if (result instanceof CellError) return result;
			else return (_a = result.varPValue()) !== null && _a !== void 0 ? _a : new CellError(ErrorType.DIV_BY_ZERO);
		}
		doStdevS(args, state) {
			const result = this.reduceAggregate(args, state);
			if (result instanceof CellError) return result;
			else {
				const val = result.varSValue();
				return val === void 0 ? new CellError(ErrorType.DIV_BY_ZERO) : Math.sqrt(val);
			}
		}
		doStdevP(args, state) {
			const result = this.reduceAggregate(args, state);
			if (result instanceof CellError) return result;
			else {
				const val = result.varPValue();
				return val === void 0 ? new CellError(ErrorType.DIV_BY_ZERO) : Math.sqrt(val);
			}
		}
		doCount(args, state) {
			return this.reduce(args, state, 0, "COUNT", (left, right) => left + right, getRawValue, (arg) => isExtendedNumber(arg) ? 1 : 0);
		}
		doCounta(args, state) {
			return this.reduce(args, state, 0, "COUNTA", (left, right) => left + right, getRawValue, (arg) => arg === EmptyValue ? 0 : 1);
		}
		doMax(args, state) {
			return zeroForInfinite$1(this.reduce(args, state, Number.NEGATIVE_INFINITY, "MAX", (left, right) => Math.max(left, right), getRawValue, strictlyNumbers));
		}
		doMin(args, state) {
			return zeroForInfinite$1(this.reduce(args, state, Number.POSITIVE_INFINITY, "MIN", (left, right) => Math.min(left, right), getRawValue, strictlyNumbers));
		}
		doSum(args, state) {
			return this.reduce(args, state, 0, "SUM", this.addWithEpsilonRaw, getRawValue, strictlyNumbers);
		}
		doProduct(args, state) {
			return this.reduce(args, state, 1, "PRODUCT", (left, right) => left * right, getRawValue, strictlyNumbers);
		}
		/**
		* Reduces procedure arguments with given reducing function
		*
		* @param args
		* @param state
		* @param initialAccValue - "neutral" value (equivalent of 0)
		* @param functionName - function name to use as cache key
		* @param reducingFunction - reducing function
		* @param mapFunction
		* @param coercionFunction
		*/
		reduce(args, state, initialAccValue, functionName, reducingFunction, mapFunction, coercionFunction) {
			if (args.length < 1) return new CellError(ErrorType.NA, ErrorMessage.WrongArgNumber);
			return args.reduce((acc, arg) => {
				if (acc instanceof CellError) return acc;
				if (arg.type === AstNodeType.CELL_RANGE || arg.type === AstNodeType.COLUMN_RANGE || arg.type === AstNodeType.ROW_RANGE) {
					const val = this.evaluateRange(arg, state, initialAccValue, functionName, reducingFunction, mapFunction, coercionFunction);
					if (val instanceof CellError) return val;
					return reducingFunction(val, acc);
				}
				let value;
				value = this.evaluateAst(arg, state);
				if (value instanceof SimpleRangeValue) return Array.from(value.valuesFromTopLeftCorner()).map(coercionFunction).filter((arg) => arg !== void 0).map((arg) => {
					if (arg instanceof CellError) return arg;
					else return mapFunction(arg);
				}).reduce((left, right) => {
					if (left instanceof CellError) return left;
					else if (right instanceof CellError) return right;
					else return reducingFunction(left, right);
				}, acc);
				else if (arg.type === AstNodeType.CELL_REFERENCE) {
					value = coercionFunction(value);
					if (value === void 0) return acc;
				} else {
					value = this.coerceScalarToNumberOrError(value);
					value = coercionFunction(value);
					if (value === void 0) return acc;
				}
				if (value instanceof CellError) return value;
				return reducingFunction(acc, mapFunction(value));
			}, initialAccValue);
		}
		/**
		* Performs range operation on given range
		*
		* @param {CellRangeAst | ColumnRangeAst | RowRangeAst} ast - cell range ast
		* @param {InterpreterState} state - interpreter state
		* @param {T} initialAccValue - initial accumulator value for reducing function
		* @param {string} functionName - function name to use as cache key
		* @param {BinaryOperation<T>} reducingFunction - reducing function
		* @param {MapOperation<T>} mapFunction - mapper transforming coerced scalar
		* @param {coercionOperation} coercionFunction - scalar-to-number coercer
		*/
		evaluateRange(ast, state, initialAccValue, functionName, reducingFunction, mapFunction, coercionFunction) {
			let range;
			try {
				range = AbsoluteCellRange.fromAst(ast, state.formulaAddress);
			} catch (err) {
				if (err instanceof SheetsNotEqual) return new CellError(ErrorType.REF, ErrorMessage.RangeManySheets);
				else throw err;
			}
			if (!this.isSheetValid(range)) return new CellError(ErrorType.REF, ErrorMessage.SheetRef);
			const rangeVertex = this.dependencyGraph.getRange(range.start, range.end);
			if (rangeVertex === void 0) throw new Error("Range does not exists in graph");
			let value = rangeVertex.getFunctionValue(functionName);
			if (value === void 0) {
				value = this.getRangeValues(functionName, range, rangeVertex, mapFunction, coercionFunction).reduce((arg1, arg2) => {
					if (arg1 instanceof CellError) return arg1;
					else if (arg2 instanceof CellError) return arg2;
					else return reducingFunction(arg1, arg2);
				}, initialAccValue);
				rangeVertex.setFunctionValue(functionName, value);
			}
			return value;
		}
		/**
		* Checks whether both ends of a range point to existing sheets (placeholders excluded).
		*/
		isSheetValid(range) {
			return this.dependencyGraph.sheetMapping.hasSheetWithId(range.start.sheet, { includePlaceholders: false }) && this.dependencyGraph.sheetMapping.hasSheetWithId(range.end.sheet, { includePlaceholders: false });
		}
		/**
		* Returns list of values for given range and function name
		*
		* If range is dependent on smaller range, list will contain value of smaller range for this function
		* and values of cells that are not present in smaller range
		*
		* @param functionName - function name (e.g., SUM)
		* @param range - cell range
		* @param rangeVertex
		* @param mapFunction
		* @param coercionFunction
		*/
		getRangeValues(functionName, range, rangeVertex, mapFunction, coercionFunction) {
			const rangeResult = [];
			const { smallerRangeVertex, restRange } = this.dependencyGraph.rangeMapping.findSmallerRange(range);
			let actualRange;
			if (smallerRangeVertex !== void 0 && this.dependencyGraph.existsEdge(smallerRangeVertex, rangeVertex)) {
				const cachedValue = smallerRangeVertex.getFunctionValue(functionName);
				if (cachedValue !== void 0) rangeResult.push(cachedValue);
				else for (const cellFromRange of smallerRangeVertex.range.addresses(this.dependencyGraph)) {
					const val = coercionFunction(this.dependencyGraph.getScalarValue(cellFromRange));
					if (val instanceof CellError) rangeResult.push(val);
					else if (val !== void 0) rangeResult.push(mapFunction(val));
				}
				actualRange = restRange;
			} else actualRange = range;
			for (const cellFromRange of actualRange.addresses(this.dependencyGraph)) {
				const val = coercionFunction(this.dependencyGraph.getScalarValue(cellFromRange));
				if (val instanceof CellError) rangeResult.push(val);
				else if (val !== void 0) rangeResult.push(mapFunction(val));
			}
			return rangeResult;
		}
	};
	NumericAggregationPlugin.implementedFunctions = {
		"SUM": {
			method: "sum",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"SUMSQ": {
			method: "sumsq",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"MAX": {
			method: "max",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"MIN": {
			method: "min",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"MAXA": {
			method: "maxa",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"MINA": {
			method: "mina",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"COUNT": {
			method: "count",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"COUNTA": {
			method: "counta",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"AVERAGE": {
			method: "average",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"AVERAGEA": {
			method: "averagea",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"PRODUCT": {
			method: "product",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"VAR.S": {
			method: "vars",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"VAR.P": {
			method: "varp",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"VARA": {
			method: "vara",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"VARPA": {
			method: "varpa",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"STDEV.S": {
			method: "stdevs",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"STDEV.P": {
			method: "stdevp",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"STDEVA": {
			method: "stdeva",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"STDEVPA": {
			method: "stdevpa",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"SUBTOTAL": {
			method: "subtotal",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		}
	};
	NumericAggregationPlugin.aliases = {
		VAR: "VAR.S",
		VARP: "VAR.P",
		STDEV: "STDEV.S",
		STDEVP: "STDEV.P",
		VARS: "VAR.S",
		STDEVS: "STDEV.S"
	};
	function strictlyNumbers(arg) {
		if (isExtendedNumber(arg) || arg instanceof CellError) return arg;
		else return;
	}
	function numbersBooleans(arg) {
		if (typeof arg === "boolean") return coerceBooleanToNumber(arg);
		else if (isExtendedNumber(arg) || arg instanceof CellError) return arg;
		else if (typeof arg === "string") return 0;
		else return;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/PowerPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var PowerPlugin = class extends FunctionPlugin {
		power(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("POWER"), Math.pow);
		}
	};
	PowerPlugin.implementedFunctions = { "POWER": {
		method: "power",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/RadiansPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RadiansPlugin = class extends FunctionPlugin {
		radians(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RADIANS"), (arg) => arg * (Math.PI / 180));
		}
	};
	RadiansPlugin.implementedFunctions = { "RADIANS": {
		method: "radians",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/RadixConversionPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var MAX_LENGTH = 10;
	var DECIMAL_NUMBER_OF_BITS = 255;
	var MIN_BASE = 2;
	var MAX_BASE = 36;
	var ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var RadixConversionPlugin = class extends FunctionPlugin {
		dec2bin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DEC2BIN"), (value, places) => decimalToBaseWithExactPadding(value, 2, places));
		}
		dec2oct(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DEC2OCT"), (value, places) => decimalToBaseWithExactPadding(value, 8, places));
		}
		dec2hex(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DEC2HEX"), (value, places) => decimalToBaseWithExactPadding(value, 16, places));
		}
		bin2dec(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BIN2DEC"), (binary) => {
				const binaryWithSign = coerceStringToBase(binary, 2, MAX_LENGTH);
				if (binaryWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotBinary);
				return twoComplementToDecimal(binaryWithSign, 2);
			});
		}
		bin2oct(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BIN2OCT"), (binary, places) => {
				const binaryWithSign = coerceStringToBase(binary, 2, MAX_LENGTH);
				if (binaryWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotBinary);
				return decimalToBaseWithExactPadding(twoComplementToDecimal(binaryWithSign, 2), 8, places);
			});
		}
		bin2hex(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BIN2HEX"), (binary, places) => {
				const binaryWithSign = coerceStringToBase(binary, 2, MAX_LENGTH);
				if (binaryWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotBinary);
				return decimalToBaseWithExactPadding(twoComplementToDecimal(binaryWithSign, 2), 16, places);
			});
		}
		oct2dec(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("OCT2DEC"), (octal) => {
				const octalWithSign = coerceStringToBase(octal, 8, MAX_LENGTH);
				if (octalWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotOctal);
				return twoComplementToDecimal(octalWithSign, 8);
			});
		}
		oct2bin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("OCT2BIN"), (octal, places) => {
				const octalWithSign = coerceStringToBase(octal, 8, MAX_LENGTH);
				if (octalWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotOctal);
				return decimalToBaseWithExactPadding(twoComplementToDecimal(octalWithSign, 8), 2, places);
			});
		}
		oct2hex(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("OCT2HEX"), (octal, places) => {
				const octalWithSign = coerceStringToBase(octal, 8, MAX_LENGTH);
				if (octalWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotOctal);
				return decimalToBaseWithExactPadding(twoComplementToDecimal(octalWithSign, 8), 16, places);
			});
		}
		hex2dec(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HEX2DEC"), (hexadecimal) => {
				const hexadecimalWithSign = coerceStringToBase(hexadecimal, 16, MAX_LENGTH);
				if (hexadecimalWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotHex);
				return twoComplementToDecimal(hexadecimalWithSign, 16);
			});
		}
		hex2bin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HEX2BIN"), (hexadecimal, places) => {
				const hexadecimalWithSign = coerceStringToBase(hexadecimal, 16, MAX_LENGTH);
				if (hexadecimalWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotHex);
				return decimalToBaseWithExactPadding(twoComplementToDecimal(hexadecimalWithSign, 16), 2, places);
			});
		}
		hex2oct(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HEX2OCT"), (hexadecimal, places) => {
				const hexadecimalWithSign = coerceStringToBase(hexadecimal, 16, MAX_LENGTH);
				if (hexadecimalWithSign === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotHex);
				return decimalToBaseWithExactPadding(twoComplementToDecimal(hexadecimalWithSign, 16), 8, places);
			});
		}
		base(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BASE"), decimalToBaseWithMinimumPadding);
		}
		decimal(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DECIMAL"), (arg, base) => {
				const input = coerceStringToBase(arg, base, DECIMAL_NUMBER_OF_BITS);
				if (input === void 0) return new CellError(ErrorType.NUM, ErrorMessage.NotHex);
				return parseInt(input, base);
			});
		}
	};
	RadixConversionPlugin.implementedFunctions = {
		"DEC2BIN": {
			method: "dec2bin",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 1,
				maxValue: 10
			}]
		},
		"DEC2OCT": {
			method: "dec2oct",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 1,
				maxValue: 10
			}]
		},
		"DEC2HEX": {
			method: "dec2hex",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 1,
				maxValue: 10
			}]
		},
		"BIN2DEC": {
			method: "bin2dec",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"BIN2OCT": {
			method: "bin2oct",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 0,
				maxValue: MAX_LENGTH
			}]
		},
		"BIN2HEX": {
			method: "bin2hex",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 0,
				maxValue: MAX_LENGTH
			}]
		},
		"OCT2DEC": {
			method: "oct2dec",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"OCT2BIN": {
			method: "oct2bin",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 0,
				maxValue: MAX_LENGTH
			}]
		},
		"OCT2HEX": {
			method: "oct2hex",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 0,
				maxValue: MAX_LENGTH
			}]
		},
		"HEX2DEC": {
			method: "hex2dec",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"HEX2BIN": {
			method: "hex2bin",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 0,
				maxValue: MAX_LENGTH
			}]
		},
		"HEX2OCT": {
			method: "hex2oct",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				minValue: 0,
				maxValue: MAX_LENGTH
			}]
		},
		"DECIMAL": {
			method: "decimal",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: MIN_BASE,
				maxValue: MAX_BASE
			}]
		},
		"BASE": {
			method: "base",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: MIN_BASE,
					maxValue: MAX_BASE
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true,
					minValue: 0,
					maxValue: DECIMAL_NUMBER_OF_BITS
				}
			]
		}
	};
	function coerceStringToBase(value, base, maxLength) {
		const baseAlphabet = ALPHABET.substr(0, base);
		const regex = new RegExp(`^[${baseAlphabet}]+$`);
		if (value.length > maxLength || !regex.test(value)) return;
		return value;
	}
	function decimalToBaseWithExactPadding(value, base, places) {
		if (value > maxValFromBase(base)) return new CellError(ErrorType.NUM, ErrorMessage.ValueBaseLarge);
		if (value < minValFromBase(base)) return new CellError(ErrorType.NUM, ErrorMessage.ValueBaseSmall);
		const result = decimalToRadixComplement(value, base);
		if (places === void 0 || value < 0) return result;
		else if (result.length > places) return new CellError(ErrorType.NUM, ErrorMessage.ValueBaseLong);
		else return padLeft(result, places);
	}
	function minValFromBase(base) {
		return -Math.pow(base, MAX_LENGTH) / 2;
	}
	function maxValFromBase(base) {
		return -minValFromBase(base) - 1;
	}
	function decimalToBaseWithMinimumPadding(value, base, places) {
		const result = decimalToRadixComplement(value, base);
		if (places !== void 0 && places > result.length) return padLeft(result, places);
		else return result;
	}
	function decimalToRadixComplement(value, base) {
		return (value + (value < 0 ? Math.pow(base, MAX_LENGTH) : 0)).toString(base).toUpperCase();
	}
	function twoComplementToDecimal(value, base) {
		const parsed = parseInt(value, base);
		const offset = Math.pow(base, MAX_LENGTH);
		return parsed >= offset / 2 ? parsed - offset : parsed;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/RandomPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RandomPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to RAND()
		*
		* Returns a pseudo-random floating-point random number
		* in the range [0,1).
		*
		* @param ast
		* @param state
		*/
		rand(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RAND"), Math.random);
		}
		randbetween(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RANDBETWEEN"), (lower, upper) => {
				if (upper < lower) return new CellError(ErrorType.NUM, ErrorMessage.WrongOrder);
				lower = Math.ceil(lower);
				upper = Math.floor(upper) + 1;
				if (lower === upper) upper += 1;
				return lower + Math.floor(Math.random() * (upper - lower));
			});
		}
	};
	RandomPlugin.implementedFunctions = {
		"RAND": {
			method: "rand",
			parameters: [],
			isVolatile: true
		},
		"RANDBETWEEN": {
			method: "randbetween",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }],
			isVolatile: true
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/RoundingPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function findNextOddNumber(arg) {
		const ceiled = Math.ceil(arg);
		return ceiled % 2 === 1 ? ceiled : ceiled + 1;
	}
	function findNextEvenNumber(arg) {
		const ceiled = Math.ceil(arg);
		return ceiled % 2 === 0 ? ceiled : ceiled + 1;
	}
	var RoundingPlugin = class extends FunctionPlugin {
		roundup(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ROUNDDOWN"), (numberToRound, places) => {
				const placesMultiplier = Math.pow(10, places);
				if (numberToRound < 0) return -Math.ceil(-numberToRound * placesMultiplier) / placesMultiplier;
				else return Math.ceil(numberToRound * placesMultiplier) / placesMultiplier;
			});
		}
		rounddown(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ROUNDDOWN"), (numberToRound, places) => {
				const placesMultiplier = Math.pow(10, places);
				if (numberToRound < 0) return -Math.floor(-numberToRound * placesMultiplier) / placesMultiplier;
				else return Math.floor(numberToRound * placesMultiplier) / placesMultiplier;
			});
		}
		round(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ROUND"), (numberToRound, places) => {
				const placesMultiplier = Math.pow(10, places);
				if (numberToRound < 0) return -Math.round(-numberToRound * placesMultiplier) / placesMultiplier;
				else return Math.round(numberToRound * placesMultiplier) / placesMultiplier;
			});
		}
		intFunc(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("INT"), (coercedNumberToRound) => {
				if (coercedNumberToRound < 0) return -Math.floor(-coercedNumberToRound);
				else return Math.floor(coercedNumberToRound);
			});
		}
		even(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EVEN"), (coercedNumberToRound) => {
				if (coercedNumberToRound < 0) return -findNextEvenNumber(-coercedNumberToRound);
				else return findNextEvenNumber(coercedNumberToRound);
			});
		}
		odd(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ODD"), (coercedNumberToRound) => {
				if (coercedNumberToRound < 0) return -findNextOddNumber(-coercedNumberToRound);
				else return findNextOddNumber(coercedNumberToRound);
			});
		}
		ceilingmath(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CEILING.MATH"), (value, significance, mode) => {
				if (significance === 0 || value === 0) return 0;
				significance = Math.abs(significance);
				if (mode === 1 && value < 0) significance = -significance;
				return Math.ceil(value / significance) * significance;
			});
		}
		ceiling(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CEILING"), (value, significance) => {
				if (value === 0) return 0;
				if (significance === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				if (value > 0 && significance < 0) return new CellError(ErrorType.NUM, ErrorMessage.DistinctSigns);
				return Math.ceil(value / significance) * significance;
			});
		}
		ceilingprecise(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CEILING.PRECISE"), (value, significance) => {
				if (significance === 0 || value === 0) return 0;
				significance = Math.abs(significance);
				return Math.ceil(value / significance) * significance;
			});
		}
		floormath(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FLOOR.MATH"), (value, significance, mode) => {
				if (significance === 0 || value === 0) return 0;
				significance = Math.abs(significance);
				if (mode === 1 && value < 0) significance *= -1;
				return Math.floor(value / significance) * significance;
			});
		}
		floor(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FLOOR"), (value, significance) => {
				if (value === 0) return 0;
				if (significance === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				if (value > 0 && significance < 0) return new CellError(ErrorType.NUM, ErrorMessage.DistinctSigns);
				return Math.floor(value / significance) * significance;
			});
		}
		floorprecise(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FLOOR.PRECISE"), (value, significance) => {
				if (significance === 0 || value === 0) return 0;
				significance = Math.abs(significance);
				return Math.floor(value / significance) * significance;
			});
		}
	};
	RoundingPlugin.implementedFunctions = {
		"ROUNDUP": {
			method: "roundup",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 0
			}]
		},
		"ROUNDDOWN": {
			method: "rounddown",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 0
			}]
		},
		"ROUND": {
			method: "round",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 0
			}]
		},
		"INT": {
			method: "intFunc",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"EVEN": {
			method: "even",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ODD": {
			method: "odd",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"CEILING.MATH": {
			method: "ceilingmath",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			]
		},
		"CEILING": {
			method: "ceiling",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"CEILING.PRECISE": {
			method: "ceilingprecise",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 1
			}]
		},
		"FLOOR.MATH": {
			method: "floormath",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				}
			]
		},
		"FLOOR": {
			method: "floor",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"FLOOR.PRECISE": {
			method: "floorprecise",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 1
			}]
		}
	};
	RoundingPlugin.aliases = {
		"ISO.CEILING": "CEILING.PRECISE",
		"TRUNC": "ROUNDDOWN"
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/SqrtPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var SqrtPlugin = class extends FunctionPlugin {
		sqrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SQRT"), Math.sqrt);
		}
	};
	SqrtPlugin.implementedFunctions = { "SQRT": {
		method: "sqrt",
		parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/generatorUtils.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	function* empty() {}
	function split(iterable) {
		const iterator = iterable[Symbol.iterator]();
		const { done, value } = iterator.next();
		if (done) return { rest: /* @__PURE__ */ empty() };
		else return {
			value,
			rest: iterator
		};
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/CriterionFunctionCompute.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var findSmallerRangeForMany = (dependencyGraph, conditionRanges, valuesRange) => {
		if (valuesRange.end.row > valuesRange.start.row) {
			const valuesRangeEndRowLess = simpleCellAddress(valuesRange.end.sheet, valuesRange.end.col, valuesRange.end.row - 1);
			const rowLessVertex = dependencyGraph.getRange(valuesRange.start, valuesRangeEndRowLess);
			if (rowLessVertex !== void 0) return {
				smallerRangeVertex: rowLessVertex,
				restValuesRange: valuesRange.withStart(simpleCellAddress(valuesRange.start.sheet, valuesRange.start.col, valuesRange.end.row)),
				restConditionRanges: conditionRanges.map((conditionRange) => conditionRange.withStart(simpleCellAddress(conditionRange.start.sheet, conditionRange.start.col, conditionRange.end.row)))
			};
		}
		return {
			restValuesRange: valuesRange,
			restConditionRanges: conditionRanges
		};
	};
	var CriterionFunctionCompute = class {
		constructor(interpreter, cacheKey, reduceInitialValue, composeFunction, mapFunction) {
			this.interpreter = interpreter;
			this.cacheKey = cacheKey;
			this.reduceInitialValue = reduceInitialValue;
			this.composeFunction = composeFunction;
			this.mapFunction = mapFunction;
			this.dependencyGraph = this.interpreter.dependencyGraph;
		}
		compute(simpleValuesRange, conditions) {
			for (const condition of conditions) if (!condition.conditionRange.sameDimensionsAs(simpleValuesRange)) return new CellError(ErrorType.VALUE, ErrorMessage.EqualLength);
			const valuesRangeVertex = this.tryToGetRangeVertexForRangeValue(simpleValuesRange);
			const conditionsVertices = conditions.map((c) => this.tryToGetRangeVertexForRangeValue(c.conditionRange));
			if (valuesRangeVertex && conditionsVertices.every((e) => e !== void 0)) {
				const fullCriterionString = conditions.map((c) => c.criterionPackage.raw).join(",");
				const cachedResult = this.findAlreadyComputedValueInCache(valuesRangeVertex, this.cacheKey(conditions), fullCriterionString);
				if (cachedResult !== void 0) {
					this.interpreter.stats.incrementCriterionFunctionFullCacheUsed();
					return cachedResult;
				}
				const cache = this.buildNewCriterionCache(this.cacheKey(conditions), conditions.map((c) => c.conditionRange.range), simpleValuesRange.range);
				if (!cache.has(fullCriterionString)) cache.set(fullCriterionString, [this.evaluateRangeValue(simpleValuesRange, conditions), conditions.map((condition) => condition.criterionPackage.lambda)]);
				valuesRangeVertex.setCriterionFunctionValues(this.cacheKey(conditions), cache);
				conditionsVertices.forEach((range) => {
					if (range !== void 0) range.addDependentCacheRange(valuesRangeVertex);
				});
				return cache.get(fullCriterionString)[0];
			} else return this.evaluateRangeValue(simpleValuesRange, conditions);
		}
		tryToGetRangeVertexForRangeValue(rangeValue) {
			const maybeRange = rangeValue.range;
			if (maybeRange === void 0) return;
			else return this.dependencyGraph.getRange(maybeRange.start, maybeRange.end);
		}
		reduceFunction(iterable) {
			let acc = this.reduceInitialValue;
			for (const val of iterable) acc = this.composeFunction(acc, val);
			return acc;
		}
		findAlreadyComputedValueInCache(rangeVertex, cacheKey, criterionString) {
			return rangeVertex.getCriterionFunctionValue(cacheKey, criterionString);
		}
		evaluateRangeValue(simpleValuesRange, conditions) {
			const criterionLambdas = conditions.map((condition) => condition.criterionPackage.lambda);
			const values = Array.from(simpleValuesRange.valuesFromTopLeftCorner()).map(this.mapFunction)[Symbol.iterator]();
			const filteredValues = ifFilter(criterionLambdas, conditions.map((condition) => condition.conditionRange.iterateValuesFromTopLeftCorner()), values);
			return this.reduceFunction(filteredValues);
		}
		buildNewCriterionCache(cacheKey, simpleConditionRanges, simpleValuesRange) {
			const currentRangeVertex = this.dependencyGraph.getRange(simpleValuesRange.start, simpleValuesRange.end);
			const { smallerRangeVertex, restConditionRanges, restValuesRange } = findSmallerRangeForMany(this.dependencyGraph, simpleConditionRanges, simpleValuesRange);
			let smallerCache;
			if (smallerRangeVertex !== void 0 && this.dependencyGraph.existsEdge(smallerRangeVertex, currentRangeVertex)) smallerCache = smallerRangeVertex.getCriterionFunctionValues(cacheKey);
			else smallerCache = /* @__PURE__ */ new Map();
			const newCache = /* @__PURE__ */ new Map();
			smallerCache.forEach(([value, criterionLambdas], key) => {
				const filteredValues = ifFilter(criterionLambdas, restConditionRanges.map((rcr) => getRangeValues(this.dependencyGraph, rcr)), Array.from(getRangeValues(this.dependencyGraph, restValuesRange)).map(this.mapFunction)[Symbol.iterator]());
				const newCacheValue = this.composeFunction(value, this.reduceFunction(filteredValues));
				this.interpreter.stats.incrementCriterionFunctionPartialCacheUsed();
				newCache.set(key, [newCacheValue, criterionLambdas]);
			});
			return newCache;
		}
	};
	var Condition$1 = class {
		constructor(conditionRange, criterionPackage) {
			this.conditionRange = conditionRange;
			this.criterionPackage = criterionPackage;
		}
	};
	function* getRangeValues(dependencyGraph, cellRange) {
		for (const cellFromRange of cellRange.addresses(dependencyGraph)) yield getRawValue(dependencyGraph.getScalarValue(cellFromRange));
	}
	function* ifFilter(criterionLambdas, conditionalIterables, computableIterable) {
		for (const computable of computableIterable) {
			const conditionalSplits = conditionalIterables.map((conditionalIterable) => split(conditionalIterable));
			if (!conditionalSplits.every((cs) => Object.prototype.hasOwnProperty.call(cs, "value"))) return;
			if (zip$1(conditionalSplits.map((cs) => getRawValue(cs.value)), criterionLambdas).every(([conditionalFirst, criterionLambda]) => criterionLambda(conditionalFirst))) yield computable;
			conditionalIterables = conditionalSplits.map((cs) => cs.rest);
		}
	}
	function zip$1(arr1, arr2) {
		const result = [];
		for (let i = 0; i < Math.min(arr1.length, arr2.length); i++) result.push([arr1[i], arr2[i]]);
		return result;
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/ConditionalAggregationPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var AverageResult = class AverageResult {
		constructor(sum, count) {
			this.sum = sum;
			this.count = count;
		}
		static single(arg) {
			return new AverageResult(arg, 1);
		}
		compose(other) {
			return new AverageResult(this.sum + other.sum, this.count + other.count);
		}
		averageValue() {
			if (this.count > 0) return this.sum / this.count;
			else return;
		}
	};
	AverageResult.empty = new AverageResult(0, 0);
	/** Computes key for criterion function cache */
	function conditionalAggregationFunctionCacheKey(functionName) {
		return (conditions) => {
			return [functionName, ...conditions.map((c) => `${c.conditionRange.range.sheet},${c.conditionRange.range.start.col},${c.conditionRange.range.start.row}`)].join(",");
		};
	}
	function zeroForInfinite(value) {
		if (isExtendedNumber(value) && !Number.isFinite(getRawValue(value))) return 0;
		else return value;
	}
	function mapToRawScalarValue(arg) {
		if (arg instanceof CellError) return arg;
		if (isExtendedNumber(arg)) return getRawValue(arg);
	}
	var ConditionalAggregationPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to SUMIF(Range, Criterion, SumRange)
		*
		* Range is the range to which criterion is to be applied.
		* Criterion is the criteria used to choose which cells will be included in sum.
		* SumRange is the range on which adding will be performed.
		*
		* @param ast
		* @param state
		*/
		sumif(ast, state) {
			const functionName = "SUMIF";
			const computeFn = (conditionRange, criterion, values) => this.computeConditionalAggregationFunction(values !== null && values !== void 0 ? values : conditionRange, [conditionRange, criterion], functionName, 0, (left, right) => this.arithmeticHelper.nonstrictadd(left, right), mapToRawScalarValue);
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		sumifs(ast, state) {
			const functionName = "SUMIFS";
			const computeFn = (values, ...args) => this.computeConditionalAggregationFunction(values, args, functionName, 0, (left, right) => this.arithmeticHelper.nonstrictadd(left, right), mapToRawScalarValue);
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		averageif(ast, state) {
			const functionName = "AVERAGEIF";
			const computeFn = (conditionRange, criterion, values) => {
				const averageResult = this.computeConditionalAggregationFunction(values !== null && values !== void 0 ? values : conditionRange, [conditionRange, criterion], functionName, AverageResult.empty, (left, right) => left.compose(right), (arg) => isExtendedNumber(arg) ? AverageResult.single(getRawValue(arg)) : AverageResult.empty);
				if (averageResult instanceof CellError) return averageResult;
				else return averageResult.averageValue() || new CellError(ErrorType.DIV_BY_ZERO);
			};
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		/**
		* Corresponds to COUNTIF(Range, Criterion)
		*
		* Range is the range to which criterion is to be applied.
		* Criterion is the criteria used to choose which cells will be included in sum.
		*
		* Returns number of cells on which criteria evaluate to true.
		*
		* @param ast
		* @param state
		*/
		countif(ast, state) {
			const functionName = "COUNTIF";
			const computeFn = (conditionRange, criterion) => this.computeConditionalAggregationFunction(conditionRange, [conditionRange, criterion], functionName, 0, (left, right) => left + right, () => 1);
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		countifs(ast, state) {
			const functionName = "COUNTIFS";
			const computeFn = (...args) => this.computeConditionalAggregationFunction(args[0], args, functionName, 0, (left, right) => left + right, () => 1);
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		minifs(ast, state) {
			const functionName = "MINIFS";
			const composeFunction = (left, right) => {
				if (right === void 0 || left === void 0) return right === void 0 ? left : right;
				return Math.min(left, right);
			};
			const computeFn = (values, ...args) => {
				return zeroForInfinite(this.computeConditionalAggregationFunction(values, args, functionName, Number.POSITIVE_INFINITY, composeFunction, mapToRawScalarValue));
			};
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		maxifs(ast, state) {
			const functionName = "MAXIFS";
			const composeFunction = (left, right) => {
				if (right === void 0 || left === void 0) return right === void 0 ? left : right;
				return Math.max(left, right);
			};
			const computeFn = (values, ...args) => {
				return zeroForInfinite(this.computeConditionalAggregationFunction(values, args, functionName, Number.NEGATIVE_INFINITY, composeFunction, mapToRawScalarValue));
			};
			return this.runFunction(ast.args, state, this.metadata(functionName), computeFn);
		}
		computeConditionalAggregationFunction(valuesRange, conditionArgs, functionName, reduceInitialValue, composeFunction, mapFunction) {
			const conditions = [];
			for (let i = 0; i < conditionArgs.length; i += 2) {
				const conditionArg = conditionArgs[i];
				const criterionPackage = this.interpreter.criterionBuilder.fromCellValue(conditionArgs[i + 1], this.arithmeticHelper);
				if (criterionPackage === void 0) return new CellError(ErrorType.VALUE, ErrorMessage.BadCriterion);
				conditions.push(new Condition$1(conditionArg, criterionPackage));
			}
			return new CriterionFunctionCompute(this.interpreter, conditionalAggregationFunctionCacheKey(functionName), reduceInitialValue, composeFunction, mapFunction).compute(valuesRange, conditions);
		}
	};
	ConditionalAggregationPlugin.implementedFunctions = {
		SUMIF: {
			method: "sumif",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NOERROR },
				{
					argumentType: FunctionArgumentType.RANGE,
					optionalArg: true
				}
			]
		},
		COUNTIF: {
			method: "countif",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.NOERROR }]
		},
		AVERAGEIF: {
			method: "averageif",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NOERROR },
				{
					argumentType: FunctionArgumentType.RANGE,
					optionalArg: true
				}
			]
		},
		SUMIFS: {
			method: "sumifs",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NOERROR }
			],
			repeatLastArgs: 2
		},
		COUNTIFS: {
			method: "countifs",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.NOERROR }],
			repeatLastArgs: 2
		},
		MINIFS: {
			method: "minifs",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NOERROR }
			],
			repeatLastArgs: 2
		},
		MAXIFS: {
			method: "maxifs",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NOERROR }
			],
			repeatLastArgs: 2
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/SumprodPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var SumprodPlugin = class extends FunctionPlugin {
		sumproduct(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SUMPRODUCT"), (...args) => {
				const width = args[0].width();
				const height = args[0].height();
				for (const arg of args) if (arg.width() !== width || arg.height() !== height) return new CellError(ErrorType.VALUE, ErrorMessage.EqualLength);
				let ret = 0;
				const iterators = args.map((arg) => arg.iterateValuesFromTopLeftCorner());
				for (let i = 0; i < width * height; i++) {
					let acc = 1;
					for (const it of iterators) {
						const val = it.next().value;
						if (val instanceof CellError) return val;
						const coercedVal = this.coerceScalarToNumberOrError(val);
						if (isExtendedNumber(coercedVal)) acc *= getRawValue(coercedVal);
						else acc = 0;
					}
					ret += acc;
				}
				return ret;
			});
		}
	};
	SumprodPlugin.implementedFunctions = { "SUMPRODUCT": {
		method: "sumproduct",
		parameters: [{ argumentType: FunctionArgumentType.RANGE }],
		repeatLastArgs: 1
	} };
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/TextPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing text-specific functions
	*/
	var TextPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to CONCATENATE(value1, [value2, ...])
		*
		* Concatenates provided arguments to one string.
		*
		* @param {ProcedureAst} ast - The procedure AST node
		* @param {InterpreterState} state - The interpreter state
		*/
		concatenate(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CONCATENATE"), (...args) => {
				return "".concat(...args);
			});
		}
		/**
		* Corresponds to SPLIT(string, index)
		*
		* Splits provided string using space separator and returns chunk at zero-based position specified by second argument
		*
		* @param {ProcedureAst} ast - The procedure AST node
		* @param {InterpreterState} state - The interpreter state
		*/
		split(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SPLIT"), (stringToSplit, indexToUse) => {
				const splittedString = stringToSplit.split(" ");
				if (indexToUse >= splittedString.length || indexToUse < 0) return new CellError(ErrorType.VALUE, ErrorMessage.IndexBounds);
				return splittedString[indexToUse];
			});
		}
		len(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LEN"), (arg) => {
				return arg.length;
			});
		}
		lower(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LOWER"), (arg) => {
				return arg.toLowerCase();
			});
		}
		trim(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TRIM"), (arg) => {
				return arg.replace(/^ +/g, "").replace(/ +$/g, "").replace(/ +/g, " ");
			});
		}
		proper(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PROPER"), (arg) => {
				return arg.replace(/\p{L}+/gu, (word) => word.charAt(0).toUpperCase() + word.substring(1).toLowerCase());
			});
		}
		clean(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CLEAN"), (arg) => {
				return arg.replace(/[\u0000-\u001F]/g, "");
			});
		}
		exact(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EXACT"), (left, right) => {
				return left === right;
			});
		}
		rept(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("REPT"), (text, count) => {
				if (count < 0) return new CellError(ErrorType.VALUE, ErrorMessage.NegativeCount);
				return text.repeat(count);
			});
		}
		right(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RIGHT"), (text, length) => {
				if (length < 0) return new CellError(ErrorType.VALUE, ErrorMessage.NegativeLength);
				else if (length === 0) return "";
				return text.slice(-length);
			});
		}
		left(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LEFT"), (text, length) => {
				if (length < 0) return new CellError(ErrorType.VALUE, ErrorMessage.NegativeLength);
				return text.slice(0, length);
			});
		}
		mid(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MID"), (text, startPosition, numberOfChars) => {
				if (startPosition < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
				if (numberOfChars < 0) return new CellError(ErrorType.VALUE, ErrorMessage.NegativeLength);
				return text.substring(startPosition - 1, startPosition + numberOfChars - 1);
			});
		}
		replace(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("REPLACE"), (text, startPosition, numberOfChars, newText) => {
				if (startPosition < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
				if (numberOfChars < 0) return new CellError(ErrorType.VALUE, ErrorMessage.NegativeLength);
				return text.substring(0, startPosition - 1) + newText + text.substring(startPosition + numberOfChars - 1);
			});
		}
		search(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SEARCH"), (pattern, text, startIndex) => {
				if (startIndex < 1 || startIndex > text.length) return new CellError(ErrorType.VALUE, ErrorMessage.LengthBounds);
				const normalizedPattern = pattern.toLowerCase();
				const normalizedText = text.substring(startIndex - 1).toLowerCase();
				const index = this.arithmeticHelper.requiresRegex(normalizedPattern) ? this.arithmeticHelper.searchString(normalizedPattern, normalizedText) : normalizedText.indexOf(normalizedPattern);
				return index > -1 ? index + startIndex : new CellError(ErrorType.VALUE, ErrorMessage.PatternNotFound);
			});
		}
		substitute(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SUBSTITUTE"), (text, searchString, replacementString, occurrenceNum) => {
				const escapedSearchString = this.escapeRegExpSpecialCharacters(searchString);
				const searchRegExp = new RegExp(escapedSearchString, "g");
				if (occurrenceNum === void 0) return text.replace(searchRegExp, replacementString);
				if (occurrenceNum < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
				let match;
				let i = 0;
				while ((match = searchRegExp.exec(text)) !== null) if (occurrenceNum === ++i) return text.substring(0, match.index) + replacementString + text.substring(searchRegExp.lastIndex);
				return text;
			});
		}
		find(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FIND"), (pattern, text, startIndex) => {
				if (startIndex < 1 || startIndex > text.length) return new CellError(ErrorType.VALUE, ErrorMessage.IndexBounds);
				const index = text.substring(startIndex - 1).indexOf(pattern) + startIndex;
				return index > 0 ? index : new CellError(ErrorType.VALUE, ErrorMessage.PatternNotFound);
			});
		}
		t(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T"), (arg) => {
				if (arg instanceof CellError) return arg;
				return typeof arg === "string" ? arg : "";
			});
		}
		/**
		* Corresponds to N(value)
		*
		* Converts a value to a number according to Excel specification:
		* - Numbers return themselves
		* - Dates return their serial number (stored as numbers internally)
		* - TRUE returns 1, FALSE returns 0
		* - Error values propagate
		* - Anything else (text, empty) returns 0
		* - For ranges, uses the first cell value
		*/
		n(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("N"), (arg) => {
				var _a;
				const value = arg instanceof SimpleRangeValue ? (_a = arg.data[0]) === null || _a === void 0 ? void 0 : _a[0] : arg;
				if (value instanceof CellError) return value;
				if (typeof value === "number") return value;
				if (typeof value === "boolean") return value ? 1 : 0;
				return 0;
			});
		}
		upper(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("UPPER"), (arg) => {
				return arg.toUpperCase();
			});
		}
		/**
		* Corresponds to VALUE(text)
		*
		* Converts a text string that represents a number to a number.
		*
		* @param {ProcedureAst} ast - The procedure AST node
		* @param {InterpreterState} state - The interpreter state
		*/
		value(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("VALUE"), (arg) => {
				if (arg instanceof CellError) return arg;
				if (isExtendedNumber(arg)) return arg;
				if (typeof arg !== "string") return new CellError(ErrorType.VALUE, ErrorMessage.NumberCoercion);
				const trimmedArg = arg.trim();
				const parenthesesMatch = /^\(([^()]+)\)$/.exec(trimmedArg);
				if (parenthesesMatch) {
					const innerValue = this.parseStringToNumber(parenthesesMatch[1]);
					if (innerValue !== void 0) return -innerValue;
				}
				const parsedValue = this.parseStringToNumber(trimmedArg);
				if (parsedValue !== void 0) return parsedValue;
				return new CellError(ErrorType.VALUE, ErrorMessage.NumberCoercion);
			});
		}
		/**
		* Parses a string to a numeric value, handling whitespace trimming and empty string validation.
		*
		* @param {string} input - The string to parse
		* @returns {Maybe<ExtendedNumber>} The parsed number or undefined if parsing fails or input is empty
		*/
		parseStringToNumber(input) {
			const trimmedInput = input.trim();
			if (trimmedInput === "") return;
			return this.arithmeticHelper.coerceToMaybeNumber(trimmedInput);
		}
		escapeRegExpSpecialCharacters(text) {
			return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
		}
	};
	TextPlugin.implementedFunctions = {
		"CONCATENATE": {
			method: "concatenate",
			parameters: [{ argumentType: FunctionArgumentType.STRING }],
			repeatLastArgs: 1,
			expandRanges: true
		},
		"EXACT": {
			method: "exact",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, { argumentType: FunctionArgumentType.STRING }]
		},
		"SPLIT": {
			method: "split",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"LEN": {
			method: "len",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"LOWER": {
			method: "lower",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"MID": {
			method: "mid",
			parameters: [
				{ argumentType: FunctionArgumentType.STRING },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER }
			]
		},
		"TRIM": {
			method: "trim",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"T": {
			method: "t",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		},
		"N": {
			method: "n",
			parameters: [{ argumentType: FunctionArgumentType.ANY }]
		},
		"PROPER": {
			method: "proper",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"CLEAN": {
			method: "clean",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"REPT": {
			method: "rept",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"RIGHT": {
			method: "right",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 1
			}]
		},
		"LEFT": {
			method: "left",
			parameters: [{ argumentType: FunctionArgumentType.STRING }, {
				argumentType: FunctionArgumentType.NUMBER,
				defaultValue: 1
			}]
		},
		"REPLACE": {
			method: "replace",
			parameters: [
				{ argumentType: FunctionArgumentType.STRING },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.STRING }
			]
		},
		"SEARCH": {
			method: "search",
			parameters: [
				{ argumentType: FunctionArgumentType.STRING },
				{ argumentType: FunctionArgumentType.STRING },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				}
			]
		},
		"SUBSTITUTE": {
			method: "substitute",
			parameters: [
				{ argumentType: FunctionArgumentType.STRING },
				{ argumentType: FunctionArgumentType.STRING },
				{ argumentType: FunctionArgumentType.STRING },
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true
				}
			]
		},
		"FIND": {
			method: "find",
			parameters: [
				{ argumentType: FunctionArgumentType.STRING },
				{ argumentType: FunctionArgumentType.STRING },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				}
			]
		},
		"UPPER": {
			method: "upper",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		"VALUE": {
			method: "value",
			parameters: [{ argumentType: FunctionArgumentType.SCALAR }]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/TrigonometryPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Interpreter plugin containing trigonometric functions
	*/
	var TrigonometryPlugin = class extends FunctionPlugin {
		/**
		* Corresponds to ACOS(value)
		*
		* Returns the arc cosine (or inverse cosine) of a number.
		*
		* @param ast
		* @param state
		*/
		acos(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ACOS"), Math.acos);
		}
		asin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ASIN"), Math.asin);
		}
		cos(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COS"), Math.cos);
		}
		sin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SIN"), Math.sin);
		}
		tan(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TAN"), Math.tan);
		}
		atan(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ATAN"), Math.atan);
		}
		atan2(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ATAN2"), (x, y) => {
				if (x === 0 && y === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return Math.atan2(y, x);
			});
		}
		cot(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COT"), (arg) => arg === 0 ? new CellError(ErrorType.DIV_BY_ZERO) : 1 / Math.tan(arg));
		}
		acot(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ACOT"), (arg) => arg === 0 ? PI / 2 : Math.atan(1 / arg));
		}
		sec(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SEC"), (arg) => 1 / Math.cos(arg));
		}
		csc(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CSC"), (arg) => arg === 0 ? new CellError(ErrorType.DIV_BY_ZERO) : 1 / Math.sin(arg));
		}
		sinh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SINH"), Math.sinh);
		}
		asinh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ASINH"), Math.asinh);
		}
		cosh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COSH"), Math.cosh);
		}
		acosh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ACOSH"), Math.acosh);
		}
		tanh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TANH"), Math.tanh);
		}
		atanh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ATANH"), Math.atanh);
		}
		coth(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COTH"), (arg) => arg === 0 ? new CellError(ErrorType.DIV_BY_ZERO) : 1 / Math.tanh(arg));
		}
		acoth(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ACOTH"), (arg) => arg === 0 ? new CellError(ErrorType.NUM, ErrorMessage.NonZero) : Math.atanh(1 / arg));
		}
		sech(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SECH"), (arg) => 1 / Math.cosh(arg));
		}
		csch(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CSCH"), (arg) => arg === 0 ? new CellError(ErrorType.DIV_BY_ZERO) : 1 / Math.sinh(arg));
		}
	};
	TrigonometryPlugin.implementedFunctions = {
		"ACOS": {
			method: "acos",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ASIN": {
			method: "asin",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"COS": {
			method: "cos",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"SIN": {
			method: "sin",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"TAN": {
			method: "tan",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ATAN": {
			method: "atan",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ATAN2": {
			method: "atan2",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"COT": {
			method: "cot",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"SEC": {
			method: "sec",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"CSC": {
			method: "csc",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"SINH": {
			method: "sinh",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"COSH": {
			method: "cosh",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"TANH": {
			method: "tanh",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"COTH": {
			method: "coth",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"SECH": {
			method: "sech",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"CSCH": {
			method: "csch",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ACOT": {
			method: "acot",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ASINH": {
			method: "asinh",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ACOSH": {
			method: "acosh",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ATANH": {
			method: "atanh",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"ACOTH": {
			method: "acoth",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/Lookup/RowSearchStrategy.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RowSearchStrategy = class extends AdvancedFind {
		constructor(dependencyGraph) {
			super(dependencyGraph);
			this.dependencyGraph = dependencyGraph;
		}
		find(searchKey, rangeValue, searchOptions) {
			return this.basicFind(searchKey, rangeValue, "col", searchOptions);
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/LookupPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var LookupPlugin = class extends FunctionPlugin {
		constructor() {
			super(...arguments);
			this.rowSearch = new RowSearchStrategy(this.dependencyGraph);
		}
		/**
		* Corresponds to VLOOKUP(key, range, index, [sorted])
		*
		* @param ast
		* @param state
		*/
		vlookup(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("VLOOKUP"), (key, rangeValue, index, sorted) => {
				const range = rangeValue.range;
				if (range === void 0) return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
				if (index < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
				if (index > range.width()) return new CellError(ErrorType.REF, ErrorMessage.IndexLarge);
				const searchOptions = {
					ordering: sorted ? "asc" : "none",
					ifNoMatch: sorted ? "returnLowerBound" : "returnNotFound"
				};
				return this.doVlookup(zeroIfEmpty(key), rangeValue, index - 1, searchOptions);
			});
		}
		/**
		* Corresponds to HLOOKUP(key, range, index, [sorted])
		*
		* @param ast
		* @param state
		*/
		hlookup(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HLOOKUP"), (key, rangeValue, index, sorted) => {
				const range = rangeValue.range;
				if (range === void 0) return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
				if (index < 1) return new CellError(ErrorType.VALUE, ErrorMessage.LessThanOne);
				if (index > range.height()) return new CellError(ErrorType.REF, ErrorMessage.IndexLarge);
				const searchOptions = {
					ordering: sorted ? "asc" : "none",
					ifNoMatch: sorted ? "returnLowerBound" : "returnNotFound"
				};
				return this.doHlookup(zeroIfEmpty(key), rangeValue, index - 1, searchOptions);
			});
		}
		/**
		* Corresponds to XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
		*
		* @param ast
		* @param state
		*/
		xlookup(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("XLOOKUP"), (key, lookupRangeValue, returnRangeValue, notFoundFlag, matchMode, searchMode) => {
				if (![
					0,
					-1,
					1,
					2
				].includes(matchMode)) return new CellError(ErrorType.VALUE, ErrorMessage.BadMode);
				if (![
					1,
					-1,
					2,
					-2
				].includes(searchMode)) return new CellError(ErrorType.VALUE, ErrorMessage.BadMode);
				const lookupRange = lookupRangeValue instanceof SimpleRangeValue ? lookupRangeValue : SimpleRangeValue.fromScalar(lookupRangeValue);
				const returnRange = returnRangeValue instanceof SimpleRangeValue ? returnRangeValue : SimpleRangeValue.fromScalar(returnRangeValue);
				const isWildcardMatchMode = matchMode === 2;
				const searchOptions = {
					ordering: searchMode === 2 ? "asc" : searchMode === -2 ? "desc" : "none",
					returnOccurrence: searchMode === -1 ? "last" : "first",
					ifNoMatch: matchMode === -1 ? "returnLowerBound" : matchMode === 1 ? "returnUpperBound" : "returnNotFound"
				};
				return this.doXlookup(zeroIfEmpty(key), lookupRange, returnRange, notFoundFlag, isWildcardMatchMode, searchOptions);
			});
		}
		xlookupArraySize(ast) {
			var _a, _b;
			const lookupRange = (_a = ast === null || ast === void 0 ? void 0 : ast.args) === null || _a === void 0 ? void 0 : _a[1];
			const returnRange = (_b = ast === null || ast === void 0 ? void 0 : ast.args) === null || _b === void 0 ? void 0 : _b[2];
			if ((lookupRange === null || lookupRange === void 0 ? void 0 : lookupRange.start) == null || (lookupRange === null || lookupRange === void 0 ? void 0 : lookupRange.end) == null || (returnRange === null || returnRange === void 0 ? void 0 : returnRange.start) == null || (returnRange === null || returnRange === void 0 ? void 0 : returnRange.end) == null) return ArraySize.error();
			const lookupRangeHeight = lookupRange.end.row - lookupRange.start.row + 1;
			const lookupRangeWidth = lookupRange.end.col - lookupRange.start.col + 1;
			const returnRangeHeight = returnRange.end.row - returnRange.start.row + 1;
			const returnRangeWidth = returnRange.end.col - returnRange.start.col + 1;
			const isVerticalSearch = lookupRangeWidth === 1 && returnRangeHeight === lookupRangeHeight;
			if (!isVerticalSearch && !(lookupRangeHeight === 1 && returnRangeWidth === lookupRangeWidth)) return ArraySize.error();
			if (isVerticalSearch) return new ArraySize(returnRangeWidth, 1);
			return new ArraySize(1, returnRangeHeight);
		}
		match(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MATCH"), (key, rangeValue, type) => {
				return this.doMatch(zeroIfEmpty(key), rangeValue, type);
			});
		}
		searchInRange(key, range, isWildcardMatchMode, searchOptions, searchStrategy) {
			if (isWildcardMatchMode && typeof key === "string" && this.arithmeticHelper.requiresRegex(key)) return searchStrategy.advancedFind(this.arithmeticHelper.eqMatcherFunction(key), range, { returnOccurrence: searchOptions.returnOccurrence });
			return searchStrategy.find(key, range, searchOptions);
		}
		doVlookup(key, rangeValue, index, searchOptions) {
			this.dependencyGraph.stats.start(StatType.VLOOKUP);
			const range = rangeValue.range;
			let searchedRange;
			if (range === void 0) searchedRange = SimpleRangeValue.onlyValues(rangeValue.data.map((arg) => [arg[0]]));
			else searchedRange = SimpleRangeValue.onlyRange(AbsoluteCellRange.spanFrom(range.start, 1, range.height()), this.dependencyGraph);
			const rowIndex = this.searchInRange(key, searchedRange, searchOptions.ordering === "none", searchOptions, this.columnSearch);
			this.dependencyGraph.stats.end(StatType.VLOOKUP);
			if (rowIndex === -1) return new CellError(ErrorType.NA, ErrorMessage.ValueNotFound);
			let value;
			if (range === void 0) value = rangeValue.data[rowIndex][index];
			else {
				const address = simpleCellAddress(range.sheet, range.start.col + index, range.start.row + rowIndex);
				value = this.dependencyGraph.getCellValue(address);
			}
			if (value instanceof SimpleRangeValue) return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
			return value;
		}
		doHlookup(key, rangeValue, index, searchOptions) {
			const range = rangeValue.range;
			let searchedRange;
			if (range === void 0) searchedRange = SimpleRangeValue.onlyValues([rangeValue.data[0]]);
			else searchedRange = SimpleRangeValue.onlyRange(AbsoluteCellRange.spanFrom(range.start, range.width(), 1), this.dependencyGraph);
			const colIndex = this.searchInRange(key, searchedRange, searchOptions.ordering === "none", searchOptions, this.rowSearch);
			if (colIndex === -1) return new CellError(ErrorType.NA, ErrorMessage.ValueNotFound);
			let value;
			if (range === void 0) value = rangeValue.data[index][colIndex];
			else {
				const address = simpleCellAddress(range.sheet, range.start.col + colIndex, range.start.row + index);
				value = this.dependencyGraph.getCellValue(address);
			}
			if (value instanceof SimpleRangeValue) return new CellError(ErrorType.VALUE, ErrorMessage.WrongType);
			return value;
		}
		doXlookup(key, lookupRange, returnRange, notFoundFlag, isWildcardMatchMode, searchOptions) {
			const isVerticalSearch = lookupRange.width() === 1 && returnRange.height() === lookupRange.height();
			const isHorizontalSearch = lookupRange.height() === 1 && returnRange.width() === lookupRange.width();
			if (!isVerticalSearch && !isHorizontalSearch) return new CellError(ErrorType.VALUE, ErrorMessage.WrongDimension);
			const searchStrategy = isVerticalSearch ? this.columnSearch : this.rowSearch;
			const indexFound = this.searchInRange(key, lookupRange, isWildcardMatchMode, searchOptions, searchStrategy);
			if (indexFound === -1) return notFoundFlag == ErrorType.NA ? new CellError(ErrorType.NA, ErrorMessage.ValueNotFound) : notFoundFlag;
			const returnValues = isVerticalSearch ? [returnRange.data[indexFound]] : returnRange.data.map((row) => [row[indexFound]]);
			return SimpleRangeValue.onlyValues(returnValues);
		}
		doMatch(key, rangeValue, type) {
			if (![
				-1,
				0,
				1
			].includes(type)) return new CellError(ErrorType.VALUE, ErrorMessage.BadMode);
			if (rangeValue.width() > 1 && rangeValue.height() > 1) return new CellError(ErrorType.NA);
			const searchStrategy = rangeValue.width() === 1 ? this.columnSearch : this.rowSearch;
			const searchOptions = type === 0 ? {
				ordering: "none",
				ifNoMatch: "returnNotFound"
			} : {
				ordering: type === -1 ? "desc" : "asc",
				ifNoMatch: type === -1 ? "returnUpperBound" : "returnLowerBound"
			};
			const index = searchStrategy.find(key, rangeValue, searchOptions);
			if (index === -1) return new CellError(ErrorType.NA, ErrorMessage.ValueNotFound);
			return index + 1;
		}
	};
	LookupPlugin.implementedFunctions = {
		"VLOOKUP": {
			method: "vlookup",
			parameters: [
				{ argumentType: FunctionArgumentType.NOERROR },
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.BOOLEAN,
					defaultValue: true
				}
			]
		},
		"HLOOKUP": {
			method: "hlookup",
			parameters: [
				{ argumentType: FunctionArgumentType.NOERROR },
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.BOOLEAN,
					defaultValue: true
				}
			]
		},
		"XLOOKUP": {
			method: "xlookup",
			sizeOfResultArrayMethod: "xlookupArraySize",
			parameters: [
				{ argumentType: FunctionArgumentType.NOERROR },
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.RANGE },
				{
					argumentType: FunctionArgumentType.SCALAR,
					optionalArg: true,
					defaultValue: ErrorType.NA
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true,
					defaultValue: 1
				}
			]
		},
		"MATCH": {
			method: "match",
			parameters: [
				{ argumentType: FunctionArgumentType.NOERROR },
				{ argumentType: FunctionArgumentType.RANGE },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				}
			]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/RomanPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var RomanPlugin = class extends FunctionPlugin {
		roman(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ROMAN"), (val, mode) => {
				val = Math.trunc(val);
				if (mode === false) mode = 4;
				else if (mode === true) mode = 0;
				mode = getRawValue(this.coerceScalarToNumberOrError(mode));
				if (mode instanceof CellError) return mode;
				mode = Math.trunc(mode);
				if (mode < 0) return new CellError(ErrorType.VALUE, ErrorMessage.ValueSmall);
				if (mode > 4) return new CellError(ErrorType.VALUE, ErrorMessage.ValueLarge);
				return romanMode(val, mode);
			});
		}
		arabic(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ARABIC"), (inputString) => {
				inputString = inputString.trim().toUpperCase();
				let minusSign = false;
				if (inputString.startsWith("-")) {
					inputString = inputString.slice(1);
					minusSign = true;
					if (inputString === "") return new CellError(ErrorType.VALUE, ErrorMessage.InvalidRoman);
				}
				const work = {
					input: inputString,
					acc: 0
				};
				eatToken(work, {
					token: "MMM",
					val: 3e3
				}, {
					token: "MM",
					val: 2e3
				}, {
					token: "M",
					val: 1e3
				});
				eatToken(work, {
					token: "IM",
					val: 999
				}, {
					token: "VM",
					val: 995
				}, {
					token: "XM",
					val: 990
				}, {
					token: "LM",
					val: 950
				}, {
					token: "CM",
					val: 900
				});
				eatToken(work, {
					token: "D",
					val: 500
				}, {
					token: "ID",
					val: 499
				}, {
					token: "VD",
					val: 495
				}, {
					token: "XD",
					val: 490
				}, {
					token: "LD",
					val: 450
				}, {
					token: "CD",
					val: 400
				});
				eatToken(work, {
					token: "CCC",
					val: 300
				}, {
					token: "CC",
					val: 200
				}, {
					token: "C",
					val: 100
				});
				eatToken(work, {
					token: "IC",
					val: 99
				}, {
					token: "VC",
					val: 95
				}, {
					token: "XC",
					val: 90
				});
				eatToken(work, {
					token: "L",
					val: 50
				}, {
					token: "IL",
					val: 49
				}, {
					token: "VL",
					val: 45
				}, {
					token: "XL",
					val: 40
				});
				eatToken(work, {
					token: "XXX",
					val: 30
				}, {
					token: "XX",
					val: 20
				}, {
					token: "X",
					val: 10
				});
				eatToken(work, {
					token: "IX",
					val: 9
				});
				eatToken(work, {
					token: "V",
					val: 5
				}, {
					token: "IV",
					val: 4
				});
				eatToken(work, {
					token: "III",
					val: 3
				}, {
					token: "II",
					val: 2
				}, {
					token: "I",
					val: 1
				});
				if (work.input !== "") return new CellError(ErrorType.VALUE, ErrorMessage.InvalidRoman);
				else return minusSign ? -work.acc : work.acc;
			});
		}
	};
	RomanPlugin.implementedFunctions = {
		"ROMAN": {
			method: "roman",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1,
				lessThan: 4e3
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				optionalArg: true,
				defaultValue: 0
			}]
		},
		"ARABIC": {
			method: "arabic",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		}
	};
	function eatToken(inputAcc, ...tokens) {
		for (const token of tokens) if (inputAcc.input.startsWith(token.token)) {
			inputAcc.input = inputAcc.input.slice(token.token.length);
			inputAcc.acc += token.val;
			break;
		}
	}
	function romanMode(input, mode) {
		const work = {
			val: input % 1e3,
			acc: "M".repeat(Math.floor(input / 1e3))
		};
		if (mode === 4) {
			absorb(work, "IM", 999, 1e3);
			absorb(work, "ID", 499, 500);
		}
		if (mode >= 3) {
			absorb(work, "VM", 995, 1e3);
			absorb(work, "VD", 495, 500);
		}
		if (mode >= 2) {
			absorb(work, "XM", 990, 1e3);
			absorb(work, "XD", 490, 500);
		}
		if (mode >= 1) {
			absorb(work, "LM", 950, 1e3);
			absorb(work, "LD", 450, 500);
		}
		absorb(work, "CM", 900, 1e3);
		absorb(work, "CD", 400, 500);
		absorb(work, "D", 500, 900);
		work.acc += "C".repeat(Math.floor(work.val / 100));
		work.val %= 100;
		if (mode >= 2) {
			absorb(work, "IC", 99, 100);
			absorb(work, "IL", 49, 50);
		}
		if (mode >= 1) {
			absorb(work, "VC", 95, 100);
			absorb(work, "VL", 45, 50);
		}
		absorb(work, "XC", 90, 100);
		absorb(work, "XL", 40, 50);
		absorb(work, "L", 50, 90);
		work.acc += "X".repeat(Math.floor(work.val / 10));
		work.val %= 10;
		absorb(work, "IX", 9, 10);
		absorb(work, "IV", 4, 5);
		absorb(work, "V", 5, 9);
		work.acc += "I".repeat(work.val);
		return work.acc;
	}
	function absorb(valAcc, token, lower, upper) {
		if (valAcc.val >= lower && valAcc.val < upper) {
			valAcc.val -= lower;
			valAcc.acc += token;
		}
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/SimpleArithmertic.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var SimpleArithmerticPlugin = class extends FunctionPlugin {
		add(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.ADD"), this.arithmeticHelper.addWithEpsilon);
		}
		concat(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.CONCAT"), this.arithmeticHelper.concat);
		}
		divide(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.DIVIDE"), this.arithmeticHelper.divide);
		}
		eq(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.EQ"), this.arithmeticHelper.eq);
		}
		gt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.GT"), this.arithmeticHelper.gt);
		}
		gte(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.GTE"), this.arithmeticHelper.geq);
		}
		lt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.LT"), this.arithmeticHelper.lt);
		}
		lte(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.LTE"), this.arithmeticHelper.leq);
		}
		minus(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.MINUS"), this.arithmeticHelper.subtract);
		}
		multiply(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.MULTIPLY"), this.arithmeticHelper.multiply);
		}
		ne(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.NE"), this.arithmeticHelper.neq);
		}
		pow(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.POW"), this.arithmeticHelper.pow);
		}
		uminus(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.UMINUS"), this.arithmeticHelper.unaryMinus);
		}
		upercent(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.UNARY_PERCENT"), this.arithmeticHelper.unaryPercent);
		}
		uplus(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HF.UPLUS"), this.arithmeticHelper.unaryPlus);
		}
	};
	SimpleArithmerticPlugin.implementedFunctions = {
		"HF.ADD": {
			method: "add",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.CONCAT": {
			method: "concat",
			parameters: [{
				argumentType: FunctionArgumentType.STRING,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.STRING,
				passSubtype: true
			}]
		},
		"HF.DIVIDE": {
			method: "divide",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.EQ": {
			method: "eq",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}]
		},
		"HF.GT": {
			method: "gt",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}]
		},
		"HF.GTE": {
			method: "gte",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}]
		},
		"HF.LT": {
			method: "lt",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}]
		},
		"HF.LTE": {
			method: "lte",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}]
		},
		"HF.MINUS": {
			method: "minus",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.MULTIPLY": {
			method: "multiply",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.NE": {
			method: "ne",
			parameters: [{
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NOERROR,
				passSubtype: true
			}]
		},
		"HF.POW": {
			method: "pow",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.UMINUS": {
			method: "uminus",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.UNARY_PERCENT": {
			method: "upercent",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		},
		"HF.UPLUS": {
			method: "uplus",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				passSubtype: true
			}]
		}
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/3rdparty/bessel/bessel.mjs
	/**
	* @license
	bessel.js (C) 2013-present SheetJS -- http://sheetjs.com
	
	Apache License
	Version 2.0, January 2004
	http://www.apache.org/licenses/
	
	TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
	
	1. Definitions.
	
	"License" shall mean the terms and conditions for use, reproduction,
	and distribution as defined by Sections 1 through 9 of this document.
	
	"Licensor" shall mean the copyright owner or entity authorized by
	the copyright owner that is granting the License.
	
	"Legal Entity" shall mean the union of the acting entity and all
	other entities that control, are controlled by, or are under common
	control with that entity. For the purposes of this definition,
	"control" means (i) the power, direct or indirect, to cause the
	direction or management of such entity, whether by contract or
	otherwise, or (ii) ownership of fifty percent (50%) or more of the
	outstanding shares, or (iii) beneficial ownership of such entity.
	
	"You" (or "Your") shall mean an individual or Legal Entity
	exercising permissions granted by this License.
	
	"Source" form shall mean the preferred form for making modifications,
	including but not limited to software source code, documentation
	source, and configuration files.
	
	"Object" form shall mean any form resulting from mechanical
	transformation or translation of a Source form, including but
	not limited to compiled object code, generated documentation,
	and conversions to other media types.
	
	"Work" shall mean the work of authorship, whether in Source or
	Object form, made available under the License, as indicated by a
	copyright notice that is included in or attached to the work
	(an example is provided in the Appendix below).
	
	"Derivative Works" shall mean any work, whether in Source or Object
	form, that is based on (or derived from) the Work and for which the
	editorial revisions, annotations, elaborations, or other modifications
	represent, as a whole, an original work of authorship. For the purposes
	of this License, Derivative Works shall not include works that remain
	separable from, or merely link (or bind by name) to the interfaces of,
	the Work and Derivative Works thereof.
	
	"Contribution" shall mean any work of authorship, including
	the original version of the Work and any modifications or additions
	to that Work or Derivative Works thereof, that is intentionally
	submitted to Licensor for inclusion in the Work by the copyright owner
	or by an individual or Legal Entity authorized to submit on behalf of
	the copyright owner. For the purposes of this definition, "submitted"
	means any form of electronic, verbal, or written communication sent
	to the Licensor or its representatives, including but not limited to
	communication on electronic mailing lists, source code control systems,
	and issue tracking systems that are managed by, or on behalf of, the
	Licensor for the purpose of discussing and improving the Work, but
	excluding communication that is conspicuously marked or otherwise
	designated in writing by the copyright owner as "Not a Contribution."
	
	"Contributor" shall mean Licensor and any individual or Legal Entity
	on behalf of whom a Contribution has been received by Licensor and
	subsequently incorporated within the Work.
	
	2. Grant of Copyright License. Subject to the terms and conditions of
	this License, each Contributor hereby grants to You a perpetual,
	worldwide, non-exclusive, no-charge, royalty-free, irrevocable
	copyright license to reproduce, prepare Derivative Works of,
	publicly display, publicly perform, sublicense, and distribute the
	Work and such Derivative Works in Source or Object form.
	
	3. Grant of Patent License. Subject to the terms and conditions of
	this License, each Contributor hereby grants to You a perpetual,
	worldwide, non-exclusive, no-charge, royalty-free, irrevocable
	(except as stated in this section) patent license to make, have made,
	use, offer to sell, sell, import, and otherwise transfer the Work,
	where such license applies only to those patent claims licensable
	by such Contributor that are necessarily infringed by their
	Contribution(s) alone or by combination of their Contribution(s)
	with the Work to which such Contribution(s) was submitted. If You
	institute patent litigation against any entity (including a
	cross-claim or counterclaim in a lawsuit) alleging that the Work
	or a Contribution incorporated within the Work constitutes direct
	or contributory patent infringement, then any patent licenses
	granted to You under this License for that Work shall terminate
	as of the date such litigation is filed.
	
	4. Redistribution. You may reproduce and distribute copies of the
	Work or Derivative Works thereof in any medium, with or without
	modifications, and in Source or Object form, provided that You
	meet the following conditions:
	
	(a) You must give any other recipients of the Work or
	Derivative Works a copy of this License; and
	
	(b) You must cause any modified files to carry prominent notices
	stating that You changed the files; and
	
	(c) You must retain, in the Source form of any Derivative Works
	that You distribute, all copyright, patent, trademark, and
	attribution notices from the Source form of the Work,
	excluding those notices that do not pertain to any part of
	the Derivative Works; and
	
	(d) If the Work includes a "NOTICE" text file as part of its
	distribution, then any Derivative Works that You distribute must
	include a readable copy of the attribution notices contained
	within such NOTICE file, excluding those notices that do not
	pertain to any part of the Derivative Works, in at least one
	of the following places: within a NOTICE text file distributed
	as part of the Derivative Works; within the Source form or
	documentation, if provided along with the Derivative Works; or,
	within a display generated by the Derivative Works, if and
	wherever such third-party notices normally appear. The contents
	of the NOTICE file are for informational purposes only and
	do not modify the License. You may add Your own attribution
	notices within Derivative Works that You distribute, alongside
	or as an addendum to the NOTICE text from the Work, provided
	that such additional attribution notices cannot be construed
	as modifying the License.
	
	You may add Your own copyright statement to Your modifications and
	may provide additional or different license terms and conditions
	for use, reproduction, or distribution of Your modifications, or
	for any such Derivative Works as a whole, provided Your use,
	reproduction, and distribution of the Work otherwise complies with
	the conditions stated in this License.
	
	5. Submission of Contributions. Unless You explicitly state otherwise,
	any Contribution intentionally submitted for inclusion in the Work
	by You to the Licensor shall be under the terms and conditions of
	this License, without any additional terms or conditions.
	Notwithstanding the above, nothing herein shall supersede or modify
	the terms of any separate license agreement you may have executed
	with Licensor regarding such Contributions.
	
	6. Trademarks. This License does not grant permission to use the trade
	names, trademarks, service marks, or product names of the Licensor,
	except as required for reasonable and customary use in describing the
	origin of the Work and reproducing the content of the NOTICE file.
	
	7. Disclaimer of Warranty. Unless required by applicable law or
	agreed to in writing, Licensor provides the Work (and each
	Contributor provides its Contributions) on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
	implied, including, without limitation, any warranties or conditions
	of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
	PARTICULAR PURPOSE. You are solely responsible for determining the
	appropriateness of using or redistributing the Work and assume any
	risks associated with Your exercise of permissions under this License.
	
	8. Limitation of Liability. In no event and under no legal theory,
	whether in tort (including negligence), contract, or otherwise,
	unless required by applicable law (such as deliberate and grossly
	negligent acts) or agreed to in writing, shall any Contributor be
	liable to You for damages, including any direct, indirect, special,
	incidental, or consequential damages of any character arising as a
	result of this License or out of the use or inability to use the
	Work (including but not limited to damages for loss of goodwill,
	work stoppage, computer failure or malfunction, or any and all
	other commercial damages or losses), even if such Contributor
	has been advised of the possibility of such damages.
	
	9. Accepting Warranty or Additional Liability. While redistributing
	the Work or Derivative Works thereof, You may choose to offer,
	and charge a fee for, acceptance of support, warranty, indemnity,
	or other liability obligations and/or rights consistent with this
	License. However, in accepting such obligations, You may act only
	on Your own behalf and on Your sole responsibility, not on behalf
	of any other Contributor, and only if You agree to indemnify,
	defend, and hold each Contributor harmless for any liability
	incurred by, or claims asserted against, such Contributor by reason
	of your accepting any such warranty or additional liability.
	
	END OF TERMS AND CONDITIONS
	
	APPENDIX: How to apply the Apache License to your work.
	
	To apply the Apache License to your work, attach the following
	boilerplate notice, with the fields enclosed by brackets "{}"
	replaced with your own identifying information. (Don't include
	the brackets!)  The text should be enclosed in the appropriate
	comment syntax for the file format. We also recommend that a
	file or class name and description of purpose be included on the
	same "printed page" as the copyright notice for easier
	identification within third-party archives.
	
	Copyright (C) 2013-present   SheetJS LLC
	
	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at
	
	http://www.apache.org/licenses/LICENSE-2.0
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
	
	*/
	var M = Math;
	function _horner(arr, v) {
		for (var i = 0, z = 0; i < arr.length; ++i) z = v * z + arr[i];
		return z;
	}
	function _bessel_iter(x, n, f0, f1, sign) {
		if (n === 0) return f0;
		if (n === 1) return f1;
		var tdx = 2 / x, f2 = f1;
		for (var o = 1; o < n; ++o) {
			f2 = f1 * o * tdx + sign * f0;
			f0 = f1;
			f1 = f2;
		}
		return f2;
	}
	function _bessel_wrap(bessel0, bessel1, name, nonzero, sign) {
		return function bessel(x, n) {
			if (nonzero) {
				if (x === 0) return nonzero == 1 ? -Infinity : Infinity;
				else if (x < 0) return NaN;
			}
			if (n === 0) return bessel0(x);
			if (n === 1) return bessel1(x);
			if (n < 0) return NaN;
			n |= 0;
			var b0 = bessel0(x), b1 = bessel1(x);
			return _bessel_iter(x, n, b0, b1, sign);
		};
	}
	var besselj = function() {
		var W = .636619772;
		var b0_a1a = [
			57568490574,
			-13362590354,
			651619640.7,
			-11214424.18,
			77392.33017,
			-184.9052456
		].reverse();
		var b0_a2a = [
			57568490411,
			1029532985,
			9494680.718,
			59272.64853,
			267.8532712,
			1
		].reverse();
		var b0_a1b = [
			1,
			-.001098628627,
			2734510407e-14,
			-2073370639e-15,
			2.093887211e-7
		].reverse();
		var b0_a2b = [
			-.01562499995,
			.0001430488765,
			-6911147651e-15,
			7.621095161e-7,
			-9.34935152e-8
		].reverse();
		function bessel0(x) {
			var a = 0, a1 = 0, a2 = 0, y = x * x;
			if (x < 8) {
				a1 = _horner(b0_a1a, y);
				a2 = _horner(b0_a2a, y);
				a = a1 / a2;
			} else {
				var xx = x - .785398164;
				y = 64 / y;
				a1 = _horner(b0_a1b, y);
				a2 = _horner(b0_a2b, y);
				a = M.sqrt(W / x) * (M.cos(xx) * a1 - M.sin(xx) * a2 * 8 / x);
			}
			return a;
		}
		var b1_a1a = [
			72362614232,
			-7895059235,
			242396853.1,
			-2972611.439,
			15704.4826,
			-30.16036606
		].reverse();
		var b1_a2a = [
			144725228442,
			2300535178,
			18583304.74,
			99447.43394,
			376.9991397,
			1
		].reverse();
		var b1_a1b = [
			1,
			.00183105,
			-3516396496e-14,
			2457520174e-15,
			-2.40337019e-7
		].reverse();
		var b1_a2b = [
			.04687499995,
			-.0002002690873,
			8449199096e-15,
			-8.8228987e-7,
			1.05787412e-7
		].reverse();
		function bessel1(x) {
			var a = 0, a1 = 0, a2 = 0, y = x * x, xx = M.abs(x) - 2.356194491;
			if (Math.abs(x) < 8) {
				a1 = x * _horner(b1_a1a, y);
				a2 = _horner(b1_a2a, y);
				a = a1 / a2;
			} else {
				y = 64 / y;
				a1 = _horner(b1_a1b, y);
				a2 = _horner(b1_a2b, y);
				a = M.sqrt(W / M.abs(x)) * (M.cos(xx) * a1 - M.sin(xx) * a2 * 8 / M.abs(x));
				if (x < 0) a = -a;
			}
			return a;
		}
		return function besselj(x, n) {
			n = Math.round(n);
			if (!isFinite(x)) return isNaN(x) ? x : 0;
			if (n < 0) return (n % 2 ? -1 : 1) * besselj(x, -n);
			if (x < 0) return (n % 2 ? -1 : 1) * besselj(-x, n);
			if (n === 0) return bessel0(x);
			if (n === 1) return bessel1(x);
			if (x === 0) return 0;
			var ret = 0;
			if (x > n) ret = _bessel_iter(x, n, bessel0(x), bessel1(x), -1);
			else {
				var m = 2 * M.floor((n + M.floor(M.sqrt(40 * n))) / 2);
				var jsum = false;
				var bjp = 0, sum = 0;
				var bj = 1, bjm = 0;
				var tox = 2 / x;
				for (var j = m; j > 0; j--) {
					bjm = j * tox * bj - bjp;
					bjp = bj;
					bj = bjm;
					if (M.abs(bj) > 1e10) {
						bj *= 1e-10;
						bjp *= 1e-10;
						ret *= 1e-10;
						sum *= 1e-10;
					}
					if (jsum) sum += bj;
					jsum = !jsum;
					if (j == n) ret = bjp;
				}
				sum = 2 * sum - bj;
				ret /= sum;
			}
			return ret;
		};
	}();
	var bessely = function() {
		var W = .636619772;
		var b0_a1a = [
			-2957821389,
			7062834065,
			-512359803.6,
			10879881.29,
			-86327.92757,
			228.4622733
		].reverse();
		var b0_a2a = [
			40076544269,
			745249964.8,
			7189466.438,
			47447.2647,
			226.1030244,
			1
		].reverse();
		var b0_a1b = [
			1,
			-.001098628627,
			2734510407e-14,
			-2073370639e-15,
			2.093887211e-7
		].reverse();
		var b0_a2b = [
			-.01562499995,
			.0001430488765,
			-6911147651e-15,
			7.621095161e-7,
			-9.34945152e-8
		].reverse();
		function bessel0(x) {
			var a = 0, a1 = 0, a2 = 0, y = x * x, xx = x - .785398164;
			if (x < 8) {
				a1 = _horner(b0_a1a, y);
				a2 = _horner(b0_a2a, y);
				a = a1 / a2 + W * besselj(x, 0) * M.log(x);
			} else {
				y = 64 / y;
				a1 = _horner(b0_a1b, y);
				a2 = _horner(b0_a2b, y);
				a = M.sqrt(W / x) * (M.sin(xx) * a1 + M.cos(xx) * a2 * 8 / x);
			}
			return a;
		}
		var b1_a1a = [
			-4900604943e3,
			127527439e4,
			-51534381390,
			734926455.1,
			-4237922.726,
			8511.937935
		].reverse();
		var b1_a2a = [
			249958057e5,
			424441966400,
			3733650367,
			22459040.02,
			102042.605,
			354.9632885,
			1
		].reverse();
		var b1_a1b = [
			1,
			.00183105,
			-3516396496e-14,
			2457520174e-15,
			-2.40337019e-7
		].reverse();
		var b1_a2b = [
			.04687499995,
			-.0002002690873,
			8449199096e-15,
			-8.8228987e-7,
			1.05787412e-7
		].reverse();
		function bessel1(x) {
			var a = 0, a1 = 0, a2 = 0, y = x * x, xx = x - 2.356194491;
			if (x < 8) {
				a1 = x * _horner(b1_a1a, y);
				a2 = _horner(b1_a2a, y);
				a = a1 / a2 + W * (besselj(x, 1) * M.log(x) - 1 / x);
			} else {
				y = 64 / y;
				a1 = _horner(b1_a1b, y);
				a2 = _horner(b1_a2b, y);
				a = M.sqrt(W / x) * (M.sin(xx) * a1 + M.cos(xx) * a2 * 8 / x);
			}
			return a;
		}
		return _bessel_wrap(bessel0, bessel1, "BESSELY", 1, -1);
	}();
	var besseli = function() {
		var b0_a = [
			1,
			3.5156229,
			3.0899424,
			1.2067492,
			.2659732,
			.0360768,
			.0045813
		].reverse();
		var b0_b = [
			.39894228,
			.01328592,
			.00225319,
			-.00157565,
			.00916281,
			-.02057706,
			.02635537,
			-.01647633,
			.00392377
		].reverse();
		function bessel0(x) {
			if (x <= 3.75) return _horner(b0_a, x * x / (3.75 * 3.75));
			return M.exp(M.abs(x)) / M.sqrt(M.abs(x)) * _horner(b0_b, 3.75 / M.abs(x));
		}
		var b1_a = [
			.5,
			.87890594,
			.51498869,
			.15084934,
			.02658733,
			.00301532,
			32411e-8
		].reverse();
		var b1_b = [
			.39894228,
			-.03988024,
			-.00362018,
			.00163801,
			-.01031555,
			.02282967,
			-.02895312,
			.01787654,
			-.00420059
		].reverse();
		function bessel1(x) {
			if (x < 3.75) return x * _horner(b1_a, x * x / (3.75 * 3.75));
			return (x < 0 ? -1 : 1) * M.exp(M.abs(x)) / M.sqrt(M.abs(x)) * _horner(b1_b, 3.75 / M.abs(x));
		}
		return function besseli(x, n) {
			n = Math.round(n);
			if (n === 0) return bessel0(x);
			if (n === 1) return bessel1(x);
			if (n < 0) return NaN;
			if (M.abs(x) === 0) return 0;
			if (x == Infinity) return Infinity;
			var ret = 0, j, tox = 2 / M.abs(x), bip = 0, bi = 1, bim = 0;
			for (j = 2 * M.round((n + M.round(M.sqrt(40 * n))) / 2); j > 0; j--) {
				bim = j * tox * bi + bip;
				bip = bi;
				bi = bim;
				if (M.abs(bi) > 1e10) {
					bi *= 1e-10;
					bip *= 1e-10;
					ret *= 1e-10;
				}
				if (j == n) ret = bip;
			}
			ret *= besseli(x, 0) / bi;
			return x < 0 && n % 2 ? -ret : ret;
		};
	}();
	var besselk = function() {
		var b0_a = [
			-.57721566,
			.4227842,
			.23069756,
			.0348859,
			.00262698,
			1075e-7,
			74e-7
		].reverse();
		var b0_b = [
			1.25331414,
			-.07832358,
			.02189568,
			-.01062446,
			.00587872,
			-.0025154,
			53208e-8
		].reverse();
		function bessel0(x) {
			if (x <= 2) return -M.log(x / 2) * besseli(x, 0) + _horner(b0_a, x * x / 4);
			return M.exp(-x) / M.sqrt(x) * _horner(b0_b, 2 / x);
		}
		var b1_a = [
			1,
			.15443144,
			-.67278579,
			-.18156897,
			-.01919402,
			-.00110404,
			-4686e-8
		].reverse();
		var b1_b = [
			1.25331414,
			.23498619,
			-.0365562,
			.01504268,
			-.00780353,
			.00325614,
			-68245e-8
		].reverse();
		function bessel1(x) {
			if (x <= 2) return M.log(x / 2) * besseli(x, 1) + 1 / x * _horner(b1_a, x * x / 4);
			return M.exp(-x) / M.sqrt(x) * _horner(b1_b, 2 / x);
		}
		return _bessel_wrap(bessel0, bessel1, "BESSELK", 2, 1);
	}();
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/3rdparty/jstat/jstat.mjs
	/**
	* @license
	Copyright (c) 2013 jStat
	
	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:
	
	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.
	
	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
	*/
	function erf(x) {
		const cof = [
			-1.3026537197817094,
			.6419697923564902,
			.019476473204185836,
			-.00956151478680863,
			-.000946595344482036,
			.000366839497852761,
			42523324806907e-18,
			-20278578112534e-18,
			-1624290004647e-18,
			130365583558e-17,
			1.5626441722e-8,
			-8.5238095915e-8,
			6.529054439e-9,
			5.059343495e-9,
			-991364156e-18,
			-227365122e-18,
			96467911e-18,
			2394038e-18,
			-6886027e-18,
			894487e-18,
			313092e-18,
			-112708e-18,
			381e-18,
			7106e-18,
			-1523e-18,
			-94e-18,
			121e-18,
			-28e-18
		];
		let j = cof.length - 1;
		let isneg = false;
		let d = 0;
		let dd = 0;
		let t, ty, tmp, res;
		if (x === 0) return 0;
		if (x < 0) {
			x = -x;
			isneg = true;
		}
		t = 2 / (2 + x);
		ty = 4 * t - 2;
		for (; j > 0; j--) {
			tmp = d;
			d = ty * d - dd + cof[j];
			dd = tmp;
		}
		res = t * Math.exp(-x * x + .5 * (cof[0] + ty * d) - dd);
		return isneg ? res - 1 : 1 - res;
	}
	function erfc(x) {
		return 1 - erf(x);
	}
	function erfcinv(p) {
		let j = 0;
		let x, err, t, pp;
		if (p >= 2) return -100;
		if (p <= 0) return 100;
		pp = p < 1 ? p : 2 - p;
		t = Math.sqrt(-2 * Math.log(pp / 2));
		x = -.70711 * ((2.30753 + t * .27061) / (1 + t * (.99229 + t * .04481)) - t);
		for (; j < 2; j++) {
			err = erfc(x) - pp;
			x += err / (1.1283791670955126 * Math.exp(-x * x) - x * err);
		}
		return p < 1 ? x : -x;
	}
	var exponential = {
		pdf: (x, rate) => {
			return x < 0 ? 0 : rate * Math.exp(-rate * x);
		},
		cdf: (x, rate) => {
			return x < 0 ? 0 : 1 - Math.exp(-rate * x);
		}
	};
	function gammafn(x) {
		const p = [
			-1.716185138865495,
			24.76565080557592,
			-379.80425647094563,
			629.3311553128184,
			866.9662027904133,
			-31451.272968848367,
			-36144.413418691176,
			66456.14382024054
		];
		const q = [
			-30.8402300119739,
			315.35062697960416,
			-1015.1563674902192,
			-3107.771671572311,
			22538.11842098015,
			4755.846277527881,
			-134659.9598649693,
			-115132.2596755535
		];
		let fact = false;
		let n = 0;
		let xden = 0;
		let xnum = 0;
		let y = x;
		let i, z, yi, res;
		if (x > 171.6243769536076) return Infinity;
		if (y <= 0) {
			res = y % 1;
			if (res) {
				fact = (!(y & 1) ? 1 : -1) * Math.PI / Math.sin(Math.PI * res);
				y = 1 - y;
			} else return Infinity;
		}
		yi = y;
		if (y < 1) z = y++;
		else z = (y -= n = (y | 0) - 1) - 1;
		for (i = 0; i < 8; ++i) {
			xnum = (xnum + p[i]) * z;
			xden = xden * z + q[i];
		}
		res = xnum / xden + 1;
		if (yi < y) res /= yi;
		else if (yi > y) for (i = 0; i < n; ++i) {
			res *= y;
			y++;
		}
		if (fact) res = fact / res;
		return res;
	}
	var gamma = {
		pdf: function pdf(x, shape, scale) {
			if (x < 0) return 0;
			return x === 0 && shape === 1 ? 1 / scale : Math.exp((shape - 1) * Math.log(x) - x / scale - gammaln(shape) - shape * Math.log(scale));
		},
		cdf: function cdf(x, shape, scale) {
			if (x < 0) return 0;
			return lowRegGamma(shape, x / scale);
		},
		inv: function(p, shape, scale) {
			return gammapinv(p, shape) * scale;
		}
	};
	function gammaln(x) {
		let j = 0;
		const cof = [
			76.18009172947146,
			-86.50532032941678,
			24.01409824083091,
			-1.231739572450155,
			.001208650973866179,
			-5395239384953e-18
		];
		let ser = 1.000000000190015;
		let xx, y, tmp;
		tmp = (y = xx = x) + 5.5;
		tmp -= (xx + .5) * Math.log(tmp);
		for (; j < 6; j++) ser += cof[j] / ++y;
		return Math.log(2.5066282746310007 * ser / xx) - tmp;
	}
	function lowRegGamma(a, x) {
		const aln = gammaln(a);
		let ap = a;
		let sum = 1 / a;
		let del = sum;
		let b = x + 1 - a;
		let c = 1 / 1e-30;
		let d = 1 / b;
		let h = d;
		let i = 1;
		const ITMAX = -~(Math.log(a >= 1 ? a : 1 / a) * 8.5 + a * .4 + 17);
		let an;
		if (x < 0 || a <= 0) return NaN;
		else if (x < a + 1) {
			for (; i <= ITMAX; i++) sum += del *= x / ++ap;
			return sum * Math.exp(-x + a * Math.log(x) - aln);
		}
		for (; i <= ITMAX; i++) {
			an = -i * (i - a);
			b += 2;
			d = an * d + b;
			c = b + an / c;
			d = 1 / d;
			h *= d * c;
		}
		return 1 - h * Math.exp(-x + a * Math.log(x) - aln);
	}
	function gammapinv(p, a) {
		let j = 0;
		const a1 = a - 1;
		const EPS = 1e-8;
		const gln = gammaln(a);
		let x, err, t, u, pp;
		let lna1;
		let afac;
		if (p >= 1) return Math.max(100, a + 100 * Math.sqrt(a));
		if (p <= 0) return 0;
		if (a > 1) {
			lna1 = Math.log(a1);
			afac = Math.exp(a1 * (lna1 - 1) - gln);
			pp = p < .5 ? p : 1 - p;
			t = Math.sqrt(-2 * Math.log(pp));
			x = (2.30753 + t * .27061) / (1 + t * (.99229 + t * .04481)) - t;
			if (p < .5) x = -x;
			x = Math.max(.001, a * Math.pow(1 - 1 / (9 * a) - x / (3 * Math.sqrt(a)), 3));
		} else {
			t = 1 - a * (.253 + a * .12);
			if (p < t) x = Math.pow(p / t, 1 / a);
			else x = 1 - Math.log(1 - (p - t) / (1 - t));
		}
		for (; j < 12; j++) {
			if (x <= 0) return 0;
			err = lowRegGamma(a, x) - p;
			if (a > 1) t = afac * Math.exp(-(x - a1) + a1 * (Math.log(x) - lna1));
			else t = Math.exp(-x + a1 * Math.log(x) - gln);
			u = err / t;
			x -= t = u / (1 - .5 * Math.min(1, u * ((a - 1) / x - 1)));
			if (x <= 0) x = .5 * (x + t);
			if (Math.abs(t) < EPS * x) break;
		}
		return x;
	}
	var normal = {
		pdf: function pdf(x, mean, std) {
			return Math.exp(-.5 * Math.log(2 * Math.PI) - Math.log(std) - Math.pow(x - mean, 2) / (2 * std * std));
		},
		cdf: function cdf(x, mean, std) {
			return .5 * (1 + erf((x - mean) / Math.sqrt(2 * std * std)));
		},
		inv: function(p, mean, std) {
			return -1.4142135623730951 * std * erfcinv(2 * p) + mean;
		}
	};
	var beta = {
		pdf: function pdf(x, alpha, beta) {
			if (x > 1 || x < 0) return 0;
			if (alpha == 1 && beta == 1) return 1;
			if (alpha < 512 && beta < 512) return Math.pow(x, alpha - 1) * Math.pow(1 - x, beta - 1) / betafn(alpha, beta);
			else return Math.exp((alpha - 1) * Math.log(x) + (beta - 1) * Math.log(1 - x) - betaln(alpha, beta));
		},
		cdf: function cdf(x, alpha, beta) {
			return x > 1 || x < 0 ? +(x > 1) : ibeta(x, alpha, beta);
		},
		inv: function inv(x, alpha, beta) {
			return ibetainv(x, alpha, beta);
		}
	};
	function betafn(x, y) {
		if (x <= 0 || y <= 0) return;
		return x + y > 170 ? Math.exp(betaln(x, y)) : gammafn(x) * gammafn(y) / gammafn(x + y);
	}
	function betaln(x, y) {
		return gammaln(x) + gammaln(y) - gammaln(x + y);
	}
	function ibetainv(p, a, b) {
		var EPS = 1e-8;
		var a1 = a - 1;
		var b1 = b - 1;
		var j = 0;
		var lna, lnb, pp, t, u, err, x, al, h, w, afac;
		if (p <= 0) return 0;
		if (p >= 1) return 1;
		if (a >= 1 && b >= 1) {
			pp = p < .5 ? p : 1 - p;
			t = Math.sqrt(-2 * Math.log(pp));
			x = (2.30753 + t * .27061) / (1 + t * (.99229 + t * .04481)) - t;
			if (p < .5) x = -x;
			al = (x * x - 3) / 6;
			h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));
			w = x * Math.sqrt(al + h) / h - (1 / (2 * b - 1) - 1 / (2 * a - 1)) * (al + 5 / 6 - 2 / (3 * h));
			x = a / (a + b * Math.exp(2 * w));
		} else {
			lna = Math.log(a / (a + b));
			lnb = Math.log(b / (a + b));
			t = Math.exp(a * lna) / a;
			u = Math.exp(b * lnb) / b;
			w = t + u;
			if (p < t / w) x = Math.pow(a * w * p, 1 / a);
			else x = 1 - Math.pow(b * w * (1 - p), 1 / b);
		}
		afac = -gammaln(a) - gammaln(b) + gammaln(a + b);
		for (; j < 10; j++) {
			if (x === 0 || x === 1) return x;
			err = ibeta(x, a, b) - p;
			t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1 - x) + afac);
			u = err / t;
			x -= t = u / (1 - .5 * Math.min(1, u * (a1 / x - b1 / (1 - x))));
			if (x <= 0) x = .5 * (x + t);
			if (x >= 1) x = .5 * (x + t + 1);
			if (Math.abs(t) < EPS * x && j > 0) break;
		}
		return x;
	}
	function ibeta(x, a, b) {
		var bt = x === 0 || x === 1 ? 0 : Math.exp(gammaln(a + b) - gammaln(a) - gammaln(b) + a * Math.log(x) + b * Math.log(1 - x));
		if (x < 0 || x > 1) return false;
		if (x < (a + 1) / (a + b + 2)) return bt * betacf(x, a, b) / a;
		return 1 - bt * betacf(1 - x, b, a) / b;
	}
	function betacf(x, a, b) {
		var fpmin = 1e-30;
		var m = 1;
		var qab = a + b;
		var qap = a + 1;
		var qam = a - 1;
		var c = 1;
		var d = 1 - qab * x / qap;
		var m2, aa, del, h;
		if (Math.abs(d) < fpmin) d = fpmin;
		d = 1 / d;
		h = d;
		for (; m <= 100; m++) {
			m2 = 2 * m;
			aa = m * (b - m) * x / ((qam + m2) * (a + m2));
			d = 1 + aa * d;
			if (Math.abs(d) < fpmin) d = fpmin;
			c = 1 + aa / c;
			if (Math.abs(c) < fpmin) c = fpmin;
			d = 1 / d;
			h *= d * c;
			aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));
			d = 1 + aa * d;
			if (Math.abs(d) < fpmin) d = fpmin;
			c = 1 + aa / c;
			if (Math.abs(c) < fpmin) c = fpmin;
			d = 1 / d;
			del = d * c;
			h *= del;
			if (Math.abs(del - 1) < 3e-7) break;
		}
		return h;
	}
	var binomial = {
		pdf: function(k, n, p) {
			return p === 0 || p === 1 ? n * p === k ? 1 : 0 : combination(n, k) * Math.pow(p, k) * Math.pow(1 - p, n - k);
		},
		cdf: function(x, n, p) {
			var betacdf;
			var eps = 1e-10;
			if (x < 0) return 0;
			if (x >= n) return 1;
			if (p < 0 || p > 1 || n <= 0) return NaN;
			x = Math.floor(x);
			var z = p;
			var a = x + 1;
			var b = n - x;
			var s = a + b;
			var bt = Math.exp(gammaln(s) - gammaln(b) - gammaln(a) + a * Math.log(z) + b * Math.log(1 - z));
			if (z < (a + 1) / (s + 2)) betacdf = bt * betinc(z, a, b, eps);
			else betacdf = 1 - bt * betinc(1 - z, b, a, eps);
			return Math.round((1 - betacdf) * (1 / eps)) / (1 / eps);
		}
	};
	function betinc(x, a, b, eps) {
		var a0 = 0;
		var b0 = 1;
		var a1 = 1;
		var b1 = 1;
		var m9 = 0;
		var a2 = 0;
		var c9;
		while (Math.abs((a1 - a2) / a1) > eps) {
			a2 = a1;
			c9 = -(a + m9) * (a + b + m9) * x / (a + 2 * m9) / (a + 2 * m9 + 1);
			a0 = a1 + c9 * a0;
			b0 = b1 + c9 * b0;
			m9 = m9 + 1;
			c9 = m9 * (b - m9) * x / (a + 2 * m9 - 1) / (a + 2 * m9);
			a1 = a0 + c9 * a1;
			b1 = b0 + c9 * b1;
			a0 = a0 / b1;
			b0 = b0 / b1;
			a1 = a1 / b1;
			b1 = 1;
		}
		return a1 / a;
	}
	function combination(n, m) {
		return n > 170 || m > 170 ? Math.exp(combinationln(n, m)) : factorial(n) / factorial(m) / factorial(n - m);
	}
	function combinationln(n, m) {
		return factorialln(n) - factorialln(m) - factorialln(n - m);
	}
	function factorialln(n) {
		return n < 0 ? NaN : gammaln(n + 1);
	}
	function factorial(n) {
		return n < 0 ? NaN : gammafn(n + 1);
	}
	var chisquare = {
		pdf: function pdf(x, dof) {
			if (x < 0) return 0;
			return x === 0 && dof === 2 ? .5 : Math.exp((dof / 2 - 1) * Math.log(x) - x / 2 - dof / 2 * Math.log(2) - gammaln(dof / 2));
		},
		cdf: function cdf(x, dof) {
			if (x < 0) return 0;
			return lowRegGamma(dof / 2, x / 2);
		},
		inv: function(p, dof) {
			return 2 * gammapinv(p, .5 * dof);
		}
	};
	var centralF = {
		pdf: function pdf(x, df1, df2) {
			var p, q, f;
			if (x < 0) return 0;
			if (df1 <= 2) {
				if (x === 0 && df1 < 2) return Infinity;
				if (x === 0 && df1 === 2) return 1;
				return 1 / betafn(df1 / 2, df2 / 2) * Math.pow(df1 / df2, df1 / 2) * Math.pow(x, df1 / 2 - 1) * Math.pow(1 + df1 / df2 * x, -(df1 + df2) / 2);
			}
			p = df1 * x / (df2 + x * df1);
			q = df2 / (df2 + x * df1);
			f = df1 * q / 2;
			return f * binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);
		},
		cdf: function cdf(x, df1, df2) {
			if (x < 0) return 0;
			return ibeta(df1 * x / (df1 * x + df2), df1 / 2, df2 / 2);
		},
		inv: function inv(x, df1, df2) {
			return df2 / (df1 * (1 / ibetainv(x, df1 / 2, df2 / 2) - 1));
		}
	};
	var weibull = {
		pdf: function pdf(x, scale, shape) {
			if (x < 0 || scale < 0 || shape < 0) return 0;
			return shape / scale * Math.pow(x / scale, shape - 1) * Math.exp(-Math.pow(x / scale, shape));
		},
		cdf: function cdf(x, scale, shape) {
			return x < 0 ? 0 : 1 - Math.exp(-Math.pow(x / scale, shape));
		}
	};
	var poisson = {
		pdf: function pdf(k, l) {
			if (l < 0 || k % 1 !== 0 || k < 0) return 0;
			return Math.pow(l, k) * Math.exp(-l) / factorial(k);
		},
		cdf: function cdf(x, l) {
			var k = 0;
			if (x < 0) return 0;
			var sum = 0;
			for (; k <= x; k++) sum += poisson.pdf(k, l);
			return sum;
		}
	};
	var hypgeom = {
		pdf: function pdf(k, N, m, n) {
			if (k < 0 || k < m - (N - n)) return 0;
			else if (k > n || k > m) return 0;
			else if (m * 2 > N) if (n * 2 > N) return hypgeom.pdf(N - m - n + k, N, N - m, N - n);
			else return hypgeom.pdf(n - k, N, N - m, n);
			else if (n * 2 > N) return hypgeom.pdf(m - k, N, m, N - n);
			else if (m < n) return hypgeom.pdf(k, N, n, m);
			else {
				var scaledPDF = 1;
				var samplesDone = 0;
				for (var i = 0; i < k; i++) {
					while (scaledPDF > 1 && samplesDone < n) {
						scaledPDF *= 1 - m / (N - samplesDone);
						samplesDone++;
					}
					scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));
				}
				for (; samplesDone < n; samplesDone++) scaledPDF *= 1 - m / (N - samplesDone);
				return Math.min(1, Math.max(0, scaledPDF));
			}
		},
		cdf: function cdf(x, N, m, n) {
			if (x < 0 || x < m - (N - n)) return 0;
			else if (x >= n || x >= m) return 1;
			else if (m * 2 > N) if (n * 2 > N) return cdf(N - m - n + x, N, N - m, N - n);
			else return 1 - hypgeom.cdf(n - x - 1, N, N - m, n);
			else if (n * 2 > N) return 1 - hypgeom.cdf(m - x - 1, N, m, N - n);
			else if (m < n) return hypgeom.cdf(x, N, n, m);
			else {
				var scaledCDF = 1;
				var scaledPDF = 1;
				var samplesDone = 0;
				for (var i = 0; i < x; i++) {
					while (scaledCDF > 1 && samplesDone < n) {
						var factor = 1 - m / (N - samplesDone);
						scaledPDF *= factor;
						scaledCDF *= factor;
						samplesDone++;
					}
					scaledPDF *= (n - i) * (m - i) / ((i + 1) * (N - m - n + i + 1));
					scaledCDF += scaledPDF;
				}
				for (; samplesDone < n; samplesDone++) scaledCDF *= 1 - m / (N - samplesDone);
				return Math.min(1, Math.max(0, scaledCDF));
			}
		}
	};
	var studentt = {
		pdf: function pdf(x, dof) {
			dof = dof > 1e100 ? 1e100 : dof;
			return 1 / (Math.sqrt(dof) * betafn(.5, dof / 2)) * Math.pow(1 + x * x / dof, -((dof + 1) / 2));
		},
		cdf: function cdf(x, dof) {
			var dof2 = dof / 2;
			return ibeta((x + Math.sqrt(x * x + dof)) / (2 * Math.sqrt(x * x + dof)), dof2, dof2);
		},
		inv: function(p, dof) {
			var x = ibetainv(2 * Math.min(p, 1 - p), .5 * dof, .5);
			x = Math.sqrt(dof * (1 - x) / x);
			return p > .5 ? x : -x;
		}
	};
	var lognormal = {
		pdf: function pdf(x, mu, sigma) {
			if (x <= 0) return 0;
			return Math.exp(-Math.log(x) - .5 * Math.log(2 * Math.PI) - Math.log(sigma) - Math.pow(Math.log(x) - mu, 2) / (2 * sigma * sigma));
		},
		cdf: function cdf(x, mu, sigma) {
			if (x < 0) return 0;
			return .5 + .5 * erf((Math.log(x) - mu) / Math.sqrt(2 * sigma * sigma));
		},
		inv: function(p, mu, sigma) {
			return Math.exp(-1.4142135623730951 * sigma * erfcinv(2 * p) + mu);
		}
	};
	var negbin = {
		pdf: function pdf(k, r, p) {
			if (k !== k >>> 0) return false;
			if (k < 0) return 0;
			return combination(k + r - 1, r - 1) * Math.pow(1 - p, k) * Math.pow(p, r);
		},
		cdf: function cdf(x, r, p) {
			var sum = 0, k = 0;
			if (x < 0) return 0;
			for (; k <= x; k++) sum += negbin.pdf(k, r, p);
			return sum;
		}
	};
	function sum(arr) {
		var sum = 0;
		var i = arr.length;
		while (--i >= 0) sum += arr[i];
		return sum;
	}
	function mean(arr) {
		return sum(arr) / arr.length;
	}
	function sumsqerr(arr) {
		var meanv = mean(arr);
		var sum = 0;
		var i = arr.length;
		var tmp;
		while (--i >= 0) {
			tmp = arr[i] - meanv;
			sum += tmp * tmp;
		}
		return sum;
	}
	function variance(arr, flag) {
		return sumsqerr(arr) / (arr.length - (flag ? 1 : 0));
	}
	function stdev(arr, flag) {
		return Math.sqrt(variance(arr, flag));
	}
	function normalci() {
		var args = [].slice.call(arguments), ans = new Array(2), change;
		if (args.length === 4) change = Math.abs(normal.inv(args[1] / 2, 0, 1) * args[2] / Math.sqrt(args[3]));
		else change = Math.abs(normal.inv(args[1] / 2, 0, 1) * stdev(args[2]) / Math.sqrt(args[2].length));
		ans[0] = args[0] - change;
		ans[1] = args[0] + change;
		return ans;
	}
	function tci() {
		var args = [].slice.call(arguments), ans = new Array(2), change;
		if (args.length === 4) change = Math.abs(studentt.inv(args[1] / 2, args[3] - 1) * args[2] / Math.sqrt(args[3]));
		else change = Math.abs(studentt.inv(args[1] / 2, args[2].length - 1) * stdev(args[2], true) / Math.sqrt(args[2].length));
		ans[0] = args[0] - change;
		ans[1] = args[0] + change;
		return ans;
	}
	function product(arr) {
		var prod = 1;
		var i = arr.length;
		while (--i >= 0) prod *= arr[i];
		return prod;
	}
	function geomean(arr) {
		return Math.pow(product(arr), 1 / arr.length);
	}
	function covariance(arr1, arr2) {
		var u = mean(arr1);
		var v = mean(arr2);
		var arr1Len = arr1.length;
		var sq_dev = new Array(arr1Len);
		var i;
		for (i = 0; i < arr1Len; i++) sq_dev[i] = (arr1[i] - u) * (arr2[i] - v);
		return sum(sq_dev) / (arr1Len - 1);
	}
	function corrcoeff(arr1, arr2) {
		return covariance(arr1, arr2) / stdev(arr1, 1) / stdev(arr2, 1);
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/StatisticalPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var StatisticalPlugin = class extends FunctionPlugin {
		erf(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ERF"), (lowerBound, upperBound) => {
				if (upperBound === void 0) return erf(lowerBound);
				else return erf(upperBound) - erf(lowerBound);
			});
		}
		erfc(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("ERFC"), erfc);
		}
		expondist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("EXPON.DIST"), (x, lambda, cumulative) => {
				if (cumulative) return exponential.cdf(x, lambda);
				else return exponential.pdf(x, lambda);
			});
		}
		fisher(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FISHER"), (x) => Math.log((1 + x) / (1 - x)) / 2);
		}
		fisherinv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FISHERINV"), (y) => 1 - 2 / (Math.exp(2 * y) + 1));
		}
		gamma(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GAMMA"), gammafn);
		}
		gammadist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GAMMA.DIST"), (value, alphaVal, betaVal, cumulative) => {
				if (cumulative) return gamma.cdf(value, alphaVal, betaVal);
				else return gamma.pdf(value, alphaVal, betaVal);
			});
		}
		gammaln(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GAMMALN"), gammaln);
		}
		gammainv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GAMMA.INV"), gamma.inv);
		}
		gauss(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GAUSS"), (z) => normal.cdf(z, 0, 1) - .5);
		}
		betadist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BETA.DIST"), (x, alphaVal, betaVal, cumulative, A, B) => {
				if (x <= A) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
				else if (x >= B) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				x = (x - A) / (B - A);
				if (cumulative) return beta.cdf(x, alphaVal, betaVal);
				else return beta.pdf(x, alphaVal, betaVal);
			});
		}
		betainv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BETA.INV"), (x, alphaVal, betaVal, A, B) => {
				if (A >= B) return new CellError(ErrorType.NUM, ErrorMessage.WrongOrder);
				else return beta.inv(x, alphaVal, betaVal) * (B - A) + A;
			});
		}
		binomialdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BINOM.DIST"), (succ, trials, prob, cumulative) => {
				if (succ > trials) return new CellError(ErrorType.NUM, ErrorMessage.WrongOrder);
				succ = Math.trunc(succ);
				trials = Math.trunc(trials);
				if (cumulative) return binomial.cdf(succ, trials, prob);
				else return binomial.pdf(succ, trials, prob);
			});
		}
		binomialinv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BINOM.INV"), (trials, prob, alpha) => {
				trials = Math.trunc(trials);
				let lower = -1;
				let upper = trials;
				while (upper > lower + 1) {
					const mid = Math.trunc((lower + upper) / 2);
					if (binomial.cdf(mid, trials, prob) >= alpha) upper = mid;
					else lower = mid;
				}
				return upper;
			});
		}
		besselifn(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BESSELI"), (x, n) => besseli(x, Math.trunc(n)));
		}
		besseljfn(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BESSELJ"), (x, n) => besselj(x, Math.trunc(n)));
		}
		besselkfn(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BESSELK"), (x, n) => besselk(x, Math.trunc(n)));
		}
		besselyfn(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BESSELY"), (x, n) => bessely(x, Math.trunc(n)));
		}
		chisqdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHISQ.DIST"), (x, deg, cumulative) => {
				deg = Math.trunc(deg);
				if (cumulative) return chisquare.cdf(x, deg);
				else return chisquare.pdf(x, deg);
			});
		}
		chisqdistrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHISQ.DIST.RT"), (x, deg) => 1 - chisquare.cdf(x, Math.trunc(deg)));
		}
		chisqinv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHISQ.INV"), (p, deg) => chisquare.inv(p, Math.trunc(deg)));
		}
		chisqinvrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHISQ.INV.RT"), (p, deg) => chisquare.inv(1 - p, Math.trunc(deg)));
		}
		fdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("F.DIST"), (x, deg1, deg2, cumulative) => {
				deg1 = Math.trunc(deg1);
				deg2 = Math.trunc(deg2);
				if (cumulative) return centralF.cdf(x, deg1, deg2);
				else return centralF.pdf(x, deg1, deg2);
			});
		}
		fdistrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("F.DIST.RT"), (x, deg1, deg2) => 1 - centralF.cdf(x, Math.trunc(deg1), Math.trunc(deg2)));
		}
		finv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("F.INV"), (p, deg1, deg2) => centralF.inv(p, Math.trunc(deg1), Math.trunc(deg2)));
		}
		finvrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("F.INV.RT"), (p, deg1, deg2) => centralF.inv(1 - p, Math.trunc(deg1), Math.trunc(deg2)));
		}
		weibulldist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("WEIBULL.DIST"), (x, shape, scale, cumulative) => {
				if (cumulative) return weibull.cdf(x, scale, shape);
				else return weibull.pdf(x, scale, shape);
			});
		}
		poissondist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("POISSON.DIST"), (x, mean, cumulative) => {
				x = Math.trunc(x);
				if (cumulative) return poisson.cdf(x, mean);
				else return poisson.pdf(x, mean);
			});
		}
		hypgeomdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HYPGEOM.DIST"), (s, numberS, populationS, numberPop, cumulative) => {
				if (s > numberS || s > populationS || numberS > numberPop || populationS > numberPop) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				if (s + numberPop < populationS + numberS) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				s = Math.trunc(s);
				numberS = Math.trunc(numberS);
				populationS = Math.trunc(populationS);
				numberPop = Math.trunc(numberPop);
				if (cumulative) return hypgeom.cdf(s, numberPop, populationS, numberS);
				else return hypgeom.pdf(s, numberPop, populationS, numberS);
			});
		}
		tdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T.DIST"), (x, deg, cumulative) => {
				deg = Math.trunc(deg);
				if (cumulative) return studentt.cdf(x, deg);
				else return studentt.pdf(x, deg);
			});
		}
		tdist2t(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T.DIST.2T"), (x, deg) => (1 - studentt.cdf(x, Math.trunc(deg))) * 2);
		}
		tdistrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T.DIST.RT"), (x, deg) => 1 - studentt.cdf(x, Math.trunc(deg)));
		}
		tdistold(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("TDIST"), (x, deg, mode) => mode * (1 - studentt.cdf(x, Math.trunc(deg))));
		}
		tinv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T.INV"), (p, deg) => studentt.inv(p, Math.trunc(deg)));
		}
		tinv2t(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T.INV.2T"), (p, deg) => studentt.inv(1 - p / 2, Math.trunc(deg)));
		}
		lognormdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LOGNORM.DIST"), (x, mean, stddev, cumulative) => {
				if (cumulative) return lognormal.cdf(x, mean, stddev);
				else return lognormal.pdf(x, mean, stddev);
			});
		}
		lognorminv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LOGNORM.INV"), (p, mean, stddev) => lognormal.inv(p, mean, stddev));
		}
		normdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NORM.DIST"), (x, mean, stddev, cumulative) => {
				if (cumulative) return normal.cdf(x, mean, stddev);
				else return normal.pdf(x, mean, stddev);
			});
		}
		norminv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NORM.INV"), (p, mean, stddev) => normal.inv(p, mean, stddev));
		}
		normsdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NORM.S.DIST"), (x, cumulative) => {
				if (cumulative) return normal.cdf(x, 0, 1);
				else return normal.pdf(x, 0, 1);
			});
		}
		normsinv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NORM.S.INV"), (p) => normal.inv(p, 0, 1));
		}
		phi(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("PHI"), (x) => normal.pdf(x, 0, 1));
		}
		negbinomdist(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("NEGBINOM.DIST"), (nf, ns, p, cumulative) => {
				nf = Math.trunc(nf);
				ns = Math.trunc(ns);
				if (cumulative) return negbin.cdf(nf, ns, p);
				else return negbin.pdf(nf, ns, p);
			});
		}
		confidencenorm(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CONFIDENCE.NORM"), (alpha, stddev, size) => normalci(1, alpha, stddev, Math.trunc(size))[1] - 1);
		}
		confidencet(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CONFIDENCE.T"), (alpha, stddev, size) => {
				size = Math.trunc(size);
				if (size === 1) return new CellError(ErrorType.DIV_BY_ZERO);
				return tci(1, alpha, stddev, size)[1] - 1;
			});
		}
		standardize(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("STANDARDIZE"), (x, mean, stddev) => (x - mean) / stddev);
		}
	};
	StatisticalPlugin.implementedFunctions = {
		"ERF": {
			method: "erf",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true
			}]
		},
		"ERFC": {
			method: "erfc",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"EXPON.DIST": {
			method: "expondist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"FISHER": {
			method: "fisher",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				greaterThan: -1,
				lessThan: 1
			}]
		},
		"FISHERINV": {
			method: "fisherinv",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"GAMMA": {
			method: "gamma",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"GAMMA.DIST": {
			method: "gammadist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"GAMMALN": {
			method: "gammaln",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				greaterThan: 0
			}]
		},
		"GAMMA.INV": {
			method: "gammainv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0,
					lessThan: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			]
		},
		"GAUSS": {
			method: "gauss",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"BETA.DIST": {
			method: "betadist",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN },
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				}
			]
		},
		"BETA.INV": {
			method: "betainv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					maxValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					defaultValue: 1
				}
			]
		},
		"BINOM.DIST": {
			method: "binomialdist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0,
					maxValue: 1
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"BINOM.INV": {
			method: "binomialinv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0,
					maxValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					lessThan: 1
				}
			]
		},
		"BESSELI": {
			method: "besselifn",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"BESSELJ": {
			method: "besseljfn",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"BESSELK": {
			method: "besselkfn",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"BESSELY": {
			method: "besselyfn",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"CHISQ.DIST": {
			method: "chisqdist",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1,
					maxValue: 1e10
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"CHISQ.DIST.RT": {
			method: "chisqdistrt",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1,
				maxValue: 1e10
			}]
		},
		"CHISQ.INV": {
			method: "chisqinv",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0,
				maxValue: 1
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1,
				maxValue: 1e10
			}]
		},
		"CHISQ.INV.RT": {
			method: "chisqinvrt",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0,
				maxValue: 1
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		},
		"F.DIST": {
			method: "fdist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"F.DIST.RT": {
			method: "fdistrt",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				}
			]
		},
		"F.INV": {
			method: "finv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0,
					maxValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				}
			]
		},
		"F.INV.RT": {
			method: "finvrt",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0,
					maxValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				}
			]
		},
		"WEIBULL.DIST": {
			method: "weibulldist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"POISSON.DIST": {
			method: "poissondist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"HYPGEOM.DIST": {
			method: "hypgeomdist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"T.DIST": {
			method: "tdist",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"T.DIST.2T": {
			method: "tdist2t",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		},
		"T.DIST.RT": {
			method: "tdistrt",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		},
		"TDIST": {
			method: "tdistold",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1,
					maxValue: 2
				}
			]
		},
		"T.INV": {
			method: "tinv",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				greaterThan: 0,
				lessThan: 1
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		},
		"T.INV.2T": {
			method: "tinv2t",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				greaterThan: 0,
				maxValue: 1
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 1
			}]
		},
		"LOGNORM.DIST": {
			method: "lognormdist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"LOGNORM.INV": {
			method: "lognorminv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					lessThan: 1
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			]
		},
		"NORM.DIST": {
			method: "normdist",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"NORM.INV": {
			method: "norminv",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					lessThan: 1
				},
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			]
		},
		"NORM.S.DIST": {
			method: "normsdist",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.BOOLEAN }]
		},
		"NORM.S.INV": {
			method: "normsinv",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				greaterThan: 0,
				lessThan: 1
			}]
		},
		"PHI": {
			method: "phi",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"NEGBINOM.DIST": {
			method: "negbinomdist",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 0,
					maxValue: 1
				},
				{ argumentType: FunctionArgumentType.BOOLEAN }
			]
		},
		"CONFIDENCE.NORM": {
			method: "confidencenorm",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					lessThan: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				}
			]
		},
		"CONFIDENCE.T": {
			method: "confidencet",
			parameters: [
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0,
					lessThan: 1
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				},
				{
					argumentType: FunctionArgumentType.NUMBER,
					minValue: 1
				}
			]
		},
		"STANDARDIZE": {
			method: "standardize",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					greaterThan: 0
				}
			]
		}
	};
	StatisticalPlugin.aliases = {
		NEGBINOMDIST: "NEGBINOM.DIST",
		EXPONDIST: "EXPON.DIST",
		BETADIST: "BETA.DIST",
		NORMDIST: "NORM.DIST",
		NORMINV: "NORM.INV",
		NORMSDIST: "NORM.S.DIST",
		NORMSINV: "NORM.S.INV",
		LOGNORMDIST: "LOGNORM.DIST",
		LOGINV: "LOGNORM.INV",
		TINV: "T.INV.2T",
		HYPGEOMDIST: "HYPGEOM.DIST",
		POISSON: "POISSON.DIST",
		WEIBULL: "WEIBULL.DIST",
		FINV: "F.INV.RT",
		FDIST: "F.DIST.RT",
		CHIDIST: "CHISQ.DIST.RT",
		CHIINV: "CHISQ.INV.RT",
		GAMMADIST: "GAMMA.DIST",
		"GAMMALN.PRECISE": "GAMMALN",
		GAMMAINV: "GAMMA.INV",
		BETAINV: "BETA.INV",
		BINOMDIST: "BINOM.DIST",
		CONFIDENCE: "CONFIDENCE.NORM",
		CRITBINOM: "BINOM.INV",
		WEIBULLDIST: "WEIBULL.DIST",
		TINV2T: "T.INV.2T",
		TDISTRT: "T.DIST.RT",
		TDIST2T: "T.DIST.2T",
		FINVRT: "F.INV.RT",
		FDISTRT: "F.DIST.RT",
		CHIDISTRT: "CHISQ.DIST.RT",
		CHIINVRT: "CHISQ.INV.RT",
		LOGNORMINV: "LOGNORM.INV",
		POISSONDIST: "POISSON.DIST"
	};
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/MathPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var MathPlugin = class extends FunctionPlugin {
		fact(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FACT"), (arg) => {
				arg = Math.trunc(arg);
				let ret = 1;
				for (let i = 1; i <= arg; i++) ret *= i;
				return ret;
			});
		}
		factdouble(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FACTDOUBLE"), (arg) => {
				arg = Math.trunc(arg);
				let ret = 1;
				for (let i = arg; i >= 1; i -= 2) ret *= i;
				return ret;
			});
		}
		combin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COMBIN"), (n, m) => {
				if (m > n) return new CellError(ErrorType.NUM, ErrorMessage.WrongOrder);
				n = Math.trunc(n);
				m = Math.trunc(m);
				return combin(n, m);
			});
		}
		combina(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COMBINA"), (n, m) => {
				n = Math.trunc(n);
				m = Math.trunc(m);
				if (n + m - 1 >= 1030) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				if (n === 0 && m === 0) return 1;
				return combin(n + m - 1, m);
			});
		}
		gcd(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GCD"), (...args) => {
				const processedArgs = this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(args);
				if (processedArgs instanceof CellError) return processedArgs;
				let ret = 0;
				for (const val of processedArgs) {
					if (val < 0) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
					ret = binaryGCD(ret, Math.trunc(val));
				}
				if (ret > Number.MAX_SAFE_INTEGER) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				return ret;
			});
		}
		lcm(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("LCM"), (...args) => {
				const processedArgs = this.arithmeticHelper.coerceNumbersCoerceRangesDropNulls(args);
				if (processedArgs instanceof CellError) return processedArgs;
				let ret = 1;
				for (const val of processedArgs) {
					if (val < 0) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
					ret = binaryLCM(ret, Math.trunc(val));
				}
				if (ret > Number.MAX_SAFE_INTEGER) return new CellError(ErrorType.NUM, ErrorMessage.ValueLarge);
				return ret;
			});
		}
		mround(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MROUND"), (nom, denom) => {
				if (denom === 0) return 0;
				if (nom > 0 && denom < 0 || nom < 0 && denom > 0) return new CellError(ErrorType.NUM, ErrorMessage.DistinctSigns);
				return Math.round(nom / denom) * denom;
			});
		}
		multinomial(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("MULTINOMIAL"), (...args) => {
				let n = 0;
				let ans = 1;
				for (let arg of args) {
					if (arg < 0) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
					arg = Math.trunc(arg);
					for (let i = 1; i <= arg; i++) ans *= (n + i) / i;
					n += arg;
				}
				return Math.round(ans);
			});
		}
		quotient(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("QUOTIENT"), (nom, denom) => {
				if (denom === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return Math.trunc(nom / denom);
			});
		}
		seriessum(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SERIESSUM"), (x, n, m, range) => {
				const coefs = this.arithmeticHelper.manyToOnlyNumbersDropNulls(range.valuesFromTopLeftCorner());
				if (coefs instanceof CellError) return coefs;
				let ret = 0;
				coefs.reverse();
				for (const coef of coefs) {
					ret *= Math.pow(x, m);
					ret += coef;
				}
				return ret * Math.pow(x, n);
			});
		}
		sign(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SIGN"), (arg) => {
				if (arg > 0) return 1;
				else if (arg < 0) return -1;
				else return 0;
			});
		}
		sumx2my2(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SUMX2MY2"), (rangeX, rangeY) => {
				const valsX = rangeX.valuesFromTopLeftCorner();
				const valsY = rangeY.valuesFromTopLeftCorner();
				if (valsX.length !== valsY.length) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const n = valsX.length;
				let ret = 0;
				for (let i = 0; i < n; i++) {
					const valX = valsX[i];
					const valY = valsY[i];
					if (valX instanceof CellError) return valX;
					if (valY instanceof CellError) return valY;
					if (typeof valX === "number" && typeof valY === "number") ret += Math.pow(valX, 2) - Math.pow(valY, 2);
				}
				return ret;
			});
		}
		sumx2py2(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SUMX2PY2"), (rangeX, rangeY) => {
				const valsX = rangeX.valuesFromTopLeftCorner();
				const valsY = rangeY.valuesFromTopLeftCorner();
				if (valsX.length !== valsY.length) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const n = valsX.length;
				let ret = 0;
				for (let i = 0; i < n; i++) {
					const valX = valsX[i];
					const valY = valsY[i];
					if (valX instanceof CellError) return valX;
					if (valY instanceof CellError) return valY;
					if (typeof valX === "number" && typeof valY === "number") ret += Math.pow(valX, 2) + Math.pow(valY, 2);
				}
				return ret;
			});
		}
		sumxmy2(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SUMXMY2"), (rangeX, rangeY) => {
				const valsX = rangeX.valuesFromTopLeftCorner();
				const valsY = rangeY.valuesFromTopLeftCorner();
				if (valsX.length !== valsY.length) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const n = valsX.length;
				let ret = 0;
				for (let i = 0; i < n; i++) {
					const valX = valsX[i];
					const valY = valsY[i];
					if (valX instanceof CellError) return valX;
					if (valY instanceof CellError) return valY;
					if (typeof valX === "number" && typeof valY === "number") ret += Math.pow(valX - valY, 2);
				}
				return ret;
			});
		}
	};
	MathPlugin.implementedFunctions = {
		"FACT": {
			method: "fact",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0,
				maxValue: 170
			}]
		},
		"FACTDOUBLE": {
			method: "factdouble",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0,
				maxValue: 288
			}]
		},
		"COMBIN": {
			method: "combin",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0,
				lessThan: 1030
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"COMBINA": {
			method: "combina",
			parameters: [{
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}, {
				argumentType: FunctionArgumentType.NUMBER,
				minValue: 0
			}]
		},
		"GCD": {
			method: "gcd",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"LCM": {
			method: "lcm",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"MROUND": {
			method: "mround",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"MULTINOMIAL": {
			method: "multinomial",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }],
			repeatLastArgs: 1,
			expandRanges: true
		},
		"QUOTIENT": {
			method: "quotient",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"SERIESSUM": {
			method: "seriessum",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.RANGE }
			]
		},
		"SIGN": {
			method: "sign",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }]
		},
		"SUMX2MY2": {
			method: "sumx2my2",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"SUMX2PY2": {
			method: "sumx2py2",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"SUMXMY2": {
			method: "sumxmy2",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		}
	};
	function combin(n, m) {
		if (2 * m > n) m = n - m;
		let ret = 1;
		for (let i = 1; i <= m; i++) ret *= (n - m + i) / i;
		return Math.round(ret);
	}
	function binaryGCD(a, b) {
		if (a < b) [a, b] = [b, a];
		while (b > 0) [a, b] = [b, a % b];
		return a;
	}
	function binaryLCM(a, b) {
		if (a === 0 || b === 0) return 0;
		return a * (b / binaryGCD(a, b));
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/ComplexPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var ComplexPlugin = class extends FunctionPlugin {
		complex(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COMPLEX"), (re, im, unit) => {
				if (unit !== "i" && unit !== "j") return new CellError(ErrorType.VALUE, ErrorMessage.ShouldBeIorJ);
				return coerceComplexToString([re, im], unit);
			});
		}
		imabs(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMABS"), abs);
		}
		imaginary(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMAGINARY"), ([_re, im]) => im);
		}
		imreal(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMREAL"), ([re, _im]) => re);
		}
		imargument(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMARGUMENT"), ([re, im]) => {
				if (re === 0 && im === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return Math.atan2(im, re);
			});
		}
		imconjugate(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMCONJUGATE"), ([re, im]) => coerceComplexToString([re, -im]));
		}
		imcos(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMCOS"), (arg) => coerceComplexToString(cos(arg)));
		}
		imcosh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMCOSH"), (arg) => coerceComplexToString(cosh(arg)));
		}
		imcot(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMCOT"), (arg) => coerceComplexToString(div(cos(arg), sin(arg))));
		}
		imcsc(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMCSC"), (arg) => coerceComplexToString(div([1, 0], sin(arg))));
		}
		imcsch(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMCSCH"), (arg) => coerceComplexToString(div([1, 0], sinh(arg))));
		}
		imsec(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSEC"), (arg) => coerceComplexToString(div([1, 0], cos(arg))));
		}
		imsech(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSECH"), (arg) => coerceComplexToString(div([1, 0], cosh(arg))));
		}
		imsin(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSIN"), (arg) => coerceComplexToString(sin(arg)));
		}
		imsinh(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSINH"), (arg) => coerceComplexToString(sinh(arg)));
		}
		imtan(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMTAN"), (arg) => coerceComplexToString(div(sin(arg), cos(arg))));
		}
		imdiv(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMDIV"), (arg1, arg2) => coerceComplexToString(div(arg1, arg2)));
		}
		improduct(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMPRODUCT"), (...args) => {
				const coerced = this.arithmeticHelper.coerceComplexExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				let prod = [1, 0];
				for (const val of coerced) prod = mul(prod, val);
				return coerceComplexToString(prod);
			});
		}
		imsum(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSUM"), (...args) => {
				const coerced = this.arithmeticHelper.coerceComplexExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				let sum = [0, 0];
				for (const val of coerced) sum = add$1(sum, val);
				return coerceComplexToString(sum);
			});
		}
		imsub(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSUB"), (arg1, arg2) => coerceComplexToString(sub(arg1, arg2)));
		}
		imexp(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMEXP"), (arg) => coerceComplexToString(exp(arg)));
		}
		imln(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMLN"), (arg) => coerceComplexToString(ln(arg)));
		}
		imlog10(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMLOG10"), (arg) => {
				const [re, im] = ln(arg);
				const c = Math.log(10);
				return coerceComplexToString([re / c, im / c]);
			});
		}
		imlog2(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMLOG2"), (arg) => {
				const [re, im] = ln(arg);
				const c = Math.log(2);
				return coerceComplexToString([re / c, im / c]);
			});
		}
		impower(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMPOWER"), (arg, n) => coerceComplexToString(power(arg, n)));
		}
		imsqrt(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("IMSQRT"), (arg) => coerceComplexToString(power(arg, .5)));
		}
	};
	ComplexPlugin.implementedFunctions = {
		"COMPLEX": {
			method: "complex",
			parameters: [
				{ argumentType: FunctionArgumentType.NUMBER },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.STRING,
					defaultValue: "i"
				}
			]
		},
		"IMABS": {
			method: "imabs",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMAGINARY": {
			method: "imaginary",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMREAL": {
			method: "imreal",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMARGUMENT": {
			method: "imargument",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMCONJUGATE": {
			method: "imconjugate",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMCOS": {
			method: "imcos",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMCOSH": {
			method: "imcosh",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMCOT": {
			method: "imcot",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMCSC": {
			method: "imcsc",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMCSCH": {
			method: "imcsch",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMSEC": {
			method: "imsec",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMSECH": {
			method: "imsech",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMSIN": {
			method: "imsin",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMSINH": {
			method: "imsinh",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMTAN": {
			method: "imtan",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMDIV": {
			method: "imdiv",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }, { argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMPRODUCT": {
			method: "improduct",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"IMSUM": {
			method: "imsum",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"IMSUB": {
			method: "imsub",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }, { argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMEXP": {
			method: "imexp",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMLN": {
			method: "imln",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMLOG10": {
			method: "imlog10",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMLOG2": {
			method: "imlog2",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		},
		"IMPOWER": {
			method: "impower",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }, { argumentType: FunctionArgumentType.NUMBER }]
		},
		"IMSQRT": {
			method: "imsqrt",
			parameters: [{ argumentType: FunctionArgumentType.COMPLEX }]
		}
	};
	function add$1([re1, im1], [re2, im2]) {
		return [re1 + re2, im1 + im2];
	}
	function sub([re1, im1], [re2, im2]) {
		return [re1 - re2, im1 - im2];
	}
	function mul([re1, im1], [re2, im2]) {
		return [re1 * re2 - im1 * im2, re1 * im2 + re2 * im1];
	}
	function div([re1, im1], [re2, im2]) {
		const denom = Math.pow(re2, 2) + Math.pow(im2, 2);
		const [nomRe, nomIm] = mul([re1, im1], [re2, -im2]);
		return [nomRe / denom, nomIm / denom];
	}
	function cos([re, im]) {
		return [Math.cos(re) * Math.cosh(im), -Math.sin(re) * Math.sinh(im)];
	}
	function cosh([re, im]) {
		return [Math.cosh(re) * Math.cos(im), Math.sinh(re) * Math.sin(im)];
	}
	function sin([re, im]) {
		return [Math.sin(re) * Math.cosh(im), Math.cos(re) * Math.sinh(im)];
	}
	function sinh([re, im]) {
		return [Math.sinh(re) * Math.cos(im), Math.cosh(re) * Math.sin(im)];
	}
	function exp([re, im]) {
		return [Math.exp(re) * Math.cos(im), Math.exp(re) * Math.sin(im)];
	}
	function abs([re, im]) {
		return Math.sqrt(re * re + im * im);
	}
	function ln([re, im]) {
		return [Math.log(abs([re, im])), Math.atan2(im, re)];
	}
	function power(arg, n) {
		const [re, im] = ln(arg);
		return exp([n * re, n * im]);
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/StatisticalAggregationPlugin.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var StatisticalAggregationPlugin = class extends FunctionPlugin {
		avedev(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("AVEDEV"), (...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				if (coerced.length === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				const avg = mean(coerced);
				return coerced.reduce((a, b) => a + Math.abs(b - avg), 0) / coerced.length;
			});
		}
		devsq(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("DEVSQ"), (...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				if (coerced.length === 0) return 0;
				return sumsqerr(coerced);
			});
		}
		geomean(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("GEOMEAN"), (...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				if (coerced.length === 0) return new CellError(ErrorType.NUM, ErrorMessage.OneValue);
				for (const val of coerced) if (val <= 0) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
				return geomean(coerced);
			});
		}
		harmean(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("HARMEAN"), (...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				if (coerced.length === 0) return new CellError(ErrorType.NUM, ErrorMessage.OneValue);
				for (const val of coerced) if (val <= 0) return new CellError(ErrorType.NUM, ErrorMessage.ValueSmall);
				return coerced.length / coerced.reduce((a, b) => a + 1 / b, 0);
			});
		}
		correl(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CORREL"), (dataX, dataY) => {
				if (dataX.numberOfElements() !== dataY.numberOfElements()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				if (ret[0].length <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
				return corrcoeff(ret[0], ret[1]);
			});
		}
		rsq(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("RSQ"), (dataX, dataY) => {
				if (dataX.numberOfElements() !== dataY.numberOfElements()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				if (ret[0].length <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
				return Math.pow(corrcoeff(ret[0], ret[1]), 2);
			});
		}
		covariancep(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COVARIANCE.P"), (dataX, dataY) => {
				if (dataX.numberOfElements() !== dataY.numberOfElements()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				const n = ret[0].length;
				if (n < 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.OneValue);
				if (n === 1) return 0;
				return covariance(ret[0], ret[1]) * (n - 1) / n;
			});
		}
		covariances(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("COVARIANCE.S"), (dataX, dataY) => {
				if (dataX.numberOfElements() !== dataY.numberOfElements()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				if (ret[0].length <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
				return covariance(ret[0], ret[1]);
			});
		}
		ztest(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("Z.TEST"), (range, x, sigma) => {
				const vals = this.arithmeticHelper.manyToExactNumbers(range.valuesFromTopLeftCorner());
				if (vals instanceof CellError) return vals;
				const n = vals.length;
				if (sigma === void 0) {
					if (n < 2) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
					sigma = stdev(vals, true);
				}
				if (n < 1) return new CellError(ErrorType.NA, ErrorMessage.OneValue);
				if (sigma === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return 1 - normal.cdf((mean(vals) - x) / (sigma / Math.sqrt(n)), 0, 1);
			});
		}
		ftest(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("F.TEST"), (dataX, dataY) => {
				const arrX = this.arithmeticHelper.manyToExactNumbers(dataX.valuesFromTopLeftCorner());
				const arrY = this.arithmeticHelper.manyToExactNumbers(dataY.valuesFromTopLeftCorner());
				if (arrX instanceof CellError) return arrX;
				if (arrY instanceof CellError) return arrY;
				if (arrX.length <= 1 || arrY.length <= 1) return new CellError(ErrorType.DIV_BY_ZERO);
				const vx = variance(arrX, true);
				const vy = variance(arrY, true);
				if (vx === 0 || vy === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				const r = vx / vy;
				const v = centralF.cdf(r, arrX.length - 1, arrY.length - 1);
				return 2 * Math.min(v, 1 - v);
			});
		}
		steyx(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("STEYX"), (dataX, dataY) => {
				if (dataX.numberOfElements() !== dataY.numberOfElements()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				const n = ret[0].length;
				if (n <= 2) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.ThreeValues);
				return Math.sqrt((sumsqerr(ret[0]) - Math.pow(covariance(ret[0], ret[1]) * (n - 1), 2) / sumsqerr(ret[1])) / (n - 2));
			});
		}
		slope(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SLOPE"), (dataX, dataY) => {
				if (dataX.numberOfElements() !== dataY.numberOfElements()) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				const n = ret[0].length;
				if (n <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
				return covariance(ret[0], ret[1]) * (n - 1) / sumsqerr(ret[1]);
			});
		}
		chisqtest(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("CHISQ.TEST"), (dataX, dataY) => {
				const r = dataX.height();
				const c = dataX.width();
				if (dataY.height() !== r || dataY.width() !== c) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
				const ret = parseTwoArrays(dataX, dataY);
				if (ret instanceof CellError) return ret;
				if (ret[0].length <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
				let sum = 0;
				for (let i = 0; i < ret[0].length; i++) {
					if (ret[1][i] === 0) return new CellError(ErrorType.DIV_BY_ZERO);
					sum += Math.pow(ret[0][i] - ret[1][i], 2) / ret[1][i];
				}
				if (sum < 0) return new CellError(ErrorType.NUM, ErrorMessage.NaN);
				return 1 - chisquare.cdf(sum, r > 1 && c > 1 ? (r - 1) * (c - 1) : r * c - 1);
			});
		}
		ttest(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("T.TEST"), (dataX, dataY, tails, type) => {
				const arrX = this.arithmeticHelper.manyToExactNumbers(dataX.valuesFromTopLeftCorner());
				const arrY = this.arithmeticHelper.manyToExactNumbers(dataY.valuesFromTopLeftCorner());
				if (arrX instanceof CellError) return arrX;
				if (arrY instanceof CellError) return arrY;
				const n = arrX.length;
				const m = arrY.length;
				if (type === 1) {
					if (m !== n) return new CellError(ErrorType.NA, ErrorMessage.EqualLength);
					if (n <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
					const sub = Array(n);
					for (let i = 0; i < n; i++) sub[i] = arrX[i] - arrY[i];
					const s = stdev(sub, true);
					if (s === 0) return new CellError(ErrorType.DIV_BY_ZERO);
					const t = Math.abs(Math.sqrt(n) * mean(sub) / s);
					return tails * (1 - studentt.cdf(t, n - 1));
				} else if (type === 2) {
					if (n <= 1 || m <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
					const s = (sumsqerr(arrX) + sumsqerr(arrY)) / (n + m - 2);
					if (s === 0) return new CellError(ErrorType.DIV_BY_ZERO);
					const t = Math.abs((mean(arrX) - mean(arrY)) / Math.sqrt(s * (1 / n + 1 / m)));
					return tails * (1 - studentt.cdf(t, n + m - 2));
				} else {
					if (n <= 1 || m <= 1) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.TwoValues);
					const sx = variance(arrX, true);
					const sy = variance(arrY, true);
					if (sx === 0 && sy === 0) return new CellError(ErrorType.DIV_BY_ZERO);
					const t = Math.abs((mean(arrX) - mean(arrY)) / Math.sqrt(sx / n + sy / m));
					const v = Math.pow(sx / n + sy / m, 2) / (Math.pow(sx / n, 2) / (n - 1) + Math.pow(sy / m, 2) / (m - 1));
					return tails * (1 - studentt.cdf(t, v));
				}
			});
		}
		skew(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SKEW"), (...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				const n = coerced.length;
				if (n < 3) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.ThreeValues);
				const avg = mean(coerced);
				const s = stdev(coerced, true);
				if (s === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return coerced.reduce((a, b) => a + Math.pow((b - avg) / s, 3), 0) * n / (n - 1) / (n - 2);
			});
		}
		skewp(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("SKEW.P"), (...args) => {
				const coerced = this.arithmeticHelper.coerceNumbersExactRanges(args);
				if (coerced instanceof CellError) return coerced;
				const n = coerced.length;
				if (n < 3) return new CellError(ErrorType.DIV_BY_ZERO, ErrorMessage.ThreeValues);
				const avg = mean(coerced);
				const s = stdev(coerced, false);
				if (s === 0) return new CellError(ErrorType.DIV_BY_ZERO);
				return coerced.reduce((a, b) => a + Math.pow((b - avg) / s, 3), 0) / n;
			});
		}
	};
	StatisticalAggregationPlugin.implementedFunctions = {
		"AVEDEV": {
			method: "avedev",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"DEVSQ": {
			method: "devsq",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"GEOMEAN": {
			method: "geomean",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"HARMEAN": {
			method: "harmean",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"CORREL": {
			method: "correl",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"RSQ": {
			method: "rsq",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"COVARIANCE.P": {
			method: "covariancep",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"COVARIANCE.S": {
			method: "covariances",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"Z.TEST": {
			method: "ztest",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.NUMBER },
				{
					argumentType: FunctionArgumentType.NUMBER,
					optionalArg: true
				}
			]
		},
		"F.TEST": {
			method: "ftest",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"STEYX": {
			method: "steyx",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"SLOPE": {
			method: "slope",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"CHISQ.TEST": {
			method: "chisqtest",
			parameters: [{ argumentType: FunctionArgumentType.RANGE }, { argumentType: FunctionArgumentType.RANGE }]
		},
		"T.TEST": {
			method: "ttest",
			parameters: [
				{ argumentType: FunctionArgumentType.RANGE },
				{ argumentType: FunctionArgumentType.RANGE },
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1,
					maxValue: 2
				},
				{
					argumentType: FunctionArgumentType.INTEGER,
					minValue: 1,
					maxValue: 3
				}
			]
		},
		"SKEW": {
			method: "skew",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		},
		"SKEW.P": {
			method: "skewp",
			parameters: [{ argumentType: FunctionArgumentType.ANY }],
			repeatLastArgs: 1
		}
	};
	StatisticalAggregationPlugin.aliases = {
		COVAR: "COVARIANCE.P",
		FTEST: "F.TEST",
		PEARSON: "CORREL",
		ZTEST: "Z.TEST",
		CHITEST: "CHISQ.TEST",
		TTEST: "T.TEST",
		COVARIANCEP: "COVARIANCE.P",
		COVARIANCES: "COVARIANCE.S",
		SKEWP: "SKEW.P"
	};
	function parseTwoArrays(dataX, dataY) {
		const xit = dataX.iterateValuesFromTopLeftCorner();
		const yit = dataY.iterateValuesFromTopLeftCorner();
		let x, y;
		const arrX = [];
		const arrY = [];
		while (x = xit.next(), y = yit.next(), !x.done && !y.done) {
			const xval = x.value;
			const yval = y.value;
			if (xval instanceof CellError) return xval;
			else if (yval instanceof CellError) return yval;
			else if (isExtendedNumber(xval) && isExtendedNumber(yval)) {
				arrX.push(getRawValue(xval));
				arrY.push(getRawValue(yval));
			}
		}
		return [arrX, arrY];
	}
	//#endregion
	//#region ../../node_modules/hyperformula/es/interpreter/plugin/index.mjs
	var plugin_exports = /* @__PURE__ */ __exportAll({
		AbsPlugin: () => AbsPlugin,
		AddressPlugin: () => AddressPlugin,
		ArrayPlugin: () => ArrayPlugin,
		BitShiftPlugin: () => BitShiftPlugin,
		BitwiseLogicOperationsPlugin: () => BitwiseLogicOperationsPlugin,
		BooleanPlugin: () => BooleanPlugin,
		CharPlugin: () => CharPlugin,
		CodePlugin: () => CodePlugin,
		ComplexPlugin: () => ComplexPlugin,
		ConditionalAggregationPlugin: () => ConditionalAggregationPlugin,
		CountBlankPlugin: () => CountBlankPlugin,
		CountUniquePlugin: () => CountUniquePlugin,
		DateTimePlugin: () => DateTimePlugin,
		DegreesPlugin: () => DegreesPlugin,
		DeltaPlugin: () => DeltaPlugin,
		ExpPlugin: () => ExpPlugin,
		FinancialPlugin: () => FinancialPlugin,
		FormulaTextPlugin: () => FormulaTextPlugin,
		HyperlinkPlugin: () => HyperlinkPlugin,
		InformationPlugin: () => InformationPlugin,
		IsEvenPlugin: () => IsEvenPlugin,
		IsOddPlugin: () => IsOddPlugin,
		LogarithmPlugin: () => LogarithmPlugin,
		LookupPlugin: () => LookupPlugin,
		MathConstantsPlugin: () => MathConstantsPlugin,
		MathPlugin: () => MathPlugin,
		MatrixPlugin: () => MatrixPlugin,
		MedianPlugin: () => MedianPlugin,
		ModuloPlugin: () => ModuloPlugin,
		NumericAggregationPlugin: () => NumericAggregationPlugin,
		PowerPlugin: () => PowerPlugin,
		RadiansPlugin: () => RadiansPlugin,
		RadixConversionPlugin: () => RadixConversionPlugin,
		RandomPlugin: () => RandomPlugin,
		RomanPlugin: () => RomanPlugin,
		RoundingPlugin: () => RoundingPlugin,
		SimpleArithmerticPlugin: () => SimpleArithmerticPlugin,
		SqrtPlugin: () => SqrtPlugin,
		StatisticalAggregationPlugin: () => StatisticalAggregationPlugin,
		StatisticalPlugin: () => StatisticalPlugin,
		SumprodPlugin: () => SumprodPlugin,
		TextPlugin: () => TextPlugin,
		TrigonometryPlugin: () => TrigonometryPlugin
	});
	//#endregion
	//#region ../../node_modules/hyperformula/es/index.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	/**
	* Aggregate class for default export
	*/
	var HyperFormulaNS = class extends HyperFormula {};
	HyperFormulaNS.HyperFormula = HyperFormula;
	HyperFormulaNS.ErrorType = ErrorType;
	HyperFormulaNS.CellError = CellError;
	HyperFormulaNS.CellType = CellType;
	HyperFormulaNS.CellValueType = CellValueType;
	HyperFormulaNS.CellValueDetailedType = CellValueDetailedType;
	HyperFormulaNS.DetailedCellError = DetailedCellError;
	HyperFormulaNS.ExportedCellChange = ExportedCellChange;
	HyperFormulaNS.ExportedNamedExpressionChange = ExportedNamedExpressionChange;
	HyperFormulaNS.ConfigValueTooBigError = ConfigValueTooBigError;
	HyperFormulaNS.ConfigValueTooSmallError = ConfigValueTooSmallError;
	HyperFormulaNS.EvaluationSuspendedError = EvaluationSuspendedError;
	HyperFormulaNS.ExpectedOneOfValuesError = ExpectedOneOfValuesError;
	HyperFormulaNS.ExpectedValueOfTypeError = ExpectedValueOfTypeError;
	HyperFormulaNS.ArraySize = ArraySize;
	HyperFormulaNS.SimpleRangeValue = SimpleRangeValue;
	HyperFormulaNS.EmptyValue = EmptyValue;
	HyperFormulaNS.FunctionPlugin = FunctionPlugin;
	HyperFormulaNS.FunctionArgumentType = FunctionArgumentType;
	HyperFormulaNS.FunctionPluginValidationError = FunctionPluginValidationError;
	HyperFormulaNS.InvalidAddressError = InvalidAddressError;
	HyperFormulaNS.InvalidArgumentsError = InvalidArgumentsError;
	HyperFormulaNS.LanguageNotRegisteredError = LanguageNotRegisteredError;
	HyperFormulaNS.LanguageAlreadyRegisteredError = LanguageAlreadyRegisteredError;
	HyperFormulaNS.MissingTranslationError = MissingTranslationError;
	HyperFormulaNS.NamedExpressionDoesNotExistError = NamedExpressionDoesNotExistError;
	HyperFormulaNS.NamedExpressionNameIsAlreadyTakenError = NamedExpressionNameIsAlreadyTakenError;
	HyperFormulaNS.NamedExpressionNameIsInvalidError = NamedExpressionNameIsInvalidError;
	HyperFormulaNS.NoOperationToRedoError = NoOperationToRedoError;
	HyperFormulaNS.NoOperationToUndoError = NoOperationToUndoError;
	HyperFormulaNS.NoRelativeAddressesAllowedError = NoRelativeAddressesAllowedError;
	HyperFormulaNS.NoSheetWithIdError = NoSheetWithIdError;
	HyperFormulaNS.NoSheetWithNameError = NoSheetWithNameError;
	HyperFormulaNS.NotAFormulaError = NotAFormulaError;
	HyperFormulaNS.NothingToPasteError = NothingToPasteError;
	HyperFormulaNS.ProtectedFunctionTranslationError = ProtectedFunctionTranslationError;
	HyperFormulaNS.SheetNameAlreadyTakenError = SheetNameAlreadyTakenError;
	HyperFormulaNS.SheetSizeLimitExceededError = SheetSizeLimitExceededError;
	HyperFormulaNS.SourceLocationHasArrayError = SourceLocationHasArrayError;
	HyperFormulaNS.TargetLocationHasArrayError = TargetLocationHasArrayError;
	HyperFormulaNS.UnableToParseError = UnableToParseError;
	var defaultLanguage = Config.defaultConfig.language;
	HyperFormula.registerLanguage(defaultLanguage, dictionary$1);
	HyperFormula.languages[dictionary$1.langCode] = dictionary$1;
	for (const pluginName of Object.getOwnPropertyNames(plugin_exports)) if (!pluginName.startsWith("_")) HyperFormula.registerFunctionPlugin(plugin_exports[pluginName]);
	//#endregion
	//#region ../../node_modules/hyperformula/es/i18n/languages/enUS.mjs
	/**
	* @license
	* Copyright (c) 2025 Handsoncode. All rights reserved.
	*/
	var dictionary = Object.assign(Object.assign({}, dictionary$1), { langCode: "enUS" });
	//#endregion
	//#region ../loot-core/src/shared/rules.ts
	var TYPE_INFO = {
		date: {
			ops: [
				"is",
				"isapprox",
				"gt",
				"gte",
				"lt",
				"lte"
			],
			nullable: false
		},
		id: {
			ops: [
				"is",
				"contains",
				"matches",
				"oneOf",
				"isNot",
				"doesNotContain",
				"notOneOf",
				"onBudget",
				"offBudget"
			],
			nullable: true
		},
		saved: {
			ops: [],
			nullable: false
		},
		string: {
			ops: [
				"is",
				"contains",
				"matches",
				"oneOf",
				"isNot",
				"doesNotContain",
				"notOneOf",
				"hasTags"
			],
			nullable: true
		},
		number: {
			ops: [
				"is",
				"isapprox",
				"isbetween",
				"gt",
				"gte",
				"lt",
				"lte"
			],
			nullable: false
		},
		boolean: {
			ops: ["is"],
			nullable: false
		}
	};
	var FIELD_INFO = {
		imported_payee: {
			type: "string",
			disallowedOps: new Set(["hasTags"])
		},
		payee: {
			type: "id",
			disallowedOps: new Set(["onBudget", "offBudget"])
		},
		payee_name: { type: "string" },
		date: { type: "date" },
		notes: {
			type: "string",
			disallowedOps: new Set(["oneOf", "notOneOf"])
		},
		amount: { type: "number" },
		category: {
			type: "id",
			disallowedOps: new Set(["onBudget", "offBudget"]),
			internalOps: new Set(["and"])
		},
		category_group: {
			type: "id",
			disallowedOps: new Set(["onBudget", "offBudget"]),
			internalOps: new Set(["and"])
		},
		account: { type: "id" },
		cleared: { type: "boolean" },
		reconciled: { type: "boolean" },
		saved: { type: "saved" },
		transfer: { type: "boolean" },
		parent: { type: "boolean" }
	};
	var fieldInfo = FIELD_INFO;
	var FIELD_TYPES = new Map(Object.entries(FIELD_INFO).map(([field, info]) => [field, info.type]));
	function isValidOp(field, op) {
		const type = FIELD_TYPES.get(field);
		if (!type) return false;
		if (fieldInfo[field].disallowedOps?.has(op)) return false;
		return TYPE_INFO[type].ops.includes(op) || fieldInfo[field].internalOps?.has(op);
	}
	function sortNumbers(num1, num2) {
		if (num1 < num2) return [num1, num2];
		return [num2, num1];
	}
	function getApproxNumberThreshold(number) {
		return Math.round(Math.abs(number) * .075);
	}
	//#endregion
	//#region ../loot-core/src/server/rules/customFunctions.ts
	var CustomFunctionsPlugin = class extends FunctionPlugin {
		integerToAmount(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("INTEGER_TO_AMOUNT"), (integerAmount, decimalPlaces = 2) => {
				return integerToAmount(integerAmount, decimalPlaces);
			});
		}
		fixed(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("FIXED"), (number, decimals = 0) => {
				return Number(number).toFixed(decimals);
			});
		}
		balanceOf(ast, state) {
			return this.runFunction(ast.args, state, this.metadata("BALANCE_OF"), (accountKey) => {
				return this.config.context?.balanceOfPrefetch?.get(accountKey) ?? 0;
			});
		}
	};
	CustomFunctionsPlugin.implementedFunctions = {
		BALANCE_OF: {
			method: "balanceOf",
			parameters: [{ argumentType: FunctionArgumentType.STRING }]
		},
		FIXED: {
			method: "fixed",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				defaultValue: 0
			}]
		},
		INTEGER_TO_AMOUNT: {
			method: "integerToAmount",
			parameters: [{ argumentType: FunctionArgumentType.NUMBER }, {
				argumentType: FunctionArgumentType.NUMBER,
				optionalArg: true,
				defaultValue: 2
			}]
		}
	};
	var customFunctionsTranslations = { enUS: {
		BALANCE_OF: "BALANCE_OF",
		FIXED: "FIXED",
		INTEGER_TO_AMOUNT: "INTEGER_TO_AMOUNT"
	} };
	//#endregion
	//#region ../../node_modules/@rschedule/core/es2015/main.js
	var InvalidDateAdapterError$1 = class extends Error {};
	var dateAdapterConfig$1;
	var DateAdapterBase$1 = class {
		constructor(_date, options) {
			/**
			* The metadata property is intended to store arbitrary data
			* related to this DateAdapter. Unlike other properties, the
			* metadata property is intended to be mutable.
			*/
			this.metadata = {};
			this.duration = options && options.duration || 0;
			this.generators = options && options.generators && options.generators.slice() || [];
			if (!Number.isInteger(this.duration) || this.duration < 0) throw new InvalidDateAdapterError$1("duration must be a non-negative integer");
		}
		static set adapter(value) {
			if (dateAdapterConfig$1) throw new Error(`"${dateAdapterConfig$1.name}" has already been configured.`);
			dateAdapterConfig$1 = value;
		}
		static get adapter() {
			if (!dateAdapterConfig$1) throw new Error("No date adapter has been configured. See rSchedule docs.");
			return dateAdapterConfig$1;
		}
		static isDate(_object) {
			throw unimplementedError$1("isDate()");
		}
		static fromDate(_date, _options) {
			throw unimplementedError$1("fromDate()");
		}
		static fromJSON(_json) {
			throw unimplementedError$1("fromJSON()");
		}
		static fromDateTime(_datetime) {
			throw unimplementedError$1("fromDateTime()");
		}
		/**
		* Returns a string in simplified extended ISO format (ISO 8601).
		*
		* _Note: this method is intended for testing and its
		* implementation isn't particularly performant._
		*/
		toISOString() {
			return this.set("timezone", "UTC").toDateTime().toISOString();
		}
		toDateTime() {
			return DateTime$1.fromJSON(Object.assign(Object.assign({}, this.toJSON()), {
				generators: this.generators,
				metadata: this.metadata
			}));
		}
	};
	DateAdapterBase$1.hasTimezoneSupport = false;
	function unimplementedError$1(name) {
		return /* @__PURE__ */ new Error(`You must implement the "${name}" method for this DateAdapter class`);
	}
	var DateAdapter$1;
	(function(DateAdapter) {
		DateAdapter.WEEKDAYS = [
			"SU",
			"MO",
			"TU",
			"WE",
			"TH",
			"FR",
			"SA"
		];
		DateAdapter.MILLISECONDS_IN_SECOND = 1e3;
		DateAdapter.MILLISECONDS_IN_MINUTE = DateAdapter.MILLISECONDS_IN_SECOND * 60;
		DateAdapter.MILLISECONDS_IN_HOUR = DateAdapter.MILLISECONDS_IN_MINUTE * 60;
		DateAdapter.MILLISECONDS_IN_DAY = DateAdapter.MILLISECONDS_IN_HOUR * 24;
		DateAdapter.MILLISECONDS_IN_WEEK = DateAdapter.MILLISECONDS_IN_DAY * 7;
	})(DateAdapter$1 || (DateAdapter$1 = {}));
	var InvalidDateTimeError$1 = class extends Error {};
	var DateTime$1 = class DateTime$1 {
		constructor(date, timezone, duration, generators, options = {}) {
			this.metadata = {};
			this.date = new Date(date);
			this.timezone = timezone || null;
			this.duration = duration || 0;
			this.generators = generators && generators.slice() || [];
			if (!Number.isInteger(this.duration) || this.duration < 0) throw new InvalidDateTimeError$1("duration must be a non-negative integer");
			if (options.metadata) Object.assign(this.metadata, options.metadata);
			this.assertIsValid();
		}
		static fromJSON(json) {
			return new DateTime$1(new Date(Date.UTC(json.year, json.month - 1, json.day, json.hour, json.minute, json.second, json.millisecond)), json.timezone, json.duration, json.generators, { metadata: json.metadata });
		}
		static fromDateAdapter(adapter) {
			return DateTime$1.fromJSON(Object.assign(Object.assign({}, adapter.toJSON()), {
				generators: adapter.generators,
				metadata: adapter.metadata
			}));
		}
		/**
		* Returns `undefined` if `duration` is `0`. Else returns
		* the `end` date.
		*/
		get end() {
			if (!this.duration) return;
			if (this._end) return this._end;
			this._end = this.add(this.duration, "millisecond");
			return this._end;
		}
		isEqual(object) {
			if (!object) return false;
			assertSameTimeZone$1(this, object);
			return this.valueOf() === object.valueOf();
		}
		isBefore(object) {
			assertSameTimeZone$1(this, object);
			return this.valueOf() < object.valueOf();
		}
		isBeforeOrEqual(object) {
			assertSameTimeZone$1(this, object);
			return this.valueOf() <= object.valueOf();
		}
		isAfter(object) {
			assertSameTimeZone$1(this, object);
			return this.valueOf() > object.valueOf();
		}
		isAfterOrEqual(object) {
			assertSameTimeZone$1(this, object);
			return this.valueOf() >= object.valueOf();
		}
		isOccurring(object) {
			if (!this.duration) throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations");
			assertSameTimeZone$1(this, object);
			return object.isAfterOrEqual(this) && object.isBeforeOrEqual(this.add(this.duration, "millisecond"));
		}
		add(amount, unit) {
			switch (unit) {
				case "generator": {
					const generators = this.generators.slice();
					generators.unshift(amount);
					return new DateTime$1(this.date, this.timezone, this.duration, generators);
				}
				case "year": return this.forkDateTime(addUTCYears$1(this.date, amount));
				case "month": return this.forkDateTime(addUTCMonths$1(this.date, amount));
				case "week": return this.forkDateTime(addUTCWeeks$1(this.date, amount));
				case "day": return this.forkDateTime(addUTCDays$1(this.date, amount));
				case "hour": return this.forkDateTime(addUTCHours$1(this.date, amount));
				case "minute": return this.forkDateTime(addUTCMinutes$1(this.date, amount));
				case "second": return this.forkDateTime(addUTCSeconds$1(this.date, amount));
				case "millisecond": return this.forkDateTime(addUTCMilliseconds$1(this.date, amount));
				default: throw new Error("Invalid unit provided to `DateTime#add`");
			}
		}
		subtract(amount, unit) {
			switch (unit) {
				case "year": return this.forkDateTime(subUTCYears$1(this.date, amount));
				case "month": return this.forkDateTime(subUTCMonths$1(this.date, amount));
				case "week": return this.forkDateTime(subUTCWeeks$1(this.date, amount));
				case "day": return this.forkDateTime(subUTCDays$1(this.date, amount));
				case "hour": return this.forkDateTime(subUTCHours$1(this.date, amount));
				case "minute": return this.forkDateTime(subUTCMinutes$1(this.date, amount));
				case "second": return this.forkDateTime(subUTCSeconds$1(this.date, amount));
				case "millisecond": return this.forkDateTime(subUTCMilliseconds$1(this.date, amount));
				default: throw new Error("Invalid unit provided to `DateTime#subtract`");
			}
		}
		get(unit) {
			switch (unit) {
				case "year": return this.date.getUTCFullYear();
				case "month": return this.date.getUTCMonth() + 1;
				case "yearday": return getUTCYearDay$1(this.date);
				case "weekday": return DateAdapter$1.WEEKDAYS[this.date.getUTCDay()];
				case "day": return this.date.getUTCDate();
				case "hour": return this.date.getUTCHours();
				case "minute": return this.date.getUTCMinutes();
				case "second": return this.date.getUTCSeconds();
				case "millisecond": return this.date.getUTCMilliseconds();
				default: throw new Error("Invalid unit provided to `DateTime#set`");
			}
		}
		set(unit, value) {
			if (unit === "duration") return new DateTime$1(this.date, this.timezone, value, this.generators);
			if (unit === "generators") return new DateTime$1(this.date, this.timezone, this.duration, value);
			let date = new Date(this.date);
			switch (unit) {
				case "year":
					date.setUTCFullYear(value);
					break;
				case "month": {
					const length = monthLength$1(value, date.getUTCFullYear());
					if (date.getUTCDate() > length) {
						date.setUTCDate(1);
						date.setUTCMonth(value);
						date = subUTCDays$1(date, 1);
					} else date.setUTCMonth(value - 1);
					break;
				}
				case "day":
					date.setUTCDate(value);
					break;
				case "hour":
					date.setUTCHours(value);
					break;
				case "minute":
					date.setUTCMinutes(value);
					break;
				case "second":
					date.setUTCSeconds(value);
					break;
				case "millisecond":
					date.setUTCMilliseconds(value);
					break;
				default: throw new Error("Invalid unit provided to `DateTime#set`");
			}
			return this.forkDateTime(date);
		}
		granularity(granularity, opt = {}) {
			let date = this.forkDateTime(this.date);
			switch (granularity) {
				case "year": date = date.set("month", 1);
				case "month":
					date = date.set("day", 1);
					break;
				case "week": date = setDateToStartOfWeek$1(date, opt.weekStart);
			}
			switch (granularity) {
				case "year":
				case "month":
				case "week":
				case "day": date = date.set("hour", 0);
				case "hour": date = date.set("minute", 0);
				case "minute": date = date.set("second", 0);
				case "second": date = date.set("millisecond", 0);
				case "millisecond": return date;
				default: throw new Error("Invalid granularity provided to `DateTime#granularity`: " + granularity);
			}
		}
		endGranularity(granularity, opt = {}) {
			let date = this.forkDateTime(this.date);
			switch (granularity) {
				case "year": date = date.set("month", 12);
				case "month":
					date = date.set("day", monthLength$1(date.get("month"), date.get("year")));
					break;
				case "week": date = setDateToEndOfWeek$1(date, opt.weekStart);
			}
			switch (granularity) {
				case "year":
				case "month":
				case "week":
				case "day": date = date.set("hour", 23);
				case "hour": date = date.set("minute", 59);
				case "minute": date = date.set("second", 59);
				case "second": date = date.set("millisecond", 999);
				case "millisecond": return date;
				default: throw new Error("Invalid granularity provided to `DateTime#granularity`: " + granularity);
			}
		}
		toISOString() {
			return this.date.toISOString();
		}
		toDateTime() {
			return this;
		}
		toJSON() {
			const json = {
				timezone: this.timezone,
				year: this.get("year"),
				month: this.get("month"),
				day: this.get("day"),
				hour: this.get("hour"),
				minute: this.get("minute"),
				second: this.get("second"),
				millisecond: this.get("millisecond")
			};
			if (this.duration) json.duration = this.duration;
			return json;
		}
		valueOf() {
			return this.date.valueOf();
		}
		assertIsValid() {
			if (isNaN(this.valueOf())) throw new InvalidDateTimeError$1("DateTime has invalid date.");
			return true;
		}
		forkDateTime(date) {
			return new DateTime$1(date, this.timezone, this.duration, this.generators);
		}
	};
	function assertSameTimeZone$1(x, y) {
		if (x.timezone !== y.timezone) throw new InvalidDateTimeError$1("Attempted to compare a datetime to another date in a different timezone: " + JSON.stringify(x) + " and " + JSON.stringify(y));
		return true;
	}
	function setDateToStartOfWeek$1(date, wkst) {
		const index = orderedWeekdays$1(wkst).indexOf(date.get("weekday"));
		return date.subtract(index, "day");
	}
	function setDateToEndOfWeek$1(date, wkst) {
		const index = orderedWeekdays$1(wkst).indexOf(date.get("weekday"));
		return date.add(6 - index, "day");
	}
	function dateTimeSortComparer(a, b) {
		if (a.isAfter(b)) return 1;
		if (a.isBefore(b)) return -1;
		if (a.duration && b.duration) {
			if (a.duration > b.duration) return 1;
			if (a.duration < b.duration) return -1;
		}
		return 0;
	}
	function uniqDateTimes(dates) {
		return Array.from(new Map(dates.map((date) => [date.toISOString(), date])).values());
	}
	function orderedWeekdays$1(wkst = "SU") {
		const wkdays = DateAdapter$1.WEEKDAYS.slice();
		let index = wkdays.indexOf(wkst);
		while (index !== 0) {
			shiftArray$1(wkdays);
			index--;
		}
		return wkdays;
	}
	function shiftArray$1(array, from = "first") {
		if (array.length === 0) return array;
		else if (from === "first") array.push(array.shift());
		else array.unshift(array.pop());
		return array;
	}
	function getDifferenceBetweenWeekdays(x, y) {
		if (x === y) return 0;
		const result = DateAdapter$1.WEEKDAYS.indexOf(x) - DateAdapter$1.WEEKDAYS.indexOf(y);
		return result > 0 ? 7 - result : Math.abs(result);
	}
	/**
	* Returns the days in the given month.
	*
	* @param month base-1
	* @param year
	*/
	function monthLength$1(month, year) {
		return {
			1: 31,
			2: getDaysInFebruary$1(year),
			3: 31,
			4: 30,
			5: 31,
			6: 30,
			7: 31,
			8: 31,
			9: 30,
			10: 31,
			11: 30,
			12: 31
		}[month];
	}
	function getDaysInFebruary$1(year) {
		return isLeapYear$1(year) ? 29 : 28;
	}
	function isLeapYear$1(year) {
		return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
	}
	function getUTCYearDay$1(now) {
		const start = new Date(Date.UTC(now.getUTCFullYear(), 0, 1));
		const diff = now.valueOf() - start.valueOf();
		return 1 + Math.floor(diff / DateAdapter$1.MILLISECONDS_IN_DAY);
	}
	/**
	* These functions are basically lifted from `date-fns`, but changed
	* to use the UTC date methods, which `date-fns` doesn't support.
	*/
	function toInteger$1(input) {
		if (input === null || input === true || input === false) return NaN;
		const int = Number(input);
		if (isNaN(int)) return int;
		return int < 0 ? Math.ceil(int) : Math.floor(int);
	}
	function addMilliseconds$1(dirtyDate, dirtyAmount) {
		if (arguments.length < 2) throw new TypeError("2 arguments required, but only " + arguments.length + " present");
		const timestamp = dirtyDate.valueOf();
		const amount = toInteger$1(dirtyAmount);
		return new Date(timestamp + amount);
	}
	function addUTCYears$1(date, input) {
		return addUTCMonths$1(date, toInteger$1(input) * 12);
	}
	function addUTCMonths$1(date, input) {
		const amount = toInteger$1(input);
		date = new Date(date);
		const desiredMonth = date.getUTCMonth() + amount;
		const dateWithDesiredMonth = /* @__PURE__ */ new Date(0);
		dateWithDesiredMonth.setUTCFullYear(date.getUTCFullYear(), desiredMonth, 1);
		dateWithDesiredMonth.setUTCHours(0, 0, 0, 0);
		const daysInMonth = monthLength$1(dateWithDesiredMonth.getUTCMonth() + 1, dateWithDesiredMonth.getUTCFullYear());
		date.setUTCMonth(desiredMonth, Math.min(daysInMonth, date.getUTCDate()));
		return date;
	}
	function addUTCWeeks$1(date, input) {
		return addUTCDays$1(date, toInteger$1(input) * 7);
	}
	function addUTCDays$1(date, input) {
		return addUTCMilliseconds$1(date, toInteger$1(input) * DateAdapter$1.MILLISECONDS_IN_DAY);
	}
	function addUTCHours$1(date, input) {
		return addMilliseconds$1(date, toInteger$1(input) * DateAdapter$1.MILLISECONDS_IN_HOUR);
	}
	function addUTCMinutes$1(date, input) {
		return addMilliseconds$1(date, toInteger$1(input) * DateAdapter$1.MILLISECONDS_IN_MINUTE);
	}
	function addUTCSeconds$1(date, input) {
		return addMilliseconds$1(date, toInteger$1(input) * DateAdapter$1.MILLISECONDS_IN_SECOND);
	}
	function addUTCMilliseconds$1(date, input) {
		const amount = toInteger$1(input);
		const timestamp = date.getTime();
		return new Date(timestamp + amount);
	}
	function subUTCYears$1(date, amount) {
		return addUTCYears$1(date, -amount);
	}
	function subUTCMonths$1(date, amount) {
		return addUTCMonths$1(date, -amount);
	}
	function subUTCWeeks$1(date, amount) {
		return addUTCWeeks$1(date, -amount);
	}
	function subUTCDays$1(date, amount) {
		return addUTCDays$1(date, -amount);
	}
	function subUTCHours$1(date, amount) {
		return addUTCHours$1(date, -amount);
	}
	function subUTCMinutes$1(date, amount) {
		return addUTCMinutes$1(date, -amount);
	}
	function subUTCSeconds$1(date, amount) {
		return addUTCSeconds$1(date, -amount);
	}
	function subUTCMilliseconds$1(date, amount) {
		return addUTCMilliseconds$1(date, -amount);
	}
	var ArgumentError = class extends Error {};
	var InfiniteLoopError = class extends Error {};
	function numberSortComparer(a, b) {
		if (a > b) return 1;
		else if (b > a) return -1;
		else return 0;
	}
	function freqToGranularity(freq) {
		switch (freq) {
			case "YEARLY": return "year";
			case "MONTHLY": return "month";
			case "WEEKLY": return "week";
			case "DAILY": return "day";
			case "HOURLY": return "hour";
			case "MINUTELY": return "minute";
			case "SECONDLY": return "second";
			case "MILLISECONDLY": return "millisecond";
			default: throw new Error("unknown freq passed to freqToGranularity()");
		}
	}
	function cloneJSON(json) {
		return JSON.parse(JSON.stringify(json));
	}
	function dateInputToDateAdapter(date) {
		return date instanceof DateTime$1 ? DateAdapterBase$1.adapter.fromDateTime(date) : date instanceof DateAdapterBase$1 ? date : DateAdapterBase$1.adapter.fromDate(date);
	}
	function dateInputToDateTime(date, timezone) {
		if (date instanceof DateTime$1) {
			if (date.timezone !== timezone) return DateAdapterBase$1.adapter.fromDateTime(date).set("timezone", timezone).toDateTime();
			return date;
		}
		return date instanceof DateAdapterBase$1 ? date.set("timezone", timezone).toDateTime() : DateAdapterBase$1.adapter.fromDate(date).set("timezone", timezone).toDateTime();
	}
	function normalizeDateTimeTimezone$1(date, timezone) {
		if (date.timezone !== timezone) return DateAdapterBase$1.adapter.fromDateTime(date).set("timezone", timezone).toDateTime();
		return date;
	}
	var RuleOptionError = class extends Error {};
	function normalizeDefaultOptions(options) {
		let start;
		if (options.start instanceof DateTime$1) start = options.start;
		else if (options.start instanceof DateAdapterBase$1) start = options.start.toDateTime();
		else if (DateAdapterBase$1.adapter.isDate(options.start)) start = DateAdapterBase$1.adapter.fromDate(options.start).toDateTime();
		else throw new RuleOptionError("\"start\" must be either a `DateAdapter` instance or an instance of the date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)");
		let end;
		if (options.end) if (options.end instanceof DateTime$1) end = options.end;
		else if (options.end instanceof DateAdapterBase$1) end = options.end.toDateTime();
		else if (DateAdapterBase$1.adapter.isDate(options.end)) end = DateAdapterBase$1.adapter.fromDate(options.end).toDateTime();
		else throw new RuleOptionError("\"end\" must be either be `undefined`, a `DateAdapter` instance, or an instance of the date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)");
		if (options.duration !== void 0) {
			if (!Number.isInteger(options.duration)) throw new RuleOptionError("\"duration\" expects a whole number");
			if (options.duration <= 0) throw new RuleOptionError("\"duration\" must be greater than 0");
		}
		if (options.count !== void 0) {
			if (!Number.isInteger(options.count)) throw new RuleOptionError("\"count\" must be a whole number");
			if (options.count < 0) throw new RuleOptionError("\"count\" must be greater than 0");
		}
		if (options.end !== void 0 && options.count !== void 0) throw new RuleOptionError("\"end\" and \"count\" cannot both be present");
		return {
			start,
			end,
			count: options.count,
			duration: options.duration
		};
	}
	function normalizeRuleOptions(recurrenceModules, options) {
		const normOptions = normalizeDefaultOptions(options);
		const startOptions = cloneJSON(options);
		recurrenceModules.forEach((mod) => {
			mod.normalizeOptions(startOptions, normOptions);
		});
		Object.keys(normOptions).forEach((key) => {
			if (normOptions[key] === void 0) delete normOptions[key];
		});
		return normOptions;
	}
	function cloneRuleOptions(options) {
		const obj = cloneJSON(options);
		obj.start = options.start;
		if (options.end) obj.end = options.end;
		return obj;
	}
	var RecurrenceRuleError = class extends Error {};
	var ValidDateTime = class {
		constructor(date) {
			this.date = date;
		}
	};
	var InvalidDateTime = class {
		constructor(date) {
			this.date = date;
		}
	};
	function recurrenceRulesReducer(rules) {
		return (iterator) => rules.reduce((prev, curr) => {
			const rule = curr.get(iterator);
			if (rule) prev.push(rule);
			return prev;
		}, []);
	}
	var RecurrenceRulesIterator = class {
		constructor(recurrenceRules, options, args) {
			this.options = options;
			this.args = args;
			this.rules = [];
			this.iterator = this.options.count === void 0 ? this.iterate() : this.args.reverse ? this.iterateWithReverseCount() : this.iterateWithCount();
			this.options = Object.assign(Object.assign({}, cloneJSON(options)), {
				start: options.start,
				end: options.end
			});
			this.reverse = this.options.count === void 0 && args.reverse || false;
			const { start, end } = this.normalizeDateTimeArgs(args);
			if (options.count !== void 0) this.start = options.start;
			else if (start && options.start) this.start = start.isAfterOrEqual(options.start) ? start : options.start;
			else this.start = start || options.start;
			if (end && options.end) this.end = end.isBeforeOrEqual(options.end) ? end : options.end;
			else this.end = end || options.end;
			if (this.args.reverse && !(options.count !== void 0 || this.end)) throw new Error("When iterating in reverse, the rule must have an `end` or `count` property or you must provide an `end` argument.");
			this.isInfinite = !this.end && this.options.count === void 0;
			this.hasDuration = !!this.options.duration;
			this.rules = Array.isArray(recurrenceRules) ? recurrenceRules : recurrenceRules(this);
		}
		[Symbol.iterator]() {
			return this.iterator;
		}
		next(args) {
			return this.iterator.next(args);
		}
		/**
		* In the pipe controller, we have an extra level of indirection with
		* the `run()` and `iterate()` methods. The `iterate()` method is the
		* method which actually runs the logic in the pipes. If we didn't
		* need to account for the `count` property of a rule, we would *only*
		* need the iterate method... so much simpler. But we do need to account
		* for rules with a `count` property.
		*
		* Rules with a `count` property need to begin iteration at the beginning
		* because the `count` is always from the rule's start time. So if someone
		* passes in a new start time as an argument to a rule with `count`, we
		* need to secretly iterate from the beginning, tracking the number of
		* iterations, and then only start yielding dates when we reach the section
		* the user cares about (or, if we hit our `count` quota, cancel iterating).
		*
		* Additionally, we need to handle iterating in reverse. In this case, we build
		* up a cache of dates between the rule's start time and the reverse iteration
		* start date. Once we hit the reverse iteration start date, we start
		* yielding dates in the cache, in reverse order.
		*
		* In general, I imagine the count number, if used, will be small. But a large
		* count will definitely have a negative performance affect. I don't think
		* there's anything to be done about this.
		*/
		*iterateWithReverseCount() {
			const dates = Array.from(this.iterateWithCount()).reverse();
			let yieldArgs;
			const dateCache = dates.slice();
			let date = dateCache.shift();
			while (date) {
				if (yieldArgs && yieldArgs.skipToDate && date.isAfter(yieldArgs.skipToDate)) {
					date = dateCache.shift();
					continue;
				}
				yieldArgs = yield date;
				if (yieldArgs && yieldArgs.skipToDate && yieldArgs.skipToDate.isAfterOrEqual(date)) throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");
				date = dateCache.shift();
			}
		}
		*iterateWithCount() {
			if (this.options.count === 0) return;
			const iterable = this.iterate();
			const start = this.args.start || this.start;
			let date = iterable.next().value;
			let index = 1;
			let yieldArgs;
			while (date && index <= this.options.count) {
				index++;
				if (date.isBefore(start)) {
					date = iterable.next().value;
					continue;
				}
				if (yieldArgs && yieldArgs.skipToDate && date.isBefore(yieldArgs.skipToDate)) {
					date = iterable.next().value;
					continue;
				}
				yieldArgs = yield date;
				if (yieldArgs && yieldArgs.skipToDate && yieldArgs.skipToDate.isBeforeOrEqual(date)) throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");
				date = iterable.next().value;
			}
		}
		*iterate() {
			let startingDate = this.start;
			if (this.reverse) startingDate = this.end;
			let date = this.nextDate(startingDate);
			while (date) {
				const args = yield this.normalizeRunOutput(date);
				if (args && args.skipToDate) {
					if (this.reverse ? args.skipToDate.isAfterOrEqual(date) : args.skipToDate.isBeforeOrEqual(date)) throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");
					date = this.nextDate(args.skipToDate);
				} else date = this.nextDate(this.reverse ? date.subtract(1, "millisecond") : date.add(1, "millisecond"));
			}
		}
		/**
		* Loops through the recurrence rules until a valid date is found.
		*/
		nextDate(start) {
			let result = this.runRules(start.set("generators", []));
			if (this.isDatePastEnd(result.date)) return null;
			let index = 0;
			while (result instanceof InvalidDateTime && index < 50) {
				result = this.runRules(result.date);
				if (this.isDatePastEnd(result.date)) return null;
				index++;
			}
			if (result instanceof InvalidDateTime) throw new RecurrenceRuleError(`Failed to find a matching occurrence in ${index} iterations. Last iterated date: "${result.date.toISOString()}"`);
			if (this.reverse ? start.isBefore(result.date) : start.isAfter(result.date)) throw new RecurrenceRuleError("An error occurred in a recurrence rule. If this happened using the rSchedule provided recurrence rules, you should open an issue in the rSchedule repo. The maintainer is going to want to know how to recreate the error.");
			return result.date;
		}
		/**
		* Performs one run of the recurrence rules and returns the result.
		* It's a slightly optimized reducer function.
		*/
		runRules(start) {
			let result = new ValidDateTime(start);
			for (const rule of this.rules) {
				if (result instanceof InvalidDateTime) return result;
				result = rule.run(result.date);
			}
			return result;
		}
		isDatePastEnd(date) {
			return this.reverse ? date.isBefore(this.start) : this.end && date.isAfter(this.end);
		}
		normalizeRunOutput(date) {
			return this.hasDuration ? date.set("duration", this.options.duration) : date;
		}
		normalizeDateTimeArgs(args) {
			return {
				start: args.start && normalizeDateTimeTimezone$1(args.start, this.options.start.timezone),
				end: args.end && normalizeDateTimeTimezone$1(args.end, this.options.start.timezone)
			};
		}
	};
	//#endregion
	//#region ../../node_modules/@rschedule/core/es2015/generators.js
	var OccurrenceGenerator = class {
		constructor(args = {}) {
			this.timezone = args.timezone !== void 0 ? args.timezone : null;
			this.maxDuration = args.maxDuration || 0;
		}
		/** Returns the first occurrence or, if there are no occurrences, null. */
		get firstDate() {
			if (this._firstDate !== void 0) return this._firstDate;
			const start = this._run().next().value;
			this._firstDate = start ? this.dateAdapter.fromDateTime(start) : null;
			return this._firstDate;
		}
		/** If generator is infinite, returns `null`. Otherwise returns the end date */
		get lastDate() {
			if (this._lastDate !== void 0) return this._lastDate;
			if (this.isInfinite) {
				this._lastDate = null;
				return null;
			}
			const end = this._run({ reverse: true }).next().value;
			this._lastDate = end ? this.dateAdapter.fromDateTime(end) : null;
			return this._lastDate;
		}
		pipe(...operators) {
			return operators.reduce((prev, curr) => curr({
				base: prev,
				timezone: this.timezone
			}), this);
		}
		/**
		* Processes the object's rules/dates and returns an iterable for the occurrences.
		*
		* Options object:
		* - `start` the date to begin iteration on
		* - `end` the date to end iteration on
		* - `take` the max number of dates to take before ending iteration
		* - `reverse` whether to iterate in reverse or not
		*
		* Examples:
		*
		* ```
		* const iterator = schedule.occurrences({ start: new Date(), take: 5 });
		
		* for (const date of iterator) {
		*   // do stuff
		* }
		
		* iterator.toArray() // returns Date array
		* iterator.next().value // returns next Date
		* ```
		*
		*/
		occurrences(args = {}) {
			return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args));
		}
		/**
		* Iterates over the object's occurrences and bundles them into collections
		* with a specified granularity (default is `"YEARLY"`). Make sure to
		* read about each option & combination of options below.
		*
		* Options object:
		*   - start?: DateAdapter
		*   - end?: DateAdapter
		*   - take?: number
		*   - reverse?: NOT SUPPORTED
		*   - granularity?: CollectionsGranularity
		*   - weekStart?: DateAdapter.Weekday
		*   - skipEmptyPeriods?: boolean
		*
		* Returned `Collection` object:
		*
		*   - `dates` property containing an array of DateAdapter objects.
		*   - `granularity` property containing the granularity.
		*     - `CollectionsGranularity` === `RuleOptions.Frequency`.
		*     - default is `"YEARLY"`
		*   - `periodStart` property containing a DateAdapter equal to the period's
		*     start time.
		*   - `periodEnd` property containing a DateAdapter equal to the period's
		*     end time.
		*
		* #### Details:
		*
		* `collections()` always returns full periods. This means that the `start` argument is
		* transformed to be the start of whatever period the `start` argument is in, and the
		* `end` argument is transformed to be the end of whatever period the `end` argument is
		* in.
		*
		* - Example: with granularity `"YEARLY"`, the `start` argument will be transformed to be the
		*   start of the year passed in the `start` argument, and the `end` argument will be transformed
		*   to be the end of the year passed in the `end` argument.
		*
		* By default, the `periodStart` value of `Collection` objects produced by this method increments linearly.
		* This means the returned `Collection#dates` property may have length 0. This can be changed by
		* passing the `skipEmptyPeriods: true` option, in which case the `periodStart` from one collection to the
		* next can "jump".
		*
		* - Example 1: if your object's first occurrence is 2019/2/1 (February 1st) and you call
		*   `collection({skipEmptyPeriods: true, granularity: 'DAILY', start: new Date(2019,0,1)})`
		*   (so starting on January 1st), the first Collection produced will have a `periodStart` in February.
		*
		* - Example 2: if your object's first occurrence is 2019/2/1 (February 1st) and you call
		*   `collection({granularity: 'DAILY', start: new Date(2019,0,1)})`
		*   (so starting on January 1st), the first collection produced will have a `Collection#periodStart`
		*   of January 1st and have `Collection#dates === []`. Similarly, the next 30 collections produced
		*   (Jan 2nd - 31st) will all contain an empty array for the `dates` property. Then the February 1st
		*   `Collection` will contain dates.
		*
		* When giving a `take` argument to `collections()`, you are specifying
		* the number of `Collection` objects to return (rather than occurrences).
		*
		* When choosing a granularity of `"WEEKLY"`, the `weekStart` option is required.
		*
		* When choosing a granularity of `"MONTHLY"`:
		*
		* - If the `weekStart` option *is not* present, will generate collections with
		*   the `periodStart` and `periodEnd` at the beginning and end of each month.
		*
		* - If the `weekStart` option *is* present, will generate collections with the
		*   `periodStart` equal to the start of the first week of the month, and the
		*   `periodEnd` equal to the end of the last week of the month. This behavior could be
		*   desired when rendering opportunities in a calendar view, where the calendar renders
		*   full weeks (which may result in the calendar displaying dates in the
		*   previous or next months).
		*
		*/
		collections(args = {}) {
			return new CollectionIterator(this, this.normalizeCollectionsArgs(args));
		}
		/**
		* Returns true if an occurrence starts on or between the provided start/end
		* datetimes. If the `excludeEnds` option is provided, then occurrences
		* equal to the start/end times are ignored.
		*
		* If the occurrence generator has a duration, and `excludeEnds !== true`,
		* and a `maxDuration` argument is supplied (either in the constructor or
		* here), then any occurrence that's time overlaps with the start/end times
		* return true.
		*/
		occursBetween(startInput, endInput, options = {}) {
			const start = this.normalizeDateInput(startInput);
			const end = this.normalizeDateInput(endInput);
			if (this.hasDuration && !options.excludeEnds) {
				const maxDuration = this.getMaxDuration("occursBetween", options);
				const iterator = this._run({
					start: start.subtract(maxDuration, "millisecond"),
					end,
					reverse: true
				});
				for (const day of iterator) {
					if (day.end.isBefore(start)) continue;
					return true;
				}
				return false;
			}
			for (const day of this._run({
				start,
				end
			})) {
				if (options.excludeEnds) {
					if (day.isEqual(start)) continue;
					if (day.isEqual(end)) break;
				}
				return true;
			}
			return false;
		}
		occursOn(rawArgs) {
			const args = this.normalizeOccursOnArgs(rawArgs);
			if (args.weekday) {
				if (this.isInfinite && !args.before) throw new ArgumentError("When calling `occursOn()` with a `weekday` argument and an occurrence object that has infinite occurrences, you must include a `before` argument as well.");
				const start = args.after && (args.excludeEnds ? args.after.add(1, "day") : args.after);
				const end = args.before && (args.excludeEnds ? args.before.subtract(1, "day") : args.before);
				const iterator = this._run({
					start,
					end
				});
				let date = iterator.next().value;
				if (!date) return false;
				while (date) {
					if (date.get("weekday") === args.weekday) return true;
					date = iterator.next({ skipToDate: date.add(getDifferenceBetweenWeekdays(date.get("weekday"), args.weekday), "day").granularity("day") }).value;
				}
				return false;
			}
			if (!args.date) throw new ArgumentError(`"occursOn()" must be called with either a "date" or "weekday" argument`);
			if (this.hasDuration) {
				const maxDuration = this.getMaxDuration("occursOn", args);
				const iterator = this._run({
					start: args.date.subtract(maxDuration, "millisecond"),
					end: args.date
				});
				for (const date of iterator) {
					if (date.end.isBefore(args.date)) continue;
					if (date.isAfter(args.date)) return false;
					return true;
				}
				return false;
			}
			for (const day of this._run({
				start: args.date,
				end: args.date
			})) return !!day;
			return false;
		}
		/**
		* Returns true if an occurrence starts after the provided datetime.
		* If the `excludeStart` option is provided, then occurrences
		* equal to the provided datetime are ignored.
		*
		* If the occurrence generator has a duration, and `excludeStart !== true`,
		* and a `maxDuration` argument is supplied (either in the constructor or
		* here), then any occurrence that's end time is after/equal to the provided
		* datetime return true.
		*/
		occursAfter(date, options = {}) {
			const adapter = this.normalizeDateInput(date);
			if (this.hasDuration && !options.excludeStart) {
				const maxDuration = this.getMaxDuration("occursAfter", options);
				const iterator = this._run({ start: adapter.subtract(maxDuration, "millisecond") });
				for (const date of iterator) {
					if (date.end.isBefore(adapter)) continue;
					return true;
				}
				return false;
			}
			for (const day of this._run({ start: adapter })) {
				if (options.excludeStart && day.isEqual(adapter)) continue;
				return true;
			}
			return false;
		}
		/**
		* Returns true if an occurrence starts before the provided datetime.
		* If the `excludeStart` option is provided, then occurrences
		* equal to the provided datetime are ignored.
		*
		* If the occurrence generator has a duration, and `excludeStart` is
		* also provided, then this will only return true if an occurrence
		* both starts and ends before the provided datetime.
		*/
		occursBefore(date, options = {}) {
			const adapter = this.normalizeDateInput(date);
			if (this.hasDuration && options.excludeStart) {
				for (const day of this._run({
					end: adapter,
					reverse: true
				})) {
					if (day.end.isAfterOrEqual(adapter)) continue;
					return true;
				}
				return false;
			}
			for (const day of this._run({
				end: adapter,
				reverse: true
			})) {
				if (options.excludeStart && day.isEqual(adapter)) continue;
				return true;
			}
			return false;
		}
		get dateAdapter() {
			return DateAdapterBase$1.adapter;
		}
		normalizeOccurrencesArgs(rawArgs) {
			return Object.assign(Object.assign({}, rawArgs), {
				start: this.normalizeDateInput(rawArgs.start),
				end: this.normalizeDateInput(rawArgs.end)
			});
		}
		normalizeCollectionsArgs(rawArgs) {
			if (rawArgs.reverse !== void 0) throw new ArgumentError("`collections()` does not support the `reverse` option at this time.");
			return Object.assign(Object.assign({}, rawArgs), {
				start: this.normalizeDateInput(rawArgs.start),
				end: this.normalizeDateInput(rawArgs.end)
			});
		}
		normalizeOccursOnArgs(rawArgs = {}) {
			return Object.assign(Object.assign({}, rawArgs), {
				date: this.normalizeDateInput(rawArgs.date),
				after: this.normalizeDateInput(rawArgs.after),
				before: this.normalizeDateInput(rawArgs.before),
				excludeDates: rawArgs.excludeDates && rawArgs.excludeDates.map((date) => this.normalizeDateInput(date))
			});
		}
		normalizeRunArgs(args) {
			return Object.assign(Object.assign({}, args), {
				start: this.normalizeDateInput(args.start),
				end: this.normalizeDateInput(args.end)
			});
		}
		normalizeDateInput(date) {
			return date ? dateInputToDateTime(date, this.timezone) : void 0;
		}
		normalizeDateInputToAdapter(date) {
			if (!date) return;
			return dateInputToDateAdapter(date);
		}
		normalizeRunOutput(date) {
			return normalizeDateTimeTimezone$1(date, this.timezone);
		}
		getMaxDuration(method, options) {
			const maxDuration = options.maxDuration || this.maxDuration;
			if (!Number.isInteger(maxDuration)) throw new ArgumentError(`When an occurrence generator has a duration, a 'maxDuration' argument must be supplied to ${method}().`);
			return maxDuration;
		}
	};
	var OccurrenceIterator = class {
		constructor(iterable, args) {
			this.iterable = iterable;
			this.args = args;
			this[Symbol.iterator] = () => this.occurrenceIterator();
			this.iterator = iterable._run(args);
			this.isInfinite = iterable.isInfinite;
		}
		next(args) {
			return this.occurrenceIterator(args).next();
		}
		toArray() {
			if (this.args.end || this.args.take || !this.isInfinite) return Array.from(this.occurrenceIterator());
			throw new InfiniteLoopError("OccurrenceIterator#toArray() can only be called if the iterator is not infinite, or you provide and `end` argument, or you provide a `take` argument.");
		}
		*occurrenceIterator(rawArgs) {
			let args = this.normalizeRunArgs(rawArgs);
			let date = this.iterator.next(args).value;
			while (date) {
				const yieldArgs = yield this.normalizeDateOutput(date);
				args = this.normalizeRunArgs(yieldArgs);
				date = this.iterator.next(args).value;
			}
		}
		normalizeRunArgs(args) {
			return { skipToDate: this.normalizeDateInput(args && args.skipToDate) };
		}
		normalizeDateInput(date) {
			return date ? dateInputToDateTime(date, this.iterable.timezone) : void 0;
		}
		normalizeDateOutput(date) {
			if (!date) return;
			return date ? DateAdapterBase$1.adapter.fromDateTime(date) : void 0;
		}
	};
	var Collection = class {
		constructor(dates = [], granularity, periodStart, periodEnd) {
			this.dates = dates;
			this.granularity = granularity;
			this.periodStart = periodStart;
			this.periodEnd = periodEnd;
		}
	};
	var CollectionIterator = class {
		constructor(iterable, args) {
			this.iterable = iterable;
			this.args = args;
			this.granularity = "year";
			this[Symbol.iterator] = () => this.iterator;
			if (args.granularity) {
				this.granularity = args.granularity;
				if (this.granularity === "week" && !args.weekStart) throw new Error("\"week\" granularity requires `weekStart` arg");
			}
			if (args.weekStart) this.weekStart = args.weekStart;
			if (args.reverse) throw new Error("`OccurrenceGenerator#collections()` does not support iterating in reverse. Though `OccurrenceGenerator#occurrences()` does support iterating in reverse.");
			this.args = Object.assign(Object.assign({}, args), {
				start: args.start || iterable._run().next().value,
				end: args.end && this.getPeriod(args.end).end
			});
			this.startDate = this.args.start && this.normalizeDateOutput(this.getPeriod(this.args.start).start) || null;
			this.iterator = this.collectionIterator();
		}
		next() {
			return this.iterator.next();
		}
		/**
		* While `next()` and `[Symbol.iterator]` both share state,
		* `toArray()` does not share state and always returns the whole
		* collections array.
		*/
		toArray() {
			if (this.args.end || this.args.take || !this.iterable.isInfinite) {
				const collections = [];
				for (const collection of this.collectionIterator()) collections.push(collection);
				return collections;
			}
			throw new InfiniteLoopError("CollectionIterator#toArray() can only be called if the iterator is not infinite, or you provide and `end` argument, or you provide a `take` argument.");
		}
		normalizeDateOutput(date) {
			if (!date) return;
			return DateAdapterBase$1.adapter.fromDateTime(date);
		}
		*collectionIterator() {
			if (!this.startDate) return;
			let iterator = this.occurrenceIterator();
			let date = iterator.next().value;
			if (!date) return;
			let period = this.getPeriod(this.args.start);
			let dates = [];
			let index = 0;
			while (date && (this.args.take === void 0 || this.args.take > index)) {
				while (date && date.isBeforeOrEqual(period.end)) {
					dates.push(date);
					date = iterator.next().value;
				}
				yield new Collection(dates.map((date) => this.normalizeDateOutput(date)), this.granularity, this.normalizeDateOutput(period.start), this.normalizeDateOutput(period.end));
				if (!date) return;
				dates = [];
				period = !this.args.skipEmptyPeriods ? this.getPeriod(this.incrementPeriod(period.period)) : this.getPeriod(date);
				if (this.granularity === "month" && this.weekStart) {
					iterator = this.iterable._run({
						start: period.start,
						end: this.args.end
					});
					date = iterator.next().value;
				}
				index++;
			}
		}
		getPeriod(date) {
			let start;
			let end;
			let period;
			if (this.granularity === "month" && this.weekStart) {
				start = date.granularity("month").granularity("week", { weekStart: this.weekStart });
				end = date.endGranularity("month").endGranularity("week", { weekStart: this.weekStart });
				period = date.granularity("month");
			} else {
				start = date.granularity(this.granularity, { weekStart: this.weekStart });
				end = date.endGranularity(this.granularity, { weekStart: this.weekStart });
				period = start;
			}
			return {
				start,
				end,
				period
			};
		}
		incrementPeriod(date) {
			return date.add(1, this.granularity);
		}
		occurrenceIterator() {
			let start = this.args.start || this.iterable._run().next().value;
			if (!start) return this.iterable._run(this.args);
			start = this.getPeriod(start).start;
			return this.iterable._run({
				start,
				end: this.args.end
			});
		}
	};
	var Operator = class Operator extends OccurrenceGenerator {
		constructor(streams, config) {
			super(config);
			this.streams = streams;
			this.config = config;
			this.timezone = config.timezone;
			this.streams = streams.map((stream) => stream instanceof Operator ? stream : stream.set("timezone", this.timezone));
			this.isInfinite = this.calculateIsInfinite();
			this.hasDuration = this.calculateHasDuration();
		}
		normalizeDateInput(date) {
			if (!date) return;
			return dateInputToDateTime(date, this.timezone);
		}
		normalizeRunOutput(date) {
			return normalizeDateTimeTimezone$1(date, this.timezone);
		}
	};
	/**
	* Simple class that lets us access the `value`, `runArgs`, and `done`
	* status of an OccurrenceGenerator iterator
	*/
	var IterableWrapper = class {
		constructor(generator, runArgs) {
			this.runArgs = runArgs;
			this.stream = generator._run(this.runArgs);
			this.next();
		}
		next(args) {
			const { done, value } = this.stream.next(args);
			this.done = typeof done === "boolean" ? done : true;
			this.value = value;
			return {
				done,
				value
			};
		}
	};
	function processYieldArgs(streams, options = {}, yieldArgs = {}) {
		if (!yieldArgs.skipToDate || streams.length === 0) return;
		if (options.reverse ? streams.every((s) => s.value.isBeforeOrEqual(yieldArgs.skipToDate)) : streams.every((s) => s.value.isAfterOrEqual(yieldArgs.skipToDate))) throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");
		for (const stream of streams) {
			if (stream.done) continue;
			if (options.reverse ? stream.value.isBeforeOrEqual(yieldArgs.skipToDate) : stream.value.isAfterOrEqual(yieldArgs.skipToDate)) continue;
			stream.next(yieldArgs);
		}
	}
	/** sorts ascending with completed iterables at the end */
	function streamsComparer(a, b) {
		if (a.done && b.done) return 0;
		if (a.done) return 1;
		if (b.done) return -1;
		if (a.value.isAfter(b.value)) return 1;
		return -1;
	}
	/** sorts descending with completed iterables at the start */
	function streamsReverseComparer(a, b) {
		if (a.done && b.done) return 0;
		if (a.done) return -1;
		if (b.done) return 1;
		if (a.value.isAfter(b.value)) return -1;
		return 1;
	}
	function selectNextIterable(streams, options = {}, yieldArgs = {}) {
		processYieldArgs(streams, options, yieldArgs);
		return streams.sort(options.reverse ? streamsReverseComparer : streamsComparer).filter((s) => !s.done).shift();
	}
	/**
	* An operator function which accepts a spread of occurrence generators
	* and adds their occurrences to the output.
	*
	* @param streams a spread of occurrence generators
	*/
	function add(...streams) {
		return (options) => new AddOperator(streams, options);
	}
	var AddOperator = class AddOperator extends Operator {
		set(_, value) {
			return new AddOperator(this.streams.map((stream) => stream.set("timezone", value)), Object.assign(Object.assign({}, this.config), {
				base: this.config.base && this.config.base.set("timezone", value),
				timezone: value
			}));
		}
		*_run(args = {}) {
			const wrappedStreams = this.streams.map((input) => new IterableWrapper(input, args));
			if (this.config.base) wrappedStreams.push(new IterableWrapper(this.config.base, args));
			if (wrappedStreams.length === 0) return;
			let stream = selectNextIterable(wrappedStreams, args);
			while (stream && !stream.done) {
				const yieldArgs = yield this.normalizeRunOutput(stream.value);
				if (!(yieldArgs && yieldArgs.skipToDate)) stream.next();
				stream = selectNextIterable(wrappedStreams, args, yieldArgs);
			}
		}
		calculateIsInfinite() {
			return this.config.base && this.config.base.isInfinite || this.streams.some((stream) => stream.isInfinite);
		}
		calculateHasDuration() {
			const streamsDuration = this.streams.every((stream) => stream.hasDuration);
			if (!this.config.base) return streamsDuration;
			return this.config.base.hasDuration && streamsDuration;
		}
	};
	var Dates = class Dates extends OccurrenceGenerator {
		constructor(args = {}) {
			super(args);
			this.adapters = [];
			this.isInfinite = false;
			this.maxDuration = 0;
			this.datetimes = [];
			this.data = args.data;
			if (args.dates) {
				this.adapters = args.dates.map((date) => {
					let adapter = this.normalizeDateInputToAdapter(date);
					if (args.duration && !adapter.duration) adapter = adapter.set("duration", args.duration);
					return adapter.set("timezone", this.timezone);
				});
				this.datetimes = this.adapters.map((adapter) => adapter.toDateTime());
			}
			this.hasDuration = this.datetimes.every((date) => !!date.duration);
			if (this.hasDuration) this.maxDuration = this.adapters.reduce((prev, curr) => curr.duration > prev ? curr.duration : prev, 0);
		}
		get length() {
			return this.adapters.length;
		}
		/** Returns the first occurrence or, if there are no occurrences, null. */
		get firstDate() {
			return this.adapters[0] || null;
		}
		/** Returns the last occurrence or, if there are no occurrences, null. */
		get lastDate() {
			return this.adapters[this.length - 1] || null;
		}
		occurrences(args = {}) {
			return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args));
		}
		collections(args = {}) {
			return new CollectionIterator(this, this.normalizeCollectionsArgs(args));
		}
		add(value) {
			return new Dates({
				dates: [...this.adapters, value],
				timezone: this.timezone,
				data: this.data
			});
		}
		remove(value) {
			const dates = this.adapters.slice();
			const input = this.normalizeDateInputToAdapter(value);
			const index = dates.findIndex((date) => date.valueOf() === input.valueOf());
			if (index >= 0) dates.splice(index, 1);
			return new Dates({
				dates,
				timezone: this.timezone,
				data: this.data
			});
		}
		set(prop, value, options = {}) {
			let timezone = this.timezone;
			let dates = this.adapters.slice();
			if (prop === "timezone") {
				if (value === this.timezone) return this;
				else if (options.keepLocalTime) dates = this.adapters.map((adapter) => {
					const json = adapter.toJSON();
					json.timezone = value;
					return this.dateAdapter.fromJSON(json);
				});
				timezone = value;
			} else if (prop === "dates") dates = value;
			else if (prop === "duration") dates = dates.map((date) => date.set("duration", value || 0));
			else throw new ArgumentError(`Unexpected prop argument "${prop}". Accepted values are "timezone" or "dates"`);
			return new Dates({
				dates,
				data: this.data,
				timezone
			});
		}
		filter(fn) {
			return new Dates({
				dates: this.adapters.filter(fn),
				data: this.data,
				timezone: this.timezone
			});
		}
		*_run(args = {}) {
			let dates = this.datetimes.sort(dateTimeSortComparer);
			if (args.start) dates = dates.filter((date) => date.isAfterOrEqual(args.start));
			if (args.end) dates = dates.filter((date) => date.isBeforeOrEqual(args.end));
			if (args.reverse) dates = dates.slice().reverse();
			if (args.take) dates = dates.slice(0, args.take);
			const dateCache = dates.slice();
			let date = dateCache.shift();
			let yieldArgs;
			while (date) {
				if (yieldArgs && yieldArgs.skipToDate && (args.reverse ? yieldArgs.skipToDate.isBefore(date) : yieldArgs.skipToDate.isAfter(date))) {
					date = dateCache.shift();
					continue;
				}
				date = date.add(this, "generator");
				yieldArgs = yield this.normalizeRunOutput(date);
				if (yieldArgs && yieldArgs.skipToDate && (args.reverse ? yieldArgs.skipToDate.isAfterOrEqual(date) : yieldArgs.skipToDate.isBeforeOrEqual(date))) throw new Error("A provided `skipToDate` option must be greater than the last yielded date (or smaller, in the case of reverse iteration)");
				date = dateCache.shift();
			}
		}
	};
	var InvalidDateAdapterError = class extends Error {};
	var dateAdapterConfig;
	var DateAdapterBase = class {
		constructor(_date, options) {
			/**
			* The metadata property is intended to store arbitrary data
			* related to this DateAdapter. Unlike other properties, the
			* metadata property is intended to be mutable.
			*/
			this.metadata = {};
			this.duration = options && options.duration || 0;
			this.generators = options && options.generators && options.generators.slice() || [];
			if (!Number.isInteger(this.duration) || this.duration < 0) throw new InvalidDateAdapterError("duration must be a non-negative integer");
		}
		static set adapter(value) {
			if (dateAdapterConfig) throw new Error(`"${dateAdapterConfig.name}" has already been configured.`);
			dateAdapterConfig = value;
		}
		static get adapter() {
			if (!dateAdapterConfig) throw new Error("No date adapter has been configured. See rSchedule docs.");
			return dateAdapterConfig;
		}
		static isDate(_object) {
			throw unimplementedError("isDate()");
		}
		static fromDate(_date, _options) {
			throw unimplementedError("fromDate()");
		}
		static fromJSON(_json) {
			throw unimplementedError("fromJSON()");
		}
		static fromDateTime(_datetime) {
			throw unimplementedError("fromDateTime()");
		}
		/**
		* Returns a string in simplified extended ISO format (ISO 8601).
		*
		* _Note: this method is intended for testing and its
		* implementation isn't particularly performant._
		*/
		toISOString() {
			return this.set("timezone", "UTC").toDateTime().toISOString();
		}
		toDateTime() {
			return DateTime.fromJSON(Object.assign(Object.assign({}, this.toJSON()), {
				generators: this.generators,
				metadata: this.metadata
			}));
		}
	};
	DateAdapterBase.hasTimezoneSupport = false;
	function unimplementedError(name) {
		return /* @__PURE__ */ new Error(`You must implement the "${name}" method for this DateAdapter class`);
	}
	var DateAdapter;
	(function(DateAdapter) {
		DateAdapter.WEEKDAYS = [
			"SU",
			"MO",
			"TU",
			"WE",
			"TH",
			"FR",
			"SA"
		];
		DateAdapter.MILLISECONDS_IN_SECOND = 1e3;
		DateAdapter.MILLISECONDS_IN_MINUTE = DateAdapter.MILLISECONDS_IN_SECOND * 60;
		DateAdapter.MILLISECONDS_IN_HOUR = DateAdapter.MILLISECONDS_IN_MINUTE * 60;
		DateAdapter.MILLISECONDS_IN_DAY = DateAdapter.MILLISECONDS_IN_HOUR * 24;
		DateAdapter.MILLISECONDS_IN_WEEK = DateAdapter.MILLISECONDS_IN_DAY * 7;
	})(DateAdapter || (DateAdapter = {}));
	var InvalidDateTimeError = class extends Error {};
	var DateTime = class DateTime {
		constructor(date, timezone, duration, generators, options = {}) {
			this.metadata = {};
			this.date = new Date(date);
			this.timezone = timezone || null;
			this.duration = duration || 0;
			this.generators = generators && generators.slice() || [];
			if (!Number.isInteger(this.duration) || this.duration < 0) throw new InvalidDateTimeError("duration must be a non-negative integer");
			if (options.metadata) Object.assign(this.metadata, options.metadata);
			this.assertIsValid();
		}
		static fromJSON(json) {
			return new DateTime(new Date(Date.UTC(json.year, json.month - 1, json.day, json.hour, json.minute, json.second, json.millisecond)), json.timezone, json.duration, json.generators, { metadata: json.metadata });
		}
		static fromDateAdapter(adapter) {
			return DateTime.fromJSON(Object.assign(Object.assign({}, adapter.toJSON()), {
				generators: adapter.generators,
				metadata: adapter.metadata
			}));
		}
		/**
		* Returns `undefined` if `duration` is `0`. Else returns
		* the `end` date.
		*/
		get end() {
			if (!this.duration) return;
			if (this._end) return this._end;
			this._end = this.add(this.duration, "millisecond");
			return this._end;
		}
		isEqual(object) {
			if (!object) return false;
			assertSameTimeZone(this, object);
			return this.valueOf() === object.valueOf();
		}
		isBefore(object) {
			assertSameTimeZone(this, object);
			return this.valueOf() < object.valueOf();
		}
		isBeforeOrEqual(object) {
			assertSameTimeZone(this, object);
			return this.valueOf() <= object.valueOf();
		}
		isAfter(object) {
			assertSameTimeZone(this, object);
			return this.valueOf() > object.valueOf();
		}
		isAfterOrEqual(object) {
			assertSameTimeZone(this, object);
			return this.valueOf() >= object.valueOf();
		}
		isOccurring(object) {
			if (!this.duration) throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations");
			assertSameTimeZone(this, object);
			return object.isAfterOrEqual(this) && object.isBeforeOrEqual(this.add(this.duration, "millisecond"));
		}
		add(amount, unit) {
			switch (unit) {
				case "generator": {
					const generators = this.generators.slice();
					generators.unshift(amount);
					return new DateTime(this.date, this.timezone, this.duration, generators);
				}
				case "year": return this.forkDateTime(addUTCYears(this.date, amount));
				case "month": return this.forkDateTime(addUTCMonths(this.date, amount));
				case "week": return this.forkDateTime(addUTCWeeks(this.date, amount));
				case "day": return this.forkDateTime(addUTCDays(this.date, amount));
				case "hour": return this.forkDateTime(addUTCHours(this.date, amount));
				case "minute": return this.forkDateTime(addUTCMinutes(this.date, amount));
				case "second": return this.forkDateTime(addUTCSeconds(this.date, amount));
				case "millisecond": return this.forkDateTime(addUTCMilliseconds(this.date, amount));
				default: throw new Error("Invalid unit provided to `DateTime#add`");
			}
		}
		subtract(amount, unit) {
			switch (unit) {
				case "year": return this.forkDateTime(subUTCYears(this.date, amount));
				case "month": return this.forkDateTime(subUTCMonths(this.date, amount));
				case "week": return this.forkDateTime(subUTCWeeks(this.date, amount));
				case "day": return this.forkDateTime(subUTCDays(this.date, amount));
				case "hour": return this.forkDateTime(subUTCHours(this.date, amount));
				case "minute": return this.forkDateTime(subUTCMinutes(this.date, amount));
				case "second": return this.forkDateTime(subUTCSeconds(this.date, amount));
				case "millisecond": return this.forkDateTime(subUTCMilliseconds(this.date, amount));
				default: throw new Error("Invalid unit provided to `DateTime#subtract`");
			}
		}
		get(unit) {
			switch (unit) {
				case "year": return this.date.getUTCFullYear();
				case "month": return this.date.getUTCMonth() + 1;
				case "yearday": return getUTCYearDay(this.date);
				case "weekday": return DateAdapter.WEEKDAYS[this.date.getUTCDay()];
				case "day": return this.date.getUTCDate();
				case "hour": return this.date.getUTCHours();
				case "minute": return this.date.getUTCMinutes();
				case "second": return this.date.getUTCSeconds();
				case "millisecond": return this.date.getUTCMilliseconds();
				default: throw new Error("Invalid unit provided to `DateTime#set`");
			}
		}
		set(unit, value) {
			if (unit === "duration") return new DateTime(this.date, this.timezone, value, this.generators);
			if (unit === "generators") return new DateTime(this.date, this.timezone, this.duration, value);
			let date = new Date(this.date);
			switch (unit) {
				case "year":
					date.setUTCFullYear(value);
					break;
				case "month": {
					const length = monthLength(value, date.getUTCFullYear());
					if (date.getUTCDate() > length) {
						date.setUTCDate(1);
						date.setUTCMonth(value);
						date = subUTCDays(date, 1);
					} else date.setUTCMonth(value - 1);
					break;
				}
				case "day":
					date.setUTCDate(value);
					break;
				case "hour":
					date.setUTCHours(value);
					break;
				case "minute":
					date.setUTCMinutes(value);
					break;
				case "second":
					date.setUTCSeconds(value);
					break;
				case "millisecond":
					date.setUTCMilliseconds(value);
					break;
				default: throw new Error("Invalid unit provided to `DateTime#set`");
			}
			return this.forkDateTime(date);
		}
		granularity(granularity, opt = {}) {
			let date = this.forkDateTime(this.date);
			switch (granularity) {
				case "year": date = date.set("month", 1);
				case "month":
					date = date.set("day", 1);
					break;
				case "week": date = setDateToStartOfWeek(date, opt.weekStart);
			}
			switch (granularity) {
				case "year":
				case "month":
				case "week":
				case "day": date = date.set("hour", 0);
				case "hour": date = date.set("minute", 0);
				case "minute": date = date.set("second", 0);
				case "second": date = date.set("millisecond", 0);
				case "millisecond": return date;
				default: throw new Error("Invalid granularity provided to `DateTime#granularity`: " + granularity);
			}
		}
		endGranularity(granularity, opt = {}) {
			let date = this.forkDateTime(this.date);
			switch (granularity) {
				case "year": date = date.set("month", 12);
				case "month":
					date = date.set("day", monthLength(date.get("month"), date.get("year")));
					break;
				case "week": date = setDateToEndOfWeek(date, opt.weekStart);
			}
			switch (granularity) {
				case "year":
				case "month":
				case "week":
				case "day": date = date.set("hour", 23);
				case "hour": date = date.set("minute", 59);
				case "minute": date = date.set("second", 59);
				case "second": date = date.set("millisecond", 999);
				case "millisecond": return date;
				default: throw new Error("Invalid granularity provided to `DateTime#granularity`: " + granularity);
			}
		}
		toISOString() {
			return this.date.toISOString();
		}
		toDateTime() {
			return this;
		}
		toJSON() {
			const json = {
				timezone: this.timezone,
				year: this.get("year"),
				month: this.get("month"),
				day: this.get("day"),
				hour: this.get("hour"),
				minute: this.get("minute"),
				second: this.get("second"),
				millisecond: this.get("millisecond")
			};
			if (this.duration) json.duration = this.duration;
			return json;
		}
		valueOf() {
			return this.date.valueOf();
		}
		assertIsValid() {
			if (isNaN(this.valueOf())) throw new InvalidDateTimeError("DateTime has invalid date.");
			return true;
		}
		forkDateTime(date) {
			return new DateTime(date, this.timezone, this.duration, this.generators);
		}
	};
	function assertSameTimeZone(x, y) {
		if (x.timezone !== y.timezone) throw new InvalidDateTimeError("Attempted to compare a datetime to another date in a different timezone: " + JSON.stringify(x) + " and " + JSON.stringify(y));
		return true;
	}
	function setDateToStartOfWeek(date, wkst) {
		const index = orderedWeekdays(wkst).indexOf(date.get("weekday"));
		return date.subtract(index, "day");
	}
	function setDateToEndOfWeek(date, wkst) {
		const index = orderedWeekdays(wkst).indexOf(date.get("weekday"));
		return date.add(6 - index, "day");
	}
	function orderedWeekdays(wkst = "SU") {
		const wkdays = DateAdapter.WEEKDAYS.slice();
		let index = wkdays.indexOf(wkst);
		while (index !== 0) {
			shiftArray(wkdays);
			index--;
		}
		return wkdays;
	}
	function shiftArray(array, from = "first") {
		if (array.length === 0) return array;
		else if (from === "first") array.push(array.shift());
		else array.unshift(array.pop());
		return array;
	}
	/**
	* Returns the days in the given month.
	*
	* @param month base-1
	* @param year
	*/
	function monthLength(month, year) {
		return {
			1: 31,
			2: getDaysInFebruary(year),
			3: 31,
			4: 30,
			5: 31,
			6: 30,
			7: 31,
			8: 31,
			9: 30,
			10: 31,
			11: 30,
			12: 31
		}[month];
	}
	function getDaysInFebruary(year) {
		return isLeapYear(year) ? 29 : 28;
	}
	function isLeapYear(year) {
		return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
	}
	function getUTCYearDay(now) {
		const start = new Date(Date.UTC(now.getUTCFullYear(), 0, 1));
		const diff = now.valueOf() - start.valueOf();
		return 1 + Math.floor(diff / DateAdapter.MILLISECONDS_IN_DAY);
	}
	/**
	* These functions are basically lifted from `date-fns`, but changed
	* to use the UTC date methods, which `date-fns` doesn't support.
	*/
	function toInteger(input) {
		if (input === null || input === true || input === false) return NaN;
		const int = Number(input);
		if (isNaN(int)) return int;
		return int < 0 ? Math.ceil(int) : Math.floor(int);
	}
	function addMilliseconds(dirtyDate, dirtyAmount) {
		if (arguments.length < 2) throw new TypeError("2 arguments required, but only " + arguments.length + " present");
		const timestamp = dirtyDate.valueOf();
		const amount = toInteger(dirtyAmount);
		return new Date(timestamp + amount);
	}
	function addUTCYears(date, input) {
		return addUTCMonths(date, toInteger(input) * 12);
	}
	function addUTCMonths(date, input) {
		const amount = toInteger(input);
		date = new Date(date);
		const desiredMonth = date.getUTCMonth() + amount;
		const dateWithDesiredMonth = /* @__PURE__ */ new Date(0);
		dateWithDesiredMonth.setUTCFullYear(date.getUTCFullYear(), desiredMonth, 1);
		dateWithDesiredMonth.setUTCHours(0, 0, 0, 0);
		const daysInMonth = monthLength(dateWithDesiredMonth.getUTCMonth() + 1, dateWithDesiredMonth.getUTCFullYear());
		date.setUTCMonth(desiredMonth, Math.min(daysInMonth, date.getUTCDate()));
		return date;
	}
	function addUTCWeeks(date, input) {
		return addUTCDays(date, toInteger(input) * 7);
	}
	function addUTCDays(date, input) {
		return addUTCMilliseconds(date, toInteger(input) * DateAdapter.MILLISECONDS_IN_DAY);
	}
	function addUTCHours(date, input) {
		return addMilliseconds(date, toInteger(input) * DateAdapter.MILLISECONDS_IN_HOUR);
	}
	function addUTCMinutes(date, input) {
		return addMilliseconds(date, toInteger(input) * DateAdapter.MILLISECONDS_IN_MINUTE);
	}
	function addUTCSeconds(date, input) {
		return addMilliseconds(date, toInteger(input) * DateAdapter.MILLISECONDS_IN_SECOND);
	}
	function addUTCMilliseconds(date, input) {
		const amount = toInteger(input);
		const timestamp = date.getTime();
		return new Date(timestamp + amount);
	}
	function subUTCYears(date, amount) {
		return addUTCYears(date, -amount);
	}
	function subUTCMonths(date, amount) {
		return addUTCMonths(date, -amount);
	}
	function subUTCWeeks(date, amount) {
		return addUTCWeeks(date, -amount);
	}
	function subUTCDays(date, amount) {
		return addUTCDays(date, -amount);
	}
	function subUTCHours(date, amount) {
		return addUTCHours(date, -amount);
	}
	function subUTCMinutes(date, amount) {
		return addUTCMinutes(date, -amount);
	}
	function subUTCSeconds(date, amount) {
		return addUTCSeconds(date, -amount);
	}
	function subUTCMilliseconds(date, amount) {
		return addUTCMilliseconds(date, -amount);
	}
	function normalizeDateTimeTimezone(date, timezone) {
		if (date.timezone !== timezone) return DateAdapterBase.adapter.fromDateTime(date).set("timezone", timezone).toDateTime();
		return date;
	}
	var RuleBase = class extends OccurrenceGenerator {
		constructor(recurrenceRules, config, options = {}) {
			super(options);
			this.recurrenceRules = recurrenceRules;
			this.options = cloneRuleOptions(config);
			this.normOptions = normalizeRuleOptions(this.recurrenceRules, this.options);
			this.timezone = options.timezone !== void 0 ? options.timezone : this.normOptions.start.timezone;
			this.data = options.data;
			this.hasDuration = !!config.duration;
			if (this.hasDuration) this.duration = config.duration;
			this.isInfinite = this.normOptions.end === void 0 && this.normOptions.count === void 0;
		}
		occurrences(args = {}) {
			return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args));
		}
		collections(args = {}) {
			return new CollectionIterator(this, this.normalizeCollectionsArgs(args));
		}
		*_run(rawArgs = {}) {
			const args = this.normalizeRunArgs(rawArgs);
			const iterator = new RecurrenceRulesIterator(recurrenceRulesReducer(this.recurrenceRules), this.normOptions, args);
			let date = iterator.next().value;
			let index = 0;
			while (date && (args.take === void 0 || index < args.take)) {
				index++;
				date = date.add(this, "generator");
				const yieldArgs = yield this.normalizeRunOutput(date);
				if (yieldArgs === null || yieldArgs === void 0 ? void 0 : yieldArgs.skipToDate) date = iterator.next(Object.assign(Object.assign({}, yieldArgs), { skipToDate: normalizeDateTimeTimezone(yieldArgs.skipToDate, iterator.start.timezone) })).value;
				else date = iterator.next(yieldArgs).value;
			}
		}
	};
	var Rule$1 = class Rule$1 extends RuleBase {
		/**
		* Create a new Rule object with the specified rule config and options.
		*
		* ### Options
		*
		* - **timezone**: the timezone that yielded occurrences should be in. Note,
		*   this does not change the rule config. Occurrences are first found using
		*   the unmodified rule config, and then converted to the timezone specified
		*   here before being yielded.
		* - **data**: arbitrary data you can associate with this rule. This
		*   is the only mutable property of `Rule` objects.
		*
		* ### Rule Config
		*
		* - #### frequency
		*
		*   The frequency rule part identifies the type of recurrence rule. Valid values
		*   include `"SECONDLY"`, `"MINUTELY"`, `"HOURLY"`, `"DAILY"`, `"WEEKLY"`,
		*   `"MONTHLY"`, or `"YEARLY"`.
		*
		* - #### start
		*
		*   The start of the rule (not necessarily the first occurrence).
		*   Either a `DateAdapter` instance, date object, or `DateTime` object.
		*   The type of date object depends on the `DateAdapter` class used for this
		*   `Rule`.
		*
		* - #### end?
		*
		*   The end of the rule (not necessarily the last occurrence).
		*   Either a `DateAdapter` instance, date object, or `DateTime` object.
		*   The type of date object depends on the `DateAdapter` class used for this
		*   `Rule`.
		*
		* - #### duration?
		*
		*   A length of time expressed in milliseconds.
		*
		* - #### interval?
		*
		*   The interval rule part contains a positive integer representing at
		*   which intervals the recurrence rule repeats. The default value is
		*   `1`, meaning every second for a SECONDLY rule, every minute for a
		*   MINUTELY rule, every hour for an HOURLY rule, every day for a
		*   DAILY rule, every week for a WEEKLY rule, every month for a
		*   MONTHLY rule, and every year for a YEARLY rule. For example,
		*   within a DAILY rule, a value of `8` means every eight days.
		*
		* - #### count?
		*
		*   The count rule part defines the number of occurrences at which to
		*   range-bound the recurrence. `count` and `end` are both two different
		*   ways of specifying how a recurrence completes.
		*
		* - #### weekStart?
		*
		*   The weekStart rule part specifies the day on which the workweek starts.
		*   Valid values are `"MO"`, `"TU"`, `"WE"`, `"TH"`, `"FR"`, `"SA"`, and `"SU"`.
		*   This is significant when a WEEKLY rule has an interval greater than 1,
		*   and a `byDayOfWeek` rule part is specified. The
		*   default value is `"MO"`.
		*
		* - #### bySecondOfMinute?
		*
		*   The bySecondOfMinute rule part expects an array of seconds
		*   within a minute. Valid values are 0 to 60.
		*
		* - #### byMinuteOfHour?
		*
		*   The byMinuteOfHour rule part expects an array of minutes within an hour.
		*   Valid values are 0 to 59.
		*
		* - #### byHourOfDay?
		*
		*   The byHourOfDay rule part expects an array of hours of the day.
		*   Valid values are 0 to 23.
		*
		* - #### byDayOfWeek?
		*
		*   *note: the byDayOfWeek rule part is kinda complex. Blame the ICAL spec.*
		*
		*   The byDayOfWeek rule part expects an array. Each array entry can
		*   be a day of the week (`"SU"`, `"MO"` , `"TU"`, `"WE"`, `"TH"`,
		*   `"FR"`, `"SA"`). If the rule's `frequency` is either MONTHLY or YEARLY,
		*   Any entry can also be a tuple where the first value of the tuple is a
		*   day of the week and the second value is an positive/negative integer
		*   (e.g. `["SU", 1]`). In this case, the number indicates the nth occurrence of
		*   the specified day within the MONTHLY or YEARLY rule.
		*
		*   The behavior of byDayOfWeek changes depending on the `frequency`
		*   of the rule.
		*
		*   Within a MONTHLY rule, `["MO", 1]` represents the first Monday
		*   within the month, whereas `["MO", -1]` represents the last Monday
		*   of the month.
		*
		*   Within a YEARLY rule, the numeric value in a byDayOfWeek tuple entry
		*   corresponds to an offset within the month when the byMonthOfYear rule part is
		*   present, and corresponds to an offset within the year otherwise.
		*
		*   Regardless of rule `frequency`, if a byDayOfWeek entry is a string
		*   (rather than a tuple), it means "all of these days" within the specified
		*   frequency (e.g. within a MONTHLY rule, `"MO"` represents all Mondays within
		*   the month).
		*
		* - #### byDayOfMonth?
		*
		*   The byDayOfMonth rule part expects an array of days
		*   of the month. Valid values are 1 to 31 or -31 to -1.
		*
		*   For example, -10 represents the tenth to the last day of the month.
		*   The byDayOfMonth rule part *must not* be specified when the rule's
		*   `frequency` is set to WEEKLY.
		*
		* - #### byMonthOfYear?
		*
		*   The byMonthOfYear rule part expects an array of months
		*   of the year. Valid values are 1 to 12.
		*
		*/
		constructor(config, options = {}) {
			super(Rule$1.recurrenceRules, config, options);
		}
		set(prop, value, tzoptions = {}) {
			let options = cloneRuleOptions(this.options);
			let timezone = this.timezone;
			if (prop === "timezone") {
				if (value === this.timezone && !tzoptions.keepLocalTime) return this;
				else if (tzoptions.keepLocalTime) {
					const json = this.normalizeDateInput(options.start).toJSON();
					json.timezone = value;
					const adapter = this.dateAdapter.fromJSON(json);
					options.start = options.start instanceof this.dateAdapter ? adapter : options.start instanceof DateTime$1 ? adapter.toDateTime() : adapter.date;
				}
				timezone = value;
			} else if (prop === "options") options = value;
			else options[prop] = value;
			return new Rule$1(options, {
				data: this.data,
				maxDuration: this.maxDuration,
				timezone
			});
		}
	};
	Rule$1.recurrenceRules = [];
	var ScheduleBase = class extends OccurrenceGenerator {
		/**
		* Create a new Schedule object with the specified options.
		*
		* The order of precidence for rrules, rdates, exrules, and exdates is:
		*
		* 1. rrules are included
		* 2. exrules are excluded
		* 3. rdates are included
		* 4. exdates are excluded
		*
		*/
		constructor(options) {
			super(options);
			this.data = options.data;
		}
		occurrences(args = {}) {
			return new OccurrenceIterator(this, this.normalizeOccurrencesArgs(args));
		}
		collections(args = {}) {
			return new CollectionIterator(this, this.normalizeCollectionsArgs(args));
		}
		*_run(args = {}) {
			const count = args.take;
			delete args.take;
			const iterator = this.occurrenceStream._run(args);
			let date = iterator.next().value;
			let index = 0;
			while (date && (count === void 0 || count > index)) {
				date = date.add(this, "generator");
				const yieldArgs = yield this.normalizeRunOutput(date);
				date = iterator.next(yieldArgs).value;
				index++;
			}
		}
	};
	/**
	* An operator function which accepts a spread of occurrence generators
	* and removes their occurrences from the output.
	*
	* @param streams a spread of occurrence generators
	*/
	function subtract(...streams) {
		return (options) => new SubtractOperator(streams, options);
	}
	var SubtractOperator = class SubtractOperator extends Operator {
		/** Not actually used but necessary for IRunnable interface */
		set(_, value) {
			return new SubtractOperator(this.streams.map((stream) => stream.set("timezone", value)), Object.assign(Object.assign({}, this.config), {
				base: this.config.base && this.config.base.set("timezone", value),
				timezone: value
			}));
		}
		*_run(args = {}) {
			if (!this.config.base) return;
			const inclusion = new IterableWrapper(this.config.base, args);
			const exclusion = new IterableWrapper(new AddOperator(this.streams, { timezone: this.config.timezone }), args);
			cycleStreams(inclusion, exclusion, args);
			while (!inclusion.done) {
				const yieldArgs = yield this.normalizeRunOutput(inclusion.value);
				if (!(yieldArgs && yieldArgs.skipToDate)) inclusion.next();
				cycleStreams(inclusion, exclusion, args, yieldArgs);
			}
		}
		calculateIsInfinite() {
			return !!(this.config.base && this.config.base.isInfinite);
		}
		calculateHasDuration() {
			return !!(this.config.base && this.config.base.hasDuration);
		}
	};
	function cycleStreams(inclusion, exclusion, options = {}, yieldArgs = {}) {
		processYieldArgs([inclusion, exclusion], options, yieldArgs);
		iterateExclusion(inclusion, exclusion, options);
		while (!inclusion.done && !exclusion.done && inclusion.value.isEqual(exclusion.value)) {
			inclusion.next();
			iterateExclusion(inclusion, exclusion, options);
		}
	}
	function iterateExclusion(inclusion, exclusion, options = {}) {
		if (options.reverse) {
			while (!exclusion.done && !inclusion.done && exclusion.value.isAfter(inclusion.value)) exclusion.next();
			return;
		}
		while (!exclusion.done && !inclusion.done && exclusion.value.isBefore(inclusion.value)) exclusion.next();
	}
	/**
	* An operator function which deduplicates an occurrence stream. Occurrence
	* `duration` is currently ignored.
	*/
	function unique() {
		return (options) => new UniqueOperator([], options);
	}
	var UniqueOperator = class UniqueOperator extends Operator {
		/** Not actually used but necessary for IRunnable interface */
		set(_, value) {
			return new UniqueOperator([], Object.assign(Object.assign({}, this.config), {
				base: this.config.base && this.config.base.set("timezone", value),
				timezone: value
			}));
		}
		*_run(args = {}) {
			if (!this.config.base) return;
			const stream = new IterableWrapper(this.config.base, args);
			while (!stream.done) {
				const yieldArgs = yield this.normalizeRunOutput(stream.value);
				const lastValue = stream.value;
				stream.next(yieldArgs);
				while (!(yieldArgs && yieldArgs.skipToDate) && !stream.done && stream.value.isEqual(lastValue)) stream.next();
			}
		}
		calculateIsInfinite() {
			return !!(this.config.base && this.config.base.isInfinite);
		}
		calculateHasDuration() {
			return !!(this.config.base && this.config.base.hasDuration);
		}
	};
	var Schedule = class Schedule extends ScheduleBase {
		/**
		* Create a new Schedule object with the specified options.
		*
		* The order of precidence for rrules, rdates, exrules, and exdates is:
		*
		* 1. rrules are included
		* 2. exrules are excluded
		* 3. rdates are included
		* 4. exdates are excluded
		*
		* ### Options
		*
		* - **timezone**: The timezone that yielded occurrences should be *displayed* in.
		*   Note, this one affects the *displayed* timezone of yielded occurrences.
		*   For rules, occurrences are first found using the unmodified rule
		*   config (including whatever timezone the `start` datetime is defined
		*   in), and then converted to the timezone specified here before being
		*   yielded. By default, the timezone is *local* time (`null`). So if you don't
		*   want your rules to be displayed in local time, you must supply a
		*   timezone argument.
		* - **data**: arbitrary data you can associate with this Schedule. This
		*   is the only mutable property of `Schedule` objects.
		* - **maxDuration**: currently unused.
		* - **rrules**: rules specifying when occurrences happen. See the "Rule Config"
		*   section below.
		* - **rdates**: individual dates that should be _included_ in the schedule.
		* - **exdates**: individual dates that should be _excluded_ from the schedule.
		* - **exrules**: rules specifying when occurrences shouldn't happen. See the
		*   "Rule Config" section below.
		*
		* ### Rule Config
		*
		* - #### frequency
		*
		*   The frequency rule part identifies the type of recurrence rule. Valid values
		*   include `"SECONDLY"`, `"MINUTELY"`, `"HOURLY"`, `"DAILY"`, `"WEEKLY"`,
		*   `"MONTHLY"`, or `"YEARLY"`.
		*
		* - #### start
		*
		*   The start of the rule (not necessarily the first occurrence).
		*   Either a `DateAdapter` instance, date object, or `DateTime` object.
		*   The type of date object depends on the `DateAdapter` class used for this
		*   `Rule`.
		*
		* - #### end?
		*
		*   The end of the rule (not necessarily the last occurrence).
		*   Either a `DateAdapter` instance, date object, or `DateTime` object.
		*   The type of date object depends on the `DateAdapter` class used for this
		*   `Rule`.
		*
		* - #### duration?
		*
		*   A length of time expressed in milliseconds.
		*
		* - #### interval?
		*
		*   The interval rule part contains a positive integer representing at
		*   which intervals the recurrence rule repeats. The default value is
		*   `1`, meaning every second for a SECONDLY rule, every minute for a
		*   MINUTELY rule, every hour for an HOURLY rule, every day for a
		*   DAILY rule, every week for a WEEKLY rule, every month for a
		*   MONTHLY rule, and every year for a YEARLY rule. For example,
		*   within a DAILY rule, a value of `8` means every eight days.
		*
		* - #### count?
		*
		*   The count rule part defines the number of occurrences at which to
		*   range-bound the recurrence. `count` and `end` are both two different
		*   ways of specifying how a recurrence completes.
		*
		* - #### weekStart?
		*
		*   The weekStart rule part specifies the day on which the workweek starts.
		*   Valid values are `"MO"`, `"TU"`, `"WE"`, `"TH"`, `"FR"`, `"SA"`, and `"SU"`.
		*   This is significant when a WEEKLY rule has an interval greater than 1,
		*   and a `byDayOfWeek` rule part is specified. The
		*   default value is `"MO"`.
		*
		* - #### bySecondOfMinute?
		*
		*   The bySecondOfMinute rule part expects an array of seconds
		*   within a minute. Valid values are 0 to 60.
		*
		* - #### byMinuteOfHour?
		*
		*   The byMinuteOfHour rule part expects an array of minutes within an hour.
		*   Valid values are 0 to 59.
		*
		* - #### byHourOfDay?
		*
		*   The byHourOfDay rule part expects an array of hours of the day.
		*   Valid values are 0 to 23.
		*
		* - #### byDayOfWeek?
		*
		*   *note: the byDayOfWeek rule part is kinda complex. Blame the ICAL spec.*
		*
		*   The byDayOfWeek rule part expects an array. Each array entry can
		*   be a day of the week (`"SU"`, `"MO"` , `"TU"`, `"WE"`, `"TH"`,
		*   `"FR"`, `"SA"`). If the rule's `frequency` is either MONTHLY or YEARLY,
		*   Any entry can also be a tuple where the first value of the tuple is a
		*   day of the week and the second value is an positive/negative integer
		*   (e.g. `["SU", 1]`). In this case, the number indicates the nth occurrence of
		*   the specified day within the MONTHLY or YEARLY rule.
		*
		*   The behavior of byDayOfWeek changes depending on the `frequency`
		*   of the rule.
		*
		*   Within a MONTHLY rule, `["MO", 1]` represents the first Monday
		*   within the month, whereas `["MO", -1]` represents the last Monday
		*   of the month.
		*
		*   Within a YEARLY rule, the numeric value in a byDayOfWeek tuple entry
		*   corresponds to an offset within the month when the byMonthOfYear rule part is
		*   present, and corresponds to an offset within the year otherwise.
		*
		*   Regardless of rule `frequency`, if a byDayOfWeek entry is a string
		*   (rather than a tuple), it means "all of these days" within the specified
		*   frequency (e.g. within a MONTHLY rule, `"MO"` represents all Mondays within
		*   the month).
		*
		* - #### byDayOfMonth?
		*
		*   The byDayOfMonth rule part expects an array of days
		*   of the month. Valid values are 1 to 31 or -31 to -1.
		*
		*   For example, -10 represents the tenth to the last day of the month.
		*   The byDayOfMonth rule part *must not* be specified when the rule's
		*   `frequency` is set to WEEKLY.
		*
		* - #### byMonthOfYear?
		*
		*   The byMonthOfYear rule part expects an array of months
		*   of the year. Valid values are 1 to 12.
		*
		*/
		constructor(options = {}) {
			super(options);
			this.rrules = [];
			this.exrules = [];
			for (const prop of ["rrules", "exrules"]) {
				const arg = options[prop];
				if (arg) this[prop] = arg.map((ruleArgs) => {
					if (ruleArgs instanceof Rule$1) return ruleArgs.set("timezone", this.timezone);
					else return new Rule$1(ruleArgs, { timezone: this.timezone });
				});
			}
			for (const prop of ["rdates", "exdates"]) {
				const arg = options[prop];
				if (arg) this[prop] = arg instanceof Dates ? arg.set("timezone", this.timezone) : new Dates({
					dates: arg,
					timezone: this.timezone
				});
				else this[prop] = new Dates({ timezone: this.timezone });
			}
			this.hasDuration = this.rrules.every((rule) => rule.hasDuration) && this.exrules.every((rule) => rule.hasDuration) && this.rdates.hasDuration && this.exdates.hasDuration;
			this.isInfinite = this.rrules.some((rule) => rule.isInfinite);
			this.occurrenceStream = [
				add(...this.rrules),
				subtract(...this.exrules),
				add(this.rdates),
				subtract(this.exdates),
				unique()
			].reduce((prev, curr) => curr({
				base: prev,
				timezone: this.timezone
			}), void 0);
		}
		add(prop, value) {
			const rrules = this.rrules.slice();
			const exrules = this.exrules.slice();
			let rdates = this.rdates;
			let exdates = this.exdates;
			switch (prop) {
				case "rrule":
					rrules.push(value);
					break;
				case "exrule":
					exrules.push(value);
					break;
				case "rdate":
					rdates = this.rdates.add(value);
					break;
				case "exdate":
					exdates = this.exdates.add(value);
					break;
			}
			return new Schedule({
				timezone: this.timezone,
				data: this.data,
				rrules,
				exrules,
				rdates,
				exdates
			});
		}
		remove(prop, value) {
			let rrules = this.rrules;
			let exrules = this.exrules;
			let rdates = this.rdates;
			let exdates = this.exdates;
			switch (prop) {
				case "rrule":
					rrules = rrules.filter((rule) => rule !== value);
					break;
				case "exrule":
					exrules = exrules.filter((rule) => rule !== value);
					break;
				case "rdate":
					rdates = this.rdates.remove(value);
					break;
				case "exdate":
					exdates = this.exdates.remove(value);
					break;
			}
			return new Schedule({
				timezone: this.timezone,
				data: this.data,
				rrules,
				exrules,
				rdates,
				exdates
			});
		}
		set(prop, value, options = {}) {
			let timezone = this.timezone;
			let rrules = this.rrules;
			let exrules = this.exrules;
			let rdates = this.rdates;
			let exdates = this.exdates;
			switch (prop) {
				case "timezone":
					if (value === this.timezone && !options.keepLocalTime) return this;
					else if (options.keepLocalTime) {
						rrules = rrules.map((rule) => rule.set("timezone", value, options));
						exrules = exrules.map((rule) => rule.set("timezone", value, options));
						rdates = rdates.set("timezone", value, options);
						exdates = exdates.set("timezone", value, options);
					}
					timezone = value;
					break;
				case "rrules":
					rrules = value;
					break;
				case "exrules":
					exrules = value;
					break;
				case "rdates":
					rdates = value;
					break;
				case "exdates":
					exdates = value;
					break;
			}
			return new Schedule({
				timezone,
				data: this.data,
				rrules,
				exrules,
				rdates,
				exdates
			});
		}
	};
	//#endregion
	//#region ../../node_modules/@rschedule/core/es2015/rules.js
	var RecurrenceRule = class {
		constructor(processor) {
			this.processor = processor;
			this.start = processor.start;
			this.end = processor.end;
			this.options = processor.options;
		}
	};
	var FrequencyRule = class extends RecurrenceRule {
		constructor(processor, initDate) {
			super(processor);
			this.initDate = initDate;
			this.intervalUnit = freqToGranularity(this.options.frequency);
			this.firstIntervalStartDate = this.normalizedStartDate(this.options.start);
			this.intervalStartDate = this.firstIntervalStartDate;
			this.intervalEndDate = this.normalizedEndDate(this.firstIntervalStartDate);
			this.skipToInterval(this.initDate);
		}
		run(date) {
			return this.validateDate(new ValidDateTime(date));
		}
		validateDate(arg) {
			const { date } = arg;
			if (arg instanceof ValidDateTime && this.dateIsWithinInterval(date)) return arg;
			this.skipToInterval(date);
			return new InvalidDateTime(this.dateIsWithinInterval(date) ? date : this.setToCurrentInterval());
		}
		setToCurrentInterval() {
			return this.intervalStartDate;
		}
		normalizedStartDate(date) {
			if (this.options.frequency === "WEEKLY") return date.granularity("week", { weekStart: this.options.weekStart });
			return date.granularity(this.intervalUnit);
		}
		normalizedEndDate(start) {
			switch (this.options.frequency) {
				case "YEARLY": return start.add(1, "year");
				case "MONTHLY": return start.add(1, "month");
				case "WEEKLY": return start.add(1, "week");
				case "DAILY": return start.add(1, "day");
				case "HOURLY": return start.add(1, "hour");
				case "MINUTELY": return start.add(1, "minute");
				case "SECONDLY": return start.add(1, "second");
				case "MILLISECONDLY": return start.add(1, "millisecond");
				default: throw new Error(`Unknown frequency ${this.options.frequency}`);
			}
		}
		skipToInterval(date) {
			const amount = this.intervalDifference(date);
			this.intervalStartDate = this.firstIntervalStartDate.add(amount, this.intervalUnit);
			this.intervalEndDate = this.normalizedEndDate(this.intervalStartDate);
		}
		dateIsWithinInterval(date) {
			return this.intervalStartDate.isBeforeOrEqual(date) && this.intervalEndDate.isAfter(date);
		}
		intervalDifference(date) {
			return intervalDifferenceBetweenDates({
				first: this.firstIntervalStartDate,
				second: date,
				unit: this.intervalUnit,
				interval: this.options.interval,
				weekStart: this.options.weekStart,
				direction: "after"
			});
		}
	};
	/**
	* Given the frequency (unit) and interval, this function finds
	* how many jumps forward the first date needs in order to equal
	* or exceed the second date.
	*
	* For example:
	*
	* 1. Unit is daily and interval is 1. The second date is 3 days
	*    after the first. This will return 3.
	* 2. Unit is yearly and interval is 1. The second date is 3 days
	*    after the first. This will return 0.
	* 3. Unit is yearly and interval is 3. The second date is 4 years
	*    after the first. This will return 6.
	*/
	function intervalDifferenceBetweenDates({ first, second, unit, interval, weekStart, direction }) {
		let difference = (() => {
			let intervalDuration;
			let months;
			switch (unit) {
				case "year":
					months = (second.get("year") - first.get("year")) * 12;
					months = months + second.get("month") - first.get("month");
					return Math.floor(months / 12);
				case "month":
					months = (second.get("year") - first.get("year")) * 12;
					months = months + second.get("month") - first.get("month");
					return months;
				case "week":
					first = first.granularity("week", { weekStart });
					intervalDuration = DateAdapter$1.MILLISECONDS_IN_WEEK;
					break;
				case "day":
					intervalDuration = DateAdapter$1.MILLISECONDS_IN_DAY;
					break;
				case "hour":
					intervalDuration = DateAdapter$1.MILLISECONDS_IN_HOUR;
					break;
				case "minute":
					intervalDuration = DateAdapter$1.MILLISECONDS_IN_MINUTE;
					break;
				case "second":
					intervalDuration = DateAdapter$1.MILLISECONDS_IN_SECOND;
					break;
				case "millisecond":
					intervalDuration = 1;
					break;
				default: throw new Error("Unexpected `unit` value");
			}
			const diff = second.valueOf() - first.valueOf();
			return Math.floor(diff / intervalDuration);
		})();
		difference = (direction === "after" ? Math.ceil : Math.floor)(difference / interval) * interval;
		return difference;
	}
	var RevFrequencyRule = class extends FrequencyRule {
		setToCurrentInterval() {
			return this.intervalEndDate.subtract(1, "millisecond");
		}
		intervalDifference(date) {
			return intervalDifferenceBetweenDates({
				first: this.firstIntervalStartDate,
				second: date,
				unit: this.intervalUnit,
				interval: this.options.interval,
				weekStart: this.options.weekStart,
				direction: "before"
			});
		}
	};
	var FREQUENCIES = [
		"MILLISECONDLY",
		"SECONDLY",
		"MINUTELY",
		"HOURLY",
		"DAILY",
		"WEEKLY",
		"MONTHLY",
		"YEARLY"
	];
	var FrequencyRuleModule = {
		name: "FrequencyRule",
		get: (processor) => {
			if (processor.options.byMillisecondOfSecond !== void 0 || processor.options.frequency !== "MILLISECONDLY") return null;
			if (processor.reverse) return new RevFrequencyRule(processor, processor.end);
			return new FrequencyRule(processor, processor.start);
		},
		normalizeOptions: (options, norm) => {
			if (!FREQUENCIES.includes(options.frequency)) throw new RuleOptionError(`"frequency" must be one of ${JSON.stringify(FREQUENCIES)}`);
			if (options.interval !== void 0) {
				if (!Number.isInteger(options.interval)) throw new RuleOptionError("\"interval\" expects a whole number");
				if (options.interval < 1) throw new RuleOptionError("\"interval\" cannot be less than 1");
			}
			if (options.weekStart !== void 0) {
				if (!DateAdapter$1.WEEKDAYS.includes(options.weekStart)) throw new RuleOptionError(`"weekStart" must be one of ${JSON.stringify(DateAdapter$1.WEEKDAYS)}`);
			}
			norm.frequency = options.frequency;
			norm.interval = options.interval || 1;
			norm.weekStart = options.weekStart || "MO";
		},
		deps: () => [FrequencyRuleModule]
	};
	function ruleOptionFilled(option) {
		return Array.isArray(option) && option.length > 0;
	}
	var freqCache = /* @__PURE__ */ new WeakMap();
	var RecurrenceRuleBase = class extends RecurrenceRule {
		constructor(processor) {
			super(processor);
			if (!freqCache.has(this.processor)) freqCache.set(this.processor, new FrequencyRule(processor, processor.start));
			this.frequency = freqCache.get(this.processor);
		}
		validateDate(arg) {
			return this.frequency.validateDate(arg);
		}
	};
	var RevRecurrenceRuleBase = class extends RecurrenceRule {
		constructor(processor) {
			super(processor);
			if (!freqCache.has(this.processor)) freqCache.set(this.processor, new RevFrequencyRule(processor, processor.end));
			this.frequency = freqCache.get(this.processor);
		}
		validateDate(arg) {
			return this.frequency.validateDate(arg);
		}
	};
	/**
	* Contains shared logic for ByHourOfDay, ByMinuteOfHour,
	* BySecondOfMinute, and ByMillisecondOfSecond reverse rule pipes
	*/
	var RevByTimeOfUnitRule = class extends RevRecurrenceRuleBase {
		run(date) {
			const currentTime = date.get(this.granularity);
			for (const time of this.option) {
				if (currentTime < time) continue;
				if (currentTime === time) return this.validateDate(new ValidDateTime(date));
				return this.validateDate(new InvalidDateTime(date.endGranularity(this.baseGranularity).set(this.granularity, time)));
			}
			return this.validateDate(new InvalidDateTime(date.endGranularity(this.baseGranularity).subtract(1, this.baseGranularity).set(this.granularity, this.option[0])));
		}
	};
	var RevByMillisecondOfSecondRule = class extends RevByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "second";
			this.granularity = "millisecond";
			this.option = this.options.byMillisecondOfSecond.slice().reverse();
		}
	};
	/**
	* Contains shared logic for ByHourOfDay, ByMinuteOfHour,
	* BySecondOfMinute, and ByMillisecondOfSecond rule pipes
	*/
	var ByTimeOfUnitRule = class extends RecurrenceRuleBase {
		run(date) {
			const currentTime = date.get(this.granularity);
			for (const time of this.option) {
				if (currentTime > time) continue;
				if (currentTime === time) return this.validateDate(new ValidDateTime(date));
				return this.validateDate(new InvalidDateTime(date.granularity(this.baseGranularity).set(this.granularity, time)));
			}
			return this.validateDate(new InvalidDateTime(date.granularity(this.baseGranularity).add(1, this.baseGranularity).set(this.granularity, this.option[0])));
		}
	};
	var ByMillisecondOfSecondRule = class extends ByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "second";
			this.granularity = "millisecond";
			this.option = this.options.byMillisecondOfSecond;
		}
	};
	var ByMillisecondOfSecondRuleModule = {
		name: "ByMillisecondOfSecond",
		get: (processor) => {
			if (processor.options.byMillisecondOfSecond === void 0) return null;
			if (processor.reverse) return new RevByMillisecondOfSecondRule(processor);
			return new ByMillisecondOfSecondRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.byMillisecondOfSecond !== void 0) {
				if (!ruleOptionFilled(options.byMillisecondOfSecond)) throw new RuleOptionError("\"byMillisecondOfSecond\" expects a non-empty array");
				if (options.byMillisecondOfSecond.some((num) => num < 0 || num > 999)) throw new RuleOptionError("\"byMillisecondOfSecond\" values must be >= 0 && <= 999");
				norm.byMillisecondOfSecond = options.byMillisecondOfSecond;
				norm.byMillisecondOfSecond.sort(numberSortComparer);
			} else if (options.frequency !== "MILLISECONDLY") norm.byMillisecondOfSecond = [norm.start.get("millisecond")];
		},
		deps: () => [FrequencyRuleModule, ByMillisecondOfSecondRuleModule]
	};
	var RevBySecondOfMinuteRule = class extends RevByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "minute";
			this.granularity = "second";
			this.option = this.options.bySecondOfMinute.slice().reverse();
		}
	};
	var BySecondOfMinuteRule = class extends ByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "minute";
			this.granularity = "second";
			this.option = this.options.bySecondOfMinute;
		}
	};
	var BySecondOfMinuteRuleModule = {
		name: "BySecondOfMinute",
		get: (processor) => {
			if (processor.options.bySecondOfMinute === void 0) return null;
			if (processor.reverse) return new RevBySecondOfMinuteRule(processor);
			return new BySecondOfMinuteRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.bySecondOfMinute !== void 0) {
				if (!ruleOptionFilled(options.bySecondOfMinute)) throw new RuleOptionError("\"bySecondOfMinute\" expects a non-empty array");
				if (options.bySecondOfMinute.some((num) => num < 0 || num > 60)) throw new RuleOptionError("\"bySecondOfMinute\" values must be >= 0 && <= 60");
				norm.bySecondOfMinute = options.bySecondOfMinute;
				norm.bySecondOfMinute.sort(numberSortComparer);
			} else if (!["SECONDLY", "MILLISECONDLY"].includes(options.frequency)) norm.bySecondOfMinute = [norm.start.get("second")];
		},
		deps: () => [
			FrequencyRuleModule,
			BySecondOfMinuteRuleModule,
			ByMillisecondOfSecondRuleModule
		]
	};
	var RevByMinuteOfHourRule = class extends RevByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "hour";
			this.granularity = "minute";
			this.option = this.options.byMinuteOfHour.slice().reverse();
		}
	};
	var ByMinuteOfHourRule = class extends ByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "hour";
			this.granularity = "minute";
			this.option = this.options.byMinuteOfHour;
		}
	};
	var ByMinuteOfHourRuleModule = {
		name: "ByMinuteOfHour",
		get: (processor) => {
			if (processor.options.byMinuteOfHour === void 0) return null;
			if (processor.reverse) return new RevByMinuteOfHourRule(processor);
			return new ByMinuteOfHourRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.byMinuteOfHour !== void 0) {
				if (!ruleOptionFilled(options.byMinuteOfHour)) throw new RuleOptionError("\"byMinuteOfHour\" expects a non-empty array");
				if (options.byMinuteOfHour.some((num) => num < 0 || num > 59)) throw new RuleOptionError("\"byMinuteOfHour\" values must be >= 0 && <= 59");
				norm.byMinuteOfHour = options.byMinuteOfHour;
				norm.byMinuteOfHour.sort(numberSortComparer);
			} else if (![
				"MINUTELY",
				"SECONDLY",
				"MILLISECONDLY"
			].includes(options.frequency)) norm.byMinuteOfHour = [norm.start.get("minute")];
		},
		deps: () => [
			FrequencyRuleModule,
			ByMinuteOfHourRuleModule,
			BySecondOfMinuteRuleModule,
			ByMillisecondOfSecondRuleModule
		]
	};
	var RevByHourOfDayRule = class extends RevByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "day";
			this.granularity = "hour";
			this.option = this.options.byHourOfDay.slice().reverse();
		}
	};
	var ByHourOfDayRule = class extends ByTimeOfUnitRule {
		constructor() {
			super(...arguments);
			this.baseGranularity = "day";
			this.granularity = "hour";
			this.option = this.options.byHourOfDay;
		}
	};
	var ByHourOfDayRuleModule = {
		name: "ByHourOfDay",
		get: (processor) => {
			if (processor.options.byHourOfDay === void 0) return null;
			if (processor.reverse) return new RevByHourOfDayRule(processor);
			return new ByHourOfDayRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.byHourOfDay !== void 0) {
				if (!ruleOptionFilled(options.byHourOfDay)) throw new RuleOptionError("\"byHourOfDay\" expects a non-empty array");
				if (options.byHourOfDay.some((num) => num < 0 || num > 23)) throw new RuleOptionError("\"byHourOfDay\" values must be >= 0 && <= 23");
				norm.byHourOfDay = options.byHourOfDay;
				norm.byHourOfDay.sort(numberSortComparer);
			} else if ([
				"YEARLY",
				"MONTHLY",
				"WEEKLY",
				"DAILY"
			].includes(options.frequency)) norm.byHourOfDay = [norm.start.get("hour")];
		},
		deps: () => [
			FrequencyRuleModule,
			ByHourOfDayRuleModule,
			ByMinuteOfHourRuleModule,
			BySecondOfMinuteRuleModule,
			ByMillisecondOfSecondRuleModule
		]
	};
	function getNextWeekday(date, weekday) {
		return date.add(getDifferenceBetweenWeekdays(date.get("weekday"), weekday), "day");
	}
	function getNthWeekdayOfMonth(date, weekday, nth) {
		let base = date.set("day", 1);
		if (nth < 0) base = base.add(1, "month");
		base = getNextWeekday(base, weekday);
		return nth < 0 ? base.add(nth, "week") : base.add(nth - 1, "week");
	}
	var ByDayOfMonthRule = class extends RecurrenceRuleBase {
		run(date) {
			const normalizedByDayOfMonth = normalizeByDayOfMonth(date, this.options.byDayOfMonth, this.options.byDayOfWeek);
			const currentDay = date.get("day");
			for (const day of normalizedByDayOfMonth) {
				if (currentDay > day) continue;
				if (currentDay === day) return this.validateDate(new ValidDateTime(date));
				return this.validateDate(new InvalidDateTime(date.granularity("month").set("day", day)));
			}
			let next;
			let nextMonth = date;
			let index = 0;
			while (!next && index < 30) {
				nextMonth = nextMonth.granularity("month").add(1, "month");
				next = normalizeByDayOfMonth(nextMonth, this.options.byDayOfMonth, this.options.byDayOfWeek)[0];
				index++;
			}
			if (index >= 13) throw new RecurrenceRuleError("byDayOfMonth Infinite while loop");
			return this.validateDate(new InvalidDateTime(nextMonth.set("day", next)));
		}
	};
	/**
	* Does a few things:
	*
	* 1. filters out byDayOfMonth entries which are not applicable
	*    to current month
	* 2. negative entries to positive ones
	* 3. if a byDayOfWeek option is given, removes days which are
	*    not on the correct day of the week
	*/
	function normalizeByDayOfMonth(date, byDayOfMonth, byDayOfWeek) {
		const lengthOfMonth = date.endGranularity("month").get("day");
		let normalizedByDayOfMonth = byDayOfMonth.filter((day) => lengthOfMonth >= Math.abs(day)).map((day) => day > 0 ? day : lengthOfMonth + day + 1);
		if (byDayOfWeek) {
			const base = date.granularity("month");
			const filteredByDayOfMonth = [];
			byDayOfWeek.forEach((entry) => {
				if (typeof entry === "string") {
					filteredByDayOfMonth.push(...normalizedByDayOfMonth.filter((day) => base.set("day", day).get("weekday") === entry));
					return;
				}
				const nthWeekdayOfMonth = getNthWeekdayOfMonth(date, ...entry).get("day");
				if (normalizedByDayOfMonth.includes(nthWeekdayOfMonth)) filteredByDayOfMonth.push(nthWeekdayOfMonth);
			});
			normalizedByDayOfMonth = Array.from(new Set(filteredByDayOfMonth));
		}
		return normalizedByDayOfMonth.sort((a, b) => {
			if (a > b) return 1;
			if (a < b) return -1;
			else return 0;
		});
	}
	var RevByDayOfMonthRule = class extends RevRecurrenceRuleBase {
		run(date) {
			const normalizedByDayOfMonth = normalizeByDayOfMonth(date, this.options.byDayOfMonth, this.options.byDayOfWeek).reverse();
			const currentDay = date.get("day");
			for (const day of normalizedByDayOfMonth) {
				if (currentDay < day) continue;
				if (currentDay === day) return this.validateDate(new ValidDateTime(date));
				return this.validateDate(new InvalidDateTime(date.endGranularity("month").set("day", day)));
			}
			let next;
			let nextMonth = date;
			let index = 0;
			while (!next && index < 30) {
				nextMonth = nextMonth.endGranularity("month").subtract(1, "month");
				next = normalizeByDayOfMonth(nextMonth, this.options.byDayOfMonth, this.options.byDayOfWeek).pop();
				index++;
			}
			if (index >= 13) throw new RecurrenceRuleError("byDayOfMonth Infinite while loop");
			return this.validateDate(new InvalidDateTime(nextMonth.set("day", next)));
		}
	};
	var ByDayOfMonthRuleModule = {
		name: "ByDayOfMonth",
		get: (processor) => {
			if (processor.options.byDayOfMonth === void 0) return null;
			if (processor.reverse) return new RevByDayOfMonthRule(processor);
			return new ByDayOfMonthRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.byDayOfMonth !== void 0) {
				if (options.frequency === "WEEKLY") throw new RuleOptionError("when \"frequency\" is \"WEEKLY\", \"byDayOfMonth\" cannot be present");
				if (!ruleOptionFilled(options.byDayOfMonth)) throw new RuleOptionError("\"byDayOfMonth\" expects a non-empty array");
				if (options.byDayOfMonth.some((num) => num === 0 || num < -31 || num > 31)) throw new RuleOptionError("\"byDayOfMonth\" values must be `num !== 0 && num <= 31 && num >= -31`");
				norm.byDayOfMonth = options.byDayOfMonth.slice();
			} else if (!(ruleOptionFilled(options.byDayOfWeek) || ruleOptionFilled(options.byDayOfYear)) && ["YEARLY", "MONTHLY"].includes(options.frequency)) norm.byDayOfMonth = [norm.start.get("day")];
		},
		deps: () => [
			FrequencyRuleModule,
			ByDayOfMonthRuleModule,
			ByHourOfDayRuleModule,
			ByMinuteOfHourRuleModule,
			BySecondOfMinuteRuleModule,
			ByMillisecondOfSecondRuleModule
		]
	};
	function getNthWeekdayOfYear(date, weekday, nth) {
		let base = date.set("month", 1).set("day", 1);
		if (nth < 0) base = base.add(1, "year");
		base = getNextWeekday(base, weekday);
		return nth < 0 ? base.add(nth, "week") : base.add(nth - 1, "week");
	}
	function getPreviousWeekday(date, weekday) {
		const diff = getDifferenceBetweenWeekdays(date.get("weekday"), weekday);
		return date.subtract(diff === 0 ? 0 : 7 - diff, "day");
	}
	var RevByDayOfWeekRule = class extends RevRecurrenceRuleBase {
		run(date) {
			if (this.options.frequency === "YEARLY") return this.options.byMonthOfYear === void 0 ? this.expandYearly(date) : this.expandMonthly(date);
			else if (this.options.frequency === "MONTHLY") return this.expandMonthly(date);
			return this.expand(date);
		}
		expandYearly(date) {
			let next = getPrevWeekdaysOfYear(date, this.options.byDayOfWeek)[0];
			let index = 0;
			let base = date;
			while (!next && index < 28) {
				index++;
				base = base.granularity("year").subtract(1, "millisecond");
				next = getPrevWeekdaysOfYear(base, this.options.byDayOfWeek)[0];
			}
			if (!next) throw new RecurrenceRuleError("The byDayOfWeek rule appears to contain an impossible combination");
			return this.result(date, next);
		}
		expandMonthly(date) {
			let next = getPrevWeekdaysOfMonth(date, this.options.byDayOfWeek)[0];
			let index = 0;
			let base = date;
			while (!next && index < 50) {
				index++;
				base = base.granularity("month").subtract(1, "millisecond");
				next = getPrevWeekdaysOfMonth(base, this.options.byDayOfWeek)[0];
			}
			if (!next) throw new RecurrenceRuleError("The byDayOfWeek rule appears to contain an impossible combination");
			return this.result(date, next);
		}
		expand(date) {
			const next = this.options.byDayOfWeek.map((weekday) => getPreviousWeekday(date, weekday)).sort(dateTimeSortComparer).pop();
			return this.result(date, next);
		}
		result(date, next) {
			if (next.isEqual(date)) return this.validateDate(new ValidDateTime(date));
			return this.validateDate(new InvalidDateTime(next.endGranularity("day")));
		}
	};
	/** For each byDayOfWeek entry, find the previous DateTime */
	function getPrevWeekdaysOfYear(date, byDayOfWeek) {
		const normalizedNthWeekdaysOfYear = byDayOfWeek.filter((entry) => Array.isArray(entry)).map((entry) => getNthWeekdayOfYear(date, ...entry));
		const normalizedNextWeekdays = byDayOfWeek.filter((entry) => typeof entry === "string").map((weekday) => getPreviousWeekday(date, weekday)).filter((entry) => entry.get("year") === date.get("year"));
		return uniqDateTimes([...normalizedNthWeekdaysOfYear, ...normalizedNextWeekdays]).filter((entry) => entry.isBeforeOrEqual(date)).sort(dateTimeSortComparer).reverse();
	}
	/** For each byDayOfWeek entry, find the previous DateTime */
	function getPrevWeekdaysOfMonth(date, byDayOfWeek) {
		const normalizedNthWeekdaysOfMonth = byDayOfWeek.filter((entry) => Array.isArray(entry)).map((entry) => getNthWeekdayOfMonth(date, ...entry));
		const normalizedNextWeekdays = byDayOfWeek.filter((entry) => typeof entry === "string").map((weekday) => getPreviousWeekday(date, weekday)).filter((entry) => entry.get("year") === date.get("year") && entry.get("month") === date.get("month"));
		return uniqDateTimes([...normalizedNthWeekdaysOfMonth, ...normalizedNextWeekdays]).filter((entry) => entry.isBeforeOrEqual(date)).sort(dateTimeSortComparer).reverse();
	}
	var ByDayOfWeekRule = class extends RecurrenceRuleBase {
		run(date) {
			if (this.options.frequency === "YEARLY") return this.options.byMonthOfYear === void 0 ? this.expandYearly(date) : this.expandMonthly(date);
			else if (this.options.frequency === "MONTHLY") return this.expandMonthly(date);
			return this.expand(date);
		}
		expandYearly(date) {
			let next = getNextWeekdaysOfYear(date, this.options.byDayOfWeek)[0];
			let index = 0;
			let base = date;
			while (!next && index < 28) {
				index++;
				base = base.granularity("year").add(1, "year");
				next = getNextWeekdaysOfYear(base, this.options.byDayOfWeek)[0];
			}
			if (!next) throw new RecurrenceRuleError("The byDayOfWeek rule appears to contain an impossible combination");
			return this.result(date, next);
		}
		expandMonthly(date) {
			let next = getNextWeekdaysOfMonth(date, this.options.byDayOfWeek)[0];
			let index = 0;
			let base = date;
			while (!next && index < 50) {
				index++;
				base = base.granularity("month").add(1, "month");
				next = getNextWeekdaysOfMonth(base, this.options.byDayOfWeek)[0];
			}
			if (!next) throw new RecurrenceRuleError("The byDayOfWeek rule appears to contain an impossible combination");
			return this.result(date, next);
		}
		expand(date) {
			const next = this.options.byDayOfWeek.map((weekday) => getNextWeekday(date, weekday)).sort(dateTimeSortComparer)[0];
			return this.result(date, next);
		}
		result(date, next) {
			if (next.isEqual(date)) return this.validateDate(new ValidDateTime(date));
			return this.validateDate(new InvalidDateTime(next.granularity("day")));
		}
	};
	/** For each byDayOfWeek entry, find the next DateTime */
	function getNextWeekdaysOfYear(date, byDayOfWeek) {
		const normalizedNthWeekdaysOfYear = byDayOfWeek.filter((entry) => Array.isArray(entry)).map((entry) => getNthWeekdayOfYear(date, ...entry));
		const normalizedNextWeekdays = byDayOfWeek.filter((entry) => typeof entry === "string").map((weekday) => getNextWeekday(date, weekday)).filter((entry) => entry.get("year") === date.get("year"));
		return uniqDateTimes([...normalizedNthWeekdaysOfYear, ...normalizedNextWeekdays]).filter((entry) => entry.isAfterOrEqual(date)).sort(dateTimeSortComparer);
	}
	/** For each byDayOfWeek entry, find the next DateTime */
	function getNextWeekdaysOfMonth(date, byDayOfWeek) {
		const normalizedNthWeekdaysOfMonth = byDayOfWeek.filter((entry) => Array.isArray(entry)).map((entry) => getNthWeekdayOfMonth(date, ...entry));
		const normalizedNextWeekdays = byDayOfWeek.filter((entry) => typeof entry === "string").map((weekday) => getNextWeekday(date, weekday)).filter((entry) => entry.get("year") === date.get("year") && entry.get("month") === date.get("month"));
		return uniqDateTimes([...normalizedNthWeekdaysOfMonth, ...normalizedNextWeekdays]).filter((entry) => entry.isAfterOrEqual(date)).sort(dateTimeSortComparer);
	}
	var ByDayOfWeekRuleModule = {
		name: "ByDayOfWeek",
		get: (processor) => {
			if (processor.options.byDayOfWeek === void 0) return null;
			if (processor.reverse) return new RevByDayOfWeekRule(processor);
			return new ByDayOfWeekRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.byDayOfWeek !== void 0) {
				if (!ruleOptionFilled(options.byDayOfWeek)) throw new RuleOptionError("\"byDayOfWeek\" expects a non-empty array");
				const invalidWeeday = options.byDayOfWeek.find((day) => Array.isArray(day) ? !DateAdapter$1.WEEKDAYS.includes(day[0]) : !DateAdapter$1.WEEKDAYS.includes(day));
				if (invalidWeeday) throw new RuleOptionError(`"byDayOfWeek" expects weedays in the form ${JSON.stringify(DateAdapter$1.WEEKDAYS)} but "${invalidWeeday}" was provided`);
				if (!["YEARLY", "MONTHLY"].includes(options.frequency) && options.byDayOfWeek.some((weekday) => Array.isArray(weekday))) throw new RuleOptionError("\"byDayOfWeek\" can only include a numeric value (i.e. `[string, number]`) when the \"frequency\" is either \"MONTHLY\" or \"YEARLY\"");
				if (options.frequency === "MONTHLY" && options.byDayOfWeek.some((weekday) => Array.isArray(weekday) && (weekday[1] < -31 || weekday[1] === 0 || weekday[1] > 31))) throw new RuleOptionError("when \"frequency\" is \"MONTHLY\", each \"byDayOfWeek\" can optionally only have a numeric value >= -31 and <= 31 and !== 0");
				if (options.frequency === "YEARLY" && options.byDayOfWeek.some((weekday) => Array.isArray(weekday) && (weekday[1] < -366 || weekday[1] === 0 || weekday[1] > 366))) throw new RuleOptionError("when \"frequency\" is \"YEARLY\", each \"byDayOfWeek\" can optionally only have a numeric value >= -366 and <= 366 and !== 0");
				norm.byDayOfWeek = options.byDayOfWeek;
			} else if (!ruleOptionFilled(options.byDayOfMonth) && options.frequency === "WEEKLY") norm.byDayOfWeek = [norm.start.get("weekday")];
		},
		deps: () => [
			FrequencyRuleModule,
			ByDayOfWeekRuleModule,
			ByHourOfDayRuleModule,
			ByMinuteOfHourRuleModule,
			BySecondOfMinuteRuleModule,
			ByMillisecondOfSecondRuleModule
		]
	};
	var RevByMonthOfYearRule = class extends RevRecurrenceRuleBase {
		constructor() {
			super(...arguments);
			this.option = this.processor.options.byMonthOfYear.slice().reverse();
		}
		run(date) {
			const currentMonth = date.get("month");
			for (const month of this.option) {
				if (currentMonth < month) continue;
				if (currentMonth === month) return this.validateDate(new ValidDateTime(date));
				return this.validateDate(new InvalidDateTime(date.endGranularity("year").set("month", month)));
			}
			return this.validateDate(new InvalidDateTime(date.endGranularity("year").subtract(1, "year").set("month", this.option[0])));
		}
	};
	var ByMonthOfYearRule = class extends RecurrenceRuleBase {
		run(date) {
			const currentMonth = date.get("month");
			for (const month of this.options.byMonthOfYear) {
				if (currentMonth > month) continue;
				if (currentMonth === month) return this.validateDate(new ValidDateTime(date));
				return this.validateDate(new InvalidDateTime(date.granularity("year").set("month", month)));
			}
			return this.validateDate(new InvalidDateTime(date.granularity("year").add(1, "year").set("month", this.options.byMonthOfYear[0])));
		}
	};
	var ByMonthOfYearRuleModule = {
		name: "ByMonthOfYear",
		get: (processor) => {
			if (processor.options.byMonthOfYear === void 0) return null;
			if (processor.reverse) return new RevByMonthOfYearRule(processor);
			return new ByMonthOfYearRule(processor);
		},
		normalizeOptions: (options, norm) => {
			if (options.byMonthOfYear !== void 0) {
				if (!ruleOptionFilled(options.byMonthOfYear)) throw new RuleOptionError("\"byMonthOfYear\" expects a non-empty array");
				if (options.byMonthOfYear.some((num) => num < 1 || num > 12)) throw new RuleOptionError("\"byMonthOfYear\" values must be `num >= 1 && num >= 12`");
				norm.byMonthOfYear = options.byMonthOfYear.slice();
				norm.byMonthOfYear.sort(numberSortComparer);
			} else if (!(ruleOptionFilled(options.byDayOfMonth) || ruleOptionFilled(options.byDayOfWeek) || ruleOptionFilled(options.byDayOfYear)) && options.frequency === "YEARLY") norm.byMonthOfYear = [norm.start.get("month")];
		},
		deps: () => [
			FrequencyRuleModule,
			ByMonthOfYearRuleModule,
			ByDayOfMonthRuleModule,
			ByHourOfDayRuleModule,
			ByMinuteOfHourRuleModule,
			BySecondOfMinuteRuleModule,
			ByMillisecondOfSecondRuleModule
		]
	};
	var ICAL_RULES = [
		FrequencyRuleModule,
		ByMonthOfYearRuleModule,
		ByDayOfMonthRuleModule,
		ByDayOfWeekRuleModule,
		ByHourOfDayRuleModule,
		ByMinuteOfHourRuleModule,
		BySecondOfMinuteRuleModule,
		ByMillisecondOfSecondRuleModule
	];
	//#endregion
	//#region ../../node_modules/@rschedule/standard-date-adapter/es2015/main.js
	var StandardDateAdapter = class StandardDateAdapter extends DateAdapterBase$1 {
		constructor(date, options = {}) {
			super(void 0, options);
			if (![
				"UTC",
				null,
				void 0
			].includes(options.timezone)) throw new InvalidDateAdapterError$1(`StandardDateAdapter only supports "UTC" and local time zones but "${options.timezone}" was provided.`);
			this._date = new Date(date);
			this.timezone = options.timezone !== void 0 ? options.timezone : null;
			if (options.metadata) Object.assign(this.metadata, options.metadata);
			this.assertIsValid();
		}
		static isDate(object) {
			return Object.prototype.toString.call(object) === "[object Date]";
		}
		static fromDate(date, options) {
			return new StandardDateAdapter(date, options);
		}
		static fromJSON(json) {
			const args = [
				json.year,
				json.month - 1,
				json.day,
				json.hour,
				json.minute,
				json.second,
				json.millisecond
			];
			let date;
			switch (json.timezone) {
				case "UTC":
					date = new StandardDateAdapter(new Date(Date.UTC(...args)), {
						timezone: "UTC",
						duration: json.duration
					});
					break;
				case null:
					date = new StandardDateAdapter(new Date(...args), {
						timezone: null,
						duration: json.duration
					});
					break;
				default: throw new InvalidDateAdapterError$1(`The \`StandardDateAdapter\` only supports datetimes in UTC or LOCAL (null) time. You provided a JSON object with timezone "${json.timezone}".`);
			}
			if (json.metadata) Object.assign(date.metadata, json.metadata);
			return date;
		}
		static fromDateTime(datetime) {
			const date = StandardDateAdapter.fromJSON(datetime.toJSON());
			date.generators.push(...datetime.generators);
			if (datetime.metadata) Object.assign(date.metadata, datetime.metadata);
			return date;
		}
		get date() {
			return new Date(this._date);
		}
		get end() {
			if (!this.duration) return;
			if (this._end) return this._end;
			this._end = StandardDateAdapter.fromDateTime(this.toDateTime().add(this.duration, "millisecond")).date;
			return this._end;
		}
		set(prop, value) {
			if (prop === "timezone") if (this.timezone === value) return this;
			else return new StandardDateAdapter(this._date, {
				timezone: value,
				duration: this.duration,
				generators: this.generators
			});
			else if (prop === "duration") if (this.duration === value) return this;
			else return new StandardDateAdapter(this._date, {
				timezone: this.timezone,
				duration: value,
				generators: this.generators
			});
			throw new ArgumentError(`Unknown prop "${prop}" for StandardDateAdapter#set()`);
		}
		valueOf() {
			return this._date.valueOf();
		}
		toJSON() {
			let json;
			if (this.timezone === "UTC") json = {
				timezone: this.timezone,
				year: this._date.getUTCFullYear(),
				month: this._date.getUTCMonth() + 1,
				day: this._date.getUTCDate(),
				hour: this._date.getUTCHours(),
				minute: this._date.getUTCMinutes(),
				second: this._date.getUTCSeconds(),
				millisecond: this._date.getUTCMilliseconds()
			};
			else json = {
				timezone: this.timezone,
				year: this._date.getFullYear(),
				month: this._date.getMonth() + 1,
				day: this._date.getDate(),
				hour: this._date.getHours(),
				minute: this._date.getMinutes(),
				second: this._date.getSeconds(),
				millisecond: this._date.getMilliseconds()
			};
			if (this.duration) json.duration = this.duration;
			return json;
		}
		assertIsValid() {
			if (!StandardDateAdapter.isDate(this._date) || isNaN(this._date.valueOf())) throw new InvalidDateAdapterError$1("StandardDateAdapter has invalid date.");
			else if (![null, "UTC"].includes(this.timezone)) throw new InvalidDateAdapterError$1(`StandardDateAdapter only supports local (null) and UTC timezones but "${this.timezone}" was specified.`);
			else if (this.duration && this.duration <= 0) throw new InvalidDateAdapterError$1("If provided, duration must be greater than 0.");
			return true;
		}
	};
	StandardDateAdapter.hasTimezoneSupport = false;
	//#endregion
	//#region ../../node_modules/@rschedule/standard-date-adapter/es2015/setup.js
	DateAdapterBase$1.adapter = StandardDateAdapter;
	Rule$1.recurrenceRules = ICAL_RULES;
	//#endregion
	//#region ../loot-core/src/server/util/rschedule.ts
	var RSchedule = class extends Schedule {};
	//#endregion
	//#region ../loot-core/src/shared/schedules.ts
	function getStatus(nextDate, completed, hasTrans, upcomingLength = "7") {
		const upcomingDays = getUpcomingDays(upcomingLength);
		const today = currentDay();
		if (completed) return "completed";
		else if (hasTrans) return "paid";
		else if (nextDate === today) return "due";
		else if (nextDate > today && nextDate <= addDays(today, upcomingDays)) return "upcoming";
		else if (nextDate < today) return "missed";
		else return "scheduled";
	}
	/**
	* Builds a query to check if each schedule already has a matching transaction.
	*
	* The date lower-bound varies:
	* - `dateCond.op === 'is'` (one-time): exact `next_date`, no lookback.
	* - `posts_transaction` (auto-posted recurring): exact `next_date`, since
	*   auto-posted dates are always precise. A lookback here would cause
	*   yesterday's transaction to falsely match today's occurrence.
	* - Otherwise (manual recurring): 2-day lookback to catch early payments.
	*/
	function getHasTransactionsQuery(schedules) {
		const filters = schedules.map((schedule) => {
			const dateCond = schedule._conditions?.find((c) => c.field === "date");
			return { $and: {
				schedule: schedule.id,
				date: { $gte: dateCond && dateCond.op === "is" ? schedule.next_date : schedule.posts_transaction ? schedule.next_date : subDays(schedule.next_date, 2) }
			} };
		});
		return q("transactions").options({ splits: "all" }).filter({ $or: filters }).orderBy({ date: "desc" }).select(["schedule", "date"]);
	}
	function recurConfigToRSchedule(config) {
		const base = {
			start: parseDate(config.start),
			frequency: config.frequency.toUpperCase(),
			byHourOfDay: [12]
		};
		if (config.interval) base.interval = config.interval;
		switch (config.endMode) {
			case "after_n_occurrences":
				base.count = config.endOccurrences;
				break;
			case "on_date":
				base.end = parseDate(config.endDate);
				break;
			default: break;
		}
		const abbrevDay = (name) => name.slice(0, 2).toUpperCase();
		switch (config.frequency) {
			case "daily": return [base];
			case "weekly": return [base];
			case "monthly": if (config.patterns && config.patterns.length > 0) {
				const days = config.patterns.filter((p) => p.type === "day");
				const dayNames = config.patterns.filter((p) => p.type !== "day");
				return [days.length > 0 && {
					...base,
					byDayOfMonth: days.map((p) => p.value)
				}, dayNames.length > 0 && {
					...base,
					byDayOfWeek: dayNames.map((p) => [abbrevDay(p.type), p.value])
				}].filter(Boolean);
			} else return [base];
			case "yearly": return [base];
			default: throw new Error("Invalid recurring date config");
		}
	}
	function extractScheduleConds(conditions) {
		return {
			payee: conditions.find((cond) => cond.op === "is" && cond.field === "payee") || conditions.find((cond) => cond.op === "is" && cond.field === "description") || null,
			account: conditions.find((cond) => cond.op === "is" && cond.field === "account") || conditions.find((cond) => cond.op === "is" && cond.field === "acct") || null,
			amount: conditions.find((cond) => (cond.op === "is" || cond.op === "isapprox" || cond.op === "isbetween") && cond.field === "amount") || null,
			date: conditions.find((cond) => (cond.op === "is" || cond.op === "isapprox") && cond.field === "date") || null
		};
	}
	function getNextDate(dateCond, start = new Date(currentDay()), noSkipWeekend = false) {
		start = startOfDay(start);
		const value = new Condition(dateCond.op, "date", dateCond.value, null).getValue();
		if (value.type === "date") return value.date;
		else if (value.type === "recur") {
			let dates = value.schedule.occurrences({
				start,
				take: 1
			}).toArray();
			if (dates.length === 0) dates = value.schedule.occurrences({
				reverse: true,
				take: 1
			}).toArray();
			if (dates.length > 0) {
				let date = dates[0].date;
				if (value.schedule.data.skipWeekend && !noSkipWeekend) date = getDateWithSkippedWeekend(date, value.schedule.data.weekendSolve);
				return dayFromDate(date);
			}
		}
		return null;
	}
	function getDateWithSkippedWeekend(date, solveMode) {
		if (isWeekend(date)) if (solveMode === "after") return nextMonday(date);
		else if (solveMode === "before") return previousFriday(date);
		else throw new Error("Unknown weekend solve mode, this should not happen!");
		return date;
	}
	function getScheduledAmount(amount, inverse = false) {
		if (amount == null) return 0;
		if (typeof amount === "number") return inverse ? -amount : amount;
		const avg = (amount.num1 + amount.num2) / 2;
		return inverse ? -Math.round(avg) : Math.round(avg);
	}
	function getUpcomingDays(upcomingLength = "7", today = currentDay()) {
		const month = getMonth(today);
		switch (upcomingLength) {
			case "currentMonth": {
				const day = getDay(today);
				return getDay(getMonthEnd(today)) - day;
			}
			case "oneMonth": return differenceInCalendarDays(nextMonth(month), month);
			default:
				if (upcomingLength.includes("-")) {
					const [num, unit] = upcomingLength.split("-");
					const value = Math.max(1, parseInt(num, 10));
					switch (unit) {
						case "day": return value;
						case "week": return value * 7;
						case "month": return differenceInCalendarDays(addMonths(today, value), month) + 1;
						case "year": return differenceInCalendarDays(addMonths(today, value * 12), month) + 1;
						default: return 7;
					}
				}
				return parseInt(upcomingLength, 10);
		}
	}
	//#endregion
	//#region ../loot-core/src/server/rules/rule-utils.ts
	function assert(test, type, msg) {
		if (!test) throw new RuleError(type, msg);
	}
	var OP_SCORES = {
		is: 10,
		isNot: 10,
		oneOf: 9,
		notOneOf: 9,
		isapprox: 5,
		isbetween: 5,
		gt: 1,
		gte: 1,
		lt: 1,
		lte: 1,
		contains: 0,
		doesNotContain: 0,
		matches: 0,
		hasTags: 0,
		onBudget: 0,
		offBudget: 0
	};
	function computeScore(rule) {
		const initialScore = rule.conditions.reduce((score, condition) => {
			if (OP_SCORES[condition.op] == null) {
				logger.log(`Found invalid operation while ranking: ${condition.op}`);
				return 0;
			}
			return score + OP_SCORES[condition.op];
		}, 0);
		if (rule.conditions.every((cond) => cond.op === "is" || cond.op === "isNot" || cond.op === "isapprox" || cond.op === "oneOf" || cond.op === "notOneOf")) return initialScore * 2;
		return initialScore;
	}
	function _rankRules(rules) {
		const scores = /* @__PURE__ */ new Map();
		rules.forEach((rule) => {
			scores.set(rule, computeScore(rule));
		});
		return [...rules].sort((r1, r2) => {
			const score1 = scores.get(r1);
			const score2 = scores.get(r2);
			if (score1 < score2) return -1;
			else if (score1 > score2) return 1;
			else {
				const id1 = r1.getId();
				const id2 = r2.getId();
				return id1 < id2 ? -1 : id1 > id2 ? 1 : 0;
			}
		});
	}
	function rankRules(rules) {
		let pre = [];
		let normal = [];
		let post = [];
		for (const rule of rules) switch (rule.stage) {
			case "pre":
				pre.push(rule);
				break;
			case "post":
				post.push(rule);
				break;
			default: normal.push(rule);
		}
		pre = _rankRules(pre);
		normal = _rankRules(normal);
		post = _rankRules(post);
		return pre.concat(normal).concat(post);
	}
	function migrateIds(rule, mappings) {
		for (let ci = 0; ci < rule.conditions.length; ci++) {
			const cond = rule.conditions[ci];
			if (cond.type === "id") switch (cond.op) {
				case "is":
					cond.value = mappings.get(cond.rawValue) || cond.rawValue;
					cond.unparsedValue = cond.value;
					break;
				case "isNot":
					cond.value = mappings.get(cond.rawValue) || cond.rawValue;
					cond.unparsedValue = cond.value;
					break;
				case "oneOf":
					cond.value = cond.rawValue.map((v) => mappings.get(v) || v);
					cond.unparsedValue = [...cond.value];
					break;
				case "notOneOf":
					cond.value = cond.rawValue.map((v) => mappings.get(v) || v);
					cond.unparsedValue = [...cond.value];
					break;
				default:
			}
		}
		for (let ai = 0; ai < rule.actions.length; ai++) {
			const action = rule.actions[ai];
			if (action.type === "id") {
				if (action.op === "set") action.value = mappings.get(action.rawValue) || action.rawValue;
			}
		}
	}
	function iterateIds(rules, fieldName, func) {
		let i;
		ruleiter: for (i = 0; i < rules.length; i++) {
			const rule = rules[i];
			for (let ci = 0; ci < rule.conditions.length; ci++) {
				const cond = rule.conditions[ci];
				if (cond.type === "id" && cond.field === fieldName) switch (cond.op) {
					case "is":
						if (func(rule, cond.value)) continue ruleiter;
						break;
					case "isNot":
						if (func(rule, cond.value)) continue ruleiter;
						break;
					case "oneOf":
						for (let vi = 0; vi < cond.value.length; vi++) if (func(rule, cond.value[vi])) continue ruleiter;
						break;
					case "notOneOf":
						for (let vi = 0; vi < cond.value.length; vi++) if (func(rule, cond.value[vi])) continue ruleiter;
						break;
					default:
				}
			}
			for (let ai = 0; ai < rule.actions.length; ai++) {
				const action = rule.actions[ai];
				if (action.type === "id" && action.field === fieldName) {
					if (action.op === "set") {
						if (func(rule, action.value)) break;
					}
				}
			}
		}
	}
	function parseRecurDate(desc) {
		try {
			return {
				type: "recur",
				schedule: new RSchedule({
					rrules: recurConfigToRSchedule(desc),
					data: {
						skipWeekend: desc.skipWeekend,
						weekendSolve: desc.weekendSolveMode
					}
				})
			};
		} catch (e) {
			throw new RuleError("parse-recur-date", e.message);
		}
	}
	function parseDateString(str) {
		if (typeof str !== "string") return null;
		else if (str.length === 10) {
			if (!isValid(parseISO(str))) return null;
			return {
				type: "date",
				date: str
			};
		} else if (str.length === 7) {
			if (!isValid(parseISO(str + "-01"))) return null;
			return {
				type: "month",
				date: str
			};
		} else if (str.length === 4) {
			if (!isValid(parseISO(str + "-01-01"))) return null;
			return {
				type: "year",
				date: str
			};
		}
		return null;
	}
	function parseBetweenAmount(between) {
		const { num1, num2 } = between;
		if (typeof num1 !== "number" || typeof num2 !== "number") return null;
		return {
			type: "between",
			num1,
			num2
		};
	}
	//#endregion
	//#region ../loot-core/src/server/rules/action.ts
	HyperFormula.registerLanguage("enUS", dictionary);
	HyperFormula.registerFunctionPlugin(CustomFunctionsPlugin, customFunctionsTranslations);
	var ACTION_OPS = [
		"set",
		"set-split-amount",
		"link-schedule",
		"prepend-notes",
		"append-notes",
		"delete-transaction"
	];
	var Action = class {
		constructor(op, field, value, options) {
			_defineProperty(this, "field", void 0);
			_defineProperty(this, "op", void 0);
			_defineProperty(this, "options", void 0);
			_defineProperty(this, "rawValue", void 0);
			_defineProperty(this, "type", void 0);
			_defineProperty(this, "value", void 0);
			_defineProperty(this, "handlebarsTemplate", void 0);
			assert(ACTION_OPS.includes(op), "internal", `Invalid action operation: ${op}`);
			if (op === "set") {
				const typeName = FIELD_TYPES.get(field);
				assert(typeName, "internal", `Invalid field for action: ${field}`);
				this.field = field;
				this.type = typeName;
				if (options?.template) {
					this.handlebarsTemplate = import_handlebars.compile(options.template, { noEscape: true });
					try {
						this.handlebarsTemplate({});
					} catch (e) {
						logger.debug(e);
						assert(false, "invalid-template", `Invalid Handlebars template`);
					}
				}
			} else if (op === "set-split-amount") {
				this.field = null;
				this.type = "number";
			} else if (op === "link-schedule") {
				this.field = null;
				this.type = "id";
			} else if (op === "prepend-notes" || op === "append-notes") {
				this.field = "notes";
				this.type = "id";
			}
			if (field === "account") assert(value, "no-null", `Field cannot be empty: ${field}`);
			this.op = op;
			this.rawValue = value;
			this.value = value;
			this.options = options;
		}
		exec(object) {
			switch (this.op) {
				case "set":
					if (this.options?.formula) try {
						if (!object._ruleErrors) object._ruleErrors = [];
						const result = this.executeFormulaSync(this.options.formula, object);
						switch (this.type) {
							case "number": {
								const numValue = typeof result === "number" ? result : parseFloat(String(result));
								if (isNaN(numValue)) {
									const error = `Formula for "${this.field}" must produce a numeric value. Got: ${JSON.stringify(result)}`;
									object._ruleErrors.push(error);
								} else object[this.field] = numValue;
								break;
							}
							case "date": {
								const parsed = parseDate(String(result));
								if (parsed && isValid(parsed)) object[this.field] = format$1(parsed, "yyyy-MM-dd");
								else {
									const error = `Formula for "${this.field}" must produce a valid date. Got: ${JSON.stringify(result)}`;
									object._ruleErrors.push(error);
								}
								break;
							}
							case "boolean":
								object[this.field] = typeof result === "boolean" ? result : String(result).toLowerCase() === "true";
								break;
							case "string":
								object[this.field] = String(result);
								break;
							default: break;
						}
					} catch (err) {
						const error = `Error executing formula for "${this.field}": ${err instanceof Error ? err.message : String(err)}`;
						object._ruleErrors.push(error);
						break;
					}
					else if (this.handlebarsTemplate) {
						object[this.field] = this.handlebarsTemplate({
							...object,
							today: currentDay()
						});
						switch (this.type) {
							case "number": {
								const numValue = parseFloat(object[this.field]);
								object[this.field] = isNaN(numValue) ? 0 : numValue;
								break;
							}
							case "date": {
								const parsed = parseDate(object[this.field]);
								if (parsed && isValid(parsed)) object[this.field] = format$1(parsed, "yyyy-MM-dd");
								else {
									logger.error(`rules: invalid date produced by template for field "${this.field}":`, object[this.field]);
									object[this.field] = "9999-12-31";
								}
								break;
							}
							case "boolean":
								object[this.field] = object[this.field] === "true";
								break;
							default: break;
						}
					} else object[this.field] = this.value;
					if (this.field === "payee_name") object["payee"] = "new";
					break;
				case "set-split-amount":
					switch (this.options.method) {
						case "fixed-amount":
							object.amount = this.value;
							break;
						case "formula":
							if (!object._ruleErrors) object._ruleErrors = [];
							if (!this.options?.formula) {
								object._ruleErrors.push("Formula method selected but no formula specified");
								break;
							}
							try {
								const result = this.executeFormulaSync(this.options.formula, object);
								const numValue = typeof result === "number" ? result : parseFloat(String(result));
								if (isNaN(numValue)) object._ruleErrors.push(`Formula for split amount must produce a numeric value. Got: ${JSON.stringify(result)}`);
								else object.amount = numValue;
							} catch (err) {
								object._ruleErrors.push(`Error executing formula for split amount: ${err instanceof Error ? err.message : String(err)}`);
							}
							break;
						default: break;
					}
					break;
				case "link-schedule":
					object.schedule = this.value;
					break;
				case "prepend-notes":
					object[this.field] = object[this.field] ? this.value + object[this.field] : this.value;
					break;
				case "append-notes":
					object[this.field] = object[this.field] ? object[this.field] + this.value : this.value;
					break;
				case "delete-transaction":
					object["tombstone"] = 1;
					break;
				default: break;
			}
		}
		extractVariablesFromAST(ast) {
			const variables = /* @__PURE__ */ new Set();
			const walk = (node) => {
				if (!node || typeof node !== "object") return;
				const typedNode = node;
				if (typedNode.type === "CELL_REFERENCE" && typeof typedNode.value === "string") variables.add(typedNode.value);
				if (Array.isArray(typedNode.args)) for (const arg of typedNode.args) walk(arg);
				for (const value of Object.values(typedNode)) if (typeof value === "object" && value !== null) walk(value);
			};
			walk(ast);
			return variables;
		}
		executeFormulaSync(formula, transaction) {
			let hfInstance = null;
			if (!formula || !formula.startsWith("=")) throw new Error("Formula must start with =");
			try {
				hfInstance = HyperFormula.buildEmpty({
					licenseKey: "gpl-v3",
					language: "enUS",
					dateFormats: [
						"DD/MM/YYYY",
						"YYYY-MM-DD",
						"YYYY/MM/DD"
					],
					context: { balanceOfPrefetch: transaction["_balanceOfPrefetched"] ?? /* @__PURE__ */ new Map() }
				});
				const sheetName = hfInstance.addSheet("Sheet1");
				const sheetId = hfInstance.getSheetId(sheetName);
				if (sheetId === void 0) throw new Error("Failed to create sheet");
				const fieldValues = {
					...transaction,
					today: currentDay(),
					account_name: transaction._account_name || "",
					category_name: transaction._category_name || ""
				};
				for (const key of Object.keys(fieldValues)) {
					if (key === "_balanceOfPrefetched") continue;
					let cellValue;
					if (fieldValues[key] === void 0 || fieldValues[key] === null || typeof fieldValues[key] === "object") cellValue = "";
					else cellValue = fieldValues[key];
					hfInstance.addNamedExpression(key, cellValue);
				}
				hfInstance.setCellContents({
					sheet: sheetId,
					col: 0,
					row: 0
				}, [[formula]]);
				const cellAddress = {
					sheet: sheetId,
					col: 0,
					row: 0
				};
				const cellValue = hfInstance.getCellValue(cellAddress);
				if (cellValue && typeof cellValue === "object" && "type" in cellValue) throw new Error(`Formula error: ${cellValue.message}`);
				if (typeof cellValue === "number") return amountToInteger(Math.round(cellValue * 100) / 100);
				return cellValue;
			} catch (err) {
				logger.error("Formula execution error:", err);
				throw err;
			} finally {
				try {
					hfInstance?.destroy();
				} catch (err) {
					logger.error("Error destroying HyperFormula instance:", err);
				}
			}
		}
		serialize() {
			return {
				op: this.op,
				field: this.field,
				value: this.value,
				type: this.type,
				...this.options ? { options: this.options } : {}
			};
		}
	};
	//#endregion
	//#region ../loot-core/src/server/rules/condition.ts
	var CONDITION_TYPES = {
		date: {
			ops: [
				"is",
				"isapprox",
				"gt",
				"gte",
				"lt",
				"lte"
			],
			nullable: false,
			parse(op, value, fieldName) {
				const parsed = typeof value === "string" ? parseDateString(value) : value.frequency != null ? parseRecurDate(value) : null;
				assert(parsed, "date-format", `Invalid date format (field: ${fieldName})`);
				if (op === "isapprox") assert(parsed.type === "date" || parsed.type === "recur", "date-format", `Invalid date value for "isapprox" (field: ${fieldName})`);
				else if (op === "gt" || op === "gte" || op === "lt" || op === "lte") assert(parsed.type === "date", "date-format", `Invalid date value for "${op}" (field: ${fieldName})`);
				return parsed;
			}
		},
		id: {
			ops: [
				"is",
				"contains",
				"matches",
				"oneOf",
				"isNot",
				"doesNotContain",
				"notOneOf",
				"and",
				"onBudget",
				"offBudget"
			],
			nullable: true,
			parse(op, value, fieldName) {
				if (op === "oneOf" || op === "notOneOf" || op === "and") {
					assert(Array.isArray(value), "no-empty-array", `oneOf must have an array value (field: ${fieldName})`);
					return value;
				}
				return value;
			}
		},
		string: {
			ops: [
				"is",
				"contains",
				"matches",
				"oneOf",
				"isNot",
				"doesNotContain",
				"notOneOf",
				"hasTags"
			],
			nullable: true,
			parse(op, value, fieldName) {
				if (op === "oneOf" || op === "notOneOf") {
					assert(Array.isArray(value), "no-empty-array", `oneOf must have an array value (field: ${fieldName}): ${JSON.stringify(value)}`);
					return value.filter(Boolean).map((val) => val.toLowerCase());
				}
				assert(typeof value === "string", "not-string", `Invalid string value (field: ${fieldName})`);
				if (op === "contains" || op === "matches" || op === "doesNotContain" || op === "hasTags") assert(value.length > 0, "no-empty-string", `${op} must have non-empty string (field: ${fieldName})`);
				if (op === "hasTags") return value;
				return value.toLowerCase();
			}
		},
		number: {
			ops: [
				"is",
				"isapprox",
				"isbetween",
				"gt",
				"gte",
				"lt",
				"lte"
			],
			nullable: false,
			parse(op, value, fieldName) {
				const parsed = typeof value === "number" ? {
					type: "literal",
					value
				} : parseBetweenAmount(value);
				assert(parsed != null, "not-number", `Value must be a number or between amount: ${JSON.stringify(value)} (field: ${fieldName})`);
				if (op === "isbetween") assert(parsed.type === "between", "number-format", `Invalid between value for "${op}" (field: ${fieldName})`);
				else assert(parsed.type === "literal", "number-format", `Invalid number value for "${op}" (field: ${fieldName})`);
				return parsed;
			}
		},
		boolean: {
			ops: ["is"],
			nullable: false,
			parse(op, value, fieldName) {
				assert(typeof value === "boolean", "not-boolean", `Value must be a boolean: ${value} (field: ${fieldName})`);
				return value;
			}
		}
	};
	var Condition = class {
		constructor(op, field, value, options) {
			_defineProperty(this, "field", void 0);
			_defineProperty(this, "op", void 0);
			_defineProperty(this, "options", void 0);
			_defineProperty(this, "rawValue", void 0);
			_defineProperty(this, "type", void 0);
			_defineProperty(this, "unparsedValue", void 0);
			_defineProperty(this, "value", void 0);
			const typeName = FIELD_TYPES.get(field);
			assert(typeName, "internal", "Invalid condition field: " + field);
			const type = CONDITION_TYPES[typeName];
			assert(type, "internal", `Invalid condition type: ${typeName} (field: ${field})`);
			assert(isValidOp(field, op), "internal", `Invalid condition operator: ${op} (type: ${typeName}, field: ${field})`);
			if (type.nullable !== true) assert(value != null, "no-null", `Field cannot be empty: ${field}`);
			if (typeName === "string" && type.nullable !== true) assert(value !== "", "no-null", `Field cannot be empty: ${field}`);
			this.rawValue = value;
			this.unparsedValue = value;
			this.op = op;
			this.field = field;
			this.value = type.parse ? type.parse(op, value, field) : value;
			this.options = options;
			this.type = typeName;
		}
		eval(object) {
			let fieldValue = object[this.field];
			const type = this.type;
			if (type === "string") fieldValue ?? (fieldValue = "");
			if (fieldValue === void 0) return false;
			if (typeof fieldValue === "string") fieldValue = fieldValue.toLowerCase();
			if (type === "number" && this.options) {
				if (this.options.outflow) {
					if (fieldValue > 0) return false;
					fieldValue = -fieldValue;
				} else if (this.options.inflow) {
					if (fieldValue < 0) return false;
				}
			}
			const extractValue = (v) => type === "number" ? v.value : v;
			switch (this.op) {
				case "isapprox":
				case "is":
					if (type === "date") {
						if (fieldValue == null) return false;
						if (this.value.type === "recur") {
							const { schedule } = this.value;
							if (this.op === "isapprox") {
								const fieldDate = parseDate(fieldValue);
								return schedule.occursBetween(subDays$1(fieldDate, 2), addDays$1(fieldDate, 2));
							} else return schedule.occursOn({ date: parseDate(fieldValue) });
						} else {
							const { date } = this.value;
							if (this.op === "isapprox") {
								const fullDate = parseDate(date);
								const high = addDays(fullDate, 2);
								const low = subDays(fullDate, 2);
								return fieldValue >= low && fieldValue <= high;
							} else switch (this.value.type) {
								case "date": return fieldValue === date;
								case "month": return monthFromDate(fieldValue) === date;
								case "year": return yearFromDate(fieldValue) === date;
								default:
							}
						}
					} else if (type === "number") {
						const number = this.value.value;
						if (this.op === "isapprox") {
							const threshold = getApproxNumberThreshold(number);
							return fieldValue >= number - threshold && fieldValue <= number + threshold;
						}
						return fieldValue === number;
					}
					return fieldValue === this.value;
				case "isNot": return fieldValue !== this.value;
				case "isbetween": {
					const [low, high] = sortNumbers(this.value.num1, this.value.num2);
					return fieldValue >= low && fieldValue <= high;
				}
				case "contains":
					if (fieldValue === null) return false;
					return String(fieldValue).indexOf(this.value) !== -1;
				case "doesNotContain":
					if (fieldValue === null) return false;
					return String(fieldValue).indexOf(this.value) === -1;
				case "oneOf":
					if (fieldValue === null) return false;
					return this.value.indexOf(fieldValue) !== -1;
				case "hasTags":
					if (fieldValue === null) return false;
					return String(fieldValue).indexOf(this.value) !== -1;
				case "notOneOf":
					if (fieldValue === null) return false;
					return this.value.indexOf(fieldValue) === -1;
				case "gt":
					if (fieldValue === null) return false;
					else if (type === "date") return isAfter(fieldValue, this.value.date);
					return fieldValue > extractValue(this.value);
				case "gte":
					if (fieldValue === null) return false;
					else if (type === "date") return fieldValue === this.value.date || isAfter(fieldValue, this.value.date);
					return fieldValue >= extractValue(this.value);
				case "lt":
					if (fieldValue === null) return false;
					else if (type === "date") return isBefore(fieldValue, this.value.date);
					return fieldValue < extractValue(this.value);
				case "lte":
					if (fieldValue === null) return false;
					else if (type === "date") return fieldValue === this.value.date || isBefore(fieldValue, this.value.date);
					return fieldValue <= extractValue(this.value);
				case "matches":
					if (fieldValue === null) return false;
					try {
						return new RegExp(this.value).test(fieldValue);
					} catch (e) {
						logger.log("invalid regexp in matches condition", e);
						return false;
					}
				case "onBudget":
					if (!object._account) return false;
					return object._account.offbudget === 0;
				case "offBudget":
					if (!object._account) return false;
					return object._account.offbudget === 1;
				default:
			}
			return false;
		}
		getValue() {
			return this.value;
		}
		serialize() {
			return {
				op: this.op,
				field: this.field,
				value: this.unparsedValue,
				type: this.type,
				...this.options ? { options: this.options } : null
			};
		}
	};
	//#endregion
	//#region ../loot-core/src/server/rules/handlebars-helpers.ts
	function registerHandlebarsHelpers() {
		const regexTest = /^\/(.*)\/([gimuy]*)$/;
		function mathHelper(fn) {
			return (a, ...b) => {
				return b.map(Number).reduce(fn, Number(a));
			};
		}
		function regexHelper(mapRegex, mapNonRegex, apply) {
			return (value, regex, replace) => {
				if (value == null) return null;
				if (typeof regex !== "string" || typeof replace !== "string") return "";
				let regexp;
				const match = regexTest.exec(regex);
				if (match) regexp = mapRegex(match[1], match[2]);
				else regexp = mapNonRegex(regex);
				return apply(String(value), regexp, replace);
			};
		}
		const helpers = {
			regex: regexHelper((regex, flags) => new RegExp(regex, flags), (value) => new RegExp(value), (value, regex, replace) => value.replace(regex, replace)),
			replace: regexHelper((regex, flags) => new RegExp(regex, flags), (value) => value, (value, regex, replace) => value.replace(regex, replace)),
			replaceAll: regexHelper((regex, flags) => new RegExp(regex, flags), (value) => value, (value, regex, replace) => value.replaceAll(regex, replace)),
			add: mathHelper((a, b) => a + b),
			sub: mathHelper((a, b) => a - b),
			div: mathHelper((a, b) => a / b),
			mul: mathHelper((a, b) => a * b),
			mod: mathHelper((a, b) => a % b),
			floor: (a) => Math.floor(Number(a)),
			ceil: (a) => Math.ceil(Number(a)),
			round: (a) => Math.round(Number(a)),
			abs: (a) => Math.abs(Number(a)),
			min: mathHelper((a, b) => Math.min(a, b)),
			max: mathHelper((a, b) => Math.max(a, b)),
			fixed: (a, digits) => Number(a).toFixed(Number(digits)),
			day: (date) => date && format$1(date, "d"),
			month: (date) => date && format$1(date, "M"),
			year: (date) => date && format$1(date, "yyyy"),
			format: (date, f) => date && f && format$1(date, f),
			addDays: (date, days) => {
				if (!date || !days) return date;
				return format$1(addDays(date, days), "yyyy-MM-dd");
			},
			subDays: (date, days) => {
				if (!date || !days) return date;
				return format$1(subDays(date, days), "yyyy-MM-dd");
			},
			addMonths: (date, months) => {
				if (!date || !months) return date;
				return format$1(addMonths$1(parseDate(date), months), "yyyy-MM-dd");
			},
			subMonths: (date, months) => {
				if (!date || !months) return date;
				return format$1(subMonths$1(parseDate(date), months), "yyyy-MM-dd");
			},
			addWeeks: (date, weeks) => {
				if (!date || !weeks) return date;
				return format$1(addWeeks$1(parseDate(date), weeks), "yyyy-MM-dd");
			},
			subWeeks: (date, weeks) => {
				if (!date || !weeks) return date;
				return format$1(subWeeks$1(parseDate(date), weeks), "yyyy-MM-dd");
			},
			addYears: (date, years) => {
				if (!date || !years) return date;
				return format$1(addYears(parseDate(date), years), "yyyy-MM-dd");
			},
			subYears: (date, years) => {
				if (!date || !years) return date;
				return format$1(subYears(parseDate(date), years), "yyyy-MM-dd");
			},
			setDay: (date, day) => {
				if (!date || day == null) return date;
				return format$1(addDays(date, day - Number(format$1(date, "d"))), "yyyy-MM-dd");
			},
			debug: (value) => {
				logger.log(value);
			},
			concat: (...args) => args.join("")
		};
		for (const [name, fn] of Object.entries(helpers)) import_handlebars.registerHelper(name, (...args) => {
			return fn(...args.slice(0, -1));
		});
	}
	//#endregion
	//#region ../loot-core/src/shared/transactions.ts
	function num(n) {
		return typeof n === "number" ? n : 0;
	}
	function SplitTransactionError(total, parent) {
		return {
			type: "SplitTransactionError",
			version: 1,
			difference: num(parent.amount) - total
		};
	}
	function makeChild(parent, data = {}) {
		const prefix = parent.id === "temp" ? "temp" : "";
		return {
			amount: 0,
			...data,
			category: "category" in data ? data.category : parent.category,
			payee: "payee" in data ? data.payee : parent.payee,
			id: "id" in data ? data.id : prefix + v4(),
			account: parent.account,
			date: parent.date,
			cleared: parent.cleared != null ? parent.cleared : null,
			reconciled: parent.reconciled != null ? parent.reconciled : null,
			starting_balance_flag: parent.starting_balance_flag != null ? parent.starting_balance_flag : null,
			sort_order: "sort_order" in data ? data.sort_order : parent.sort_order ?? null,
			is_child: true,
			parent_id: parent.id,
			error: null
		};
	}
	function recalculateSplit(trans) {
		const total = (trans.subtransactions || []).reduce((acc, t) => acc + num(t.amount), 0);
		const { error: _error, ...rest } = trans;
		return {
			...rest,
			error: total === num(trans.amount) ? null : SplitTransactionError(total, trans)
		};
	}
	function findParentIndex(transactions, idx) {
		while (idx >= 0) {
			if (transactions[idx].is_parent) return idx;
			idx--;
		}
		return null;
	}
	function getSplit(transactions, parentIndex) {
		const split = [transactions[parentIndex]];
		let curr = parentIndex + 1;
		while (curr < transactions.length && transactions[curr].is_child) {
			split.push(transactions[curr]);
			curr++;
		}
		return split;
	}
	function ungroupTransactions(transactions) {
		return transactions.reduce((list, parent) => {
			const { subtransactions, ...trans } = parent;
			const _subtransactions = subtransactions || [];
			list.push(trans);
			for (let i = 0; i < _subtransactions.length; i++) list.push(_subtransactions[i]);
			return list;
		}, []);
	}
	function groupTransaction(split) {
		return {
			...split[0],
			subtransactions: split.slice(1)
		};
	}
	function ungroupTransaction(split) {
		if (split == null) return [];
		return ungroupTransactions([split]);
	}
	function replaceTransactions(transactions, id, func) {
		const idx = transactions.findIndex((t) => t.id === id);
		const trans = transactions[idx];
		const transactionsCopy = [...transactions];
		if (idx === -1) throw new Error("Tried to edit unknown transaction id: " + id);
		if (trans.is_parent || trans.is_child) {
			const parentIndex = findParentIndex(transactions, idx);
			if (parentIndex == null) {
				logger.log("Cannot find parent index");
				return {
					data: [],
					diff: {
						added: [],
						deleted: [],
						updated: []
					},
					newTransaction: null
				};
			}
			const split = getSplit(transactions, parentIndex);
			let grouped = func(groupTransaction(split));
			const newSplit = ungroupTransaction(grouped);
			let diff;
			if (newSplit == null) {
				diff = {
					added: [],
					deleted: [{ id: split[0].id }],
					updated: []
				};
				grouped = {
					...split[0],
					_deleted: true
				};
				transactionsCopy.splice(parentIndex, split.length);
			} else {
				diff = diffItems(split, newSplit);
				transactionsCopy.splice(parentIndex, split.length, ...newSplit);
			}
			return {
				data: transactionsCopy,
				newTransaction: grouped,
				diff
			};
		} else {
			const grouped = func(trans);
			const newTrans = ungroupTransaction(grouped) || [];
			if (grouped) grouped.subtransactions = grouped.subtransactions || [];
			transactionsCopy.splice(idx, 1, ...newTrans);
			return {
				data: transactionsCopy,
				newTransaction: grouped || {
					...trans,
					_deleted: true
				},
				diff: diffItems([trans], newTrans)
			};
		}
	}
	function addSplitTransaction(transactions, id) {
		return replaceTransactions(transactions, id, (trans) => {
			if (!trans.is_parent) return trans;
			const prevSub = last$1(trans.subtransactions || []);
			trans.subtransactions?.push(makeChild(trans, {
				amount: 0,
				sort_order: num(prevSub && prevSub.sort_order) - 1
			}));
			return trans;
		});
	}
	function updateTransaction$1(transactions, transaction) {
		return replaceTransactions(transactions, transaction.id, (trans) => {
			if (trans.is_parent) {
				const parent = trans.id === transaction.id ? {
					...trans,
					...transaction
				} : trans;
				const sub = (parent.subtransactions ?? trans.subtransactions)?.map((t) => {
					let child = t;
					if (trans.id === transaction.id) {
						const { payee: childPayee, ...rest } = t;
						const newPayee = childPayee === trans.payee ? transaction.payee : childPayee;
						child = {
							...rest,
							...newPayee != null ? { payee: newPayee } : {}
						};
					} else if (t.id === transaction.id) child = transaction;
					return makeChild(parent, child);
				});
				return recalculateSplit({
					...parent,
					...sub && { subtransactions: sub }
				});
			} else return transaction;
		});
	}
	function deleteTransaction$1(transactions, id) {
		return replaceTransactions(transactions, id, (trans) => {
			if (trans.is_parent) if (trans.id === id) return null;
			else if (trans.subtransactions?.length === 1) {
				const { subtransactions: _subtransactions, ...rest } = trans;
				return {
					...rest,
					is_parent: false,
					error: null
				};
			} else {
				const sub = trans.subtransactions?.filter((t) => t.id !== id);
				return recalculateSplit({
					...trans,
					...sub && { subtransactions: sub }
				});
			}
			else return null;
		});
	}
	function splitTransaction(transactions, id, createSubtransactions) {
		return replaceTransactions(transactions, id, (trans) => {
			if (trans.is_parent || trans.is_child) return trans;
			const subtransactions = createSubtransactions?.(trans) || [makeChild(trans)];
			const { error: _error, ...rest } = trans;
			return {
				...rest,
				is_parent: true,
				error: num(trans.amount) === 0 ? null : SplitTransactionError(0, trans),
				subtransactions: subtransactions.map((t) => ({
					...t,
					sort_order: t.sort_order || -1
				}))
			};
		});
	}
	//#endregion
	//#region ../loot-core/src/server/rules/rule.ts
	function execNonSplitActions(actions, transaction) {
		const update = transaction;
		actions.forEach((action) => action.exec(update));
		return update;
	}
	function getSplitRemainder(transactions) {
		const { error } = recalculateSplit(groupTransaction(transactions));
		return error ? error.difference : 0;
	}
	function execSplitActions(actions, transaction) {
		const splitAmountActions = actions.filter((action) => action.op === "set-split-amount");
		const { data } = splitTransaction(ungroupTransaction(transaction), transaction.id);
		let newTransactions = data;
		actions.forEach((action) => {
			const splitTransactionIndex = (action.options?.splitIndex ?? 0) + 1;
			if (splitTransactionIndex >= newTransactions.length) {
				const { data } = addSplitTransaction(newTransactions, transaction.id);
				newTransactions = data;
			}
			newTransactions[splitTransactionIndex].parent_amount = transaction.amount;
			newTransactions[splitTransactionIndex].balance = transaction.balance;
			newTransactions[splitTransactionIndex]._balanceOfPrefetched = transaction._balanceOfPrefetched;
			action.exec(newTransactions[splitTransactionIndex]);
		});
		const remainingAfterFixedAmounts = getSplitRemainder(newTransactions);
		splitAmountActions.filter((action) => action.options.method === "fixed-percent").forEach((action) => {
			const splitTransactionIndex = (action.options?.splitIndex ?? 0) + 1;
			const percent = action.value / 100;
			const amount = Math.round(remainingAfterFixedAmounts * percent);
			newTransactions[splitTransactionIndex].amount = amount;
		});
		const remainderActions = splitAmountActions.filter((action) => action.options.method === "remainder");
		const remainingAfterFixedPercents = getSplitRemainder(newTransactions);
		if (remainderActions.length !== 0) {
			const amountPerRemainderSplit = Math.round(remainingAfterFixedPercents / remainderActions.length);
			let lastNonFixedTransactionIndex = -1;
			remainderActions.forEach((action) => {
				const splitTransactionIndex = (action.options?.splitIndex ?? 0) + 1;
				newTransactions[splitTransactionIndex].amount = amountPerRemainderSplit;
				lastNonFixedTransactionIndex = Math.max(lastNonFixedTransactionIndex, splitTransactionIndex);
			});
			newTransactions[lastNonFixedTransactionIndex].amount += getSplitRemainder(newTransactions);
		}
		newTransactions.splice(1, 1);
		return recalculateSplit(groupTransaction(newTransactions));
	}
	function execActions(actions, transaction) {
		const parentActions = actions.filter((action) => !action.options?.splitIndex);
		const childActions = actions.filter((action) => action.options?.splitIndex);
		const totalSplitCount = actions.reduce((prev, cur) => Math.max(prev, cur.options?.splitIndex ?? 0), 0) + 1;
		const nonSplitResult = execNonSplitActions(parentActions, transaction);
		if (totalSplitCount === 1) return nonSplitResult;
		if (nonSplitResult.is_child) return nonSplitResult;
		return execSplitActions(childActions, nonSplitResult);
	}
	var Rule = class {
		constructor({ id, stage, conditionsOp, conditions, actions }) {
			_defineProperty(this, "actions", void 0);
			_defineProperty(this, "conditions", void 0);
			_defineProperty(this, "conditionsOp", void 0);
			_defineProperty(this, "id", void 0);
			_defineProperty(this, "stage", void 0);
			this.id = id;
			this.stage = stage ?? null;
			this.conditionsOp = conditionsOp;
			this.conditions = conditions.map((c) => new Condition(c.op, c.field, c.value, c.options));
			this.actions = actions.map((a) => new Action(a.op, a.field, a.value, a.options));
		}
		evalConditions(object) {
			if (this.conditions.length === 0) return false;
			const method = this.conditionsOp === "or" ? "some" : "every";
			return this.conditions[method]((condition) => {
				return condition.eval(object);
			});
		}
		execActions(object) {
			const result = execActions(this.actions, { ...object });
			return Object.keys(result).reduce((prev, cur) => {
				if (result[cur] !== object[cur]) prev[cur] = result[cur];
				return prev;
			}, {});
		}
		exec(object) {
			if (this.evalConditions(object)) return this.execActions(object);
			return null;
		}
		apply(object) {
			const changes = this.exec(object);
			return Object.assign({}, object, changes);
		}
		getId() {
			return this.id;
		}
		serialize() {
			return {
				id: this.id,
				stage: this.stage,
				conditionsOp: this.conditionsOp,
				conditions: this.conditions.map((c) => c.serialize()),
				actions: this.actions.map((a) => a.serialize())
			};
		}
	};
	//#endregion
	//#region ../loot-core/src/server/rules/rule-indexer.ts
	var RuleIndexer = class {
		constructor({ field, method }) {
			_defineProperty(this, "field", void 0);
			_defineProperty(this, "method", void 0);
			_defineProperty(this, "rules", void 0);
			this.field = field;
			this.method = method;
			this.rules = /* @__PURE__ */ new Map();
		}
		getIndex(key) {
			if (!this.rules.has(key)) this.rules.set(key, /* @__PURE__ */ new Set());
			return this.rules.get(key);
		}
		getIndexForValue(value) {
			return this.getIndex(this.getKey(value) || "*");
		}
		getKey(value) {
			if (typeof value === "string" && value !== "") {
				if (this.method === "firstchar") return value[0].toLowerCase();
				return value.toLowerCase();
			}
			return null;
		}
		getIndexes(rule) {
			const cond = rule.conditions.find((cond) => cond.field === this.field);
			const indexes = [];
			if (cond && (cond.op === "oneOf" || cond.op === "is" || cond.op === "isNot" || cond.op === "notOneOf")) if (cond.op === "oneOf" || cond.op === "notOneOf") cond.value.forEach((val) => indexes.push(this.getIndexForValue(val)));
			else indexes.push(this.getIndexForValue(cond.value));
			else indexes.push(this.getIndex("*"));
			return indexes;
		}
		index(rule) {
			this.getIndexes(rule).forEach((index) => {
				index.add(rule);
			});
		}
		remove(rule) {
			this.getIndexes(rule).forEach((index) => {
				index.delete(rule);
			});
		}
		getApplicableRules(object) {
			let indexedRules;
			if (this.field in object) {
				const key = this.getKey(object[this.field]);
				if (key) indexedRules = this.rules.get(key);
			}
			return fastSetMerge(indexedRules || /* @__PURE__ */ new Set(), this.rules.get("*") || /* @__PURE__ */ new Set());
		}
	};
	//#endregion
	//#region ../loot-core/src/server/rules/index.ts
	registerHandlebarsHelpers();
	//#endregion
	//#region ../loot-core/src/server/rules/balanceOfFormula.ts
	/** Collect formula strings from serialized or live rule actions. */
	function collectFormulasFromActions(actions) {
		const out = [];
		for (const action of actions) {
			const f = action.options?.formula;
			if (typeof f === "string") out.push(f);
		}
		return out;
	}
	/** Decode escape sequences inside a double-quoted formula string literal. */
	function decodeBalanceOfQuotedLiteral(inner) {
		return inner.replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
	}
	/**
	* Distinct decoded string literals from BALANCE_OF("…") calls in a formula.
	*/
	function extractBalanceOfLiterals(formula) {
		const seen = /* @__PURE__ */ new Set();
		const out = [];
		const re = /BALANCE_OF\s*\(\s*"((?:[^"\\]|\\.)*)"\s*\)/gi;
		let m;
		while ((m = re.exec(formula)) !== null) {
			const decoded = decodeBalanceOfQuotedLiteral(m[1]);
			if (!seen.has(decoded)) {
				seen.add(decoded);
				out.push(decoded);
			}
		}
		return out;
	}
	/**
	* Resolve account id: map key (id) first, else first exact name match.
	*/
	function resolveAccountIdForBalanceOf(literal, accountsMap) {
		if (accountsMap.has(literal)) return literal;
		for (const acc of accountsMap.values()) if (acc.name === literal) return acc.id;
		return null;
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/transaction-rules.ts
	var allRules;
	var unlistenSync;
	var firstcharIndexer;
	var payeeIndexer;
	function resetState() {
		allRules = /* @__PURE__ */ new Map();
		firstcharIndexer = new RuleIndexer({
			field: "imported_payee",
			method: "firstchar"
		});
		payeeIndexer = new RuleIndexer({ field: "payee" });
	}
	function invert(obj) {
		return Object.fromEntries(Object.entries(obj).map((entry) => {
			return [entry[1], entry[0]];
		}));
	}
	var internalFields = schemaConfig.views.transactions.fields;
	var publicFields = invert(schemaConfig.views.transactions.fields);
	function fromInternalField(obj) {
		return {
			...obj,
			field: publicFields[obj.field] || obj.field
		};
	}
	function toInternalField(obj) {
		return {
			...obj,
			field: internalFields[obj.field] || obj.field
		};
	}
	function parseArray(str) {
		let value;
		try {
			value = typeof str === "string" ? JSON.parse(str) : str;
		} catch {
			throw new RuleError("internal", "Cannot parse rule json");
		}
		if (!Array.isArray(value)) throw new RuleError("internal", "Rule json must be an array");
		return value;
	}
	function parseConditionsOrActions(str) {
		return str ? parseArray(str).map((item) => fromInternalField(item)) : [];
	}
	function serializeConditionsOrActions(arr) {
		return JSON.stringify(arr.map((item) => toInternalField(item)));
	}
	var ruleModel = {
		validate(rule, { update } = {}) {
			requiredFields("rules", rule, ["conditions", "actions"], update);
			if (!update || "stage" in rule) {
				if (rule.stage !== "pre" && rule.stage !== "post" && rule.stage !== null) throw new Error("Invalid rule stage: " + rule.stage);
			}
			if (!update || "conditionsOp" in rule) {
				if (!["and", "or"].includes(rule.conditionsOp)) throw new Error("Invalid rule conditionsOp: " + rule.conditionsOp);
			}
			return rule;
		},
		toJS(row) {
			const { conditions, conditions_op, actions, ...fields } = row;
			return {
				...fields,
				conditionsOp: conditions_op,
				conditions: parseConditionsOrActions(conditions),
				actions: parseConditionsOrActions(actions)
			};
		},
		fromJS(rule) {
			const { conditions, conditionsOp, actions, ...row } = rule;
			if (conditionsOp) row.conditions_op = conditionsOp;
			if (Array.isArray(conditions)) row.conditions = serializeConditionsOrActions(conditions);
			if (Array.isArray(actions)) row.actions = serializeConditionsOrActions(actions);
			return row;
		}
	};
	function makeRule(data) {
		let rule;
		try {
			rule = new Rule(ruleModel.toJS(data));
		} catch (e) {
			logger.warn("Invalid rule", e);
			if (e instanceof RuleError) return null;
			throw e;
		}
		migrateIds(rule, getMappings());
		return rule;
	}
	async function loadRules() {
		resetState();
		const rules = await all(`
    SELECT * FROM rules
      WHERE conditions IS NOT NULL AND actions IS NOT NULL AND tombstone = 0
  `);
		for (let i = 0; i < rules.length; i++) {
			const desc = rules[i];
			if (desc.stage === "cleanup" || desc.stage === "modify") desc.stage = "pre";
			const rule = makeRule(desc);
			if (rule) {
				allRules.set(rule.id, rule);
				firstcharIndexer.index(rule);
				payeeIndexer.index(rule);
			}
		}
		if (unlistenSync) unlistenSync();
		unlistenSync = addSyncListener(onApplySync$1);
	}
	function getRules$1() {
		return [...allRules.values()];
	}
	async function insertRule(rule) {
		rule = ruleModel.validate(rule);
		return insertWithUUID("rules", ruleModel.fromJS(rule));
	}
	async function updateRule$1(rule) {
		rule = ruleModel.validate(rule, { update: true });
		return update("rules", ruleModel.fromJS(rule));
	}
	async function deleteRule$1(id) {
		if (await first$2("SELECT id FROM schedules WHERE rule = ?", [id])) return false;
		await delete_("rules", id);
		return true;
	}
	function onApplySync$1(oldValues, newValues) {
		newValues.forEach((items, table) => {
			if (table === "rules") items.forEach((newValue) => {
				const oldRule = allRules.get(newValue.id);
				if (newValue.tombstone === 1) {
					const rule = allRules.get(newValue.id);
					if (rule) {
						allRules.delete(rule.getId());
						firstcharIndexer.remove(rule);
						payeeIndexer.remove(rule);
					}
				} else {
					const rule = makeRule(newValue);
					if (rule) {
						if (oldRule) {
							firstcharIndexer.remove(oldRule);
							payeeIndexer.remove(oldRule);
						}
						allRules.set(newValue.id, rule);
						firstcharIndexer.index(rule);
						payeeIndexer.index(rule);
					}
				}
			});
		});
		if ([...newValues.keys()].find((table) => table.indexOf("mapping") !== -1)) getRules$1().forEach((rule) => {
			migrateIds(rule, getMappings());
		});
	}
	async function getRuleIdFromScheduleId(scheduleId) {
		return (await first$2("SELECT rule FROM schedules WHERE id = ?", [scheduleId]))?.rule || null;
	}
	async function getAllRuleIdsFromSchedules(excluding) {
		return (await all("SELECT rule FROM schedules")).map((r) => r.rule).filter((rule) => !!rule).filter((ruleId) => ruleId !== excluding);
	}
	async function runRules$1(trans, accounts = null) {
		let accountsMap = null;
		if (accounts === null) accountsMap = new Map((await getAccounts$2()).map((account) => [account.id, account]));
		else accountsMap = accounts;
		let finalTrans = await prepareTransactionForRules({ ...trans }, accountsMap);
		let scheduleRuleID = "";
		if (trans.schedule != null) {
			const ruleId = await getRuleIdFromScheduleId(trans.schedule);
			if (ruleId != null) scheduleRuleID = ruleId;
		}
		const RuleIdsLinkedToSchedules = await getAllRuleIdsFromSchedules(scheduleRuleID);
		const rules = rankRules(fastSetMerge(firstcharIndexer.getApplicableRules(trans), payeeIndexer.getApplicableRules(trans)));
		const formulaStrings = rules.flatMap((rule) => collectFormulasFromActions(rule.actions));
		finalTrans._balanceOfPrefetched = await prefetchBalanceOfForTransaction(finalTrans, accountsMap, formulaStrings);
		for (let i = 0; i < rules.length; i++) if (scheduleRuleID !== "") if (rules[i].id === scheduleRuleID) {
			const changes = rules[i].execActions(finalTrans);
			finalTrans = Object.assign({}, finalTrans, changes);
		} else if (RuleIdsLinkedToSchedules.includes(rules[i].id)) continue;
		else finalTrans = rules[i].apply(finalTrans);
		else finalTrans = rules[i].apply(finalTrans);
		return await finalizeTransactionForRules(finalTrans);
	}
	function conditionSpecialCases(cond) {
		if (!cond) return cond;
		if (cond.op === "is" && cond.field === "category" && cond.value === null) return new Condition("and", cond.field, [
			cond,
			new Condition("is", "transfer", false, null),
			new Condition("is", "parent", false, null)
		], {});
		else if (cond.op === "isNot" && cond.field === "category" && cond.value === null) return new Condition("and", cond.field, [cond, new Condition("is", "parent", false, null)], {});
		return cond;
	}
	function conditionsToAQL(conditions, { recurDateBounds = 100, applySpecialCases = true } = {}) {
		const errors = [];
		conditions = conditions.map((cond) => {
			if (cond instanceof Condition) return cond;
			try {
				return new Condition(cond.op, cond.field, cond.value, cond.options);
			} catch (e) {
				errors.push(e.type || "internal");
				logger.log("conditionsToAQL: invalid condition: " + e.message);
				return null;
			}
		}).map((cond) => applySpecialCases ? conditionSpecialCases(cond) : cond).filter(Boolean);
		const mapConditionToActualQL = (cond) => {
			const { type, options } = cond;
			let { field, op, value } = cond;
			const getValue = (value) => {
				if (type === "number") return value.value;
				return value;
			};
			if (field === "transfer" && op === "is") {
				field = "transfer_id";
				if (value) {
					op = "isNot";
					value = null;
				} else value = null;
			} else if (field === "parent" && op === "is") {
				field = "is_parent";
				if (value) op = "true";
				else op = "false";
			} else if (field === "category_group") field = "category.group";
			const apply = (field, aqlOp, value) => {
				if (type === "number") {
					if (options) {
						if (options.outflow) return { $and: [{ amount: { $lt: 0 } }, { [field]: {
							$transform: "$neg",
							[aqlOp]: value
						} }] };
						else if (options.inflow) return { $and: [{ amount: { $gt: 0 } }, { [field]: { [aqlOp]: value } }] };
					}
					return { amount: { [aqlOp]: value } };
				} else if (type === "string") return { [field]: {
					$transform: op !== "hasTags" ? "$lower" : void 0,
					[aqlOp]: value
				} };
				else if (type === "date") return { [field]: { [aqlOp]: value.date } };
				return { [field]: { [aqlOp]: value } };
			};
			switch (op) {
				case "isapprox":
				case "is":
					if (type === "date") if (value.type === "recur") return { $or: value.schedule.occurrences({ take: recurDateBounds }).toArray().map((d) => dayFromDate(d.date)).map((d) => {
						if (op === "isapprox") return { $and: [{ date: { $gte: subDays(d, 2) } }, { date: { $lte: addDays(d, 2) } }] };
						return { date: d };
					}) };
					else if (op === "isapprox") {
						const fullDate = parseDate(value.date);
						const high = addDays(fullDate, 2);
						return { $and: [{ date: { $gte: subDays(fullDate, 2) } }, { date: { $lte: high } }] };
					} else switch (value.type) {
						case "date": return { date: value.date };
						case "month": {
							const low = value.date + "-00";
							const high = value.date + "-99";
							return { $and: [{ date: { $gte: low } }, { date: { $lte: high } }] };
						}
						case "year": {
							const low = value.date + "-00-00";
							const high = value.date + "-99-99";
							return { $and: [{ date: { $gte: low } }, { date: { $lte: high } }] };
						}
						default:
					}
					else if (type === "number") {
						const number = value.value;
						if (op === "isapprox") {
							const threshold = getApproxNumberThreshold(number);
							return { $and: [apply(field, "$gte", number - threshold), apply(field, "$lte", number + threshold)] };
						}
						return apply(field, "$eq", number);
					} else if (type === "string") {
						if (value === "") return { $or: [apply(field, "$eq", null), apply(field, "$eq", "")] };
					}
					return apply(field, "$eq", value);
				case "isNot": return apply(field, "$ne", value);
				case "isbetween":
					const [low, high] = sortNumbers(value.num1, value.num2);
					return { [field]: [{ $gte: low }, { $lte: high }] };
				case "contains": return apply(type === "id" ? field + ".name" : field, "$like", "%" + value + "%");
				case "matches": return apply(type === "id" ? field + ".name" : field, "$regexp", value);
				case "doesNotContain": return apply(type === "id" ? field + ".name" : field, "$notlike", "%" + value + "%");
				case "oneOf":
					const values = value;
					if (values.length === 0) return { id: null };
					return { $or: values.map((v) => apply(field, "$eq", v)) };
				case "hasTags": {
					const tagValues = [];
					const seenTags = /* @__PURE__ */ new Set();
					for (const [_, tag] of value.matchAll(/(?<!#)(#[^#\s]+)/g)) if (!seenTags.has(tag)) {
						seenTags.add(tag);
						tagValues.push(tag);
					}
					if (tagValues.length === 0) return { id: null };
					return { $and: tagValues.map((v) => {
						const pattern = `(?<!#)${v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\$/g, "[$]")}([\\s#]|$)`;
						return apply(field, "$regexp", pattern);
					}) };
				}
				case "notOneOf":
					const notValues = value;
					if (notValues.length === 0) return { id: null };
					return { $and: notValues.map((v) => apply(field, "$ne", v)) };
				case "gt": return apply(field, "$gt", getValue(value));
				case "gte": return apply(field, "$gte", getValue(value));
				case "lt": return apply(field, "$lt", getValue(value));
				case "lte": return apply(field, "$lte", getValue(value));
				case "true": return apply(field, "$eq", true);
				case "false": return apply(field, "$eq", false);
				case "and": return { $and: getValue(value).map((subExpr) => mapConditionToActualQL(subExpr)) };
				case "onBudget": return { "account.offbudget": false };
				case "offBudget": return { "account.offbudget": true };
				default: throw new Error("Unhandled operator: " + op);
			}
		};
		return {
			filters: conditions.map(mapConditionToActualQL),
			errors
		};
	}
	async function applyActions(transactions, actions) {
		const parsedActions = actions.map((action) => {
			if (action instanceof Action) return action;
			try {
				if (action.op === "set-split-amount") return new Action(action.op, null, action.value, action.options);
				else if (action.op === "link-schedule") return new Action(action.op, null, action.value, null);
				else if (action.op === "prepend-notes" || action.op === "append-notes") return new Action(action.op, null, action.value, null);
				else if (action.op === "delete-transaction") return new Action(action.op, null, null, null);
				return new Action(action.op, action.field, action.value, action.options);
			} catch (e) {
				logger.log("Action error", e);
				return null;
			}
		}).filter(Boolean);
		if (parsedActions.length !== actions.length) return null;
		const accounts = await getAccounts$2();
		const accountsMap = new Map(accounts.map((account) => [account.id, account]));
		const transactionsForRules = await Promise.all(transactions.map((transactions) => prepareTransactionForRules(transactions, accountsMap)));
		const formulaStrings = collectFormulasFromActions(parsedActions);
		const balanceOfPrefetchResults = await Promise.all(transactionsForRules.map((trans) => prefetchBalanceOfForTransaction(trans, accountsMap, formulaStrings)));
		transactionsForRules.forEach((trans, i) => {
			trans._balanceOfPrefetched = balanceOfPrefetchResults[i];
		});
		const updated = transactionsForRules.flatMap((trans) => {
			return ungroupTransaction(execActions(parsedActions, trans));
		});
		const finalized = [];
		for (const trans of updated) finalized.push(await finalizeTransactionForRules(trans));
		return batchUpdateTransactions({ updated: finalized });
	}
	function getRulesForPayee(payeeId) {
		const rules = /* @__PURE__ */ new Set();
		iterateIds(getRules$1(), "payee", (rule, id) => {
			if (id === payeeId) rules.add(rule);
		});
		return rankRules([...rules]);
	}
	function* getIsSetterRules(stage, condField, actionField, { condValue, actionValue }) {
		const rules = getRules$1();
		for (let i = 0; i < rules.length; i++) {
			const rule = rules[i];
			if (rule.stage === stage && rule.actions.length === 1 && rule.actions[0].op === "set" && rule.actions[0].field === actionField && (actionValue === void 0 || rule.actions[0].value === actionValue) && rule.conditions.length === 1 && (rule.conditions[0].op === "is" || rule.conditions[0].op === "isNot") && rule.conditions[0].field === condField && (condValue === void 0 || rule.conditions[0].value === condValue)) yield rule.serialize();
		}
		return null;
	}
	function* getOneOfSetterRules(stage, condField, actionField, { condValue, actionValue }) {
		const rules = getRules$1();
		for (let i = 0; i < rules.length; i++) {
			const rule = rules[i];
			if (rule.stage === stage && rule.actions.length === 1 && rule.actions[0].op === "set" && rule.actions[0].field === actionField && (actionValue == null || rule.actions[0].value === actionValue) && rule.conditions.length === 1 && rule.conditions[0].op === "oneOf" && rule.conditions[0].field === condField && (condValue == null || rule.conditions[0].value.indexOf(condValue) !== -1)) yield rule.serialize();
		}
		return null;
	}
	async function updatePayeeRenameRule(fromNames, to) {
		const renameRule = getOneOfSetterRules("pre", "imported_payee", "payee", { actionValue: to }).next().value;
		if (renameRule) {
			const condition = renameRule.conditions[0];
			const newValue = [...fastSetMerge(new Set(condition.value), new Set(fromNames.filter((name) => name !== "")))];
			await updateRule$1({
				...renameRule,
				conditions: [{
					...condition,
					value: newValue
				}]
			});
			return renameRule.id;
		} else return insertRule(new Rule({
			stage: "pre",
			conditionsOp: "and",
			conditions: [{
				op: "oneOf",
				field: "imported_payee",
				value: fromNames
			}],
			actions: [{
				op: "set",
				field: "payee",
				value: to
			}]
		}).serialize());
	}
	function getProbableCategory(transactions) {
		const scores = /* @__PURE__ */ new Map();
		transactions.forEach((trans) => {
			if (trans.category) scores.set(trans.category, (scores.get(trans.category) || 0) + 1);
		});
		const winner = transactions.reduce((winner, trans) => {
			const score = scores.get(trans.category);
			if (!winner || score > winner.score) return {
				score,
				category: trans.category
			};
			return winner;
		}, null);
		return winner.score >= 3 ? winner.category : null;
	}
	async function updateCategoryRules(transactions) {
		if (transactions.length === 0) return;
		const payeeIds = new Set(transactions.map((trans) => trans.payee));
		const transIds = new Set(transactions.map((trans) => trans.id));
		let oldestDate = null;
		for (let i = 0; i < transactions.length; i++) if (oldestDate === null || transactions[i].date < oldestDate) oldestDate = transactions[i].date;
		oldestDate = subDays(oldestDate, 180);
		const allTransactions = partitionByField(await all(`SELECT t.* FROM v_transactions t
     LEFT JOIN accounts a ON a.id = t.account
     LEFT JOIN payees p ON p.id = t.payee
     WHERE date >= ? AND date <= ? AND is_parent = 0 AND a.closed = 0 AND p.learn_categories = 1
     ORDER BY date DESC`, [toDateRepr(oldestDate), toDateRepr(addDays(currentDay(), 180))]), "payee");
		const categoriesToSet = /* @__PURE__ */ new Map();
		for (const payeeId of payeeIds) if (payeeId) {
			const latestTrans = (allTransactions.get(payeeId) || []).slice(0, 5);
			if (latestTrans.find((trans) => transIds.has(trans.id))) {
				const category = getProbableCategory(latestTrans);
				if (category) categoriesToSet.set(payeeId, category);
			}
		}
		await batchMessages(async () => {
			for (const [payeeId, category] of categoriesToSet.entries()) {
				const ruleSetters = [...getIsSetterRules(null, "payee", "category", { condValue: payeeId })];
				if (ruleSetters.length > 0) for (const rule of ruleSetters) {
					const action = rule.actions[0];
					if (action.value !== category) await updateRule$1({
						...rule,
						actions: [{
							...action,
							value: category
						}]
					});
				}
				else await insertRule(new Rule({
					stage: null,
					conditionsOp: "and",
					conditions: [{
						op: "is",
						field: "payee",
						value: payeeId
					}],
					actions: [{
						op: "set",
						field: "category",
						value: category
					}]
				}).serialize());
			}
		});
	}
	/**
	* Running balance for `accountId` before the current transaction row (same cutoff as `balance`).
	*/
	async function getRunningBalanceBeforeTransaction(trans, accountId) {
		const dateBoundary = trans.date ?? currentDay();
		let query = q("transactions").filter({
			account: accountId,
			is_parent: false
		}).options({ splits: "inline" });
		if (trans.id) query = query.filter({ id: { $ne: trans.id } });
		const sameDayFilter = trans.sort_order != null ? { $and: [{ date: dateBoundary }, { sort_order: { $lt: trans.sort_order } }] } : { $and: [{ date: dateBoundary }, { $or: [{ sort_order: { $ne: null } }, ...trans.id ? [{ id: { $lt: trans.id } }] : []] }] };
		const { data: balance } = await aqlQuery(query.filter({ $or: [{ date: { $lt: dateBoundary } }, sameDayFilter] }).calculate({ $sum: "$amount" }));
		return balance ?? 0;
	}
	async function prefetchBalanceOfForTransaction(trans, accountsMap, formulas) {
		const map = /* @__PURE__ */ new Map();
		const literals = /* @__PURE__ */ new Set();
		for (const f of formulas) for (const lit of extractBalanceOfLiterals(f)) literals.add(lit);
		for (const literal of literals) {
			const accountId = resolveAccountIdForBalanceOf(literal, accountsMap);
			if (accountId) map.set(literal, await getRunningBalanceBeforeTransaction(trans, accountId));
			else map.set(literal, 0);
		}
		return map;
	}
	async function prepareTransactionForRules(trans, accounts = null) {
		const r = { ...trans };
		if (trans.payee) {
			const payee = await getPayee$1(trans.payee);
			if (payee) r.payee_name = payee.name;
		}
		r.balance = 0;
		if (trans.account) {
			if (accounts !== null && accounts.has(trans.account)) {
				r._account = accounts.get(trans.account);
				r._account_name = r._account?.name || "";
			} else {
				r._account = await getAccount(trans.account);
				r._account_name = r._account?.name || "";
			}
			r.balance = await getRunningBalanceBeforeTransaction(trans, trans.account);
		}
		if (trans.category) {
			const category = await getCategory(trans.category);
			if (category) r._category_name = category.name;
		}
		return r;
	}
	async function finalizeTransactionForRules(trans) {
		if ("payee_name" in trans) {
			if (trans.payee === "new") if (trans.payee_name) {
				let payeeId = (await getPayeeByName(trans.payee_name))?.id;
				payeeId ?? (payeeId = await insertPayee({ name: trans.payee_name }));
				trans.payee = payeeId;
			} else trans.payee = null;
			delete trans.payee_name;
		}
		if ("balance" in trans) delete trans.balance;
		if ("_balanceOfPrefetched" in trans) delete trans._balanceOfPrefetched;
		if ("parent_amount" in trans) delete trans.parent_amount;
		if (trans.subtransactions?.length) trans.subtransactions.forEach((stx) => {
			if ("balance" in stx) delete stx.balance;
			if ("_balanceOfPrefetched" in stx) delete stx._balanceOfPrefetched;
			if ("parent_amount" in stx) delete stx.parent_amount;
		});
		return trans;
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/transfer.ts
	async function getPayee(acct) {
		return first$2("SELECT * FROM payees WHERE transfer_acct = ?", [acct]);
	}
	async function getTransferredAccount(transaction) {
		if (transaction.payee) return (await first$2("SELECT transfer_acct FROM v_payees WHERE id = ?", [transaction.payee]))?.transfer_acct || null;
		return null;
	}
	async function clearCategory(transaction, transferAcct) {
		const { offbudget: fromOffBudget } = await first$2("SELECT offbudget FROM accounts WHERE id = ?", [transaction.account]);
		const { offbudget: toOffBudget } = await first$2("SELECT offbudget FROM accounts WHERE id = ?", [transferAcct]);
		if (fromOffBudget === toOffBudget) {
			await updateTransaction$2({
				id: transaction.id,
				category: null
			});
			if (transaction.transfer_id) await updateTransaction$2({
				id: transaction.transfer_id,
				category: null
			});
			return true;
		}
		return false;
	}
	async function addTransfer(transaction, transferredAccount) {
		if (transaction.is_parent) return null;
		const { id: fromPayee } = await first$2("SELECT id FROM payees WHERE transfer_acct = ?", [transaction.account]);
		const transferTransaction = {
			account: transferredAccount,
			amount: -transaction.amount,
			payee: fromPayee,
			date: transaction.date,
			transfer_id: transaction.id,
			notes: transaction.notes || null,
			schedule: transaction.schedule,
			cleared: false
		};
		const { notes, cleared, schedule } = await runRules$1(transferTransaction);
		const matchedSchedule = schedule ?? transaction.schedule;
		const id = await insertTransaction({
			...transferTransaction,
			notes,
			cleared,
			schedule: matchedSchedule
		});
		await updateTransaction$2({
			id: transaction.id,
			transfer_id: id,
			...matchedSchedule ? { schedule: matchedSchedule } : {}
		});
		const categoryCleared = await clearCategory(transaction, transferredAccount);
		return {
			id: transaction.id,
			transfer_id: id,
			...categoryCleared ? { category: null } : {}
		};
	}
	async function removeTransfer(transaction) {
		const transferTrans = await getTransaction(transaction.transfer_id);
		if (transferTrans) if (transferTrans.is_child) await updateTransaction$2({
			id: transaction.transfer_id,
			transfer_id: null,
			payee: null
		});
		else await deleteTransaction$2({ id: transaction.transfer_id });
		await updateTransaction$2({
			id: transaction.id,
			transfer_id: null
		});
		return {
			id: transaction.id,
			transfer_id: null
		};
	}
	async function updateTransfer(transaction, transferredAccount) {
		const payee = await getPayee(transaction.account);
		await updateTransaction$2({
			id: transaction.transfer_id,
			account: transferredAccount,
			payee: payee.id,
			notes: transaction.notes,
			amount: -transaction.amount,
			schedule: transaction.schedule
		});
		if (await clearCategory(transaction, transferredAccount)) return {
			id: transaction.id,
			category: null
		};
	}
	async function onInsert(transaction) {
		const transferredAccount = await getTransferredAccount(transaction);
		if (transferredAccount) return addTransfer(transaction, transferredAccount);
	}
	async function onDelete(transaction) {
		if (transaction.transfer_id) await removeTransfer(transaction);
	}
	async function onUpdate(transaction) {
		const transferredAccount = await getTransferredAccount(transaction);
		if (transaction.is_parent) return removeTransfer(transaction);
		if (transferredAccount && !transaction.transfer_id) return addTransfer(transaction, transferredAccount);
		if (!transferredAccount && transaction.transfer_id) return removeTransfer(transaction);
		if (transferredAccount && transaction.transfer_id) return updateTransfer(transaction, transferredAccount);
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/index.ts
	async function idsWithChildren(ids) {
		const rows = await all(`SELECT id FROM v_transactions_internal WHERE ${whereIn(ids, "parent_id")}`);
		const set = new Set(ids);
		for (const row of rows) set.add(row.id);
		return [...set];
	}
	async function getTransactionsByIds(ids) {
		return incrFetch((query, params) => selectWithSchema("transactions", query, params), ids, (id) => `id = '${id}'`, (where) => `SELECT * FROM v_transactions_internal WHERE ${where}`);
	}
	async function batchUpdateTransactions({ added, deleted, updated, learnCategories = false, detectOrphanPayees = true, runTransfers = true }) {
		let addedIds = [];
		const updatedIds = updated ? updated.map((u) => u.id) : [];
		const deletedIds = deleted ? await idsWithChildren(deleted.map((d) => d.id)) : [];
		const oldPayees = /* @__PURE__ */ new Set();
		const accounts = await all("SELECT * FROM accounts WHERE tombstone = 0");
		if (updated) {
			const transactions = await getTransactionsByIds(updated.filter((update) => update.payee).map((update) => update.id));
			for (let i = 0; i < transactions.length; i++) oldPayees.add(transactions[i].payee);
		}
		await batchMessages(async () => {
			if (added) addedIds = await Promise.all(added.map(async (t) => {
				const account = accounts.find((acct) => acct.id === t.account);
				if (t.is_parent || account?.offbudget === 1) t.category = null;
				return insertTransaction(t);
			}));
			if (deleted) await Promise.all(deletedIds.map(async (id) => {
				await deleteTransaction$2({ id });
			}));
			if (updated) await Promise.all(updated.map(async (t) => {
				if (t.account) {
					const account = accounts.find((acct) => acct.id === t.account);
					if (t.is_parent || account?.offbudget === 1) t.category = null;
				}
				await updateTransaction$2(t);
			}));
		});
		const allAdded = await getTransactionsByIds(addedIds);
		const allUpdated = await getTransactionsByIds(updatedIds);
		const allDeleted = await getTransactionsByIds(deletedIds);
		const resultAdded = allAdded;
		const resultUpdated = allUpdated;
		let transfersUpdated;
		if (runTransfers) await batchMessages(async () => {
			await Promise.all(allAdded.map((t) => onInsert(t)));
			transfersUpdated = (await Promise.all(allUpdated.map((t) => onUpdate(t)))).filter(Boolean);
			await Promise.all(allDeleted.map((t) => onDelete(t)));
		});
		if (learnCategories) {
			const ids = new Set([...added ? added.filter((add) => add.category).map((add) => add.id) : [], ...updated ? updated.filter((update) => update.category).map((update) => update.id) : []]);
			await updateCategoryRules(allAdded.concat(allUpdated).filter((trans) => ids.has(trans.id)));
		}
		if (detectOrphanPayees) {
			if (updated) {
				const newPayeeIds = updated.map((u) => u.payee).filter(Boolean);
				if (newPayeeIds.length > 0) {
					const allOrphaned = new Set(await getOrphanedPayees$1());
					const orphanedIds = [...oldPayees].filter((id) => allOrphaned.has(id));
					if (orphanedIds.length > 0) send$1("orphaned-payees", {
						orphanedIds,
						updatedPayeeIds: newPayeeIds
					});
				}
			}
		}
		return {
			added: resultAdded,
			updated: runTransfers ? transfersUpdated : resultUpdated,
			deleted: allDeleted,
			errors: (added || []).concat(updated || []).flatMap((t) => t._ruleErrors || [])
		};
	}
	//#endregion
	//#region ../loot-core/src/server/util/custom-sync-mapping.ts
	var mappingsFromString = (str) => {
		try {
			const parsed = JSON.parse(str);
			if (typeof parsed !== "object" || parsed === null) throw new Error("Invalid mapping format");
			return new Map(Object.entries(parsed).map(([key, value]) => [key, new Map(Object.entries(value))]));
		} catch (e) {
			const message = e instanceof Error ? e.message : e;
			throw new Error(`Failed to parse mapping: ${String(message)}`);
		}
	};
	var defaultMappings = new Map([["payment", new Map([
		["date", "date"],
		["payee", "payeeName"],
		["notes", "notes"]
	])], ["deposit", new Map([
		["date", "date"],
		["payee", "payeeName"],
		["notes", "notes"]
	])]]);
	//#endregion
	//#region ../loot-core/src/server/accounts/title/lower-case.ts
	var conjunctions = [
		"for",
		"and",
		"nor",
		"but",
		"or",
		"yet",
		"so"
	];
	var articles = [
		"a",
		"an",
		"the"
	];
	var prepositions = [
		"aboard",
		"about",
		"above",
		"across",
		"after",
		"against",
		"along",
		"amid",
		"among",
		"anti",
		"around",
		"as",
		"at",
		"before",
		"behind",
		"below",
		"beneath",
		"beside",
		"besides",
		"between",
		"beyond",
		"but",
		"by",
		"concerning",
		"considering",
		"despite",
		"down",
		"during",
		"except",
		"excepting",
		"excluding",
		"following",
		"for",
		"from",
		"in",
		"inside",
		"into",
		"like",
		"minus",
		"near",
		"of",
		"off",
		"on",
		"onto",
		"opposite",
		"over",
		"past",
		"per",
		"plus",
		"regarding",
		"round",
		"save",
		"since",
		"than",
		"through",
		"to",
		"toward",
		"towards",
		"under",
		"underneath",
		"unlike",
		"until",
		"up",
		"upon",
		"versus",
		"via",
		"with",
		"within",
		"without"
	];
	var lowerCaseSet = new Set([
		...conjunctions,
		...articles,
		...prepositions
	]);
	//#endregion
	//#region ../loot-core/src/server/accounts/title/specials.ts
	var specials = [
		"CLI",
		"API",
		"HTTP",
		"HTTPS",
		"JSX",
		"DNS",
		"URL",
		"CI",
		"CDN",
		"GitHub",
		"CSS",
		"JS",
		"JavaScript",
		"TypeScript",
		"HTML",
		"WordPress",
		"JavaScript",
		"Next.js",
		"Node.js"
	];
	//#endregion
	//#region ../loot-core/src/server/accounts/title/index.ts
	var character = "[0-9A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶ-ͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԣԱ-Ֆՙա-ևא-תװ-ײء-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴ-ߵߺऄ-हऽॐक़-ॡॱ-ॲॻ-ॿঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘ-ౙౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹഽൠ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཬྈ-ྋက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᰀ-ᰣᱍ-ᱏᱚ-ᱽᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-Ɐⱱ-ⱽⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀䶵一鿃ꀀ-ꒌꔀ-ꘌꘐ-ꘟꘪ-ꘫꙀ-ꙟꙢ-ꙮꙿ-ꚗꜗ-ꜟꜢ-ꞈꞋ-ꞌꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꤊ-ꤥꤰ-ꥆꨀ-ꨨꩀ-ꩂꩄ-ꩋ가힣豈-鶴侮-頻並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ]";
	var regex = new RegExp(`(?:(?:(\\s?(?:^|[.\\(\\)!?;:"-])\\s*)(${character}))|(${character}))(${character}*[’']*${character}*)`, "g");
	var convertToRegExp = (specials) => specials.map((s) => [new RegExp(`\\b${s}\\b`, "gi"), s]);
	function parseMatch(match) {
		const firstCharacter = match[0];
		if (/\s/.test(firstCharacter)) return match.substr(1);
		if (/[()]/.test(firstCharacter)) return null;
		return match;
	}
	function title(str, options = { special: void 0 }) {
		str = str.toLowerCase().replace(regex, (m, lead = "", forced, lower, rest) => {
			const parsedMatch = parseMatch(m);
			if (!parsedMatch) return m;
			if (!forced) {
				const fullLower = lower + rest;
				if (lowerCaseSet.has(fullLower)) return parsedMatch;
			}
			return lead + (lower || forced).toUpperCase() + rest;
		});
		const customSpecials = options.special || [];
		convertToRegExp([...specials, ...customSpecials]).forEach(([pattern, s]) => {
			str = str.replace(pattern, s);
		});
		return str;
	}
	//#endregion
	//#region ../loot-core/src/server/accounts/sync.ts
	function BankSyncError(type, code, details) {
		return {
			type: "BankSyncError",
			category: type,
			code,
			details
		};
	}
	function makeSplitTransaction(trans, subtransactions) {
		const { subtransactions: sub, ...parent } = recalculateSplit({
			...trans,
			is_parent: true,
			subtransactions: subtransactions.map((transaction, idx) => makeChild(trans, {
				...transaction,
				sort_order: 0 - idx
			}))
		});
		return [parent, ...sub];
	}
	async function updateAccountBalance(id, balance) {
		await update("accounts", {
			id,
			balance_current: balance
		});
	}
	async function getAccountOldestTransaction(id) {
		return (await aqlQuery(q("transactions").filter({
			account: id,
			date: { $lte: currentDay() }
		}).select("date").orderBy("date").limit(1))).data?.[0];
	}
	async function getAccountSyncStartDate(id) {
		const dates = [subDays(currentDay(), 89)];
		const oldestTransaction = await getAccountOldestTransaction(id);
		if (oldestTransaction) dates.push(oldestTransaction.date);
		return dayFromDate(max(dates.map((d) => parseDate(d))));
	}
	async function downloadGoCardlessTransactions(userId, userKey, acctId, bankId, since, includeBalance = true) {
		const userToken = await getItem("user-token");
		if (!userToken) return;
		logger.log("Pulling transactions from GoCardless");
		const res = await post(getServer().GOCARDLESS_SERVER + "/transactions", {
			userId,
			key: userKey,
			requisitionId: bankId,
			accountId: acctId,
			startDate: since,
			includeBalance
		}, { "X-ACTUAL-TOKEN": userToken });
		if (res.error_code) {
			const errorDetails = { rateLimitHeaders: res.rateLimitHeaders };
			throw BankSyncError(res.error_type, res.error_code, errorDetails);
		}
		if (includeBalance) {
			const { transactions: { all }, balances, startingBalance } = res;
			logger.log("Response:", res);
			return {
				transactions: all,
				accountBalance: balances,
				startingBalance
			};
		} else {
			logger.log("Response:", res);
			return { transactions: res.transactions.all };
		}
	}
	async function downloadSimpleFinTransactions(acctId, since) {
		const userToken = await getItem("user-token");
		if (!userToken) return;
		const batchSync = Array.isArray(acctId);
		logger.log("Pulling transactions from SimpleFin");
		let res;
		try {
			res = await post(getServer().SIMPLEFIN_SERVER + "/transactions", {
				accountId: acctId,
				startDate: since
			}, { "X-ACTUAL-TOKEN": userToken }, Array.isArray(acctId) ? 3e5 : 6e4);
		} catch (error) {
			logger.error("Suspected timeout during bank sync:", error);
			throw BankSyncError("TIMED_OUT", "TIMED_OUT");
		}
		if (Object.keys(res).length === 0) throw BankSyncError("NO_DATA", "NO_DATA");
		if (res.error_code) throw BankSyncError(res.error_type, res.error_code);
		let retVal = {};
		if (batchSync) {
			const batchErrors = res.errors;
			for (const accountId of Object.keys(res)) {
				if (accountId === "errors") continue;
				const data = res[accountId];
				const error = batchErrors?.[accountId]?.[0];
				retVal[accountId] = {
					transactions: data?.transactions?.all,
					accountBalance: data?.balances,
					startingBalance: data?.startingBalance
				};
				if (error) {
					retVal[accountId].error_type = error.error_type;
					retVal[accountId].error_code = error.error_code;
				}
			}
			if (batchErrors) {
				for (const [accountId, errorList] of Object.entries(batchErrors)) if (!retVal[accountId] && Array.isArray(errorList) && errorList.length > 0) {
					const error = errorList[0];
					retVal[accountId] = {
						transactions: [],
						accountBalance: [],
						startingBalance: 0,
						error_type: error.error_type,
						error_code: error.error_code
					};
				}
			}
		} else retVal = {
			transactions: res.transactions.all,
			accountBalance: res.balances,
			startingBalance: res.startingBalance
		};
		logger.log("Response:", retVal);
		return retVal;
	}
	async function downloadPluggyAiTransactions(acctId, since) {
		const userToken = await getItem("user-token");
		if (!userToken) return;
		logger.log("Pulling transactions from Pluggy.ai");
		const res = await post(getServer().PLUGGYAI_SERVER + "/transactions", {
			accountId: acctId,
			startDate: since
		}, { "X-ACTUAL-TOKEN": userToken }, 6e4);
		if (res.error_code) throw BankSyncError(res.error_type, res.error_code);
		else if ("error" in res) throw BankSyncError("Connection", res.error);
		let retVal = {};
		const singleRes = res;
		retVal = {
			transactions: singleRes.transactions.all,
			accountBalance: singleRes.balances,
			startingBalance: singleRes.startingBalance
		};
		logger.log("Response:", retVal);
		return retVal;
	}
	async function downloadEnableBankingTransactions(acctId, since) {
		const userToken = await getItem("user-token");
		if (!userToken) return;
		logger.log("Pulling transactions from Enable Banking");
		const res = await post(getServer().ENABLEBANKING_SERVER + "/transactions", {
			accountId: acctId,
			startDate: since
		}, { "X-ACTUAL-TOKEN": userToken }, 6e4);
		if (res.error_code) throw BankSyncError(res.error_type, res.error_code);
		const { transactions: { all }, balances, startingBalance } = res;
		return {
			transactions: all,
			accountBalance: balances,
			startingBalance
		};
	}
	async function resolvePayee(trans, payeeName, payeesToCreate) {
		if (trans.payee == null && payeeName) {
			let payee = payeesToCreate.get(payeeName.toLowerCase());
			payee = payee || await getPayeeByName(payeeName);
			if (payee != null) return payee.id;
			else {
				const newPayee = {
					id: v4(),
					name: payeeName
				};
				payeesToCreate.set(payeeName.toLowerCase(), newPayee);
				return newPayee.id;
			}
		}
		return trans.payee;
	}
	async function normalizeTransactions(transactions, acctId, { rawPayeeName = false } = {}) {
		const payeesToCreate = /* @__PURE__ */ new Map();
		const normalized = [];
		for (let trans of transactions) {
			if (trans.date == null) throw new Error("`date` is required when adding a transaction");
			const { payee_name: originalPayeeName, subtransactions, ...rest } = trans;
			trans = rest;
			if (trans.amount != null && !Number.isInteger(trans.amount)) throw new TransactionError(`Amount is invalid, must be an integer: ${trans.amount}`);
			if (subtransactions) {
				for (const sub of subtransactions) if (sub.amount != null && !Number.isInteger(sub.amount)) throw new TransactionError(`Subtransaction amount is invalid, must be an integer: ${sub.amount}`);
			}
			let payee_name = originalPayeeName;
			if (payee_name) {
				const trimmed = payee_name.trim();
				if (trimmed === "") payee_name = null;
				else payee_name = rawPayeeName ? trimmed : title(trimmed);
			}
			trans.imported_payee = trans.imported_payee || payee_name;
			if (trans.imported_payee) trans.imported_payee = trans.imported_payee.trim();
			trans.account = acctId;
			trans.payee = await resolvePayee(trans, payee_name, payeesToCreate);
			trans.category = trans.category ?? null;
			normalized.push({
				payee_name,
				subtransactions: subtransactions ? subtransactions.map((t) => ({
					...t,
					account: acctId
				})) : null,
				trans
			});
		}
		return {
			normalized,
			payeesToCreate
		};
	}
	async function normalizeBankSyncTransactions(transactions, acctId) {
		const payeesToCreate = /* @__PURE__ */ new Map();
		const [customMappingsRaw, importPending, importNotes] = await Promise.all([
			aqlQuery(q("preferences").filter({ id: `custom-sync-mappings-${acctId}` }).select("value")).then((data) => data?.data?.[0]?.value),
			aqlQuery(q("preferences").filter({ id: `sync-import-pending-${acctId}` }).select("value")).then((data) => String(data?.data?.[0]?.value ?? "true") === "true"),
			aqlQuery(q("preferences").filter({ id: `sync-import-notes-${acctId}` }).select("value")).then((data) => String(data?.data?.[0]?.value ?? "true") === "true")
		]);
		const mappings = customMappingsRaw ? mappingsFromString(customMappingsRaw) : defaultMappings;
		const normalized = [];
		for (const trans of transactions) {
			trans.cleared = Boolean(trans.booked);
			if (!importPending && !trans.cleared) continue;
			if (!trans.amount) trans.amount = trans.transactionAmount.amount;
			const mapping = mappings.get(trans.amount <= 0 ? "payment" : "deposit");
			const date = trans[mapping.get("date")] ?? trans.date;
			const payeeName = trans[mapping.get("payee")] ?? trans.payeeName;
			const notes = trans[mapping.get("notes")];
			if (date == null) throw new Error("`date` is required when adding a transaction");
			if (payeeName == null) throw new Error("`payeeName` is required when adding a transaction");
			trans.imported_payee = trans.imported_payee || payeeName;
			if (trans.imported_payee) trans.imported_payee = trans.imported_payee.trim();
			let imported_id = trans.transactionId;
			if (trans.cleared && !trans.transactionId && trans.internalTransactionId) imported_id = `${trans.account}-${trans.internalTransactionId}`;
			trans.account = acctId;
			trans.payee = await resolvePayee(trans, payeeName, payeesToCreate);
			normalized.push({
				payee_name: payeeName,
				trans: {
					amount: amountToInteger(trans.amount),
					payee: trans.payee,
					account: trans.account,
					date,
					notes: importNotes && notes ? notes.trim().replace(/#/g, "##") : null,
					category: trans.category ?? null,
					imported_id,
					imported_payee: trans.imported_payee,
					cleared: trans.cleared,
					raw_synced_data: JSON.stringify(trans)
				}
			});
		}
		return {
			normalized,
			payeesToCreate
		};
	}
	async function createNewPayees(payeesToCreate, addsAndUpdates) {
		const usedPayeeIds = new Set(addsAndUpdates.map((t) => t.payee));
		await batchMessages(async () => {
			for (const payee of payeesToCreate.values()) if (usedPayeeIds.has(payee.id)) await insertPayee(payee);
		});
	}
	async function reconcileTransactions(acctId, transactions, isBankSyncAccount = false, strictIdChecking = true, isPreview = false, defaultCleared = true, updateDates = false, reimportDeleted) {
		logger.log("Performing transaction reconciliation");
		const updated = [];
		const added = [];
		const updatedPreview = [];
		const existingPayeeMap = /* @__PURE__ */ new Map();
		const { payeesToCreate, transactionsStep1, transactionsStep2, transactionsStep3 } = await matchTransactions(acctId, transactions, isBankSyncAccount, strictIdChecking, reimportDeleted);
		for (const { trans, subtransactions, match } of transactionsStep3) if (match && !trans.forceAddTransaction) {
			if (match.reconciled) {
				updatedPreview.push({
					transaction: trans,
					ignored: true
				});
				continue;
			}
			const existing = {
				...match,
				cleared: match.cleared === 1,
				date: fromDateRepr(match.date)
			};
			const updates = {
				imported_id: trans.imported_id || null,
				payee: existing.payee || trans.payee || null,
				category: existing.category || trans.category || null,
				imported_payee: trans.imported_payee || null,
				notes: existing.notes || trans.notes || null,
				cleared: existing.cleared || trans.cleared || false,
				raw_synced_data: existing.raw_synced_data ?? trans.raw_synced_data ?? null
			};
			if (updateDates && trans.date) updates["date"] = trans.date;
			if (hasFieldsChanged(existing, updates, Object.keys(updates).filter((k) => {
				if (!existing.raw_synced_data && !trans.raw_synced_data) return k !== "raw_synced_data";
				return true;
			}))) {
				updated.push({
					id: existing.id,
					...updates
				});
				if (!existingPayeeMap.has(existing.payee)) {
					const payee = await getPayee$1(existing.payee);
					existingPayeeMap.set(existing.payee, payee?.name);
				}
				existing.payee_name = existingPayeeMap.get(existing.payee);
				existing.amount = integerToAmount(existing.amount);
				updatedPreview.push({
					transaction: trans,
					existing
				});
			} else updatedPreview.push({
				transaction: trans,
				ignored: true
			});
			const clearedUpdated = existing.cleared !== updates.cleared;
			const dateUpdated = updateDates && trans.date && existing.date !== trans.date;
			if (existing.is_parent && (clearedUpdated || dateUpdated)) {
				const children = await all("SELECT id FROM v_transactions WHERE parent_id = ?", [existing.id]);
				const childUpdates = {};
				if (clearedUpdated) childUpdates["cleared"] = updates.cleared;
				if (dateUpdated) childUpdates["date"] = trans.date;
				for (const child of children) updated.push({
					id: child.id,
					...childUpdates
				});
			}
		} else if (trans.tombstone) {
			if (isPreview) updatedPreview.push({
				transaction: trans,
				existing: false,
				tombstone: true
			});
		} else {
			const { forceAddTransaction: _forceAddTransaction, ...newTrans } = trans;
			const finalTransaction = {
				...newTrans,
				id: v4(),
				category: trans.category || null,
				cleared: trans.cleared ?? defaultCleared
			};
			if (subtransactions && subtransactions.length > 0) added.push(...makeSplitTransaction(finalTransaction, subtransactions));
			else added.push(finalTransaction);
		}
		const now = Date.now();
		added.forEach((t, index) => {
			t.sort_order ?? (t.sort_order = now - index * 1024);
		});
		if (!isPreview) {
			await createNewPayees(payeesToCreate, [...added, ...updated]);
			await batchUpdateTransactions({
				added,
				updated
			});
		}
		logger.log("Debug data for the operations:", {
			transactionsStep1,
			transactionsStep2,
			transactionsStep3,
			added,
			updated,
			updatedPreview
		});
		return {
			added: added.map((trans) => trans.id),
			updated: updated.map((trans) => trans.id),
			updatedPreview
		};
	}
	async function matchTransactions(acctId, transactions, isBankSyncAccount = false, strictIdChecking = true, reimportDeletedOverride) {
		logger.log("Performing transaction reconciliation matching");
		const reimportDeleted = reimportDeletedOverride !== void 0 ? reimportDeletedOverride : await aqlQuery(q("preferences").filter({ id: `sync-reimport-deleted-${acctId}` }).select("value")).then((data) => String(data?.data?.[0]?.value ?? "true") === "true");
		const hasMatched = /* @__PURE__ */ new Set();
		const { normalized, payeesToCreate } = await (isBankSyncAccount ? normalizeBankSyncTransactions : normalizeTransactions)(transactions, acctId);
		const accounts = await getAccounts$2();
		const accountsMap = new Map(accounts.map((account) => [account.id, account]));
		const transactionsStep1 = [];
		for (const { payee_name, trans: originalTrans, subtransactions } of normalized) {
			const trans = await runRules$1(originalTrans, accountsMap);
			let match = null;
			let fuzzyDataset = null;
			if (trans.imported_id) {
				match = await first$2(`SELECT * FROM ${reimportDeleted ? "v_transactions" : "v_transactions_internal"} WHERE imported_id = ? AND account = ?`, [trans.imported_id, acctId]);
				if (match) hasMatched.add(match.id);
			}
			if (!match) {
				const sevenDaysBefore = toDateRepr(subDays(trans.date, 7));
				const sevenDaysAfter = toDateRepr(addDays(trans.date, 7));
				if (strictIdChecking) fuzzyDataset = await all(`SELECT id, is_parent, date, imported_id, payee, imported_payee, category, notes, reconciled, cleared, amount
          FROM v_transactions
          WHERE
            -- If both ids are set, and we didn't match earlier then skip dedup
            (imported_id IS NULL OR ? IS NULL)
            AND date >= ? AND date <= ? AND amount = ?
            AND account = ?`, [
					trans.imported_id || null,
					sevenDaysBefore,
					sevenDaysAfter,
					trans.amount || 0,
					acctId
				]);
				else fuzzyDataset = await all(`SELECT id, is_parent, date, imported_id, payee, imported_payee, category, notes, reconciled, cleared, amount
          FROM v_transactions
          WHERE date >= ? AND date <= ? AND amount = ? AND account = ?`, [
					sevenDaysBefore,
					sevenDaysAfter,
					trans.amount || 0,
					acctId
				]);
				fuzzyDataset = fuzzyDataset.sort((a, b) => {
					return Math.abs(differenceInMilliseconds(parseISO(trans.date), parseISO(fromDateRepr(a.date)))) > Math.abs(differenceInMilliseconds(parseISO(trans.date), parseISO(fromDateRepr(b.date)))) ? 1 : -1;
				});
			}
			transactionsStep1.push({
				payee_name,
				trans,
				subtransactions: trans.subtransactions || subtransactions,
				match,
				fuzzyDataset
			});
		}
		const transactionsStep2 = transactionsStep1.map((data) => {
			if (!data.match && data.fuzzyDataset) {
				const match = data.fuzzyDataset.find((row) => !hasMatched.has(row.id) && data.trans.payee === row.payee);
				if (match) {
					hasMatched.add(match.id);
					return {
						...data,
						match
					};
				}
			}
			return data;
		});
		return {
			payeesToCreate,
			transactionsStep1,
			transactionsStep2,
			transactionsStep3: transactionsStep2.map((data) => {
				if (!data.match && data.fuzzyDataset) {
					const match = data.fuzzyDataset.find((row) => !hasMatched.has(row.id));
					if (match) {
						hasMatched.add(match.id);
						return {
							...data,
							match
						};
					}
				}
				return data;
			})
		};
	}
	async function addTransactions(acctId, transactions, { runTransfers = true, learnCategories = false } = {}) {
		const added = [];
		const { normalized, payeesToCreate } = await normalizeTransactions(transactions, acctId, { rawPayeeName: true });
		const accounts = await getAccounts$2();
		const accountsMap = new Map(accounts.map((account) => [account.id, account]));
		for (const { trans: originalTrans, subtransactions } of normalized) {
			const trans = await runRules$1(originalTrans, accountsMap);
			const finalTransaction = {
				id: v4(),
				...trans,
				account: acctId,
				cleared: trans.cleared != null ? trans.cleared : true
			};
			const updatedSubtransactions = finalTransaction.subtransactions || subtransactions;
			if (updatedSubtransactions && updatedSubtransactions.length > 0) added.push(...makeSplitTransaction(finalTransaction, updatedSubtransactions));
			else added.push(finalTransaction);
		}
		await createNewPayees(payeesToCreate, added);
		const now = Date.now();
		added.forEach((t, index) => {
			t.sort_order ?? (t.sort_order = now - index * 1024);
		});
		let newTransactions;
		if (runTransfers || learnCategories) newTransactions = (await batchUpdateTransactions({
			added,
			learnCategories,
			runTransfers
		})).added.map((t) => t.id);
		else await batchMessages(async () => {
			newTransactions = await Promise.all(added.map(async (trans) => insertTransaction(trans)));
		});
		return newTransactions;
	}
	async function processBankSyncDownload(download, id, acctRow, initialSync = false, customStartingBalance, customStartingDate) {
		const useStrictIdChecking = !acctRow.account_sync_source;
		const importTransactions = await aqlQuery(q("preferences").filter({ id: `sync-import-transactions-${id}` }).select("value")).then((data) => String(data?.data?.[0]?.value ?? "true") === "true");
		const updateDates = await aqlQuery(q("preferences").filter({ id: `sync-update-dates-${id}` }).select("value")).then((data) => String(data?.data?.[0]?.value ?? "false") === "true");
		/** Starting balance is actually the current balance of the account. */
		const { transactions: originalTransactions, startingBalance: currentBalance } = download;
		if (initialSync) {
			const { transactions } = download;
			let balanceToUse = currentBalance;
			if (customStartingBalance !== void 0) balanceToUse = customStartingBalance;
			else if (acctRow.account_sync_source === "simpleFin") balanceToUse = transactions.reduce((total, trans) => {
				return total - parseInt(trans.transactionAmount.amount.replace(".", ""));
			}, currentBalance);
			else if (acctRow.account_sync_source === "pluggyai") {
				const currentBalance = download.startingBalance;
				const previousBalance = transactions.reduce((total, trans) => total - trans.transactionAmount.amount * 100, currentBalance);
				balanceToUse = Math.round(previousBalance);
			} else if (acctRow.account_sync_source === "enableBanking") balanceToUse = (await aqlQuery(q("preferences").filter({ id: `sync-import-pending-${id}` }).select("value")).then((data) => String(data?.data?.[0]?.value ?? "true") === "true") ? transactions : transactions.filter((trans) => Boolean(trans.booked))).reduce((total, trans) => {
				return total - amountToInteger(trans.transactionAmount.amount);
			}, currentBalance);
			const oldestTransaction = transactions[transactions.length - 1];
			let startingBalanceDate;
			if (customStartingDate) startingBalanceDate = customStartingDate;
			else if (transactions.length > 0) startingBalanceDate = oldestTransaction.date;
			else startingBalanceDate = currentDay();
			const payee = await getStartingBalancePayee();
			return runMutator(async () => {
				const initialId = await insertTransaction({
					account: id,
					amount: balanceToUse,
					category: acctRow.offbudget === 0 ? payee.category : null,
					payee: payee.id,
					date: startingBalanceDate,
					cleared: true,
					starting_balance_flag: true
				});
				const result = await reconcileTransactions(id, transactions, true, useStrictIdChecking, false, true, updateDates);
				return {
					...result,
					added: [initialId, ...result.added]
				};
			});
		}
		const transactions = originalTransactions.map((trans) => ({
			...trans,
			account: id
		}));
		return runMutator(async () => {
			const result = await reconcileTransactions(id, importTransactions ? transactions : [], true, useStrictIdChecking, false, true, updateDates);
			if (currentBalance != null) await updateAccountBalance(id, currentBalance);
			return result;
		});
	}
	async function syncAccount(userId, userKey, id, acctId, bankId, customStartingDate, customStartingBalance) {
		const acctRow = await select("accounts", id);
		const syncStartDate = customStartingDate ?? await getAccountSyncStartDate(id);
		const newAccount = await getAccountOldestTransaction(id) == null;
		let download;
		if (acctRow.account_sync_source === "simpleFin") download = await downloadSimpleFinTransactions(acctId, syncStartDate);
		else if (acctRow.account_sync_source === "pluggyai") download = await downloadPluggyAiTransactions(acctId, syncStartDate);
		else if (acctRow.account_sync_source === "goCardless") download = await downloadGoCardlessTransactions(userId, userKey, acctId, bankId, syncStartDate, newAccount);
		else if (acctRow.account_sync_source === "enableBanking") download = await downloadEnableBankingTransactions(acctId, syncStartDate);
		else throw new Error(`Unrecognized bank-sync provider: ${acctRow.account_sync_source}`);
		return processBankSyncDownload(download, id, acctRow, newAccount, customStartingBalance, customStartingDate);
	}
	async function simpleFinBatchSync$1(accounts) {
		const startDates = await Promise.all(accounts.map(async (a) => getAccountSyncStartDate(a.id)));
		const res = await downloadSimpleFinTransactions(accounts.map((a) => a.account_id), startDates);
		if (!res) return accounts.map((account) => ({
			accountId: account.id,
			res: {
				error_type: "NO_DATA",
				error_code: "NO_DATA"
			}
		}));
		const promises = [];
		for (let i = 0; i < accounts.length; i++) {
			const account = accounts[i];
			const download = res[account.account_id];
			if (!download || Object.keys(download).length === 0) {
				promises.push(Promise.resolve({
					accountId: account.id,
					res: {
						error_type: "ACCOUNT_MISSING",
						error_code: "ACCOUNT_MISSING"
					}
				}));
				continue;
			}
			const acctRow = await select("accounts", account.id);
			const newAccount = await getAccountOldestTransaction(account.id) == null;
			if (download.error_code) {
				promises.push(Promise.resolve({
					accountId: account.id,
					res: download
				}));
				continue;
			}
			if (!download.transactions) {
				promises.push(Promise.resolve({
					accountId: account.id,
					res: {
						error_type: "ACCOUNT_MISSING",
						error_code: "ACCOUNT_MISSING"
					}
				}));
				continue;
			}
			promises.push(processBankSyncDownload(download, account.id, acctRow, newAccount).then((res) => ({
				accountId: account.id,
				res
			})).catch((err) => ({
				accountId: account.id,
				res: {
					error_type: err?.category || "INTERNAL_ERROR",
					error_code: err?.code || "INTERNAL_ERROR"
				}
			})));
		}
		return await Promise.all(promises);
	}
	//#endregion
	//#region ../loot-core/src/server/accounts/app.ts
	async function updateAccount({ id, name, last_reconciled }) {
		await update("accounts", {
			id,
			name,
			...last_reconciled && { last_reconciled }
		});
		return {};
	}
	async function getAccounts$1() {
		return (await getAccounts$2()).map((dbAccount) => ({
			id: dbAccount.id,
			name: dbAccount.name,
			offbudget: dbAccount.offbudget,
			closed: dbAccount.closed,
			sort_order: dbAccount.sort_order,
			last_reconciled: dbAccount.last_reconciled ?? null,
			tombstone: dbAccount.tombstone,
			account_id: dbAccount.account_id ?? null,
			bank: dbAccount.bank ?? null,
			bankName: dbAccount.bankName ?? null,
			bankId: dbAccount.bankId ?? null,
			mask: dbAccount.mask ?? null,
			official_name: dbAccount.official_name ?? null,
			balance_current: dbAccount.balance_current ?? null,
			balance_available: dbAccount.balance_available ?? null,
			balance_limit: dbAccount.balance_limit ?? null,
			account_sync_source: dbAccount.account_sync_source ?? null,
			last_sync: dbAccount.last_sync ?? null
		}));
	}
	async function getAccountBalance({ id, cutoff }) {
		const result = await first$2("SELECT sum(amount) as balance FROM transactions WHERE acct = ? AND isParent = 0 AND tombstone = 0 AND date <= ?", [id, toDateRepr(dayFromDate(cutoff))]);
		return result?.balance ? result.balance : 0;
	}
	async function getAccountProperties({ id }) {
		const balanceResult = await first$2("SELECT sum(amount) as balance FROM transactions WHERE acct = ? AND isParent = 0 AND tombstone = 0", [id]);
		const countResult = await first$2("SELECT count(id) as count FROM transactions WHERE acct = ? AND tombstone = 0", [id]);
		return {
			balance: balanceResult?.balance || 0,
			numTransactions: countResult?.count || 0
		};
	}
	async function linkGoCardlessAccount({ requisitionId, account, upgradingId, offBudget = false, startingDate, startingBalance }) {
		let id;
		const bank = await findOrCreateBank(account.institution, requisitionId);
		if (upgradingId) {
			const accRow = await first$2("SELECT * FROM accounts WHERE id = ?", [upgradingId]);
			if (!accRow) throw new Error(`Account with ID ${upgradingId} not found.`);
			id = accRow.id;
			await update("accounts", {
				id,
				account_id: account.account_id,
				bank: bank.id,
				account_sync_source: "goCardless"
			});
		} else {
			id = v4();
			await insertWithUUID("accounts", {
				id,
				account_id: account.account_id,
				mask: account.mask,
				name: account.name,
				official_name: account.official_name,
				bank: bank.id,
				offbudget: offBudget ? 1 : 0,
				account_sync_source: "goCardless"
			});
			await insertPayee({
				name: "",
				transfer_acct: id
			});
		}
		await handleSyncResponse(await syncAccount(void 0, void 0, id, account.account_id, bank.bank_id, startingDate, startingBalance), id);
		send$1("sync-event", {
			type: "success",
			tables: ["transactions"]
		});
		return "ok";
	}
	async function linkSimpleFinAccount({ externalAccount, upgradingId, offBudget = false, startingDate, startingBalance }) {
		let id;
		const bank = await findOrCreateBank({ name: externalAccount.institution ?? t("Unknown") }, externalAccount.orgDomain ?? externalAccount.orgId);
		if (upgradingId) {
			const accRow = await first$2("SELECT * FROM accounts WHERE id = ?", [upgradingId]);
			if (!accRow) throw new Error(`Account with ID ${upgradingId} not found.`);
			id = accRow.id;
			await update("accounts", {
				id,
				account_id: externalAccount.account_id,
				bank: bank.id,
				account_sync_source: "simpleFin"
			});
		} else {
			id = v4();
			await insertWithUUID("accounts", {
				id,
				account_id: externalAccount.account_id,
				name: externalAccount.name,
				official_name: externalAccount.name,
				bank: bank.id,
				offbudget: offBudget ? 1 : 0,
				account_sync_source: "simpleFin"
			});
			await insertPayee({
				name: "",
				transfer_acct: id
			});
		}
		await handleSyncResponse(await syncAccount(void 0, void 0, id, externalAccount.account_id, bank.bank_id, startingDate, startingBalance), id);
		send$1("sync-event", {
			type: "success",
			tables: ["transactions"]
		});
		return "ok";
	}
	async function linkPluggyAiAccount({ externalAccount, upgradingId, offBudget = false, startingDate, startingBalance }) {
		let id;
		const bank = await findOrCreateBank({ name: externalAccount.institution ?? t("Unknown") }, externalAccount.orgDomain ?? externalAccount.orgId);
		if (upgradingId) {
			const accRow = await first$2("SELECT * FROM accounts WHERE id = ?", [upgradingId]);
			if (!accRow) throw new Error(`Account with ID ${upgradingId} not found.`);
			id = accRow.id;
			await update("accounts", {
				id,
				account_id: externalAccount.account_id,
				bank: bank.id,
				account_sync_source: "pluggyai"
			});
		} else {
			id = v4();
			await insertWithUUID("accounts", {
				id,
				account_id: externalAccount.account_id,
				name: externalAccount.name,
				official_name: externalAccount.name,
				bank: bank.id,
				offbudget: offBudget ? 1 : 0,
				account_sync_source: "pluggyai"
			});
			await insertPayee({
				name: "",
				transfer_acct: id
			});
		}
		await handleSyncResponse(await syncAccount(void 0, void 0, id, externalAccount.account_id, bank.bank_id, startingDate, startingBalance), id);
		send$1("sync-event", {
			type: "success",
			tables: ["transactions"]
		});
		return "ok";
	}
	async function linkEnableBankingAccount({ externalAccount, upgradingId, offBudget = false, startingDate, startingBalance }) {
		let id;
		const bank = await findOrCreateBank({ name: externalAccount.institution ?? t("Unknown") }, externalAccount.account_id);
		if (upgradingId) {
			const accRow = await first$2("SELECT * FROM accounts WHERE id = ?", [upgradingId]);
			if (!accRow) throw new Error(`Account with ID ${upgradingId} not found.`);
			id = accRow.id;
			await update("accounts", {
				id,
				account_id: externalAccount.account_id,
				bank: bank.id,
				account_sync_source: "enableBanking"
			});
		} else {
			id = v4();
			await insertWithUUID("accounts", {
				id,
				account_id: externalAccount.account_id,
				name: externalAccount.name,
				official_name: externalAccount.name,
				bank: bank.id,
				offbudget: offBudget ? 1 : 0,
				account_sync_source: "enableBanking"
			});
			await insertPayee({
				name: "",
				transfer_acct: id
			});
		}
		if (id == null) throw new Error("id was not assigned in linkEnableBankingAccount");
		await handleSyncResponse(await syncAccount(void 0, void 0, id, externalAccount.account_id, bank.bank_id, startingDate, startingBalance), id);
		send$1("sync-event", {
			type: "success",
			tables: ["transactions"]
		});
		return "ok";
	}
	async function createAccount({ name, balance = 0, offBudget = false, closed = false }) {
		const id = await insertAccount({
			name,
			offbudget: offBudget ? 1 : 0,
			closed: closed ? 1 : 0
		});
		await insertPayee({
			name: "",
			transfer_acct: id
		});
		if (balance != null && balance !== 0) {
			const payee = await getStartingBalancePayee();
			await insertTransaction({
				account: id,
				amount: amountToInteger(balance),
				category: offBudget ? null : payee.category,
				payee: payee.id,
				date: currentDay(),
				cleared: true,
				starting_balance_flag: true
			});
		}
		return id;
	}
	async function closeAccount({ id, transferAccountId, categoryId, forced = false }) {
		await unlinkAccount({ id });
		return withUndo(async () => {
			const account = await first$2("SELECT * FROM accounts WHERE id = ? AND tombstone = 0", [id]);
			if (!account || account.closed === 1) return;
			const { balance, numTransactions } = await getAccountProperties({ id });
			if (numTransactions === 0) await deleteAccount({ id });
			else if (forced) {
				const rows = runQuery("SELECT id, transfer_id FROM v_transactions WHERE account = ?", [id], true);
				const transferPayee = await first$2("SELECT id FROM payees WHERE transfer_acct = ?", [id]);
				if (!transferPayee) throw new Error(`Transfer payee with account ID ${id} not found.`);
				await batchMessages(async () => {
					rows.forEach((row) => {
						if (row.transfer_id) updateTransaction$2({
							id: row.transfer_id,
							payee: null,
							transfer_id: null
						});
						deleteTransaction$2({ id: row.id });
					});
					deleteAccount({ id });
					deleteTransferPayee({ id: transferPayee.id });
				});
			} else {
				if (balance !== 0 && transferAccountId == null) throw APIError("balance is non-zero: transferAccountId is required");
				if (id === transferAccountId) throw APIError("transfer account can not be the account being closed");
				await update("accounts", {
					id,
					closed: 1
				});
				if (balance !== 0 && transferAccountId) {
					const transferPayee = await first$2("SELECT id FROM payees WHERE transfer_acct = ?", [transferAccountId]);
					if (!transferPayee) throw new Error(`Transfer payee with account ID ${transferAccountId} not found.`);
					await app$20.handlers["transaction-add"]({
						id: v4(),
						payee: transferPayee.id,
						amount: -balance,
						account: id,
						date: currentDay(),
						notes: "Closing account",
						category: categoryId
					});
				}
			}
		});
	}
	async function reopenAccount({ id }) {
		await update("accounts", {
			id,
			closed: 0
		});
	}
	async function moveAccount({ id, targetId }) {
		await moveAccount$1(id, targetId);
	}
	async function setSecret({ name, value }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		try {
			return await post(serverConfig.BASE_SERVER + "/secret", {
				name,
				value
			}, { "X-ACTUAL-TOKEN": userToken });
		} catch (error) {
			return {
				error: "failed",
				reason: error instanceof PostError ? error.reason : void 0
			};
		}
	}
	async function checkSecret(name) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		try {
			return await get$1(serverConfig.BASE_SERVER + "/secret/" + name, { "X-ACTUAL-TOKEN": userToken });
		} catch (error) {
			logger.error(error);
			return { error: "failed" };
		}
	}
	var stopPolling = false;
	async function pollGoCardlessWebToken({ requisitionId }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unknown" };
		const startTime = Date.now();
		stopPolling = false;
		async function getData(cb) {
			if (stopPolling) return;
			if (Date.now() - startTime >= 1e3 * 60 * 10) {
				cb({ status: "timeout" });
				return;
			}
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("Failed to get server config.");
			const data = await post(serverConfig.GOCARDLESS_SERVER + "/get-accounts", { requisitionId }, { "X-ACTUAL-TOKEN": userToken });
			if (data) if (data.error_code) {
				logger.error("Failed linking gocardless account:", data);
				cb({
					status: "unknown",
					message: data.error_type
				});
			} else cb({
				status: "success",
				data
			});
			else setTimeout(() => getData(cb), 3e3);
		}
		return new Promise((resolve) => {
			getData((data) => {
				if (data.status === "success") {
					resolve({ data: data.data });
					return;
				}
				if (data.status === "timeout") {
					resolve({ error: data.status });
					return;
				}
				resolve({
					error: data.status,
					message: data.message
				});
			});
		});
	}
	async function stopGoCardlessWebTokenPolling() {
		stopPolling = true;
		return "ok";
	}
	async function goCardlessStatus() {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.GOCARDLESS_SERVER + "/status", {}, { "X-ACTUAL-TOKEN": userToken });
	}
	async function simpleFinStatus() {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.SIMPLEFIN_SERVER + "/status", {}, { "X-ACTUAL-TOKEN": userToken });
	}
	async function pluggyAiStatus() {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.PLUGGYAI_SERVER + "/status", {}, { "X-ACTUAL-TOKEN": userToken });
	}
	async function simpleFinAccounts() {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		try {
			return await post(serverConfig.SIMPLEFIN_SERVER + "/accounts", {}, { "X-ACTUAL-TOKEN": userToken }, 6e4);
		} catch {
			return { error_code: "TIMED_OUT" };
		}
	}
	async function pluggyAiAccounts() {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		try {
			return await post(serverConfig.PLUGGYAI_SERVER + "/accounts", {}, { "X-ACTUAL-TOKEN": userToken }, 6e4);
		} catch {
			return { error_code: "TIMED_OUT" };
		}
	}
	async function enableBankingStatus() {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.ENABLEBANKING_SERVER + "/status", {}, { "X-ACTUAL-TOKEN": userToken });
	}
	async function enableBankingAspsps(country) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.ENABLEBANKING_SERVER + "/aspsps", { country }, { "X-ACTUAL-TOKEN": userToken });
	}
	async function enableBankingStartAuth({ aspspId, country, redirectUrl, maxConsentValidity }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		if (maxConsentValidity !== void 0 && (!Number.isFinite(maxConsentValidity) || !Number.isInteger(maxConsentValidity) || maxConsentValidity <= 0 || maxConsentValidity > 31536e4)) return { error: "invalid_max_consent_validity" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.ENABLEBANKING_SERVER + "/start-auth", {
			aspsp: {
				name: aspspId,
				country
			},
			redirectUrl,
			maxConsentValidity
		}, { "X-ACTUAL-TOKEN": userToken });
	}
	async function enableBankingCompleteAuth({ code, state }) {
		if (!state) return { error: "missing-state" };
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.ENABLEBANKING_SERVER + "/complete-auth", {
			code,
			state
		}, { "X-ACTUAL-TOKEN": userToken });
	}
	var enableBankingPollControllers = /* @__PURE__ */ new Map();
	async function enableBankingPollAuth({ state }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		const controller = new AbortController();
		enableBankingPollControllers.set(state, controller);
		try {
			return await post(serverConfig.ENABLEBANKING_SERVER + "/poll-auth", { state }, { "X-ACTUAL-TOKEN": userToken }, 31e4, controller.signal);
		} finally {
			if (enableBankingPollControllers.get(state) === controller) enableBankingPollControllers.delete(state);
		}
	}
	async function stopEnableBankingPollAuth({ state }) {
		const controller = enableBankingPollControllers.get(state);
		if (controller) {
			controller.abort();
			enableBankingPollControllers.delete(state);
		}
		return "ok";
	}
	async function enableBankingConfigure(config) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.ENABLEBANKING_SERVER + "/configure", config, { "X-ACTUAL-TOKEN": userToken });
	}
	async function getGoCardlessBanks(country) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		return post(serverConfig.GOCARDLESS_SERVER + "/get-banks", {
			country,
			showDemo: isNonProductionEnvironment()
		}, { "X-ACTUAL-TOKEN": userToken });
	}
	async function createGoCardlessWebToken({ institutionId, accessValidForDays }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "unauthorized" };
		const serverConfig = getServer();
		if (!serverConfig) throw new Error("Failed to get server config.");
		try {
			return await post(serverConfig.GOCARDLESS_SERVER + "/create-web-token", {
				institutionId,
				accessValidForDays
			}, { "X-ACTUAL-TOKEN": userToken });
		} catch (error) {
			logger.error(error);
			return { error: "failed" };
		}
	}
	async function handleSyncResponse(res, acctId) {
		const { added, updated } = res;
		const newTransactions = [];
		const matchedTransactions = [];
		const updatedAccounts = [];
		newTransactions.push(...added);
		matchedTransactions.push(...updated);
		if (added.length > 0) updatedAccounts.push(acctId);
		await update("accounts", {
			id: acctId,
			last_sync: (/* @__PURE__ */ new Date()).getTime().toString()
		});
		return {
			newTransactions,
			matchedTransactions,
			updatedAccounts
		};
	}
	/**
	* Type guard to check if an error is a BankSyncError.
	* Handles both class instances and plain objects with the BankSyncError shape.
	*/
	function isBankSyncError(err) {
		return err instanceof BankSyncError$1 || typeof err === "object" && err !== null && "type" in err && err.type === "BankSyncError";
	}
	/**
	* Converts a sync error into a standardized SyncError response object.
	*/
	function handleSyncError(err, acct) {
		if (isBankSyncError(err)) {
			const syncError = {
				type: "SyncError",
				accountId: acct.id,
				message: "Failed syncing account \"" + acct.name + ".\"",
				category: err.category,
				code: err.code
			};
			if (err.category === "RATE_LIMIT_EXCEEDED") return {
				...syncError,
				message: `Failed syncing account ${acct.name}. Rate limit exceeded. Please try again later.`
			};
			return syncError;
		}
		if (err instanceof PostError && err.reason !== "internal") return {
			accountId: acct.id,
			message: err.reason ? err.reason : `Account "${acct.name}" is not linked properly. Please link it again.`
		};
		return {
			accountId: acct.id,
			message: "There was an internal error. Please get in touch https://actualbudget.org/contact for support.",
			internal: err.stack
		};
	}
	async function accountsBankSync({ ids = [] }) {
		const { "user-id": userId, "user-key": userKey } = await multiGet(["user-id", "user-key"]);
		const accounts = runQuery(`
    SELECT a.*, b.bank_id as bankId
    FROM accounts a
    LEFT JOIN banks b ON a.bank = b.id
    WHERE a.tombstone = 0 AND a.closed = 0
      ${ids.length ? `AND a.id IN (${ids.map(() => "?").join(", ")})` : ""}
    ORDER BY a.offbudget, a.sort_order
  `, ids, true);
		const errors = [];
		const newTransactions = [];
		const matchedTransactions = [];
		const updatedAccounts = [];
		for (const acct of accounts) if (acct.bankId && acct.account_id) try {
			logger.group("Bank Sync operation for account:", acct.name);
			const syncResponseData = await handleSyncResponse(await syncAccount(userId, userKey, acct.id, acct.account_id, acct.bankId), acct.id);
			newTransactions.push(...syncResponseData.newTransactions);
			matchedTransactions.push(...syncResponseData.matchedTransactions);
			updatedAccounts.push(...syncResponseData.updatedAccounts);
		} catch (err) {
			const error = err;
			errors.push(handleSyncError(error, acct));
			captureException({
				...error,
				message: "Failed syncing account \"" + acct.name + ".\""
			});
		} finally {
			logger.groupEnd();
		}
		if (updatedAccounts.length > 0) send$1("sync-event", {
			type: "success",
			tables: ["transactions"]
		});
		return {
			errors,
			newTransactions,
			matchedTransactions,
			updatedAccounts
		};
	}
	async function simpleFinBatchSync({ ids = [] }) {
		const accounts = runQuery(`SELECT a.*, b.bank_id as bankId FROM accounts a
         LEFT JOIN banks b ON a.bank = b.id
         WHERE
          a.tombstone = 0
          AND a.closed = 0
          AND a.account_sync_source = 'simpleFin'
          ${ids.length ? `AND a.id IN (${ids.map(() => "?").join(", ")})` : ""}
         ORDER BY a.offbudget, a.sort_order`, ids.length ? ids : [], true);
		const retVal = [];
		logger.group("Bank Sync operation for all SimpleFin accounts");
		try {
			const syncResponses = await simpleFinBatchSync$1(accounts.map((a) => ({
				id: a.id,
				account_id: a.account_id || null
			})));
			for (const syncResponse of syncResponses) {
				const account = accounts.find((a) => a.id === syncResponse.accountId);
				if (!account) {
					logger.error(`Invalid account ID found in response: ${syncResponse.accountId}. Proceeding to the next account...`);
					continue;
				}
				const errors = [];
				const newTransactions = [];
				const matchedTransactions = [];
				const updatedAccounts = [];
				if (syncResponse.res?.error_code) errors.push(handleSyncError({
					type: "BankSyncError",
					reason: "Failed syncing account \"" + account.name + ".\"",
					category: syncResponse.res.error_type,
					code: syncResponse.res.error_code
				}, account));
				else if (syncResponse.res) {
					const syncResponseData = await handleSyncResponse(syncResponse.res, account.id);
					newTransactions.push(...syncResponseData.newTransactions);
					matchedTransactions.push(...syncResponseData.matchedTransactions);
					updatedAccounts.push(...syncResponseData.updatedAccounts);
				} else errors.push(handleSyncError(/* @__PURE__ */ new Error("Failed syncing account \"" + account.name + "\": empty response"), account));
				retVal.push({
					accountId: syncResponse.accountId,
					res: {
						errors,
						newTransactions,
						matchedTransactions,
						updatedAccounts
					}
				});
			}
		} catch (err) {
			for (const account of accounts) {
				const error = err;
				retVal.push({
					accountId: account.id,
					res: {
						errors: [handleSyncError(error, account)],
						newTransactions: [],
						matchedTransactions: [],
						updatedAccounts: []
					}
				});
			}
		}
		if (retVal.some((a) => a.res.updatedAccounts.length > 0)) send$1("sync-event", {
			type: "success",
			tables: ["transactions"]
		});
		logger.groupEnd();
		return retVal;
	}
	async function importTransactions$2({ accountId, transactions, isPreview, opts }) {
		if (typeof accountId !== "string") throw APIError("transactions-import: accountId must be an id");
		try {
			const reconciled = await reconcileTransactions(accountId, transactions, false, true, isPreview, opts?.defaultCleared, false, opts?.reimportDeleted);
			return {
				errors: [],
				added: reconciled.added,
				updated: reconciled.updated,
				updatedPreview: reconciled.updatedPreview
			};
		} catch (err) {
			if (err instanceof TransactionError) return {
				errors: [{ message: err.message }],
				added: [],
				updated: [],
				updatedPreview: []
			};
			throw err;
		}
	}
	async function unlinkAccount({ id }) {
		const accRow = await first$2("SELECT * FROM accounts WHERE id = ?", [id]);
		if (!accRow) throw new Error(`Account with ID ${id} not found.`);
		const bankId = accRow.bank;
		if (!bankId) return "ok";
		const isGoCardless = accRow.account_sync_source === "goCardless";
		await updateAccount$1({
			id,
			account_id: null,
			bank: null,
			balance_current: null,
			balance_available: null,
			balance_limit: null,
			account_sync_source: null
		});
		if (isGoCardless === false) return;
		const accountWithBankResult = await first$2("SELECT COUNT(*) as count FROM accounts WHERE bank = ?", [bankId]);
		const userToken = await getItem("user-token");
		if (!userToken) return "ok";
		if (!accountWithBankResult || accountWithBankResult.count === 0) {
			const bank = await first$2("SELECT bank_id FROM banks WHERE id = ?", [bankId]);
			if (!bank) throw new Error(`Bank with ID ${bankId} not found.`);
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("Failed to get server config.");
			const requisitionId = bank.bank_id;
			try {
				await post(serverConfig.GOCARDLESS_SERVER + "/remove-account", { requisitionId }, { "X-ACTUAL-TOKEN": userToken });
			} catch (error) {
				logger.log({ error });
			}
		}
		return "ok";
	}
	var app$19 = createApp();
	app$19.method("account-update", mutator(undoable(updateAccount)));
	app$19.method("accounts-get", getAccounts$1);
	app$19.method("account-balance", getAccountBalance);
	app$19.method("account-properties", getAccountProperties);
	app$19.method("gocardless-accounts-link", linkGoCardlessAccount);
	app$19.method("simplefin-accounts-link", linkSimpleFinAccount);
	app$19.method("pluggyai-accounts-link", linkPluggyAiAccount);
	app$19.method("enablebanking-accounts-link", linkEnableBankingAccount);
	app$19.method("account-create", mutator(undoable(createAccount)));
	app$19.method("account-close", mutator(closeAccount));
	app$19.method("account-reopen", mutator(undoable(reopenAccount)));
	app$19.method("account-move", mutator(undoable(moveAccount)));
	app$19.method("secret-set", setSecret);
	app$19.method("secret-check", checkSecret);
	app$19.method("gocardless-poll-web-token", pollGoCardlessWebToken);
	app$19.method("gocardless-poll-web-token-stop", stopGoCardlessWebTokenPolling);
	app$19.method("gocardless-status", goCardlessStatus);
	app$19.method("simplefin-status", simpleFinStatus);
	app$19.method("pluggyai-status", pluggyAiStatus);
	app$19.method("enablebanking-status", enableBankingStatus);
	app$19.method("enablebanking-aspsps", enableBankingAspsps);
	app$19.method("enablebanking-start-auth", enableBankingStartAuth);
	app$19.method("enablebanking-complete-auth", enableBankingCompleteAuth);
	app$19.method("enablebanking-poll-auth", enableBankingPollAuth);
	app$19.method("enablebanking-poll-auth-stop", stopEnableBankingPollAuth);
	app$19.method("enablebanking-configure", enableBankingConfigure);
	app$19.method("simplefin-accounts", simpleFinAccounts);
	app$19.method("pluggyai-accounts", pluggyAiAccounts);
	app$19.method("gocardless-get-banks", getGoCardlessBanks);
	app$19.method("gocardless-create-web-token", createGoCardlessWebToken);
	app$19.method("accounts-bank-sync", accountsBankSync);
	app$19.method("simplefin-batch-sync", simpleFinBatchSync);
	app$19.method("transactions-import", mutator(undoable(importTransactions$2)));
	app$19.method("account-unlink", mutator(unlinkAccount));
	//#endregion
	//#region ../loot-core/src/server/admin/app.ts
	var app$18 = createApp();
	app$18.method("users-get", getUsers);
	app$18.method("user-delete-all", deleteAllUsers);
	app$18.method("user-add", addUser);
	app$18.method("user-update", updateUser);
	app$18.method("access-add", addAccess);
	app$18.method("access-delete-all", deleteAllAccess);
	app$18.method("access-get-available-users", accessGetAvailableUsers);
	app$18.method("transfer-ownership", transferOwnership);
	app$18.method("owner-created", ownerCreated);
	async function getUsers() {
		const userToken = await getItem("user-token");
		if (userToken) {
			const res = await get$1(getServer().BASE_SERVER + "/admin/users/", { headers: { "X-ACTUAL-TOKEN": userToken } });
			if (res) try {
				return JSON.parse(res);
			} catch (err) {
				return { error: "Failed to parse response: " + err.message };
			}
		}
		return null;
	}
	async function deleteAllUsers(ids) {
		const userToken = await getItem("user-token");
		if (userToken) try {
			const res = await del(getServer().BASE_SERVER + "/admin/users", { ids }, { "X-ACTUAL-TOKEN": userToken });
			if (res) return res;
		} catch (err) {
			return { error: err.reason };
		}
		return { someDeletionsFailed: true };
	}
	async function addUser(user) {
		const userToken = await getItem("user-token");
		if (userToken) try {
			return await post(getServer().BASE_SERVER + "/admin/users/", user, { "X-ACTUAL-TOKEN": userToken });
		} catch (err) {
			return { error: err.reason };
		}
		return null;
	}
	async function updateUser(user) {
		const userToken = await getItem("user-token");
		if (userToken) try {
			return await patch(getServer().BASE_SERVER + "/admin/users/", user, { "X-ACTUAL-TOKEN": userToken });
		} catch (err) {
			return { error: err.reason };
		}
		return null;
	}
	async function addAccess(access) {
		const userToken = await getItem("user-token");
		if (userToken) try {
			await post(getServer().BASE_SERVER + "/admin/access/", access, { "X-ACTUAL-TOKEN": userToken });
			return {};
		} catch (err) {
			return { error: err.reason };
		}
		return null;
	}
	async function deleteAllAccess({ fileId, ids }) {
		const userToken = await getItem("user-token");
		if (userToken) try {
			const res = await del(getServer().BASE_SERVER + `/admin/access?fileId=${fileId}`, {
				token: userToken,
				ids
			});
			if (res) return res;
		} catch (err) {
			return { error: err.reason };
		}
		return { someDeletionsFailed: true };
	}
	async function accessGetAvailableUsers(fileId) {
		const userToken = await getItem("user-token");
		if (userToken) {
			const res = await get$1(`${getServer().BASE_SERVER + "/admin/access/users"}?fileId=${fileId}`, { headers: { "X-ACTUAL-TOKEN": userToken } });
			if (res) try {
				return JSON.parse(res);
			} catch (err) {
				return { error: "Failed to parse response: " + err.message };
			}
		}
		return [];
	}
	async function transferOwnership({ fileId, newUserId }) {
		const userToken = await getItem("user-token");
		if (userToken) try {
			await post(getServer().BASE_SERVER + "/admin/access/transfer-ownership/", {
				fileId,
				newUserId
			}, { "X-ACTUAL-TOKEN": userToken });
		} catch (err) {
			return { error: err.reason };
		}
		return {};
	}
	async function ownerCreated() {
		const res = await get$1(getServer().BASE_SERVER + "/admin/owner-created/");
		if (res) return JSON.parse(res);
		return null;
	}
	//#endregion
	//#region ../loot-core/src/shared/errors.ts
	function getDownloadError({ reason, meta, fileName }) {
		switch (reason) {
			case "network":
			case "download-failure": return t("Downloading the file failed. Check your network connection.");
			case "not-zip-file":
			case "invalid-zip-file":
			case "invalid-meta-file": return t("Downloaded file is invalid, sorry! Visit https://actualbudget.org/contact/ for support.");
			case "decrypt-failure": return "Unable to decrypt file " + (fileName || "(unknown)") + ". To change your key, first download this file with the proper password.";
			case "out-of-sync-migrations": return t("This budget cannot be loaded with this version of the app. Make sure the app is up-to-date.");
			case "clock-drift": return t("Failed to download the budget because your device time differs too much from the server. Please check your device time settings and ensure they are correct.");
			default: return t("Something went wrong trying to download that file, sorry! Visit https://actualbudget.org/contact/ for support. reason: {{reason}}{{info}}", {
				reason,
				info: meta && typeof meta === "object" && "fileId" in meta && meta.fileId ? `, fileId: ${String(meta.fileId)}` : ""
			});
		}
	}
	function getTestKeyError({ reason }) {
		switch (reason) {
			case "network": return t("Unable to connect to the server. We need to access the server to get some information about your keys.");
			case "old-key-style": return t("This file is encrypted with an old unsupported key style. Recreate the key on a device where the file is available, or use an older version of Actual to download it.");
			case "decrypt-failure": return t("Unable to decrypt file with this password. Please try again.");
			default: return t("Something went wrong trying to create a key, sorry! Visit https://actualbudget.org/contact/ for support.");
		}
	}
	function getSyncError(error, id) {
		if (error === "out-of-sync-migrations" || error === "out-of-sync-data") return t("This budget cannot be loaded with this version of the app.");
		else if (error === "budget-not-found") return t("Budget \"{{id}}\" not found. Check the ID of your budget in the Advanced section of the settings page.", { id });
		else if (error === "clock-drift") return t("Failed to sync because your device time differs too much from the server. Please check your device time settings and ensure they are correct.");
		else return t("We had an unknown problem opening \"{{id}}\".", { id });
	}
	function getBankSyncError(error) {
		return error.message || t("We had an unknown problem syncing the account.");
	}
	//#endregion
	//#region ../loot-core/src/server/api-models.ts
	var accountModel = {
		...accountModel$1,
		toExternal(account) {
			return {
				id: account.id,
				name: account.name,
				offbudget: account.offbudget ? true : false,
				closed: account.closed ? true : false,
				balance_current: account.balance_current ?? null
			};
		},
		fromExternal(account) {
			const result = { ...account };
			if ("offbudget" in account) result.offbudget = account.offbudget ? 1 : 0;
			if ("closed" in account) result.closed = account.closed ? 1 : 0;
			return result;
		}
	};
	var categoryModel = {
		...categoryModel$1,
		toExternal(category) {
			return {
				id: category.id,
				name: category.name,
				is_income: category.is_income ? true : false,
				hidden: category.hidden ? true : false,
				group_id: category.group
			};
		},
		fromExternal(category) {
			const { group_id, ...apiCategory } = category;
			return {
				...apiCategory,
				group: group_id
			};
		}
	};
	var categoryGroupModel = {
		...categoryGroupModel$1,
		toExternal(group) {
			return {
				id: group.id,
				name: group.name,
				is_income: group.is_income ? true : false,
				hidden: group.hidden ? true : false,
				categories: group.categories?.map((cat) => categoryModel.toExternal(cat)) || []
			};
		},
		fromExternal(group) {
			const result = { ...group };
			if ("categories" in group && group.categories) result.categories = group.categories.map((cat) => categoryModel.fromExternal(cat));
			return result;
		}
	};
	var payeeModel = {
		...payeeModel$1,
		toExternal(payee) {
			return {
				id: payee.id,
				name: payee.name,
				transfer_acct: payee.transfer_acct
			};
		},
		fromExternal(payee) {
			return payee;
		}
	};
	var tagModel = {
		toExternal(tag) {
			return {
				id: tag.id,
				tag: tag.tag,
				color: tag.color ?? null,
				description: tag.description ?? null
			};
		},
		fromExternal(tag) {
			return tag;
		}
	};
	var remoteFileModel = {
		toExternal(file) {
			if (file.deleted) return null;
			return {
				cloudFileId: file.fileId,
				state: "remote",
				groupId: file.groupId,
				name: file.name,
				encryptKeyId: file.encryptKeyId,
				hasKey: file.hasKey,
				owner: file.owner,
				usersWithAccess: file.usersWithAccess
			};
		},
		fromExternal(file) {
			return {
				deleted: false,
				fileId: file.cloudFileId,
				...file
			};
		}
	};
	var budgetModel = {
		toExternal(file) {
			return file;
		},
		fromExternal(file) {
			return file;
		}
	};
	var scheduleModel = {
		toExternal(schedule) {
			return {
				id: schedule.id,
				name: schedule.name,
				rule: schedule.rule,
				next_date: schedule.next_date,
				completed: schedule.completed,
				posts_transaction: schedule.posts_transaction,
				payee: schedule._payee,
				account: schedule._account,
				amount: schedule._amount,
				amountOp: schedule._amountOp,
				date: schedule._date
			};
		},
		fromExternal(schedule) {
			const amount = schedule.amount ?? 0;
			return {
				id: schedule.id,
				name: schedule.name,
				rule: String(schedule.rule),
				next_date: String(schedule.next_date),
				completed: Boolean(schedule.completed),
				posts_transaction: schedule.posts_transaction,
				tombstone: false,
				_payee: String(schedule.payee),
				_account: String(schedule.account),
				_amount: amount,
				_amountOp: schedule.amountOp,
				_date: schedule.date,
				_conditions: [
					{
						op: "is",
						field: "payee",
						value: String(schedule.payee)
					},
					{
						op: "is",
						field: "account",
						value: String(schedule.account)
					},
					{
						op: "isapprox",
						field: "date",
						value: schedule.date
					},
					{
						op: schedule.amountOp,
						field: "amount",
						value: amount
					}
				],
				_actions: []
			};
		}
	};
	//#endregion
	//#region ../loot-core/src/server/api.ts
	var IMPORT_MODE = false;
	function withMutation(handler) {
		return (...args) => {
			return runMutator(async () => {
				const latestTimestamp = getClock().timestamp.toString();
				const result = await handler(...args);
				const rows = await all("SELECT DISTINCT dataset FROM messages_crdt WHERE timestamp > ?", [latestTimestamp]);
				if (getNumClients() > 1) send$1("sync-event", {
					type: "success",
					tables: rows.map((row) => row.dataset)
				});
				return result;
			}, { undoDisabled: true });
		};
	}
	var handlers$1 = {};
	async function validateMonth(month) {
		if (!month.match(/^\d{4}-\d{2}$/)) throw APIError("Invalid month format, use YYYY-MM: " + month);
		if (!IMPORT_MODE) {
			const { start, end } = await handlers$1["get-budget-bounds"]();
			if (!range(start, end).includes(month)) throw APIError("No budget exists for month: " + month);
		}
	}
	async function validateExpenseCategory(debug, id) {
		if (id == null) throw APIError(`${debug}: category id is required`);
		const row = await first$2("SELECT is_income FROM categories WHERE id = ?", [id]);
		if (!row) throw APIError(`${debug}: category "${id}" does not exist`);
		if (row.is_income !== 0) throw APIError(`${debug}: category "${id}" is not an expense category`);
	}
	function checkFileOpen() {
		if (!(getPrefs() || {}).id) throw APIError("No budget file is open");
	}
	var batchPromise = null;
	handlers$1["api/batch-budget-start"] = async function() {
		if (batchPromise) throw APIError("Cannot start a batch process: batch already started");
		if (IMPORT_MODE) asyncTransaction(() => {
			return new Promise((resolve, reject) => {
				batchPromise = {
					resolve,
					reject
				};
			});
		});
		else batchMessages(() => {
			return new Promise((resolve, reject) => {
				batchPromise = {
					resolve,
					reject
				};
			});
		});
	};
	handlers$1["api/batch-budget-end"] = async function() {
		if (!batchPromise) throw APIError("Cannot end a batch process: no batch started");
		batchPromise.resolve();
		batchPromise = null;
	};
	handlers$1["api/load-budget"] = async function({ id }) {
		const { id: currentId } = getPrefs() || {};
		if (currentId !== id) {
			send$1("start-load");
			const { error } = await handlers$1["load-budget"]({ id });
			if (!error) send$1("finish-load");
			else {
				send$1("show-budgets");
				throw new Error(getSyncError(error, id));
			}
		}
	};
	handlers$1["api/download-budget"] = async function({ syncId, password }) {
		const { id: currentId } = getPrefs() || {};
		if (currentId) await handlers$1["close-budget"]();
		const localBudget = (await handlers$1["get-budgets"]()).find((b) => b.groupId === syncId);
		let remoteBudget;
		if (!localBudget) {
			const files = await handlers$1["get-remote-files"]();
			if (!files) throw new Error("Could not get remote files");
			const file = files.find((f) => f.groupId === syncId);
			if (!file) throw new Error(`Budget "${syncId}" not found. Check the sync id of your budget in the Advanced section of the settings page.`);
			remoteBudget = file;
		}
		const activeFile = remoteBudget ? remoteBudget : localBudget;
		if (activeFile.encryptKeyId) {
			if (!password) throw new Error(`File ${activeFile.name} is encrypted. Please provide a password.`);
			const result = await handlers$1["key-test"]({
				cloudFileId: remoteBudget ? remoteBudget.fileId : localBudget.cloudFileId,
				password
			});
			if (result.error) throw new Error(getTestKeyError(result.error));
		}
		if (localBudget) {
			await handlers$1["load-budget"]({ id: localBudget.id });
			const result = await handlers$1["sync-budget"]();
			if (result.error) throw new Error(getSyncError(result.error.reason, localBudget.id));
			return;
		}
		const result = await handlers$1["download-budget"]({ cloudFileId: remoteBudget.fileId });
		if (result.error) {
			logger.log("Full error details", result.error);
			throw new Error(getDownloadError(result.error));
		}
		await handlers$1["load-budget"]({ id: result.id });
	};
	handlers$1["api/get-budgets"] = async function() {
		const budgets = await handlers$1["get-budgets"]();
		const files = await handlers$1["get-remote-files"]() || [];
		return [...budgets.map((file) => budgetModel.toExternal(file)), ...files.map((file) => remoteFileModel.toExternal(file)).filter((file) => file)];
	};
	handlers$1["api/sync"] = async function() {
		const { id } = getPrefs();
		const result = await handlers$1["sync-budget"]();
		if (result.error) throw new Error(getSyncError(result.error.reason, id));
	};
	handlers$1["api/bank-sync"] = async function(args) {
		const batchSync = args?.accountId == null;
		const allErrors = [];
		if (!batchSync) {
			const { errors } = await handlers$1["accounts-bank-sync"]({ ids: [args.accountId] });
			allErrors.push(...errors);
		} else {
			const accountsData = await handlers$1["accounts-get"]();
			const accountIdsToSync = accountsData.map((a) => a.id);
			const simpleFinAccounts = accountsData.filter((a) => a.account_sync_source === "simpleFin");
			const simpleFinAccountIds = simpleFinAccounts.map((a) => a.id);
			if (simpleFinAccounts.length > 1) (await handlers$1["simplefin-batch-sync"]({ ids: simpleFinAccountIds })).forEach((a) => allErrors.push(...a.res.errors));
			const { errors } = await handlers$1["accounts-bank-sync"]({ ids: accountIdsToSync.filter((a) => !simpleFinAccountIds.includes(a)) });
			allErrors.push(...errors);
		}
		const errors = allErrors.filter((e) => e != null);
		if (errors.length > 0) throw new Error(getBankSyncError(errors[0]));
	};
	handlers$1["api/start-import"] = async function({ budgetName }) {
		await handlers$1["close-budget"]();
		await handlers$1["create-budget"]({
			budgetName,
			avoidUpload: true
		});
		runQuery("DELETE FROM categories WHERE is_income = 0");
		runQuery("DELETE FROM category_groups WHERE is_income = 0");
		setSyncingMode("import");
		send$1("start-import");
		IMPORT_MODE = true;
	};
	handlers$1["api/finish-import"] = async function() {
		checkFileOpen();
		get$2().markCacheDirty();
		const { id } = getPrefs();
		await handlers$1["close-budget"]();
		await handlers$1["load-budget"]({ id });
		await handlers$1["get-budget-bounds"]();
		await waitOnSpreadsheet();
		await upload().catch((err) => {
			logger.warn("cloudStorage.upload failed during finish-import", err);
		});
		send$1("finish-import");
		IMPORT_MODE = false;
	};
	handlers$1["api/abort-import"] = async function() {
		if (IMPORT_MODE) {
			checkFileOpen();
			const { id } = getPrefs();
			await handlers$1["close-budget"]();
			await handlers$1["delete-budget"]({ id });
			send$1("show-budgets");
		}
		IMPORT_MODE = false;
	};
	handlers$1["api/query"] = async function({ query }) {
		checkFileOpen();
		return aqlQuery(query);
	};
	handlers$1["api/budget-months"] = async function() {
		checkFileOpen();
		const { start, end } = await handlers$1["get-budget-bounds"]();
		return range(start, end);
	};
	handlers$1["api/budget-month"] = async function({ month }) {
		checkFileOpen();
		await validateMonth(month);
		const { data: groups } = await aqlQuery(q("category_groups").select("*"));
		const sheetName = sheetForMonth(month);
		function value(name) {
			const v = get$2().getCellValue(sheetName, name);
			return v === "" ? 0 : v;
		}
		return {
			month,
			incomeAvailable: value("available-funds"),
			lastMonthOverspent: value("last-month-overspent"),
			forNextMonth: value("buffered"),
			totalBudgeted: value("total-budgeted"),
			toBudget: value("to-budget"),
			fromLastMonth: value("from-last-month"),
			totalIncome: value("total-income"),
			totalSpent: value("total-spent"),
			totalBalance: value("total-leftover"),
			categoryGroups: groups.map((group) => {
				if (group.is_income) {
					if (isTrackingBudget()) return {
						...categoryGroupModel.toExternal(group),
						budgeted: value(`group-budget-${group.id}`),
						received: value(`group-sum-amount-${group.id}`),
						balance: value(`group-leftover-${group.id}`),
						categories: group.categories.map((cat) => ({
							...categoryModel.toExternal(cat),
							budgeted: value(`budget-${cat.id}`),
							received: value(`sum-amount-${cat.id}`),
							balance: value(`leftover-${cat.id}`),
							carryover: value(`carryover-${cat.id}`)
						}))
					};
					return {
						...categoryGroupModel.toExternal(group),
						received: value("total-income"),
						categories: group.categories.map((cat) => ({
							...categoryModel.toExternal(cat),
							received: value(`sum-amount-${cat.id}`)
						}))
					};
				}
				return {
					...categoryGroupModel.toExternal(group),
					budgeted: value(`group-budget-${group.id}`),
					spent: value(`group-sum-amount-${group.id}`),
					balance: value(`group-leftover-${group.id}`),
					categories: group.categories.map((cat) => ({
						...categoryModel.toExternal(cat),
						budgeted: value(`budget-${cat.id}`),
						spent: value(`sum-amount-${cat.id}`),
						balance: value(`leftover-${cat.id}`),
						carryover: value(`carryover-${cat.id}`)
					}))
				};
			})
		};
	};
	handlers$1["api/budget-set-amount"] = withMutation(async function({ month, categoryId, amount }) {
		checkFileOpen();
		return handlers$1["budget/budget-amount"]({
			month,
			category: categoryId,
			amount
		});
	});
	handlers$1["api/budget-set-carryover"] = withMutation(async function({ month, categoryId, flag }) {
		checkFileOpen();
		await validateMonth(month);
		await validateExpenseCategory("budget-set-carryover", categoryId);
		return handlers$1["budget/set-carryover"]({
			startMonth: month,
			category: categoryId,
			flag
		});
	});
	handlers$1["api/budget-hold-for-next-month"] = withMutation(async function({ month, amount }) {
		checkFileOpen();
		await validateMonth(month);
		if (amount <= 0) throw APIError("Amount to hold needs to be greater than 0");
		return handlers$1["budget/hold-for-next-month"]({
			month,
			amount
		});
	});
	handlers$1["api/budget-reset-hold"] = withMutation(async function({ month }) {
		checkFileOpen();
		await validateMonth(month);
		return handlers$1["budget/reset-hold"]({ month });
	});
	handlers$1["api/transactions-export"] = async function({ transactions, categoryGroups, payees, accounts }) {
		checkFileOpen();
		return handlers$1["transactions-export"]({
			transactions,
			categoryGroups,
			payees,
			accounts
		});
	};
	handlers$1["api/transactions-import"] = withMutation(async function({ accountId, transactions, isPreview = false, opts }) {
		checkFileOpen();
		return handlers$1["transactions-import"]({
			accountId,
			transactions,
			isPreview,
			opts
		});
	});
	handlers$1["api/transactions-add"] = withMutation(async function({ accountId, transactions, runTransfers = false, learnCategories = false }) {
		checkFileOpen();
		await addTransactions(accountId, transactions, {
			runTransfers,
			learnCategories
		});
		return "ok";
	});
	handlers$1["api/transactions-get"] = async function({ accountId, startDate, endDate }) {
		checkFileOpen();
		const { data } = await aqlQuery(q("transactions").filter({ $and: [
			accountId && { account: accountId },
			startDate && { date: { $gte: startDate } },
			endDate && { date: { $lte: endDate } }
		].filter(Boolean) }).select("*").options({ splits: "grouped" }));
		return data;
	};
	handlers$1["api/transaction-update"] = withMutation(async function({ id, fields }) {
		checkFileOpen();
		const { data } = await aqlQuery(q("transactions").filter({ id }).select("*").options({ splits: "grouped" }));
		const transactions = ungroupTransactions(data);
		if (transactions.length === 0) return [];
		const { diff } = updateTransaction$1(transactions, {
			id,
			...fields
		});
		return handlers$1["transactions-batch-update"](diff)["updated"];
	});
	handlers$1["api/transaction-delete"] = withMutation(async function({ id }) {
		checkFileOpen();
		const { data } = await aqlQuery(q("transactions").filter({ id }).select("*").options({ splits: "grouped" }));
		const transactions = ungroupTransactions(data);
		if (transactions.length === 0) return [];
		const { diff } = deleteTransaction$1(transactions, id);
		return handlers$1["transactions-batch-update"](diff)["deleted"];
	});
	handlers$1["api/accounts-get"] = async function() {
		checkFileOpen();
		return (await handlers$1["accounts-get"]()).map((account) => accountModel.toExternal(account));
	};
	handlers$1["api/account-create"] = withMutation(async function({ account, initialBalance = null }) {
		checkFileOpen();
		return handlers$1["account-create"]({
			name: account.name,
			offBudget: account.offbudget,
			closed: account.closed,
			balance: initialBalance != null ? integerToAmount(initialBalance) : null
		});
	});
	handlers$1["api/account-update"] = withMutation(async function({ id, fields }) {
		checkFileOpen();
		return updateAccount$1({
			id,
			...accountModel.fromExternal(fields)
		});
	});
	handlers$1["api/account-close"] = withMutation(async function({ id, transferAccountId, transferCategoryId }) {
		checkFileOpen();
		return handlers$1["account-close"]({
			id,
			transferAccountId,
			categoryId: transferCategoryId
		});
	});
	handlers$1["api/account-reopen"] = withMutation(async function({ id }) {
		checkFileOpen();
		return handlers$1["account-reopen"]({ id });
	});
	handlers$1["api/account-delete"] = withMutation(async function({ id }) {
		checkFileOpen();
		return handlers$1["account-close"]({
			id,
			forced: true
		});
	});
	handlers$1["api/account-balance"] = withMutation(async function({ id, cutoff = /* @__PURE__ */ new Date() }) {
		checkFileOpen();
		return handlers$1["account-balance"]({
			id,
			cutoff
		});
	});
	handlers$1["api/categories-get"] = async function({ grouped, hidden } = {}) {
		checkFileOpen();
		const result = await handlers$1["get-categories"]({ hidden });
		return grouped ? result.grouped.map((group) => categoryGroupModel.toExternal(group)) : result.list.map((category) => categoryModel.toExternal(category));
	};
	handlers$1["api/category-groups-get"] = async function({ hidden } = {}) {
		checkFileOpen();
		return (await handlers$1["get-category-groups"]({ hidden })).map((group) => categoryGroupModel.toExternal(group));
	};
	handlers$1["api/category-group-create"] = withMutation(async function({ group }) {
		checkFileOpen();
		return handlers$1["category-group-create"]({
			name: group.name,
			hidden: group.hidden
		});
	});
	handlers$1["api/category-group-update"] = withMutation(async function({ id, fields }) {
		checkFileOpen();
		return handlers$1["category-group-update"]({
			id,
			...categoryGroupModel.fromExternal(fields)
		});
	});
	handlers$1["api/category-group-delete"] = withMutation(async function({ id, transferCategoryId }) {
		checkFileOpen();
		return handlers$1["category-group-delete"]({
			id,
			transferId: transferCategoryId
		});
	});
	handlers$1["api/category-create"] = withMutation(async function({ category }) {
		checkFileOpen();
		return handlers$1["category-create"]({
			name: category.name,
			groupId: category.group_id,
			isIncome: category.is_income,
			hidden: category.hidden
		});
	});
	handlers$1["api/category-update"] = withMutation(async function({ id, fields }) {
		checkFileOpen();
		return handlers$1["category-update"]({
			id,
			...categoryModel.fromExternal(fields)
		});
	});
	handlers$1["api/category-delete"] = withMutation(async function({ id, transferCategoryId }) {
		checkFileOpen();
		return handlers$1["category-delete"]({
			id,
			transferId: transferCategoryId
		});
	});
	handlers$1["api/note-get"] = async function({ id }) {
		checkFileOpen();
		return handlers$1["notes-get"]({ id });
	};
	handlers$1["api/note-update"] = withMutation(async function({ id, note }) {
		checkFileOpen();
		return handlers$1["notes-save"]({
			id,
			note
		});
	});
	handlers$1["api/common-payees-get"] = async function() {
		checkFileOpen();
		return (await handlers$1["common-payees-get"]()).map((payee) => payeeModel.toExternal(payee));
	};
	handlers$1["api/payees-get"] = async function() {
		checkFileOpen();
		return (await handlers$1["payees-get"]()).map((payee) => payeeModel.toExternal(payee));
	};
	handlers$1["api/payee-create"] = withMutation(async function({ payee }) {
		checkFileOpen();
		return handlers$1["payee-create"]({ name: payee.name });
	});
	handlers$1["api/payee-update"] = withMutation(async function({ id, fields }) {
		checkFileOpen();
		return handlers$1["payees-batch-change"]({ updated: [{
			id,
			...payeeModel.fromExternal(fields)
		}] });
	});
	handlers$1["api/payee-delete"] = withMutation(async function({ id }) {
		checkFileOpen();
		return handlers$1["payees-batch-change"]({ deleted: [{ id }] });
	});
	handlers$1["api/payees-merge"] = withMutation(async function({ targetId, mergeIds }) {
		checkFileOpen();
		return handlers$1["payees-merge"]({
			targetId,
			mergeIds
		});
	});
	handlers$1["api/tags-get"] = async function() {
		checkFileOpen();
		return (await handlers$1["tags-get"]()).map((tag) => tagModel.toExternal(tag));
	};
	handlers$1["api/tag-create"] = withMutation(async function({ tag }) {
		checkFileOpen();
		return (await handlers$1["tags-create"]({
			tag: tag.tag,
			color: tag.color,
			description: tag.description
		})).id;
	});
	handlers$1["api/tag-update"] = withMutation(async function({ id, fields }) {
		checkFileOpen();
		await handlers$1["tags-update"]({
			id,
			...tagModel.fromExternal(fields)
		});
	});
	handlers$1["api/tag-delete"] = withMutation(async function({ id }) {
		checkFileOpen();
		await handlers$1["tags-delete"]({ id });
	});
	handlers$1["api/payee-location-create"] = withMutation(async function({ payeeId, latitude, longitude }) {
		checkFileOpen();
		return handlers$1["payee-location-create"]({
			payeeId,
			latitude,
			longitude
		});
	});
	handlers$1["api/payee-locations-get"] = async function({ payeeId }) {
		checkFileOpen();
		return handlers$1["payee-locations-get"]({ payeeId });
	};
	handlers$1["api/payee-location-delete"] = withMutation(async function({ id }) {
		checkFileOpen();
		return handlers$1["payee-location-delete"]({ id });
	});
	handlers$1["api/payees-get-nearby"] = async function({ latitude, longitude, maxDistance }) {
		checkFileOpen();
		return handlers$1["payees-get-nearby"]({
			latitude,
			longitude,
			maxDistance
		});
	};
	handlers$1["api/rules-get"] = async function() {
		checkFileOpen();
		return handlers$1["rules-get"]();
	};
	handlers$1["api/payee-rules-get"] = async function({ id }) {
		checkFileOpen();
		return handlers$1["payees-get-rules"]({ id });
	};
	handlers$1["api/rule-create"] = withMutation(async function({ rule }) {
		checkFileOpen();
		const addedRule = await handlers$1["rule-add"](rule);
		if ("error" in addedRule) throw APIError("Failed creating a new rule", addedRule.error);
		return addedRule;
	});
	handlers$1["api/rule-update"] = withMutation(async function({ rule }) {
		checkFileOpen();
		const updatedRule = await handlers$1["rule-update"](rule);
		if ("error" in updatedRule) throw APIError("Failed updating the rule", updatedRule.error);
		return updatedRule;
	});
	handlers$1["api/rule-delete"] = withMutation(async function(id) {
		checkFileOpen();
		return handlers$1["rule-delete"](id);
	});
	handlers$1["api/schedules-get"] = async function() {
		checkFileOpen();
		const { data } = await aqlQuery(q("schedules").select("*"));
		return data.map((schedule) => scheduleModel.toExternal(schedule));
	};
	handlers$1["api/schedule-create"] = withMutation(async function(schedule) {
		checkFileOpen();
		const internalSchedule = scheduleModel.fromExternal({
			...schedule,
			id: ""
		});
		const partialSchedule = {
			name: internalSchedule.name,
			posts_transaction: internalSchedule.posts_transaction
		};
		return handlers$1["schedule/create"]({
			schedule: partialSchedule,
			conditions: internalSchedule._conditions
		});
	});
	handlers$1["api/schedule-update"] = withMutation(async function({ id, fields, resetNextDate }) {
		checkFileOpen();
		const { data } = await aqlQuery(q("schedules").filter({ id }).select("*"));
		if (!data || data.length === 0) throw APIError(`Schedule ${id} not found`);
		const sched = data[0];
		let conditionsUpdated = false;
		const payeeIndex = sched._conditions.findIndex((c) => c.field === "payee");
		const accountIndex = sched._conditions.findIndex((c) => c.field === "account");
		const dateIndex = sched._conditions.findIndex((c) => c.field === "date");
		const amountIndex = sched._conditions.findIndex((c) => c.field === "amount");
		for (const key in fields) {
			const typedKey = key;
			const value = fields[typedKey];
			switch (typedKey) {
				case "name": {
					const newName = String(value);
					const { data: existing } = await aqlQuery(q("schedules").filter({ name: newName }).select("*"));
					if (!existing || existing.length === 0 || existing[0].id === sched.id) {
						sched.name = newName;
						conditionsUpdated = true;
					} else throw APIError(`There is already a schedule named: ${newName}`);
					break;
				}
				case "next_date":
				case "completed": throw APIError(`Field ${typedKey} is system-managed and not user-editable.`);
				case "posts_transaction":
					sched.posts_transaction = Boolean(value);
					conditionsUpdated = true;
					break;
				case "payee":
					if (payeeIndex !== -1) {
						sched._conditions[payeeIndex].value = value;
						conditionsUpdated = true;
					} else {
						sched._conditions.push({
							field: "payee",
							op: "is",
							value: String(value)
						});
						conditionsUpdated = true;
					}
					break;
				case "account":
					if (accountIndex !== -1) {
						sched._conditions[accountIndex].value = value;
						conditionsUpdated = true;
					} else {
						sched._conditions.push({
							field: "account",
							op: "is",
							value: String(value)
						});
						conditionsUpdated = true;
					}
					break;
				case "amountOp":
					if (amountIndex !== -1) {
						let convertedOp;
						switch (value) {
							case "is":
								convertedOp = "is";
								break;
							case "isapprox":
								convertedOp = "isapprox";
								break;
							case "isbetween":
								convertedOp = "isbetween";
								break;
							default: throw APIError(`Invalid amount operator: ${String(value)}. Expected: is, isapprox, or isbetween`);
						}
						sched._conditions[amountIndex].op = convertedOp;
						conditionsUpdated = true;
					} else throw APIError(`Ammount can not be found. There is a bug here`);
					break;
				case "amount":
					if (amountIndex !== -1) {
						sched._conditions[amountIndex].value = value;
						conditionsUpdated = true;
					} else throw APIError(`Ammount can not be found. There is a bug here`);
					break;
				case "date":
					if (dateIndex !== -1) {
						sched._conditions[dateIndex].value = value;
						conditionsUpdated = true;
					} else throw APIError(`Date can not be found. Schedules can not be created without a date there is a bug here`);
					break;
				default: throw APIError(`Unhandled field: ${typedKey}`);
			}
		}
		if (conditionsUpdated) return handlers$1["schedule/update"]({
			schedule: {
				id: sched.id,
				posts_transaction: sched.posts_transaction,
				name: sched.name
			},
			conditions: sched._conditions,
			resetNextDate
		});
		else return sched.id;
	});
	handlers$1["api/schedule-delete"] = withMutation(async function(id) {
		checkFileOpen();
		return handlers$1["schedule/delete"]({ id });
	});
	handlers$1["api/get-id-by-name"] = async function({ type, name }) {
		checkFileOpen();
		if (![
			"payees",
			"categories",
			"schedules",
			"accounts"
		].includes(type)) throw APIError("Provide a valid type");
		const { data } = await aqlQuery(q(type).filter({ name }).select("*"));
		if (!data || data.length === 0) throw APIError(`Not found: ${type} with name ${name}`);
		return data[0].id;
	};
	handlers$1["api/get-server-version"] = async function() {
		checkFileOpen();
		return handlers$1["get-server-version"]();
	};
	function installAPI(serverHandlers) {
		const merged = Object.assign({}, serverHandlers, handlers$1);
		handlers$1 = merged;
		return merged;
	}
	//#endregion
	//#region ../loot-core/src/server/auth/app.ts
	var app$17 = createApp();
	app$17.method("get-did-bootstrap", didBootstrap);
	app$17.method("subscribe-needs-bootstrap", needsBootstrap);
	app$17.method("subscribe-bootstrap", bootstrap);
	app$17.method("subscribe-get-login-methods", getLoginMethods);
	app$17.method("subscribe-get-user", getUser);
	app$17.method("subscribe-change-password", changePassword);
	app$17.method("subscribe-sign-in", signIn);
	app$17.method("subscribe-sign-out", signOut);
	app$17.method("subscribe-set-token", setToken);
	app$17.method("enable-openid", enableOpenId);
	app$17.method("get-openid-config", getOpenIdConfig);
	app$17.method("enable-password", enablePassword);
	async function didBootstrap() {
		return Boolean(await getItem("did-bootstrap"));
	}
	async function needsBootstrap({ url } = {}) {
		if (url && !isValidBaseURL(url)) return { error: "get-server-failure" };
		let serverConfig;
		try {
			serverConfig = getServer(url);
			if (!serverConfig) return {
				bootstrapped: true,
				hasServer: false
			};
		} catch {
			return { error: "get-server-failure" };
		}
		let resText;
		try {
			resText = await get$1(serverConfig.SIGNUP_SERVER + "/needs-bootstrap");
		} catch {
			return { error: "network-failure" };
		}
		let res;
		try {
			res = JSON.parse(resText);
		} catch {
			return { error: "parse-failure" };
		}
		return {
			bootstrapped: res.data.bootstrapped,
			availableLoginMethods: res.data.availableLoginMethods || [{
				method: "password",
				active: true,
				displayName: "Password"
			}],
			multiuser: res.data.multiuser || false,
			hasServer: true
		};
	}
	async function bootstrap(loginConfig) {
		try {
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			await post(serverConfig.SIGNUP_SERVER + "/bootstrap", loginConfig);
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		return {};
	}
	async function getLoginMethods() {
		let res;
		try {
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			res = await fetch(serverConfig.SIGNUP_SERVER + "/login-methods").then((res) => res.json());
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		if (res.methods) return { methods: res.methods };
		return { error: "internal" };
	}
	async function getUser() {
		const serverConfig = getServer();
		if (!serverConfig) {
			if (!await getItem("did-bootstrap")) return null;
			return { offline: false };
		}
		const userToken = await getItem("user-token");
		if (!userToken) return null;
		try {
			const res = await get$1(serverConfig.SIGNUP_SERVER + "/validate", { headers: { "X-ACTUAL-TOKEN": userToken } });
			let tokenExpired = false;
			const { status, reason, data: { userName = null, permission = "", userId = null, displayName = null, loginMethod = null, prefs: serverPrefs } = {} } = JSON.parse(res) || {};
			if (status === "error") if (reason === "unauthorized") return null;
			else if (reason === "token-expired") tokenExpired = true;
			else return { offline: true };
			return {
				offline: false,
				userName,
				permission,
				userId,
				displayName,
				loginMethod,
				tokenExpired,
				serverPrefs
			};
		} catch (e) {
			logger.log(e);
			return { offline: true };
		}
	}
	async function changePassword({ password }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "not-logged-in" };
		try {
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			await post(serverConfig.SIGNUP_SERVER + "/change-password", {
				token: userToken,
				password
			});
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		return {};
	}
	async function signIn(loginInfo) {
		if (typeof loginInfo.loginMethod !== "string" || loginInfo.loginMethod == null) loginInfo.loginMethod = "password";
		let res;
		try {
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			res = await post(serverConfig.SIGNUP_SERVER + "/login", loginInfo);
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		if (res.returnUrl) return { redirectUrl: res.returnUrl };
		if (!res.token) throw new Error("login: User token not set");
		await setItem("user-token", res.token);
		return {};
	}
	async function signOut() {
		unloadAllKeys();
		await multiRemove([
			"user-token",
			"encrypt-keys",
			"lastBudget",
			"readOnly"
		]);
		return "ok";
	}
	async function setToken({ token }) {
		await setItem("user-token", token);
	}
	async function enableOpenId(openIdConfig) {
		try {
			const userToken = await getItem("user-token");
			if (!userToken) return { error: "unauthorized" };
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			await post(serverConfig.BASE_SERVER + "/openid/enable", openIdConfig, { "X-ACTUAL-TOKEN": userToken });
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		return {};
	}
	async function getOpenIdConfig({ password }) {
		try {
			const userToken = await getItem("user-token");
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			const res = await post(serverConfig.BASE_SERVER + "/openid/config", { password }, { "X-ACTUAL-TOKEN": userToken });
			if (res) return res;
			return null;
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
	}
	async function enablePassword(passwordConfig) {
		try {
			const userToken = await getItem("user-token");
			if (!userToken) return { error: "unauthorized" };
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			await post(serverConfig.BASE_SERVER + "/openid/disable", passwordConfig, { "X-ACTUAL-TOKEN": userToken });
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		return {};
	}
	//#endregion
	//#region ../loot-core/src/server/budget/cleanup-groups.ts
	async function resolveCleanupGroup(name) {
		const trimmed = name.trim();
		if (trimmed.length === 0) throw new Error("Cleanup group name cannot be empty");
		const existing = await first$2(`SELECT id, tombstone FROM cleanup_groups WHERE lower(name) = ? LIMIT 1`, [trimmed.toLowerCase()]);
		if (existing) {
			if (existing.tombstone) await update("cleanup_groups", {
				id: existing.id,
				tombstone: 0
			});
			return existing.id;
		}
		const id = v4();
		await insertWithSchema("cleanup_groups", {
			id,
			name: trimmed,
			tombstone: 0
		});
		return id;
	}
	async function createCleanupGroup({ name }) {
		return { id: await resolveCleanupGroup(name) };
	}
	async function tombstoneOrphanCleanupGroups() {
		await run(`
      UPDATE cleanup_groups
      SET tombstone = 1
      WHERE tombstone = 0
        AND id NOT IN (
          SELECT json_extract(je.value, '$.groupId') AS group_id
          FROM categories c, json_each(c.cleanup_def) je
          WHERE c.tombstone = 0
            AND c.cleanup_def IS NOT NULL
            AND json_extract(je.value, '$.groupId') IS NOT NULL
        )
    `);
	}
	//#endregion
	//#region ../loot-core/src/server/budget/cleanup-template.pegjs
	var peg$SyntaxError$1 = class extends SyntaxError {
		constructor(message, expected, found, location) {
			super(message);
			this.expected = expected;
			this.found = found;
			this.location = location;
			this.name = "SyntaxError";
		}
		format(sources) {
			let str = "Error: " + this.message;
			if (this.location) {
				let src = null;
				const st = sources.find((s) => s.source === this.location.source);
				if (st) src = st.text.split(/\r\n|\n|\r/g);
				const s = this.location.start;
				const offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
				const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
				if (src) {
					const e = this.location.end;
					const filler = "".padEnd(offset_s.line.toString().length, " ");
					const line = src[s.line - 1];
					const hatLen = (s.line === e.line ? e.column : line.length + 1) - s.column || 1;
					str += "\n --> " + loc + "\n" + filler + " |\n" + offset_s.line + " | " + line + "\n" + filler + " | " + "".padEnd(s.column - 1, " ") + "".padEnd(hatLen, "^");
				} else str += "\n at " + loc;
			}
			return str;
		}
		static buildMessage(expected, found) {
			function hex(ch) {
				return ch.codePointAt(0).toString(16).toUpperCase();
			}
			const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode") ? /* @__PURE__ */ new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu") : null;
			function unicodeEscape(s) {
				if (nonPrintable) return s.replace(nonPrintable, (ch) => "\\u{" + hex(ch) + "}");
				return s;
			}
			function literalEscape(s) {
				return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
			}
			function classEscape(s) {
				return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
			}
			const DESCRIBE_EXPECTATION_FNS = {
				literal(expectation) {
					return "\"" + literalEscape(expectation.text) + "\"";
				},
				class(expectation) {
					const escapedParts = expectation.parts.map((part) => Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part));
					return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
				},
				any() {
					return "any character";
				},
				end() {
					return "end of input";
				},
				other(expectation) {
					return expectation.description;
				}
			};
			function describeExpectation(expectation) {
				return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
			}
			function describeExpected(expected) {
				const descriptions = expected.map(describeExpectation);
				descriptions.sort();
				if (descriptions.length > 0) {
					let j = 1;
					for (let i = 1; i < descriptions.length; i++) if (descriptions[i - 1] !== descriptions[i]) {
						descriptions[j] = descriptions[i];
						j++;
					}
					descriptions.length = j;
				}
				switch (descriptions.length) {
					case 1: return descriptions[0];
					case 2: return descriptions[0] + " or " + descriptions[1];
					default: return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
				}
			}
			function describeFound(found) {
				return found ? "\"" + literalEscape(found) + "\"" : "end of input";
			}
			return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
		}
	};
	function peg$parse$1(input, options) {
		options = options !== void 0 ? options : {};
		const peg$FAILED = {};
		const peg$source = options.grammarSource;
		const peg$startRuleFunctions = { expr: peg$parseexpr };
		let peg$startRuleFunction = peg$parseexpr;
		const peg$c0 = "#cleanup";
		const peg$c1 = "source";
		const peg$c2 = "sink";
		const peg$c3 = " ";
		const peg$c4 = " source";
		const peg$c5 = " sink";
		const peg$r0 = /^[0-9]/;
		const peg$e0 = peg$literalExpectation("#cleanup", false);
		const peg$e1 = peg$literalExpectation("source", false);
		const peg$e2 = peg$literalExpectation("sink", false);
		const peg$e3 = peg$otherExpectation("space");
		const peg$e4 = peg$literalExpectation(" ", false);
		const peg$e5 = peg$otherExpectation("digit");
		const peg$e6 = peg$classExpectation([["0", "9"]], false, false, false);
		const peg$e7 = peg$otherExpectation("weight");
		const peg$e8 = peg$literalExpectation(" source", false);
		const peg$e9 = peg$anyExpectation();
		const peg$e10 = peg$literalExpectation(" sink", false);
		function peg$f0(inner) {
			return inner;
		}
		function peg$f1() {
			return {
				group: null,
				type: "source"
			};
		}
		function peg$f2(weight) {
			return {
				type: "sink",
				weight: +weight || 1,
				group: null
			};
		}
		function peg$f3(group) {
			return {
				group: group || null,
				type: "source"
			};
		}
		function peg$f4(group, weight) {
			return {
				type: "sink",
				weight: +weight || 1,
				group: group || null
			};
		}
		function peg$f5(group) {
			return {
				group,
				type: null
			};
		}
		function peg$f6(weight) {
			return +weight;
		}
		let peg$currPos = options.peg$currPos | 0;
		const peg$posDetailsCache = [{
			line: 1,
			column: 1
		}];
		let peg$maxFailPos = peg$currPos;
		let peg$maxFailExpected = options.peg$maxFailExpected || [];
		let peg$silentFails = options.peg$silentFails | 0;
		let peg$result;
		if (options.startRule) {
			if (!(options.startRule in peg$startRuleFunctions)) throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
			peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
		}
		function peg$getUnicode(pos = peg$currPos) {
			const cp = input.codePointAt(pos);
			if (cp === void 0) return "";
			return String.fromCodePoint(cp);
		}
		function peg$literalExpectation(text, ignoreCase) {
			return {
				type: "literal",
				text,
				ignoreCase
			};
		}
		function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
			return {
				type: "class",
				parts,
				inverted,
				ignoreCase,
				unicode
			};
		}
		function peg$anyExpectation() {
			return { type: "any" };
		}
		function peg$endExpectation() {
			return { type: "end" };
		}
		function peg$otherExpectation(description) {
			return {
				type: "other",
				description
			};
		}
		function peg$computePosDetails(pos) {
			let details = peg$posDetailsCache[pos];
			let p;
			if (details) return details;
			else {
				if (pos >= peg$posDetailsCache.length) p = peg$posDetailsCache.length - 1;
				else {
					p = pos;
					while (!peg$posDetailsCache[--p]);
				}
				details = peg$posDetailsCache[p];
				details = {
					line: details.line,
					column: details.column
				};
				while (p < pos) {
					if (input.charCodeAt(p) === 10) {
						details.line++;
						details.column = 1;
					} else details.column++;
					p++;
				}
				peg$posDetailsCache[pos] = details;
				return details;
			}
		}
		function peg$computeLocation(startPos, endPos, offset) {
			const startPosDetails = peg$computePosDetails(startPos);
			const endPosDetails = peg$computePosDetails(endPos);
			const res = {
				source: peg$source,
				start: {
					offset: startPos,
					line: startPosDetails.line,
					column: startPosDetails.column
				},
				end: {
					offset: endPos,
					line: endPosDetails.line,
					column: endPosDetails.column
				}
			};
			if (offset && peg$source && typeof peg$source.offset === "function") {
				res.start = peg$source.offset(res.start);
				res.end = peg$source.offset(res.end);
			}
			return res;
		}
		function peg$fail(expected) {
			if (peg$currPos < peg$maxFailPos) return;
			if (peg$currPos > peg$maxFailPos) {
				peg$maxFailPos = peg$currPos;
				peg$maxFailExpected = [];
			}
			peg$maxFailExpected.push(expected);
		}
		function peg$buildStructuredError(expected, found, location) {
			return new peg$SyntaxError$1(peg$SyntaxError$1.buildMessage(expected, found), expected, found, location);
		}
		function peg$parseexpr() {
			let s0, s1, s2, s3;
			s0 = peg$currPos;
			if (input.substr(peg$currPos, 8) === peg$c0) {
				s1 = peg$c0;
				peg$currPos += 8;
			} else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e0);
			}
			if (s1 !== peg$FAILED) {
				s2 = peg$parse_();
				if (s2 !== peg$FAILED) {
					s3 = peg$parseinner();
					if (s3 !== peg$FAILED) s0 = peg$f0(s3);
					else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parseinner() {
			let s0, s1, s2, s3, s4, s5;
			s0 = peg$currPos;
			s1 = peg$parsesource();
			if (s1 !== peg$FAILED) s1 = peg$f1();
			s0 = s1;
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				s1 = peg$parsesink();
				if (s1 !== peg$FAILED) {
					s2 = peg$parse_();
					if (s2 === peg$FAILED) s2 = null;
					s3 = peg$parseweight();
					if (s3 === peg$FAILED) s3 = null;
					s0 = peg$f2(s3);
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
				if (s0 === peg$FAILED) {
					s0 = peg$currPos;
					s1 = peg$parsesourcegroup();
					s2 = peg$parse_();
					if (s2 === peg$FAILED) s2 = null;
					s3 = peg$parsesource();
					if (s3 !== peg$FAILED) s0 = peg$f3(s1);
					else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
					if (s0 === peg$FAILED) {
						s0 = peg$currPos;
						s1 = peg$parsesinkgroup();
						s2 = peg$parse_();
						if (s2 === peg$FAILED) s2 = null;
						s3 = peg$parsesink();
						if (s3 !== peg$FAILED) {
							s4 = peg$parse_();
							if (s4 === peg$FAILED) s4 = null;
							s5 = peg$parseweight();
							if (s5 === peg$FAILED) s5 = null;
							s0 = peg$f4(s1, s5);
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
						if (s0 === peg$FAILED) {
							s0 = peg$currPos;
							s1 = peg$parsesourcegroup();
							s1 = peg$f5(s1);
							s0 = s1;
						}
					}
				}
			}
			return s0;
		}
		function peg$parsesource() {
			let s0;
			if (input.substr(peg$currPos, 6) === peg$c1) {
				s0 = peg$c1;
				peg$currPos += 6;
			} else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e1);
			}
			return s0;
		}
		function peg$parsesink() {
			let s0;
			if (input.substr(peg$currPos, 4) === peg$c2) {
				s0 = peg$c2;
				peg$currPos += 4;
			} else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e2);
			}
			return s0;
		}
		function peg$parse_() {
			let s0, s1;
			peg$silentFails++;
			s0 = [];
			if (input.charCodeAt(peg$currPos) === 32) {
				s1 = peg$c3;
				peg$currPos++;
			} else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e4);
			}
			if (s1 !== peg$FAILED) while (s1 !== peg$FAILED) {
				s0.push(s1);
				if (input.charCodeAt(peg$currPos) === 32) {
					s1 = peg$c3;
					peg$currPos++;
				} else {
					s1 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e4);
				}
			}
			else s0 = peg$FAILED;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e3);
			}
			return s0;
		}
		function peg$parsed() {
			let s0;
			peg$silentFails++;
			s0 = input.charAt(peg$currPos);
			if (peg$r0.test(s0)) peg$currPos++;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e6);
			}
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				if (peg$silentFails === 0) peg$fail(peg$e5);
			}
			return s0;
		}
		function peg$parseweight() {
			let s0, s1, s2, s3;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = [];
			s3 = peg$parsed();
			if (s3 !== peg$FAILED) while (s3 !== peg$FAILED) {
				s2.push(s3);
				s3 = peg$parsed();
			}
			else s2 = peg$FAILED;
			if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
			else s1 = s2;
			if (s1 !== peg$FAILED) s1 = peg$f6(s1);
			s0 = s1;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e7);
			}
			return s0;
		}
		function peg$parsesourcegroup() {
			let s0, s1, s2, s3, s4;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = [];
			s2 = peg$currPos;
			s3 = peg$currPos;
			peg$silentFails++;
			if (input.substr(peg$currPos, 7) === peg$c4) {
				s4 = peg$c4;
				peg$currPos += 7;
			} else {
				s4 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e8);
			}
			peg$silentFails--;
			if (s4 === peg$FAILED) s3 = void 0;
			else {
				peg$currPos = s3;
				s3 = peg$FAILED;
			}
			if (s3 !== peg$FAILED) {
				if (input.length > peg$currPos) {
					s4 = input.charAt(peg$currPos);
					peg$currPos++;
				} else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e9);
				}
				if (s4 !== peg$FAILED) {
					s3 = [s3, s4];
					s2 = s3;
				} else {
					peg$currPos = s2;
					s2 = peg$FAILED;
				}
			} else {
				peg$currPos = s2;
				s2 = peg$FAILED;
			}
			while (s2 !== peg$FAILED) {
				s1.push(s2);
				s2 = peg$currPos;
				s3 = peg$currPos;
				peg$silentFails++;
				if (input.substr(peg$currPos, 7) === peg$c4) {
					s4 = peg$c4;
					peg$currPos += 7;
				} else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e8);
				}
				peg$silentFails--;
				if (s4 === peg$FAILED) s3 = void 0;
				else {
					peg$currPos = s3;
					s3 = peg$FAILED;
				}
				if (s3 !== peg$FAILED) {
					if (input.length > peg$currPos) {
						s4 = input.charAt(peg$currPos);
						peg$currPos++;
					} else {
						s4 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e9);
					}
					if (s4 !== peg$FAILED) {
						s3 = [s3, s4];
						s2 = s3;
					} else {
						peg$currPos = s2;
						s2 = peg$FAILED;
					}
				} else {
					peg$currPos = s2;
					s2 = peg$FAILED;
				}
			}
			s0 = input.substring(s0, peg$currPos);
			peg$silentFails--;
			return s0;
		}
		function peg$parsesinkgroup() {
			let s0, s1, s2, s3, s4;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = [];
			s2 = peg$currPos;
			s3 = peg$currPos;
			peg$silentFails++;
			if (input.substr(peg$currPos, 5) === peg$c5) {
				s4 = peg$c5;
				peg$currPos += 5;
			} else {
				s4 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e10);
			}
			peg$silentFails--;
			if (s4 === peg$FAILED) s3 = void 0;
			else {
				peg$currPos = s3;
				s3 = peg$FAILED;
			}
			if (s3 !== peg$FAILED) {
				if (input.length > peg$currPos) {
					s4 = input.charAt(peg$currPos);
					peg$currPos++;
				} else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e9);
				}
				if (s4 !== peg$FAILED) {
					s3 = [s3, s4];
					s2 = s3;
				} else {
					peg$currPos = s2;
					s2 = peg$FAILED;
				}
			} else {
				peg$currPos = s2;
				s2 = peg$FAILED;
			}
			while (s2 !== peg$FAILED) {
				s1.push(s2);
				s2 = peg$currPos;
				s3 = peg$currPos;
				peg$silentFails++;
				if (input.substr(peg$currPos, 5) === peg$c5) {
					s4 = peg$c5;
					peg$currPos += 5;
				} else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e10);
				}
				peg$silentFails--;
				if (s4 === peg$FAILED) s3 = void 0;
				else {
					peg$currPos = s3;
					s3 = peg$FAILED;
				}
				if (s3 !== peg$FAILED) {
					if (input.length > peg$currPos) {
						s4 = input.charAt(peg$currPos);
						peg$currPos++;
					} else {
						s4 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e9);
					}
					if (s4 !== peg$FAILED) {
						s3 = [s3, s4];
						s2 = s3;
					} else {
						peg$currPos = s2;
						s2 = peg$FAILED;
					}
				} else {
					peg$currPos = s2;
					s2 = peg$FAILED;
				}
			}
			s0 = input.substring(s0, peg$currPos);
			peg$silentFails--;
			return s0;
		}
		peg$result = peg$startRuleFunction();
		const peg$success = peg$result !== peg$FAILED && peg$currPos === input.length;
		function peg$throw() {
			if (peg$result !== peg$FAILED && peg$currPos < input.length) peg$fail(peg$endExpectation());
			throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
		}
		if (options.peg$library) return {
			peg$result,
			peg$currPos,
			peg$FAILED,
			peg$maxFailExpected,
			peg$maxFailPos,
			peg$success,
			peg$throw: peg$success ? void 0 : peg$throw
		};
		if (peg$success) return peg$result;
		else peg$throw();
	}
	async function storeNoteCleanups(categoryIds) {
		const candidates = await getCategoriesWithCleanupNotes(categoryIds);
		const parsedByCategory = /* @__PURE__ */ new Map();
		const allGroupNames = /* @__PURE__ */ new Set();
		for (const { id, note } of candidates) {
			if (!note) continue;
			const rows = parseCleanupNote(note);
			if (rows.length === 0) continue;
			parsedByCategory.set(id, rows);
			for (const r of rows) if (r.group != null) allGroupNames.add(r.group);
		}
		const nameToId = await resolveCleanupGroups(allGroupNames);
		for (const { id } of candidates) {
			const parsed = parsedByCategory.get(id);
			if (!parsed) {
				await updateWithSchema("categories", {
					id,
					cleanup_def: null
				});
				continue;
			}
			const cleanupDef = parsed.map((row) => toCleanupTemplate(row, nameToId));
			await updateWithSchema("categories", {
				id,
				cleanup_def: JSON.stringify(cleanupDef)
			});
		}
		await tombstoneOrphanCleanupGroups();
	}
	function parseCleanupNote(note) {
		const rows = [];
		for (const line of note.split("\n")) {
			const trimmed = line.trim();
			if (!trimmed.toLowerCase().startsWith("#cleanup ")) continue;
			try {
				const raw = peg$parse$1(trimmed);
				const row = raw.type === "source" ? {
					type: "source",
					group: raw.group
				} : raw.type === "sink" ? {
					type: "sink",
					group: raw.group,
					weight: raw.weight ?? 1
				} : {
					type: "overspend",
					group: raw.group ?? ""
				};
				if (row.type === "overspend" && row.group === "") continue;
				rows.push(row);
			} catch {}
		}
		return rows;
	}
	function toCleanupTemplate(row, nameToId) {
		switch (row.type) {
			case "source": return {
				role: "source",
				groupId: resolveGroup(row.group, nameToId)
			};
			case "sink": return {
				role: "sink",
				groupId: resolveGroup(row.group, nameToId),
				weight: row.weight
			};
			case "overspend": {
				const groupId = nameToId.get(row.group.toLowerCase());
				if (groupId == null) throw new Error(`Unresolved cleanup group for overspend row: ${row.group}`);
				return {
					role: "overspend",
					groupId
				};
			}
			default: throw new Error(`Unknown cleanup row type: ${String(row)}`);
		}
	}
	function resolveGroup(name, nameToId) {
		return name != null ? nameToId.get(name.toLowerCase()) ?? null : null;
	}
	async function resolveCleanupGroups(names) {
		const map = /* @__PURE__ */ new Map();
		for (const name of names) {
			const id = await resolveCleanupGroup(name);
			map.set(name.toLowerCase(), id);
		}
		return map;
	}
	async function getCategoriesWithCleanupNotes(categoryIds) {
		const baseQuery = `
    SELECT c.id AS id, n.note AS note
    FROM categories c
    LEFT JOIN notes n ON n.id = c.id
    WHERE c.tombstone = 0
      AND COALESCE(JSON_EXTRACT(c.template_settings, '$.source'), 'notes') <> 'ui'
  `;
		if (!categoryIds) return all(baseQuery);
		if (categoryIds.length === 0) return [];
		return all(`${baseQuery} AND c.id IN (${categoryIds.map(() => "?").join(",")})`, categoryIds);
	}
	//#endregion
	//#region ../loot-core/src/server/budget/cleanup-template.ts
	async function cleanupTemplate({ month }) {
		await storeNoteCleanups();
		return processCleanup(month);
	}
	async function applyGroupCleanups(month, sourceGroups, sinkGroups, overspendGroups, groupNamesById) {
		const sheetName = sheetForMonth(month);
		const warnings = [];
		const db_month = parseInt(month.replace("-", ""));
		let groupLength = sourceGroups.length;
		while (groupLength > 0) {
			const groupId = sourceGroups[0].groupId;
			const tempSourceGroups = sourceGroups.filter((c) => c.groupId === groupId);
			const sinkGroup = sinkGroups.filter((c) => c.groupId === groupId);
			const overspendGroup = overspendGroups.filter((c) => c.groupId === groupId);
			let total_weight = 0;
			let available_amount = 0;
			if (sinkGroup.length > 0 || overspendGroup.length > 0) {
				for (let ii = 0; ii < tempSourceGroups.length; ii++) {
					const balance = await getSheetValue(sheetName, `leftover-${tempSourceGroups[ii].category}`);
					const budgeted = await getSheetValue(sheetName, `budget-${tempSourceGroups[ii].category}`);
					await setBudget({
						category: tempSourceGroups[ii].category,
						month,
						amount: budgeted - balance
					});
					available_amount += balance;
				}
				for (let ii = 0; ii < sinkGroup.length; ii++) total_weight += sinkGroup[ii].weight;
				for (let ii = 0; ii < overspendGroup.length && available_amount > 0; ii++) {
					const balance = await getSheetValue(sheetName, `leftover-${overspendGroup[ii].category}`);
					const budgeted = await getSheetValue(sheetName, `budget-${overspendGroup[ii].category}`);
					const to_budget = budgeted + Math.abs(balance);
					const categoryId = overspendGroup[ii].category;
					let carryover = await first$2(`SELECT carryover FROM zero_budgets WHERE month = ? and category = ?`, [db_month, categoryId]);
					if (carryover === null) carryover = { carryover: 0 };
					if (balance < 0 && Math.abs(balance) <= available_amount && carryover.carryover === 0) {
						await setBudget({
							category: categoryId,
							month,
							amount: to_budget
						});
						available_amount -= Math.abs(balance);
					} else if (balance < 0 && carryover.carryover === 0 && Math.abs(balance) > available_amount) {
						await setBudget({
							category: categoryId,
							month,
							amount: budgeted + available_amount
						});
						available_amount = 0;
					}
				}
				for (let ii = 0; ii < sinkGroup.length && available_amount > 0; ii++) {
					const to_budget = await getSheetValue(sheetName, `budget-${sinkGroup[ii].category}`) + Math.round(sinkGroup[ii].weight / total_weight * available_amount);
					await setBudget({
						category: sinkGroup[ii].category,
						month,
						amount: to_budget
					});
				}
			} else {
				const groupName = groupNamesById.get(groupId) ?? groupId;
				warnings.push(`Cleanup group "${groupName}" has no matching sink categories.`);
			}
			sourceGroups = sourceGroups.filter((c) => c.groupId !== groupId);
			groupLength = sourceGroups.length;
		}
		return warnings;
	}
	async function processCleanup(month) {
		let num_sources = 0;
		let num_sinks = 0;
		let total_weight = 0;
		const errors = [];
		const warnings = [];
		const sinkCategory = [];
		const db_month = parseInt(month.replace("-", ""));
		const categories = await all("SELECT * FROM v_categories WHERE tombstone = 0");
		const sheetName = sheetForMonth(month);
		const groupSource = [];
		const groupSink = [];
		const groupOverspend = [];
		for (const category of categories) {
			const def = parseCleanupDef(category.cleanup_def);
			if (!def) continue;
			for (const row of def) if (row.role === "source" && row.groupId !== null) groupSource.push({
				category: category.id,
				groupId: row.groupId
			});
			else if (row.role === "sink" && row.groupId !== null) groupSink.push({
				category: category.id,
				groupId: row.groupId,
				weight: row.weight
			});
			else if (row.role === "overspend") groupOverspend.push({
				category: category.id,
				groupId: row.groupId
			});
		}
		const groupRows = await all("SELECT id, name FROM cleanup_groups WHERE tombstone = 0");
		const newWarnings = await applyGroupCleanups(month, groupSource, groupSink, groupOverspend, new Map(groupRows.map((g) => [g.id, g.name])));
		warnings.splice(1, 0, ...newWarnings);
		for (const category of categories) {
			const def = parseCleanupDef(category.cleanup_def);
			if (!def) continue;
			if (def.find((r) => r.role === "source" && r.groupId === null)) {
				const balance = await getSheetValue(sheetName, `leftover-${category.id}`);
				const budgeted = await getSheetValue(sheetName, `budget-${category.id}`);
				if (balance >= 0) {
					await setBudget({
						category: category.id,
						month,
						amount: budgeted - balance
					});
					await setGoal({
						category: category.id,
						month,
						goal: budgeted - balance,
						long_goal: 0
					});
					num_sources += 1;
				} else warnings.push(category.name + " does not have available funds.");
			}
			const globalSink = def.find((r) => r.role === "sink" && r.groupId === null);
			if (globalSink && globalSink.role === "sink") {
				sinkCategory.push({
					cat: category,
					weight: globalSink.weight
				});
				num_sinks += 1;
				total_weight += globalSink.weight;
			}
		}
		for (const category of categories) {
			const budgetAvailable = await getSheetValue(sheetName, `to-budget`);
			const balance = await getSheetValue(sheetName, `leftover-${category.id}`);
			const budgeted = await getSheetValue(sheetName, `budget-${category.id}`);
			const to_budget = budgeted + Math.abs(balance);
			const categoryId = category.id;
			let carryover = await first$2(`SELECT carryover FROM zero_budgets WHERE month = ? and category = ?`, [db_month, categoryId]);
			if (carryover === null) carryover = { carryover: 0 };
			if (balance < 0 && Math.abs(balance) <= budgetAvailable && !category.is_income && carryover.carryover === 0) await setBudget({
				category: category.id,
				month,
				amount: to_budget
			});
			else if (balance < 0 && !category.is_income && carryover.carryover === 0 && Math.abs(balance) > budgetAvailable) await setBudget({
				category: category.id,
				month,
				amount: budgeted + budgetAvailable
			});
		}
		const budgetAvailable = await getSheetValue(sheetName, `to-budget`);
		if (budgetAvailable < 0) warnings.push("Global: No funds are available to reallocate.");
		for (let c = 0; c < sinkCategory.length; c++) {
			const { cat, weight } = sinkCategory[c];
			const budgeted = await getSheetValue(sheetName, `budget-${cat.id}`);
			let to_budget = budgeted + Math.round(weight / total_weight * budgetAvailable);
			if (c === sinkCategory.length - 1) {
				const currentBudgetAvailable = await getSheetValue(sheetName, `to-budget`);
				if (to_budget > currentBudgetAvailable) to_budget = budgeted + currentBudgetAvailable;
			}
			await setBudget({
				category: cat.id,
				month,
				amount: to_budget
			});
		}
		if (num_sources === 0) if (errors.length) return {
			type: "error",
			sticky: true,
			message: "There were errors interpreting some templates:",
			pre: errors.join("\n\n")
		};
		else if (warnings.length) return {
			type: "warning",
			message: "Global: Funds not available:",
			pre: warnings.join("\n\n")
		};
		else return {
			type: "message",
			message: "All categories were up to date."
		};
		else {
			const applied = `Successfully returned funds from ${num_sources} ${num_sources === 1 ? "source" : "sources"} and funded ${num_sinks} sinking ${num_sinks === 1 ? "fund" : "funds"}.`;
			if (errors.length) return {
				sticky: true,
				message: `${applied} There were errors interpreting some templates:`,
				pre: errors.join("\n\n")
			};
			else if (warnings.length) return {
				type: "warning",
				message: "Global: Funds not available:",
				pre: warnings.join("\n\n")
			};
			else if (budgetAvailable === 0) return {
				type: "message",
				message: "All categories were up to date."
			};
			else return {
				type: "message",
				message: applied
			};
		}
	}
	function parseCleanupDef(raw) {
		if (!raw) return null;
		try {
			const parsed = JSON.parse(raw);
			return Array.isArray(parsed) && parsed.length > 0 ? parsed : null;
		} catch {
			return null;
		}
	}
	//#endregion
	//#region ../loot-core/src/server/schedules/find-schedules.ts
	function takeDates(config) {
		return new RSchedule({ rrules: recurConfigToRSchedule(config) }).occurrences({ take: 3 }).toArray().map((d) => d.date);
	}
	async function getTransactions$1(date, account) {
		const { data } = await aqlQuery(q("transactions").filter({
			account,
			schedule: null,
			"payee.transfer_acct": null,
			$and: [{ date: { $gte: subDays$1(date, 2) } }, { date: { $lte: addDays$1(date, 2) } }]
		}).select("*").options({ splits: "none" }));
		return data;
	}
	function getRank(day1, day2) {
		return 1 / (Math.abs(differenceInDays(parseDate(day1), parseDate(day2))) + 1);
	}
	function matchSchedules(allOccurs, config) {
		allOccurs = [...allOccurs].reverse();
		const baseOccur = allOccurs[0];
		const occurs = allOccurs.slice(1);
		const schedules = [];
		for (const trans of baseOccur.transactions) {
			const threshold = getApproxNumberThreshold(trans.amount);
			const payee = trans.payee;
			const found = occurs.map((occur) => {
				let matched = occur.transactions.find((t) => t.amount >= trans.amount - threshold && t.amount <= trans.amount + threshold);
				matched = matched && matched.payee === payee ? matched : null;
				if (matched) return {
					trans: matched,
					rank: getRank(occur.date, matched.date)
				};
				return null;
			});
			if (found.indexOf(null) !== -1) continue;
			const rank = found.reduce((total, match) => total + match.rank, getRank(baseOccur.date, trans.date));
			const exactAmount = found.reduce((exact, match) => exact && match.trans.amount === trans.amount, true);
			schedules.push({
				rank,
				amount: trans.amount,
				account: trans.account,
				payee: trans.payee,
				date: config,
				exactDate: rank === allOccurs.length,
				exactAmount
			});
		}
		return schedules;
	}
	async function schedulesForPattern(baseStart, numDays, baseConfig, accountId) {
		let schedules = [];
		for (let i = 0; i < numDays; i++) {
			const start = addDays$1(baseStart, i);
			let config;
			if (typeof baseConfig === "function") {
				config = baseConfig(start);
				if (config === false) continue;
			} else config = {
				...baseConfig,
				start
			};
			config.start = dayFromDate(config.start);
			const data = [];
			const dates = takeDates(config);
			for (const date of dates) data.push({
				date: dayFromDate(date),
				transactions: await getTransactions$1(date, accountId)
			});
			schedules = schedules.concat(matchSchedules(data, config));
		}
		return schedules;
	}
	async function weekly(startDate, accountId) {
		return schedulesForPattern(subWeeks$1(parseDate(startDate), 4), 14, { frequency: "weekly" }, accountId);
	}
	async function every2weeks(startDate, accountId) {
		return schedulesForPattern(subWeeks$1(parseDate(startDate), 7), 14, {
			frequency: "weekly",
			interval: 2
		}, accountId);
	}
	async function monthly(startDate, accountId) {
		return schedulesForPattern(subMonths$1(parseDate(startDate), 4), 62, (start) => {
			if (getDate(start) > 28) return false;
			return {
				start,
				frequency: "monthly"
			};
		}, accountId);
	}
	async function monthlyLastDay(startDate, accountId) {
		const s1 = await schedulesForPattern(subMonths$1(parseDate(startDate), 3), 1, {
			frequency: "monthly",
			patterns: [{
				type: "day",
				value: -1
			}]
		}, accountId);
		const s2 = await schedulesForPattern(subMonths$1(parseDate(startDate), 4), 1, {
			frequency: "monthly",
			patterns: [{
				type: "day",
				value: -1
			}]
		}, accountId);
		return s1.concat(s2);
	}
	async function monthly1stor3rd(startDate, accountId) {
		return schedulesForPattern(subWeeks$1(parseDate(startDate), 8), 14, (start) => {
			const dayValue = format$2(/* @__PURE__ */ new Date(), "iiii").slice(0, 2).toUpperCase();
			return {
				start,
				frequency: "monthly",
				patterns: [{
					type: dayValue,
					value: 1
				}, {
					type: dayValue,
					value: 3
				}]
			};
		}, accountId);
	}
	async function monthly2ndor4th(startDate, accountId) {
		return schedulesForPattern(subMonths$1(parseDate(startDate), 8), 14, (start) => {
			const dayValue = format$2(/* @__PURE__ */ new Date(), "iiii").slice(0, 2).toUpperCase();
			return {
				start,
				frequency: "monthly",
				patterns: [{
					type: dayValue,
					value: 2
				}, {
					type: dayValue,
					value: 4
				}]
			};
		}, accountId);
	}
	async function findStartDate(schedule) {
		const conditions = schedule._conditions;
		let currentConfig = conditions.find((c) => c.field === "date").value;
		while (true) {
			const prevConfig = currentConfig;
			currentConfig = { ...prevConfig };
			switch (currentConfig.frequency) {
				case "weekly":
					currentConfig.start = dayFromDate(subWeeks$1(parseDate(currentConfig.start), currentConfig.interval || 1));
					break;
				case "monthly":
					currentConfig.start = dayFromDate(subMonths$1(parseDate(currentConfig.start), currentConfig.interval || 1));
					break;
				case "yearly":
					currentConfig.start = dayFromDate(subYears(parseDate(currentConfig.start), currentConfig.interval || 1));
					break;
				default: throw new Error("findStartDate: invalid frequency");
			}
			const { filters, errors } = conditionsToAQL(conditions.map((c) => c.field === "date" ? {
				...c,
				value: currentConfig
			} : c), { recurDateBounds: 1 });
			if (errors.length > 0) {
				currentConfig = null;
				break;
			}
			const { data } = await aqlQuery(q("transactions").filter({ $and: filters }).select("*"));
			if (data.length === 0) {
				currentConfig = prevConfig;
				break;
			}
		}
		if (currentConfig) return {
			...schedule,
			date: currentConfig,
			_conditions: conditions.map((c) => c.field === "date" ? {
				...c,
				value: currentConfig
			} : c)
		};
		return schedule;
	}
	async function findSchedules() {
		const { data: accounts } = await aqlQuery(q("accounts").filter({ closed: false }).select("*"));
		let allSchedules = [];
		for (const account of accounts) {
			const latestTrans = await first$2("SELECT date FROM v_transactions WHERE account = ? AND parent_id IS NULL ORDER BY date DESC LIMIT 1", [account.id]);
			if (latestTrans) {
				const latestDate = fromDateRepr(latestTrans.date);
				allSchedules = allSchedules.concat(await weekly(latestDate, account.id), await every2weeks(latestDate, account.id), await monthly(latestDate, account.id), await monthlyLastDay(latestDate, account.id), await monthly1stor3rd(latestDate, account.id), await monthly2ndor4th(latestDate, account.id));
			}
		}
		const schedules = [...groupBy$1(allSchedules, "payee").entries()].map(([, schedules]) => {
			schedules.sort((s1, s2) => s2.rank - s1.rank);
			const winner = schedules[0];
			return {
				id: v4(),
				account: winner.account,
				payee: winner.payee,
				date: winner.date,
				amount: winner.amount,
				_conditions: [
					{
						op: "is",
						field: "account",
						value: winner.account
					},
					{
						op: "is",
						field: "payee",
						value: winner.payee
					},
					{
						op: winner.exactDate ? "is" : "isapprox",
						field: "date",
						value: winner.date
					},
					{
						op: winner.exactAmount ? "is" : "isapprox",
						field: "amount",
						value: winner.amount
					}
				]
			};
		});
		const finalized = [];
		for (const schedule of schedules) finalized.push(await findStartDate(schedule));
		return finalized;
	}
	//#endregion
	//#region ../loot-core/src/server/schedules/app.ts
	function zip(arr1, arr2) {
		const result = [];
		for (let i = 0; i < arr1.length; i++) result.push([arr1[i], arr2[i]]);
		return result;
	}
	function areConditionValuesEqual(left, right) {
		if (left === right) return true;
		if (left == null || right == null) return left === right;
		if (Array.isArray(left) || Array.isArray(right)) return Array.isArray(left) && Array.isArray(right) && left.length === right.length && left.every((value, index) => areConditionValuesEqual(value, right[index]));
		if (typeof left === "object" && typeof right === "object") {
			const leftKeys = Object.keys(left).sort();
			const rightKeys = Object.keys(right).sort();
			return leftKeys.length === rightKeys.length && leftKeys.every((key, index) => {
				const rightKey = rightKeys[index];
				return key === rightKey && areConditionValuesEqual(left[key], right[rightKey]);
			});
		}
		return false;
	}
	function areScheduleConditionsEqual(left, right) {
		if (left == null || right == null) return left === right;
		const { type: _leftType, ...leftCondition } = left;
		const { type: _rightType, ...rightCondition } = right;
		return areConditionValuesEqual(leftCondition, rightCondition);
	}
	function updateConditions(conditions, newConditions) {
		const scheduleConds = extractScheduleConds(conditions);
		const newScheduleConds = extractScheduleConds(newConditions);
		const replacements = zip(Object.values(scheduleConds), Object.values(newScheduleConds));
		const updated = conditions.map((cond) => {
			const r = replacements.find((r) => cond === r[0]);
			return r && r[1] ? r[1] : cond;
		});
		const added = replacements.filter((x) => x[0] == null && x[1] != null).map((x) => x[1]);
		return updated.concat(added);
	}
	async function getRuleForSchedule(id) {
		if (id == null) throw new Error("Schedule not attached to a rule");
		const { data: ruleId } = await aqlQuery(q("schedules").filter({ id }).calculate("rule"));
		return getRules$1().find((rule) => rule.id === ruleId);
	}
	async function fixRuleForSchedule(id) {
		const { data: ruleId } = await aqlQuery(q("schedules").filter({ id }).calculate("rule"));
		if (ruleId) await delete_("rules", ruleId);
		const newId = await insertRule({
			stage: null,
			conditionsOp: "and",
			conditions: [{
				op: "isapprox",
				field: "date",
				value: currentDay()
			}, {
				op: "isapprox",
				field: "amount",
				value: 0
			}],
			actions: [{
				op: "link-schedule",
				value: id
			}]
		});
		await updateWithSchema("schedules", {
			id,
			rule: newId
		});
		return getRules$1().find((rule) => rule.id === newId);
	}
	async function setNextDate({ id, start, conditions, reset, skipRequested }) {
		if (conditions == null) {
			const rule = await getRuleForSchedule(id);
			if (rule == null) throw new Error("No rule found for schedule");
			conditions = rule.serialize().conditions;
		}
		const { date: dateCond } = extractScheduleConds(conditions);
		let { data: nextDate } = await aqlQuery(q("schedules").filter({ id }).calculate("next_date"));
		if (skipRequested === true) {
			const skipWeekend = dateCond.value?.skipWeekend;
			if (dateCond.value?.weekendSolveMode === "before" && skipWeekend === true) {
				const parsedNextDate = parseDate(nextDate);
				if (isFriday(parsedNextDate) || isWeekend(parsedNextDate)) nextDate = dayFromDate(nextMonday(parsedNextDate));
			}
		}
		if (dateCond) {
			const newNextDate = getNextDate(dateCond, start ? start(nextDate) : /* @__PURE__ */ new Date());
			if (newNextDate != null && newNextDate !== nextDate) {
				const nd = await first$2("SELECT id, base_next_date_ts FROM schedules_next_date WHERE schedule_id = ?", [id]);
				await update("schedules_next_date", reset ? {
					id: nd.id,
					base_next_date: toDateRepr(newNextDate),
					base_next_date_ts: Date.now()
				} : {
					id: nd.id,
					local_next_date: toDateRepr(newNextDate),
					local_next_date_ts: nd.base_next_date_ts
				});
			}
		}
	}
	async function checkIfScheduleExists(name, scheduleId) {
		const idForName = await first$2("SELECT id from schedules WHERE tombstone = 0 AND name = ?", [name]);
		if (idForName == null) return false;
		if (scheduleId) return idForName["id"] !== scheduleId;
		return true;
	}
	async function createSchedule({ schedule = null, conditions = [] } = {}) {
		const scheduleId = schedule?.id || v4();
		const { date: dateCond } = extractScheduleConds(conditions);
		if (dateCond == null) throw new Error("A date condition is required to create a schedule");
		if (dateCond.value == null) throw new Error("Date is required");
		const nextDate = getNextDate(dateCond);
		const nextDateRepr = nextDate ? toDateRepr(nextDate) : null;
		if (schedule) if (schedule.name) {
			if (await checkIfScheduleExists(schedule.name, scheduleId)) throw new Error("Cannot create schedules with the same name");
		} else schedule.name = null;
		const ruleId = await insertRule({
			stage: null,
			conditionsOp: "and",
			conditions,
			actions: [{
				op: "link-schedule",
				value: scheduleId
			}]
		});
		const now = Date.now();
		await insertWithUUID("schedules_next_date", {
			schedule_id: scheduleId,
			local_next_date: nextDateRepr,
			local_next_date_ts: now,
			base_next_date: nextDateRepr,
			base_next_date_ts: now
		});
		await insertWithSchema("schedules", {
			...schedule,
			id: scheduleId,
			rule: ruleId
		});
		return scheduleId;
	}
	async function updateSchedule({ schedule, conditions, resetNextDate }) {
		if (schedule.rule) throw new Error("You cannot change the rule of a schedule");
		let rule;
		if (conditions) {
			const { date: dateCond } = extractScheduleConds(conditions);
			if (dateCond && dateCond.value == null) throw new Error("Date is required");
			rule = await getRuleForSchedule(schedule.id);
			if (rule == null) rule = await fixRuleForSchedule(schedule.id);
		}
		await batchMessages(async () => {
			if (conditions) {
				const oldConditions = rule.serialize().conditions;
				const newConditions = updateConditions(oldConditions, conditions);
				await updateRule$1({
					id: rule.id,
					conditions: newConditions
				});
				const stripType = ({ type: _type, ...fields }) => fields;
				if (resetNextDate || !areScheduleConditionsEqual(oldConditions.find((c) => c.field === "account"), newConditions.find((c) => c.field === "account")) || !areConditionValuesEqual(stripType(oldConditions.find((c) => c.field === "date") || {}), stripType(newConditions.find((c) => c.field === "date") || {}))) await setNextDate({
					id: schedule.id,
					conditions: newConditions,
					reset: true
				});
			} else if (resetNextDate) await setNextDate({
				id: schedule.id,
				reset: true
			});
			await updateWithSchema("schedules", schedule);
		});
		return schedule.id;
	}
	async function deleteSchedule({ id }) {
		const { data: ruleId } = await aqlQuery(q("schedules").filter({ id }).calculate("rule"));
		await batchMessages(async () => {
			await delete_("rules", ruleId);
			await delete_("schedules", id);
		});
	}
	async function skipNextDate({ id }) {
		return setNextDate({
			id,
			start: (nextDate) => {
				return addDays$1(parseDate(nextDate), 1);
			},
			skipRequested: true
		});
	}
	function discoverSchedules() {
		return findSchedules();
	}
	async function getUpcomingDates({ config, count }) {
		const rules = recurConfigToRSchedule(config);
		try {
			return new RSchedule({ rrules: rules }).occurrences({
				start: startOfDay(/* @__PURE__ */ new Date()),
				take: count
			}).toArray().map((date) => config.skipWeekend ? getDateWithSkippedWeekend(date.date, config.weekendSolveMode) : date.date).map((date) => dayFromDate(date));
		} catch (err) {
			captureBreadcrumb(config);
			throw err;
		}
	}
	function onRuleUpdate(rule) {
		const { actions, conditions } = rule instanceof Rule ? rule.serialize() : ruleModel.toJS(rule);
		if (actions && actions.find((a) => a.op === "link-schedule")) {
			const scheduleId = actions.find((a) => a.op === "link-schedule").value;
			if (scheduleId) {
				const conds = extractScheduleConds(conditions);
				const payeeIdx = conditions.findIndex((c) => c === conds.payee);
				const accountIdx = conditions.findIndex((c) => c === conds.account);
				const amountIdx = conditions.findIndex((c) => c === conds.amount);
				const dateIdx = conditions.findIndex((c) => c === conds.date);
				runQuery("INSERT OR REPLACE INTO schedules_json_paths (schedule_id, payee, account, amount, date) VALUES (?, ?, ?, ?, ?)", [
					scheduleId,
					payeeIdx === -1 ? null : `$[${payeeIdx}]`,
					accountIdx === -1 ? null : `$[${accountIdx}]`,
					amountIdx === -1 ? null : `$[${amountIdx}]`,
					dateIdx === -1 ? null : `$[${dateIdx}]`
				]);
			}
		}
	}
	function trackJSONPaths() {
		transaction(() => {
			getRules$1().forEach((rule) => {
				onRuleUpdate(rule);
			});
		});
		return addSyncListener(onApplySync);
	}
	function onApplySync(oldValues, newValues) {
		newValues.forEach((items, table) => {
			if (table === "rules") items.forEach((newValue) => {
				onRuleUpdate(newValue);
			});
		});
	}
	async function postTransactionForSchedule({ id, today }) {
		const { data } = await aqlQuery(q("schedules").filter({ id }).select("*"));
		const schedule = data[0];
		if (schedule == null || schedule._account == null) return;
		const transaction = {
			payee: schedule._payee,
			account: schedule._account,
			amount: getScheduledAmount(schedule._amount),
			date: today ? currentDay() : schedule.next_date,
			schedule: schedule.id,
			cleared: false
		};
		if (transaction.account) await addTransactions(transaction.account, [transaction]);
	}
	async function advanceSchedulesService(syncSuccess) {
		const { data: schedules } = await aqlQuery(q("schedules").filter({
			completed: false,
			"_account.closed": false
		}).select("*"));
		const { data: hasTransData } = await aqlQuery(getHasTransactionsQuery(schedules));
		const hasTrans = new Set(hasTransData.filter(Boolean).map((row) => row.schedule));
		const failedToPost = [];
		let didPost = false;
		const { data: upcomingLength } = await aqlQuery(q("preferences").filter({ id: "upcomingScheduledTransactionLength" }).select("value"));
		for (const schedule of schedules) {
			const status = getStatus(schedule.next_date, schedule.completed, hasTrans.has(schedule.id), schedule.custom_upcoming_length ?? upcomingLength[0]?.value ?? "7");
			if (status === "paid") {
				if (schedule._date) {
					if (schedule._date.frequency) try {
						await setNextDate({ id: schedule.id });
					} catch {}
					else if (schedule._date < currentDay()) await updateSchedule({ schedule: {
						id: schedule.id,
						completed: true
					} });
				}
			} else if ((status === "due" || status === "missed") && schedule.posts_transaction && schedule._account) if (syncSuccess) {
				await postTransactionForSchedule({ id: schedule.id });
				didPost = true;
			} else failedToPost.push(schedule._payee);
		}
		if (failedToPost.length > 0) send$1("schedules-offline");
		else if (didPost) send$1("sync-event", {
			type: "success",
			tables: ["transactions"],
			syncDisabled: false
		});
	}
	var app$16 = createApp();
	app$16.method("schedule/create", mutator(undoable(createSchedule)));
	app$16.method("schedule/update", mutator(undoable(updateSchedule)));
	app$16.method("schedule/delete", mutator(undoable(deleteSchedule)));
	app$16.method("schedule/skip-next-date", mutator(undoable(skipNextDate)));
	app$16.method("schedule/post-transaction", mutator(undoable(postTransactionForSchedule)));
	app$16.method("schedule/force-run-service", mutator(() => advanceSchedulesService(true)));
	app$16.method("schedule/discover", discoverSchedules);
	app$16.method("schedule/get-upcoming-dates", getUpcomingDates);
	app$16.service(trackJSONPaths);
	app$16.events.on("sync", ({ type }) => {
		if ((type === "success" || type === "error" || type === "unauthorized") && getPrefs()) {
			if (!getDatabase()) {
				logger.info("database is not available, skipping schedule service");
				return;
			}
			const { lastScheduleRun } = getPrefs();
			if (lastScheduleRun !== currentDay()) {
				runMutator(() => advanceSchedulesService(type === "success"));
				if (type === "success") savePrefs({ lastScheduleRun: currentDay() });
			}
		}
	});
	//#endregion
	//#region ../loot-core/src/server/budget/schedule-template.ts
	async function createScheduleList(templates, current_month, category, currency) {
		const t = [];
		const errors = [];
		const accounts = await getAccounts$2() ?? [];
		const accountsMap = new Map(accounts.map((a) => [a.id, a]));
		for (const template of templates) {
			const { id: sid, completed } = await first$2("SELECT id, completed FROM schedules WHERE TRIM(name) = ? AND tombstone = 0", [template.name]);
			const rule = await getRuleForSchedule(sid);
			const conditions = rule.serialize().conditions;
			const { date: dateConditions, amount: amountCondition } = extractScheduleConds(conditions);
			let scheduleAmount = amountCondition.op === "isbetween" ? Math.round(amountCondition.value.num1 + amountCondition.value.num2) / 2 : amountCondition.value;
			if (template.adjustment !== void 0 && template.adjustmentType) switch (template.adjustmentType) {
				case "percent": {
					const adjustmentFactor = 1 + template.adjustment / 100;
					scheduleAmount = scheduleAmount * adjustmentFactor;
					break;
				}
				case "fixed":
					scheduleAmount += (scheduleAmount < 0 ? -1 : 1) * amountToInteger(template.adjustment, currency.decimalPlaces);
					break;
				default:
			}
			scheduleAmount = Math.round(scheduleAmount);
			const next_date_string = getNextDate(dateConditions, _parse(current_month));
			const formulaStrings = collectFormulasFromActions(rule.actions);
			const scheduleRuleContext = {
				amount: scheduleAmount,
				category: category.id,
				subtransactions: [],
				...next_date_string ? { date: next_date_string } : {},
				id: null,
				sort_order: null
			};
			const balanceOfPrefetched = await prefetchBalanceOfForTransaction(scheduleRuleContext, accountsMap, formulaStrings);
			const { amount: postRuleAmount, subtransactions } = rule.execActions({
				...scheduleRuleContext,
				_balanceOfPrefetched: balanceOfPrefetched
			});
			const categorySubtransactions = subtransactions?.filter((t) => t.category === category.id);
			const target = (category.is_income ? 1 : -1) * (categorySubtransactions?.length ? categorySubtransactions.reduce((acc, t) => acc + t.amount, 0) : postRuleAmount ?? scheduleAmount);
			const target_interval = dateConditions.value.interval ? dateConditions.value.interval : 1;
			const target_frequency = dateConditions.value.frequency;
			const isRepeating = Object(dateConditions.value) === dateConditions.value && "frequency" in dateConditions.value;
			const num_months = differenceInCalendarMonths(next_date_string, current_month);
			if (num_months < 0) errors.push(`Schedule ${template.name} is in the Past.`);
			else {
				t.push({
					target,
					next_date_string,
					target_interval,
					target_frequency,
					num_months,
					completed,
					full: template.full === null ? false : template.full,
					repeat: isRepeating,
					name: template.name
				});
				if (!completed) {
					if (isRepeating) {
						let monthlyTarget = 0;
						const nextMonth = addMonths(current_month, t[t.length - 1].num_months + 1);
						let nextBaseDate = getNextDate(dateConditions, _parse(current_month), true);
						let nextDate = dateConditions.value.skipWeekend ? dayFromDate(getDateWithSkippedWeekend(_parse(nextBaseDate), dateConditions.value.weekendSolveMode)) : nextBaseDate;
						while (nextDate < nextMonth) {
							monthlyTarget += -target;
							const currentDate = nextBaseDate;
							nextBaseDate = getNextDate(dateConditions, _parse(addDays(nextBaseDate, 1)), true);
							nextDate = dateConditions.value.skipWeekend ? dayFromDate(getDateWithSkippedWeekend(_parse(nextBaseDate), dateConditions.value.weekendSolveMode)) : nextBaseDate;
							if (!differenceInCalendarDays(nextBaseDate, currentDate)) break;
						}
						t[t.length - 1].target = -monthlyTarget;
					}
				} else errors.push(`Schedule ${template.name} is not active during the month in question.`);
			}
		}
		return {
			t: t.filter((c) => c.completed === 0),
			errors
		};
	}
	function getPayMonthOfTotal(t) {
		let total = 0;
		const schedules = t.filter((c) => c.num_months === 0);
		for (const schedule of schedules) total += schedule.target;
		return total;
	}
	function getSinkingContributionBreakdown(t, remainder, last_month_balance) {
		let total = 0;
		const perSchedule = /* @__PURE__ */ new Map();
		for (const [index, schedule] of t.entries()) {
			remainder = index === 0 ? schedule.target - last_month_balance : schedule.target - remainder;
			let tg = 0;
			if (remainder >= 0) {
				tg = remainder;
				remainder = 0;
			} else {
				tg = 0;
				remainder = Math.abs(remainder);
			}
			const contribution = tg / (schedule.num_months + 1);
			total += contribution;
			perSchedule.set(schedule.name.trim(), (perSchedule.get(schedule.name.trim()) ?? 0) + contribution);
		}
		return {
			total,
			perSchedule
		};
	}
	function getMonthlyBaseContribution(schedule) {
		let prevDate;
		let intervalMonths;
		switch (schedule.target_frequency) {
			case "yearly": return schedule.target / schedule.target_interval / 12;
			case "monthly": return schedule.target / schedule.target_interval;
			case "weekly":
				prevDate = subWeeks(schedule.next_date_string, schedule.target_interval);
				intervalMonths = differenceInCalendarMonths(schedule.next_date_string, prevDate);
				if (intervalMonths === 0) intervalMonths = 1;
				return schedule.target / intervalMonths;
			case "daily":
				prevDate = subDays(schedule.next_date_string, schedule.target_interval);
				intervalMonths = differenceInCalendarMonths(schedule.next_date_string, prevDate);
				if (intervalMonths === 0) intervalMonths = 1;
				return schedule.target / intervalMonths;
			default: return schedule.target / schedule.target_interval;
		}
	}
	function getSinkingBaseContributionTotal(t) {
		let total = 0;
		for (const schedule of t) total += getMonthlyBaseContribution(schedule);
		return total;
	}
	function getSinkingTotal(t) {
		let total = 0;
		for (const schedule of t) total += schedule.target;
		return total;
	}
	async function runSchedule(template_lines, current_month, balance, remainder, last_month_balance, to_budget, errors, category, currency) {
		const t = await createScheduleList(template_lines.filter((t) => t.type === "schedule"), current_month, category, currency);
		errors = errors.concat(t.errors);
		const isPayMonthOf = (c) => c.full || (c.target_frequency === "monthly" || !c.target_frequency) && c.target_interval === 1 && c.num_months === 0 || c.target_frequency === "weekly" && c.target_interval <= 4 || c.target_frequency === "daily" && c.target_interval <= 31 || isTrackingBudget();
		const isSubMonthly = (c) => c.target_frequency === "weekly" || c.target_frequency === "daily";
		const t_payMonthOf = t.t.filter(isPayMonthOf);
		const t_sinking = t.t.filter((c) => !isPayMonthOf(c)).sort((a, b) => a.next_date_string.localeCompare(b.next_date_string));
		const numSubMonthly = t.t.filter(isSubMonthly).length;
		const totalPayMonthOf = getPayMonthOfTotal(t_payMonthOf);
		const totalSinking = getSinkingTotal(t_sinking);
		const totalSinkingBaseContribution = getSinkingBaseContributionTotal(t_sinking);
		const lastMonthGoal = await getSheetValue(sheetForMonth(subMonths(current_month, 1)), `goal-${category.id}`);
		const perScheduleMonthly = /* @__PURE__ */ new Map();
		const addContribution = (name, amount) => {
			perScheduleMonthly.set(name.trim(), (perScheduleMonthly.get(name.trim()) ?? 0) + amount);
		};
		if (balance >= totalSinking + totalPayMonthOf || lastMonthGoal < totalSinking + totalPayMonthOf && lastMonthGoal !== 0 && balance >= lastMonthGoal && numSubMonthly > 0) {
			to_budget += Math.round(totalPayMonthOf + totalSinkingBaseContribution);
			for (const c of t_payMonthOf) addContribution(c.name, c.target);
			for (const c of t_sinking) addContribution(c.name, getMonthlyBaseContribution(c));
		} else {
			const { total: totalSinkingContribution, perSchedule: sinkingPerSchedule } = getSinkingContributionBreakdown(t_sinking, remainder, last_month_balance);
			if (t_sinking.length === 0) to_budget += Math.round(totalPayMonthOf + totalSinkingContribution) - last_month_balance;
			else to_budget += Math.round(totalPayMonthOf + totalSinkingContribution);
			for (const c of t_payMonthOf) addContribution(c.name, c.target);
			for (const [name, amount] of sinkingPerSchedule) addContribution(name, amount);
		}
		return {
			to_budget,
			errors,
			remainder,
			perScheduleMonthly
		};
	}
	//#endregion
	//#region ../loot-core/src/server/budget/goal-template.pegjs
	var peg$SyntaxError = class extends SyntaxError {
		constructor(message, expected, found, location) {
			super(message);
			this.expected = expected;
			this.found = found;
			this.location = location;
			this.name = "SyntaxError";
		}
		format(sources) {
			let str = "Error: " + this.message;
			if (this.location) {
				let src = null;
				const st = sources.find((s) => s.source === this.location.source);
				if (st) src = st.text.split(/\r\n|\n|\r/g);
				const s = this.location.start;
				const offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
				const loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
				if (src) {
					const e = this.location.end;
					const filler = "".padEnd(offset_s.line.toString().length, " ");
					const line = src[s.line - 1];
					const hatLen = (s.line === e.line ? e.column : line.length + 1) - s.column || 1;
					str += "\n --> " + loc + "\n" + filler + " |\n" + offset_s.line + " | " + line + "\n" + filler + " | " + "".padEnd(s.column - 1, " ") + "".padEnd(hatLen, "^");
				} else str += "\n at " + loc;
			}
			return str;
		}
		static buildMessage(expected, found) {
			function hex(ch) {
				return ch.codePointAt(0).toString(16).toUpperCase();
			}
			const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode") ? /* @__PURE__ */ new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu") : null;
			function unicodeEscape(s) {
				if (nonPrintable) return s.replace(nonPrintable, (ch) => "\\u{" + hex(ch) + "}");
				return s;
			}
			function literalEscape(s) {
				return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
			}
			function classEscape(s) {
				return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex(ch)));
			}
			const DESCRIBE_EXPECTATION_FNS = {
				literal(expectation) {
					return "\"" + literalEscape(expectation.text) + "\"";
				},
				class(expectation) {
					const escapedParts = expectation.parts.map((part) => Array.isArray(part) ? classEscape(part[0]) + "-" + classEscape(part[1]) : classEscape(part));
					return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]" + (expectation.unicode ? "u" : "");
				},
				any() {
					return "any character";
				},
				end() {
					return "end of input";
				},
				other(expectation) {
					return expectation.description;
				}
			};
			function describeExpectation(expectation) {
				return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
			}
			function describeExpected(expected) {
				const descriptions = expected.map(describeExpectation);
				descriptions.sort();
				if (descriptions.length > 0) {
					let j = 1;
					for (let i = 1; i < descriptions.length; i++) if (descriptions[i - 1] !== descriptions[i]) {
						descriptions[j] = descriptions[i];
						j++;
					}
					descriptions.length = j;
				}
				switch (descriptions.length) {
					case 1: return descriptions[0];
					case 2: return descriptions[0] + " or " + descriptions[1];
					default: return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
				}
			}
			function describeFound(found) {
				return found ? "\"" + literalEscape(found) + "\"" : "end of input";
			}
			return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
		}
	};
	function peg$parse(input, options) {
		options = options !== void 0 ? options : {};
		const peg$FAILED = {};
		const peg$source = options.grammarSource;
		const peg$startRuleFunctions = { expr: peg$parseexpr };
		let peg$startRuleFunction = peg$parseexpr;
		const peg$c0 = "average";
		const peg$c1 = "months";
		const peg$c2 = "copy from";
		const peg$c3 = "months ago";
		const peg$c4 = "[";
		const peg$c5 = "]";
		const peg$c6 = "increase";
		const peg$c7 = "decrease";
		const peg$c8 = ".";
		const peg$c9 = "%";
		const peg$c10 = "month";
		const peg$c11 = "year";
		const peg$c12 = "years";
		const peg$c13 = "per week starting";
		const peg$c14 = "per day";
		const peg$c15 = "previous";
		const peg$c16 = "day";
		const peg$c17 = "days";
		const peg$c18 = "spend";
		const peg$c19 = "from";
		const peg$c20 = "week";
		const peg$c21 = "weeks";
		const peg$c22 = "by";
		const peg$c23 = "of";
		const peg$c24 = "repeat";
		const peg$c25 = "every";
		const peg$c26 = "starting";
		const peg$c27 = "up";
		const peg$c28 = "to";
		const peg$c29 = "hold";
		const peg$c30 = "schedule";
		const peg$c31 = "full";
		const peg$c32 = "-";
		const peg$c33 = "remainder";
		const peg$c34 = "#template";
		const peg$c35 = "#goal";
		const peg$r0 = /^[ \t]/;
		const peg$r1 = /^[0-9]/;
		const peg$r2 = /^[1-9]/;
		const peg$r3 = /^[^ \t\r\n]/;
		const peg$r4 = /^[^\r\n]/;
		const peg$r5 = /^[^\r\n\t]/;
		const peg$e0 = peg$literalExpectation("average", true);
		const peg$e1 = peg$literalExpectation("months", true);
		const peg$e2 = peg$literalExpectation("copy from", true);
		const peg$e3 = peg$literalExpectation("months ago", true);
		const peg$e4 = peg$literalExpectation("[", false);
		const peg$e5 = peg$literalExpectation("]", false);
		const peg$e6 = peg$literalExpectation("increase", true);
		const peg$e7 = peg$literalExpectation("decrease", true);
		const peg$e8 = peg$literalExpectation(".", false);
		const peg$e9 = peg$literalExpectation("%", false);
		const peg$e10 = peg$otherExpectation("repeat interval");
		const peg$e11 = peg$literalExpectation("month", true);
		const peg$e12 = peg$literalExpectation("year", true);
		const peg$e13 = peg$literalExpectation("years", true);
		const peg$e14 = peg$literalExpectation("per week starting", true);
		const peg$e15 = peg$literalExpectation("per day", true);
		const peg$e16 = peg$literalExpectation("previous", true);
		const peg$e17 = peg$literalExpectation("day", true);
		const peg$e18 = peg$literalExpectation("days", true);
		const peg$e19 = peg$literalExpectation("spend", true);
		const peg$e20 = peg$literalExpectation("from", true);
		const peg$e21 = peg$literalExpectation("week", true);
		const peg$e22 = peg$literalExpectation("weeks", true);
		const peg$e23 = peg$literalExpectation("by", true);
		const peg$e24 = peg$literalExpectation("of", true);
		const peg$e25 = peg$literalExpectation("repeat", true);
		const peg$e26 = peg$literalExpectation("every", true);
		const peg$e27 = peg$literalExpectation("starting", true);
		const peg$e28 = peg$literalExpectation("up", true);
		const peg$e29 = peg$literalExpectation("to", true);
		const peg$e30 = peg$literalExpectation("hold", true);
		const peg$e31 = peg$literalExpectation("schedule", true);
		const peg$e32 = peg$literalExpectation("full", true);
		const peg$e33 = peg$literalExpectation("-", true);
		const peg$e34 = peg$literalExpectation("remainder", true);
		const peg$e35 = peg$literalExpectation("#template", false);
		const peg$e36 = peg$literalExpectation("#goal", true);
		const peg$e37 = peg$classExpectation([" ", "	"], false, false, false);
		const peg$e38 = peg$otherExpectation("digit");
		const peg$e39 = peg$classExpectation([["0", "9"]], false, false, false);
		const peg$e40 = peg$otherExpectation("number");
		const peg$e41 = peg$classExpectation([["1", "9"]], false, false, false);
		const peg$e42 = peg$otherExpectation("amount");
		const peg$e43 = peg$literalExpectation("-", false);
		const peg$e44 = peg$otherExpectation("percentage");
		const peg$e45 = peg$otherExpectation("year");
		const peg$e46 = peg$otherExpectation("month");
		const peg$e47 = peg$otherExpectation("day");
		const peg$e48 = peg$otherExpectation("currency symbol");
		const peg$e49 = peg$anyExpectation();
		const peg$e50 = peg$classExpectation([
			" ",
			"	",
			"\r",
			"\n"
		], true, false, false);
		const peg$e51 = peg$classExpectation(["\r", "\n"], true, false, false);
		const peg$e52 = peg$otherExpectation("Name");
		const peg$e53 = peg$classExpectation([
			"\r",
			"\n",
			"	"
		], true, false, false);
		function peg$f0(template, percentOf, category) {
			return {
				type: "percentage",
				percent: +percentOf.percent,
				previous: percentOf.prev,
				category,
				priority: template.priority,
				directive: template.directive
			};
		}
		function peg$f1(template, amount, period, starting, limit) {
			return {
				type: "periodic",
				amount,
				period,
				starting,
				limit,
				priority: template.priority,
				directive: template.directive
			};
		}
		function peg$f2(template, amount, month, from, repeat) {
			return {
				type: from ? "spend" : "by",
				amount,
				month,
				...repeat ? repeat[3] : {},
				from,
				priority: template.priority,
				directive: template.directive
			};
		}
		function peg$f3(template, monthly, limit) {
			return {
				type: "simple",
				monthly,
				limit,
				priority: template.priority,
				directive: template.directive
			};
		}
		function peg$f4(template, limit) {
			return {
				type: "simple",
				monthly: null,
				limit,
				priority: template.priority,
				directive: template.directive
			};
		}
		function peg$f5(template, schedule, full, name, modifiers) {
			return {
				type: "schedule",
				name: name.trim(),
				priority: template.priority,
				directive: template.directive,
				full,
				adjustment: modifiers?.adjustment,
				adjustmentType: modifiers?.adjustmentType
			};
		}
		function peg$f6(template, remainder, limit) {
			return {
				type: "remainder",
				priority: null,
				directive: template.directive,
				weight: remainder,
				limit
			};
		}
		function peg$f7(template, amount, modifiers) {
			return {
				type: "average",
				numMonths: +amount,
				priority: template.priority,
				directive: template.directive,
				adjustment: modifiers?.adjustment,
				adjustmentType: modifiers?.adjustmentType
			};
		}
		function peg$f8(template, lookBack, limit) {
			return {
				type: "copy",
				priority: template.priority,
				directive: template.directive,
				lookBack: +lookBack,
				limit
			};
		}
		function peg$f9(goal, amount) {
			return {
				type: "goal",
				amount,
				priority: null,
				directive: goal
			};
		}
		function peg$f10(modifier) {
			return modifier;
		}
		function peg$f11(op, value) {
			return {
				adjustment: (op.toLowerCase() === "increase" ? 1 : -1) * +value.value,
				adjustmentType: value.type
			};
		}
		function peg$f12(value) {
			return {
				value,
				type: "percent"
			};
		}
		function peg$f13(value) {
			return {
				value,
				type: "fixed"
			};
		}
		function peg$f14() {
			return { annual: false };
		}
		function peg$f15(months) {
			return {
				annual: false,
				repeat: +months
			};
		}
		function peg$f16() {
			return { annual: true };
		}
		function peg$f17(years) {
			return {
				annual: true,
				repeat: +years
			};
		}
		function peg$f18(amount, start, hold) {
			return {
				amount,
				hold,
				period: "weekly",
				start
			};
		}
		function peg$f19(amount, hold) {
			return {
				amount,
				hold,
				period: "daily",
				start: null
			};
		}
		function peg$f20(amount, hold) {
			return {
				amount,
				hold,
				period: "monthly",
				start: null
			};
		}
		function peg$f21(percent) {
			return {
				percent,
				prev: true
			};
		}
		function peg$f22(percent) {
			return {
				percent,
				prev: false
			};
		}
		function peg$f23() {
			return {
				period: "day",
				amount: 1
			};
		}
		function peg$f24(n) {
			return {
				period: "day",
				amount: +n
			};
		}
		function peg$f25() {
			return {
				period: "week",
				amount: 1
			};
		}
		function peg$f26(n) {
			return {
				period: "week",
				amount: +n
			};
		}
		function peg$f27(n) {
			return {
				period: "month",
				amount: +n
			};
		}
		function peg$f28() {
			return {
				period: "year",
				amount: 1
			};
		}
		function peg$f29(n) {
			return {
				period: "year",
				amount: +n
			};
		}
		function peg$f30(month) {
			return month;
		}
		function peg$f31() {
			return true;
		}
		function peg$f32() {
			return text();
		}
		function peg$f33() {
			return true;
		}
		function peg$f34(number) {
			return number;
		}
		function peg$f35(weight) {
			return +weight || 1;
		}
		function peg$f36(priority) {
			return {
				priority: +priority,
				directive: "template"
			};
		}
		function peg$f37() {
			return "goal";
		}
		function peg$f38() {
			return text();
		}
		function peg$f39(amount) {
			return +amount;
		}
		function peg$f40(percent) {
			return percent;
		}
		function peg$f41(symbol) {
			return /\p{Sc}/u.test(symbol);
		}
		function peg$f42() {
			return text().trim();
		}
		function peg$f43() {
			return text();
		}
		let peg$currPos = options.peg$currPos | 0;
		let peg$savedPos = peg$currPos;
		const peg$posDetailsCache = [{
			line: 1,
			column: 1
		}];
		let peg$maxFailPos = peg$currPos;
		let peg$maxFailExpected = options.peg$maxFailExpected || [];
		let peg$silentFails = options.peg$silentFails | 0;
		let peg$result;
		if (options.startRule) {
			if (!(options.startRule in peg$startRuleFunctions)) throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
			peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
		}
		function text() {
			return input.substring(peg$savedPos, peg$currPos);
		}
		function peg$getUnicode(pos = peg$currPos) {
			const cp = input.codePointAt(pos);
			if (cp === void 0) return "";
			return String.fromCodePoint(cp);
		}
		function peg$literalExpectation(text, ignoreCase) {
			return {
				type: "literal",
				text,
				ignoreCase
			};
		}
		function peg$classExpectation(parts, inverted, ignoreCase, unicode) {
			return {
				type: "class",
				parts,
				inverted,
				ignoreCase,
				unicode
			};
		}
		function peg$anyExpectation() {
			return { type: "any" };
		}
		function peg$endExpectation() {
			return { type: "end" };
		}
		function peg$otherExpectation(description) {
			return {
				type: "other",
				description
			};
		}
		function peg$computePosDetails(pos) {
			let details = peg$posDetailsCache[pos];
			let p;
			if (details) return details;
			else {
				if (pos >= peg$posDetailsCache.length) p = peg$posDetailsCache.length - 1;
				else {
					p = pos;
					while (!peg$posDetailsCache[--p]);
				}
				details = peg$posDetailsCache[p];
				details = {
					line: details.line,
					column: details.column
				};
				while (p < pos) {
					if (input.charCodeAt(p) === 10) {
						details.line++;
						details.column = 1;
					} else details.column++;
					p++;
				}
				peg$posDetailsCache[pos] = details;
				return details;
			}
		}
		function peg$computeLocation(startPos, endPos, offset) {
			const startPosDetails = peg$computePosDetails(startPos);
			const endPosDetails = peg$computePosDetails(endPos);
			const res = {
				source: peg$source,
				start: {
					offset: startPos,
					line: startPosDetails.line,
					column: startPosDetails.column
				},
				end: {
					offset: endPos,
					line: endPosDetails.line,
					column: endPosDetails.column
				}
			};
			if (offset && peg$source && typeof peg$source.offset === "function") {
				res.start = peg$source.offset(res.start);
				res.end = peg$source.offset(res.end);
			}
			return res;
		}
		function peg$fail(expected) {
			if (peg$currPos < peg$maxFailPos) return;
			if (peg$currPos > peg$maxFailPos) {
				peg$maxFailPos = peg$currPos;
				peg$maxFailExpected = [];
			}
			peg$maxFailExpected.push(expected);
		}
		function peg$buildStructuredError(expected, found, location) {
			return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
		}
		function peg$parseexpr() {
			let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
			s0 = peg$currPos;
			s1 = peg$parsetemplate();
			if (s1 !== peg$FAILED) {
				s2 = peg$parse_();
				s3 = peg$parsepercentOf();
				if (s3 !== peg$FAILED) {
					s4 = peg$parsename();
					if (s4 !== peg$FAILED) {
						peg$savedPos = s0;
						s0 = peg$f0(s1, s3, s4);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				s1 = peg$parsetemplate();
				if (s1 !== peg$FAILED) {
					s2 = peg$parse_();
					s3 = peg$parseamount();
					if (s3 !== peg$FAILED) {
						s4 = peg$parse_();
						s5 = peg$parserepeatEvery();
						if (s5 !== peg$FAILED) {
							s6 = peg$parse_();
							s7 = peg$parseperiodCount();
							if (s7 !== peg$FAILED) {
								s8 = peg$parse_();
								s9 = peg$parsestarting();
								if (s9 !== peg$FAILED) {
									s10 = peg$parse_();
									s11 = peg$parsedate();
									if (s11 !== peg$FAILED) {
										s12 = peg$parselimit();
										if (s12 === peg$FAILED) s12 = null;
										peg$savedPos = s0;
										s0 = peg$f1(s1, s3, s7, s11, s12);
									} else {
										peg$currPos = s0;
										s0 = peg$FAILED;
									}
								} else {
									peg$currPos = s0;
									s0 = peg$FAILED;
								}
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
				if (s0 === peg$FAILED) {
					s0 = peg$currPos;
					s1 = peg$parsetemplate();
					if (s1 !== peg$FAILED) {
						s2 = peg$parse_();
						s3 = peg$parseamount();
						if (s3 !== peg$FAILED) {
							s4 = peg$parse_();
							s5 = peg$parseby();
							if (s5 !== peg$FAILED) {
								s6 = peg$parse_();
								s7 = peg$parsemonth();
								if (s7 !== peg$FAILED) {
									s8 = peg$parsespendFrom();
									if (s8 === peg$FAILED) s8 = null;
									s9 = peg$currPos;
									s10 = peg$parse_();
									s11 = peg$parserepeatEvery();
									if (s11 !== peg$FAILED) {
										s12 = peg$parse_();
										s13 = peg$parserepeat();
										if (s13 !== peg$FAILED) {
											s10 = [
												s10,
												s11,
												s12,
												s13
											];
											s9 = s10;
										} else {
											peg$currPos = s9;
											s9 = peg$FAILED;
										}
									} else {
										peg$currPos = s9;
										s9 = peg$FAILED;
									}
									if (s9 === peg$FAILED) s9 = null;
									peg$savedPos = s0;
									s0 = peg$f2(s1, s3, s7, s8, s9);
								} else {
									peg$currPos = s0;
									s0 = peg$FAILED;
								}
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
					if (s0 === peg$FAILED) {
						s0 = peg$currPos;
						s1 = peg$parsetemplate();
						if (s1 !== peg$FAILED) {
							s2 = peg$parse_();
							s3 = peg$parseamount();
							if (s3 !== peg$FAILED) {
								s4 = peg$parselimit();
								if (s4 === peg$FAILED) s4 = null;
								peg$savedPos = s0;
								s0 = peg$f3(s1, s3, s4);
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
						if (s0 === peg$FAILED) {
							s0 = peg$currPos;
							s1 = peg$parsetemplate();
							if (s1 !== peg$FAILED) {
								s2 = peg$parse_();
								s3 = peg$parselimit();
								if (s3 !== peg$FAILED) {
									peg$savedPos = s0;
									s0 = peg$f4(s1, s3);
								} else {
									peg$currPos = s0;
									s0 = peg$FAILED;
								}
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
							if (s0 === peg$FAILED) {
								s0 = peg$currPos;
								s1 = peg$parsetemplate();
								if (s1 !== peg$FAILED) {
									s2 = peg$parse_();
									s3 = peg$parseschedule();
									if (s3 !== peg$FAILED) {
										s4 = peg$parse_();
										s5 = peg$parsefull();
										if (s5 === peg$FAILED) s5 = null;
										s6 = peg$parserawScheduleName();
										if (s6 !== peg$FAILED) {
											s7 = peg$parsemodifiers();
											if (s7 === peg$FAILED) s7 = null;
											peg$savedPos = s0;
											s0 = peg$f5(s1, s3, s5, s6, s7);
										} else {
											peg$currPos = s0;
											s0 = peg$FAILED;
										}
									} else {
										peg$currPos = s0;
										s0 = peg$FAILED;
									}
								} else {
									peg$currPos = s0;
									s0 = peg$FAILED;
								}
								if (s0 === peg$FAILED) {
									s0 = peg$currPos;
									s1 = peg$parsetemplate();
									if (s1 !== peg$FAILED) {
										s2 = peg$parse_();
										s3 = peg$parseremainder();
										if (s3 !== peg$FAILED) {
											s4 = peg$parselimit();
											if (s4 === peg$FAILED) s4 = null;
											peg$savedPos = s0;
											s0 = peg$f6(s1, s3, s4);
										} else {
											peg$currPos = s0;
											s0 = peg$FAILED;
										}
									} else {
										peg$currPos = s0;
										s0 = peg$FAILED;
									}
									if (s0 === peg$FAILED) {
										s0 = peg$currPos;
										s1 = peg$parsetemplate();
										if (s1 !== peg$FAILED) {
											s2 = peg$parse_();
											s3 = input.substr(peg$currPos, 7);
											if (s3.toLowerCase() === peg$c0) peg$currPos += 7;
											else {
												s3 = peg$FAILED;
												if (peg$silentFails === 0) peg$fail(peg$e0);
											}
											if (s3 !== peg$FAILED) {
												s4 = peg$parse_();
												s5 = peg$parsepositive();
												if (s5 !== peg$FAILED) {
													s6 = peg$parse_();
													s7 = input.substr(peg$currPos, 6);
													if (s7.toLowerCase() === peg$c1) peg$currPos += 6;
													else {
														s7 = peg$FAILED;
														if (peg$silentFails === 0) peg$fail(peg$e1);
													}
													if (s7 === peg$FAILED) s7 = null;
													s8 = peg$parsemodifiers();
													if (s8 === peg$FAILED) s8 = null;
													peg$savedPos = s0;
													s0 = peg$f7(s1, s5, s8);
												} else {
													peg$currPos = s0;
													s0 = peg$FAILED;
												}
											} else {
												peg$currPos = s0;
												s0 = peg$FAILED;
											}
										} else {
											peg$currPos = s0;
											s0 = peg$FAILED;
										}
										if (s0 === peg$FAILED) {
											s0 = peg$currPos;
											s1 = peg$parsetemplate();
											if (s1 !== peg$FAILED) {
												s2 = peg$parse_();
												s3 = input.substr(peg$currPos, 9);
												if (s3.toLowerCase() === peg$c2) peg$currPos += 9;
												else {
													s3 = peg$FAILED;
													if (peg$silentFails === 0) peg$fail(peg$e2);
												}
												if (s3 !== peg$FAILED) {
													s4 = peg$parse_();
													s5 = peg$parsepositive();
													if (s5 !== peg$FAILED) {
														s6 = peg$parse_();
														s7 = input.substr(peg$currPos, 10);
														if (s7.toLowerCase() === peg$c3) peg$currPos += 10;
														else {
															s7 = peg$FAILED;
															if (peg$silentFails === 0) peg$fail(peg$e3);
														}
														if (s7 !== peg$FAILED) {
															s8 = peg$parselimit();
															if (s8 === peg$FAILED) s8 = null;
															peg$savedPos = s0;
															s0 = peg$f8(s1, s5, s8);
														} else {
															peg$currPos = s0;
															s0 = peg$FAILED;
														}
													} else {
														peg$currPos = s0;
														s0 = peg$FAILED;
													}
												} else {
													peg$currPos = s0;
													s0 = peg$FAILED;
												}
											} else {
												peg$currPos = s0;
												s0 = peg$FAILED;
											}
											if (s0 === peg$FAILED) {
												s0 = peg$currPos;
												s1 = peg$parsegoal();
												if (s1 !== peg$FAILED) {
													s2 = peg$parseamount();
													if (s2 !== peg$FAILED) {
														peg$savedPos = s0;
														s0 = peg$f9(s1, s2);
													} else {
														peg$currPos = s0;
														s0 = peg$FAILED;
													}
												} else {
													peg$currPos = s0;
													s0 = peg$FAILED;
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			return s0;
		}
		function peg$parsemodifiers() {
			let s0, s2, s3, s4;
			s0 = peg$currPos;
			peg$parse_();
			if (input.charCodeAt(peg$currPos) === 91) {
				s2 = peg$c4;
				peg$currPos++;
			} else {
				s2 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e4);
			}
			if (s2 !== peg$FAILED) {
				s3 = peg$parsemodifier();
				if (s3 !== peg$FAILED) {
					if (input.charCodeAt(peg$currPos) === 93) {
						s4 = peg$c5;
						peg$currPos++;
					} else {
						s4 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e5);
					}
					if (s4 !== peg$FAILED) {
						peg$savedPos = s0;
						s0 = peg$f10(s3);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsemodifier() {
			let s0, s1, s3;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 8);
			if (s1.toLowerCase() === peg$c6) peg$currPos += 8;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e6);
			}
			if (s1 === peg$FAILED) {
				s1 = input.substr(peg$currPos, 8);
				if (s1.toLowerCase() === peg$c7) peg$currPos += 8;
				else {
					s1 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e7);
				}
			}
			if (s1 !== peg$FAILED) {
				peg$parse_();
				s3 = peg$parsepercentOrNumber();
				if (s3 !== peg$FAILED) {
					peg$savedPos = s0;
					s0 = peg$f11(s1, s3);
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsepercentOrNumber() {
			let s0, s1, s2, s3, s4, s5, s6, s7;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$currPos;
			s3 = [];
			s4 = peg$parsed();
			if (s4 !== peg$FAILED) while (s4 !== peg$FAILED) {
				s3.push(s4);
				s4 = peg$parsed();
			}
			else s3 = peg$FAILED;
			if (s3 !== peg$FAILED) {
				s4 = peg$currPos;
				if (input.charCodeAt(peg$currPos) === 46) {
					s5 = peg$c8;
					peg$currPos++;
				} else {
					s5 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e8);
				}
				if (s5 !== peg$FAILED) {
					s6 = [];
					s7 = peg$parsed();
					if (s7 !== peg$FAILED) while (s7 !== peg$FAILED) {
						s6.push(s7);
						s7 = peg$parsed();
					}
					else s6 = peg$FAILED;
					if (s6 === peg$FAILED) s6 = null;
					s5 = [s5, s6];
					s4 = s5;
				} else {
					peg$currPos = s4;
					s4 = peg$FAILED;
				}
				if (s4 === peg$FAILED) s4 = null;
				s3 = [s3, s4];
				s2 = s3;
			} else {
				peg$currPos = s2;
				s2 = peg$FAILED;
			}
			if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
			else s1 = s2;
			if (s1 !== peg$FAILED) {
				s2 = peg$parse_();
				if (input.charCodeAt(peg$currPos) === 37) {
					s3 = peg$c9;
					peg$currPos++;
				} else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e9);
				}
				if (s3 !== peg$FAILED) {
					peg$savedPos = s0;
					s0 = peg$f12(s1);
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				s1 = peg$currPos;
				s2 = peg$currPos;
				s3 = [];
				s4 = peg$parsed();
				if (s4 !== peg$FAILED) while (s4 !== peg$FAILED) {
					s3.push(s4);
					s4 = peg$parsed();
				}
				else s3 = peg$FAILED;
				if (s3 !== peg$FAILED) {
					s4 = peg$currPos;
					if (input.charCodeAt(peg$currPos) === 46) {
						s5 = peg$c8;
						peg$currPos++;
					} else {
						s5 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e8);
					}
					if (s5 !== peg$FAILED) {
						s6 = [];
						s7 = peg$parsed();
						if (s7 !== peg$FAILED) while (s7 !== peg$FAILED) {
							s6.push(s7);
							s7 = peg$parsed();
						}
						else s6 = peg$FAILED;
						if (s6 === peg$FAILED) s6 = null;
						s5 = [s5, s6];
						s4 = s5;
					} else {
						peg$currPos = s4;
						s4 = peg$FAILED;
					}
					if (s4 === peg$FAILED) s4 = null;
					s3 = [s3, s4];
					s2 = s3;
				} else {
					peg$currPos = s2;
					s2 = peg$FAILED;
				}
				if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
				else s1 = s2;
				if (s1 !== peg$FAILED) {
					peg$savedPos = s0;
					s1 = peg$f13(s1);
				}
				s0 = s1;
			}
			return s0;
		}
		function peg$parserepeat() {
			let s0, s1, s3;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 5);
			if (s1.toLowerCase() === peg$c10) peg$currPos += 5;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e11);
			}
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f14();
			}
			s0 = s1;
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				s1 = peg$parsepositive();
				if (s1 !== peg$FAILED) {
					peg$parse_();
					s3 = input.substr(peg$currPos, 6);
					if (s3.toLowerCase() === peg$c1) peg$currPos += 6;
					else {
						s3 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e1);
					}
					if (s3 !== peg$FAILED) {
						peg$savedPos = s0;
						s0 = peg$f15(s1);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
				if (s0 === peg$FAILED) {
					s0 = peg$currPos;
					s1 = input.substr(peg$currPos, 4);
					if (s1.toLowerCase() === peg$c11) peg$currPos += 4;
					else {
						s1 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e12);
					}
					if (s1 !== peg$FAILED) {
						peg$savedPos = s0;
						s1 = peg$f16();
					}
					s0 = s1;
					if (s0 === peg$FAILED) {
						s0 = peg$currPos;
						s1 = peg$parsepositive();
						if (s1 !== peg$FAILED) {
							peg$parse_();
							s3 = input.substr(peg$currPos, 5);
							if (s3.toLowerCase() === peg$c12) peg$currPos += 5;
							else {
								s3 = peg$FAILED;
								if (peg$silentFails === 0) peg$fail(peg$e13);
							}
							if (s3 !== peg$FAILED) {
								peg$savedPos = s0;
								s0 = peg$f17(s1);
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
					}
				}
			}
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e10);
			}
			return s0;
		}
		function peg$parselimit() {
			let s0, s2, s4, s6, s8, s10;
			s0 = peg$currPos;
			peg$parse_();
			s2 = peg$parseupTo();
			if (s2 !== peg$FAILED) {
				peg$parse_();
				s4 = peg$parseamount();
				if (s4 !== peg$FAILED) {
					peg$parse_();
					s6 = input.substr(peg$currPos, 17);
					if (s6.toLowerCase() === peg$c13) peg$currPos += 17;
					else {
						s6 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e14);
					}
					if (s6 !== peg$FAILED) {
						peg$parse_();
						s8 = peg$parsedate();
						if (s8 !== peg$FAILED) {
							peg$parse_();
							s10 = peg$parsehold();
							if (s10 === peg$FAILED) s10 = null;
							peg$savedPos = s0;
							s0 = peg$f18(s4, s8, s10);
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				peg$parse_();
				s2 = peg$parseupTo();
				if (s2 !== peg$FAILED) {
					peg$parse_();
					s4 = peg$parseamount();
					if (s4 !== peg$FAILED) {
						peg$parse_();
						s6 = input.substr(peg$currPos, 7);
						if (s6.toLowerCase() === peg$c14) peg$currPos += 7;
						else {
							s6 = peg$FAILED;
							if (peg$silentFails === 0) peg$fail(peg$e15);
						}
						if (s6 !== peg$FAILED) {
							peg$parse_();
							s8 = peg$parsehold();
							if (s8 === peg$FAILED) s8 = null;
							peg$savedPos = s0;
							s0 = peg$f19(s4, s8);
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
				if (s0 === peg$FAILED) {
					s0 = peg$currPos;
					peg$parse_();
					s2 = peg$parseupTo();
					if (s2 !== peg$FAILED) {
						peg$parse_();
						s4 = peg$parseamount();
						if (s4 !== peg$FAILED) {
							peg$parse_();
							s6 = peg$parsehold();
							if (s6 === peg$FAILED) s6 = null;
							peg$savedPos = s0;
							s0 = peg$f20(s4, s6);
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				}
			}
			return s0;
		}
		function peg$parsepercentOf() {
			let s0, s1, s3, s5;
			s0 = peg$currPos;
			s1 = peg$parsepercent();
			if (s1 !== peg$FAILED) {
				peg$parse_();
				s3 = peg$parseof();
				if (s3 !== peg$FAILED) {
					peg$parse_();
					s5 = input.substr(peg$currPos, 8);
					if (s5.toLowerCase() === peg$c15) peg$currPos += 8;
					else {
						s5 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e16);
					}
					if (s5 !== peg$FAILED) {
						peg$parse_();
						peg$savedPos = s0;
						s0 = peg$f21(s1);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				s1 = peg$parsepercent();
				if (s1 !== peg$FAILED) {
					peg$parse_();
					s3 = peg$parseof();
					if (s3 !== peg$FAILED) {
						peg$parse_();
						peg$savedPos = s0;
						s0 = peg$f22(s1);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			}
			return s0;
		}
		function peg$parseperiodCount() {
			let s0, s1, s3;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 3);
			if (s1.toLowerCase() === peg$c16) peg$currPos += 3;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e17);
			}
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f23();
			}
			s0 = s1;
			if (s0 === peg$FAILED) {
				s0 = peg$currPos;
				s1 = peg$parsenumber();
				if (s1 !== peg$FAILED) {
					peg$parse_();
					s3 = input.substr(peg$currPos, 4);
					if (s3.toLowerCase() === peg$c17) peg$currPos += 4;
					else {
						s3 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e18);
					}
					if (s3 !== peg$FAILED) {
						peg$parse_();
						peg$savedPos = s0;
						s0 = peg$f24(s1);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
				if (s0 === peg$FAILED) {
					s0 = peg$currPos;
					s1 = peg$parseweek();
					if (s1 !== peg$FAILED) {
						peg$parse_();
						peg$savedPos = s0;
						s0 = peg$f25();
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
					if (s0 === peg$FAILED) {
						s0 = peg$currPos;
						s1 = peg$parsenumber();
						if (s1 !== peg$FAILED) {
							peg$parse_();
							s3 = peg$parseweeks();
							if (s3 !== peg$FAILED) {
								peg$savedPos = s0;
								s0 = peg$f26(s1);
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
						} else {
							peg$currPos = s0;
							s0 = peg$FAILED;
						}
						if (s0 === peg$FAILED) {
							s0 = peg$currPos;
							s1 = peg$parsenumber();
							if (s1 !== peg$FAILED) {
								peg$parse_();
								s3 = input.substr(peg$currPos, 6);
								if (s3.toLowerCase() === peg$c1) peg$currPos += 6;
								else {
									s3 = peg$FAILED;
									if (peg$silentFails === 0) peg$fail(peg$e1);
								}
								if (s3 !== peg$FAILED) {
									peg$parse_();
									peg$savedPos = s0;
									s0 = peg$f27(s1);
								} else {
									peg$currPos = s0;
									s0 = peg$FAILED;
								}
							} else {
								peg$currPos = s0;
								s0 = peg$FAILED;
							}
							if (s0 === peg$FAILED) {
								s0 = peg$currPos;
								s1 = input.substr(peg$currPos, 4);
								if (s1.toLowerCase() === peg$c11) peg$currPos += 4;
								else {
									s1 = peg$FAILED;
									if (peg$silentFails === 0) peg$fail(peg$e12);
								}
								if (s1 !== peg$FAILED) {
									peg$parse_();
									peg$savedPos = s0;
									s0 = peg$f28();
								} else {
									peg$currPos = s0;
									s0 = peg$FAILED;
								}
								if (s0 === peg$FAILED) {
									s0 = peg$currPos;
									s1 = peg$parsenumber();
									if (s1 !== peg$FAILED) {
										peg$parse_();
										s3 = input.substr(peg$currPos, 5);
										if (s3.toLowerCase() === peg$c12) peg$currPos += 5;
										else {
											s3 = peg$FAILED;
											if (peg$silentFails === 0) peg$fail(peg$e13);
										}
										if (s3 !== peg$FAILED) {
											peg$parse_();
											peg$savedPos = s0;
											s0 = peg$f29(s1);
										} else {
											peg$currPos = s0;
											s0 = peg$FAILED;
										}
									} else {
										peg$currPos = s0;
										s0 = peg$FAILED;
									}
								}
							}
						}
					}
				}
			}
			return s0;
		}
		function peg$parsespendFrom() {
			let s0, s2, s4, s6;
			s0 = peg$currPos;
			peg$parse_();
			s2 = input.substr(peg$currPos, 5);
			if (s2.toLowerCase() === peg$c18) peg$currPos += 5;
			else {
				s2 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e19);
			}
			if (s2 !== peg$FAILED) {
				peg$parse_();
				s4 = input.substr(peg$currPos, 4);
				if (s4.toLowerCase() === peg$c19) peg$currPos += 4;
				else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e20);
				}
				if (s4 !== peg$FAILED) {
					peg$parse_();
					s6 = peg$parsemonth();
					if (s6 !== peg$FAILED) {
						peg$savedPos = s0;
						s0 = peg$f30(s6);
					} else {
						peg$currPos = s0;
						s0 = peg$FAILED;
					}
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parseweek() {
			let s0;
			s0 = input.substr(peg$currPos, 4);
			if (s0.toLowerCase() === peg$c20) peg$currPos += 4;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e21);
			}
			return s0;
		}
		function peg$parseweeks() {
			let s0;
			s0 = input.substr(peg$currPos, 5);
			if (s0.toLowerCase() === peg$c21) peg$currPos += 5;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e22);
			}
			return s0;
		}
		function peg$parseby() {
			let s0;
			s0 = input.substr(peg$currPos, 2);
			if (s0.toLowerCase() === peg$c22) peg$currPos += 2;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e23);
			}
			return s0;
		}
		function peg$parseof() {
			let s0;
			s0 = input.substr(peg$currPos, 2);
			if (s0.toLowerCase() === peg$c23) peg$currPos += 2;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e24);
			}
			return s0;
		}
		function peg$parserepeatEvery() {
			let s0, s1, s2, s3;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 6);
			if (s1.toLowerCase() === peg$c24) peg$currPos += 6;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e25);
			}
			if (s1 !== peg$FAILED) {
				s2 = peg$parse_();
				s3 = input.substr(peg$currPos, 5);
				if (s3.toLowerCase() === peg$c25) peg$currPos += 5;
				else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e26);
				}
				if (s3 !== peg$FAILED) {
					s1 = [
						s1,
						s2,
						s3
					];
					s0 = s1;
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsestarting() {
			let s0;
			s0 = input.substr(peg$currPos, 8);
			if (s0.toLowerCase() === peg$c26) peg$currPos += 8;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e27);
			}
			return s0;
		}
		function peg$parseupTo() {
			let s0, s1, s2, s3;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 2);
			if (s1.toLowerCase() === peg$c27) peg$currPos += 2;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e28);
			}
			if (s1 !== peg$FAILED) {
				s2 = peg$parse_();
				s3 = input.substr(peg$currPos, 2);
				if (s3.toLowerCase() === peg$c28) peg$currPos += 2;
				else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e29);
				}
				if (s3 !== peg$FAILED) {
					s1 = [
						s1,
						s2,
						s3
					];
					s0 = s1;
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsehold() {
			let s0, s1;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 4);
			if (s1.toLowerCase() === peg$c29) peg$currPos += 4;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e30);
			}
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f31();
			}
			s0 = s1;
			return s0;
		}
		function peg$parseschedule() {
			let s0, s1;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 8);
			if (s1.toLowerCase() === peg$c30) peg$currPos += 8;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e31);
			}
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f32();
			}
			s0 = s1;
			return s0;
		}
		function peg$parsefull() {
			let s0, s1;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 4);
			if (s1.toLowerCase() === peg$c31) peg$currPos += 4;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e32);
			}
			if (s1 !== peg$FAILED) {
				peg$parse_();
				peg$savedPos = s0;
				s0 = peg$f33();
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsepriority() {
			let s0, s1, s2;
			s0 = peg$currPos;
			s1 = input.charAt(peg$currPos);
			if (s1.toLowerCase() === peg$c32) peg$currPos++;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e33);
			}
			if (s1 !== peg$FAILED) {
				s2 = peg$parsenumber();
				if (s2 !== peg$FAILED) {
					peg$savedPos = s0;
					s0 = peg$f34(s2);
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parseremainder() {
			let s0, s1, s3;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 9);
			if (s1.toLowerCase() === peg$c33) peg$currPos += 9;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e34);
			}
			if (s1 !== peg$FAILED) {
				peg$parse_();
				s3 = peg$parsepositive();
				if (s3 === peg$FAILED) s3 = null;
				peg$savedPos = s0;
				s0 = peg$f35(s3);
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsetemplate() {
			let s0, s1, s2;
			s0 = peg$currPos;
			if (input.substr(peg$currPos, 9) === peg$c34) {
				s1 = peg$c34;
				peg$currPos += 9;
			} else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e35);
			}
			if (s1 !== peg$FAILED) {
				s2 = peg$parsepriority();
				if (s2 === peg$FAILED) s2 = null;
				peg$savedPos = s0;
				s0 = peg$f36(s2);
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			return s0;
		}
		function peg$parsegoal() {
			let s0, s1;
			s0 = peg$currPos;
			s1 = input.substr(peg$currPos, 5);
			if (s1.toLowerCase() === peg$c35) peg$currPos += 5;
			else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e36);
			}
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f37();
			}
			s0 = s1;
			return s0;
		}
		function peg$parse_() {
			let s0, s1, s2;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = [];
			s2 = input.charAt(peg$currPos);
			if (peg$r0.test(s2)) peg$currPos++;
			else {
				s2 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e37);
			}
			while (s2 !== peg$FAILED) {
				s1.push(s2);
				s2 = input.charAt(peg$currPos);
				if (peg$r0.test(s2)) peg$currPos++;
				else {
					s2 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e37);
				}
			}
			peg$savedPos = s0;
			s1 = peg$f38();
			s0 = s1;
			peg$silentFails--;
			return s0;
		}
		function peg$parsed() {
			let s0;
			peg$silentFails++;
			s0 = input.charAt(peg$currPos);
			if (peg$r1.test(s0)) peg$currPos++;
			else {
				s0 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e39);
			}
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				if (peg$silentFails === 0) peg$fail(peg$e38);
			}
			return s0;
		}
		function peg$parsenumber() {
			let s0, s1, s2;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = [];
			s2 = peg$parsed();
			if (s2 !== peg$FAILED) while (s2 !== peg$FAILED) {
				s1.push(s2);
				s2 = peg$parsed();
			}
			else s1 = peg$FAILED;
			if (s1 !== peg$FAILED) s0 = input.substring(s0, peg$currPos);
			else s0 = s1;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e40);
			}
			return s0;
		}
		function peg$parsepositive() {
			let s0, s1, s2, s3, s4;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = input.charAt(peg$currPos);
			if (peg$r2.test(s2)) peg$currPos++;
			else {
				s2 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e41);
			}
			if (s2 !== peg$FAILED) {
				s3 = [];
				s4 = input.charAt(peg$currPos);
				if (peg$r1.test(s4)) peg$currPos++;
				else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e39);
				}
				while (s4 !== peg$FAILED) {
					s3.push(s4);
					s4 = input.charAt(peg$currPos);
					if (peg$r1.test(s4)) peg$currPos++;
					else {
						s4 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e39);
					}
				}
				s2 = [s2, s3];
				s1 = s2;
			} else {
				peg$currPos = s1;
				s1 = peg$FAILED;
			}
			if (s1 !== peg$FAILED) s0 = input.substring(s0, peg$currPos);
			else s0 = s1;
			return s0;
		}
		function peg$parseamount() {
			let s0, s1, s3, s4, s5, s6, s7, s8, s9, s10, s11;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$parsecurrencySymbol();
			if (s1 === peg$FAILED) s1 = null;
			peg$parse_();
			s3 = peg$currPos;
			s4 = peg$currPos;
			if (input.charCodeAt(peg$currPos) === 45) {
				s5 = peg$c32;
				peg$currPos++;
			} else {
				s5 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e43);
			}
			if (s5 === peg$FAILED) s5 = null;
			s6 = [];
			s7 = peg$parsed();
			if (s7 !== peg$FAILED) while (s7 !== peg$FAILED) {
				s6.push(s7);
				s7 = peg$parsed();
			}
			else s6 = peg$FAILED;
			if (s6 !== peg$FAILED) {
				s7 = peg$currPos;
				if (input.charCodeAt(peg$currPos) === 46) {
					s8 = peg$c8;
					peg$currPos++;
				} else {
					s8 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e8);
				}
				if (s8 !== peg$FAILED) {
					s9 = peg$currPos;
					s10 = peg$parsed();
					if (s10 !== peg$FAILED) {
						s11 = peg$parsed();
						if (s11 === peg$FAILED) s11 = null;
						s10 = [s10, s11];
						s9 = s10;
					} else {
						peg$currPos = s9;
						s9 = peg$FAILED;
					}
					if (s9 === peg$FAILED) s9 = null;
					s8 = [s8, s9];
					s7 = s8;
				} else {
					peg$currPos = s7;
					s7 = peg$FAILED;
				}
				if (s7 === peg$FAILED) s7 = null;
				s5 = [
					s5,
					s6,
					s7
				];
				s4 = s5;
			} else {
				peg$currPos = s4;
				s4 = peg$FAILED;
			}
			if (s4 !== peg$FAILED) s3 = input.substring(s3, peg$currPos);
			else s3 = s4;
			if (s3 !== peg$FAILED) {
				peg$savedPos = s0;
				s0 = peg$f39(s3);
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e42);
			}
			return s0;
		}
		function peg$parsepercent() {
			let s0, s1, s2, s3, s4, s5, s6, s7;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$currPos;
			s3 = [];
			s4 = peg$parsed();
			if (s4 !== peg$FAILED) while (s4 !== peg$FAILED) {
				s3.push(s4);
				s4 = peg$parsed();
			}
			else s3 = peg$FAILED;
			if (s3 !== peg$FAILED) {
				s4 = peg$currPos;
				if (input.charCodeAt(peg$currPos) === 46) {
					s5 = peg$c8;
					peg$currPos++;
				} else {
					s5 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e8);
				}
				if (s5 !== peg$FAILED) {
					s6 = [];
					s7 = peg$parsed();
					if (s7 !== peg$FAILED) while (s7 !== peg$FAILED) {
						s6.push(s7);
						s7 = peg$parsed();
					}
					else s6 = peg$FAILED;
					if (s6 === peg$FAILED) s6 = null;
					s5 = [s5, s6];
					s4 = s5;
				} else {
					peg$currPos = s4;
					s4 = peg$FAILED;
				}
				if (s4 === peg$FAILED) s4 = null;
				s3 = [s3, s4];
				s2 = s3;
			} else {
				peg$currPos = s2;
				s2 = peg$FAILED;
			}
			if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
			else s1 = s2;
			if (s1 !== peg$FAILED) {
				s2 = peg$parse_();
				if (input.charCodeAt(peg$currPos) === 37) {
					s3 = peg$c9;
					peg$currPos++;
				} else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e9);
				}
				if (s3 !== peg$FAILED) {
					peg$savedPos = s0;
					s0 = peg$f40(s1);
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e44);
			}
			return s0;
		}
		function peg$parseyear() {
			let s0, s1, s2, s3, s4, s5;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$parsed();
			if (s2 !== peg$FAILED) {
				s3 = peg$parsed();
				if (s3 !== peg$FAILED) {
					s4 = peg$parsed();
					if (s4 !== peg$FAILED) {
						s5 = peg$parsed();
						if (s5 !== peg$FAILED) {
							s2 = [
								s2,
								s3,
								s4,
								s5
							];
							s1 = s2;
						} else {
							peg$currPos = s1;
							s1 = peg$FAILED;
						}
					} else {
						peg$currPos = s1;
						s1 = peg$FAILED;
					}
				} else {
					peg$currPos = s1;
					s1 = peg$FAILED;
				}
			} else {
				peg$currPos = s1;
				s1 = peg$FAILED;
			}
			if (s1 !== peg$FAILED) s0 = input.substring(s0, peg$currPos);
			else s0 = s1;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e45);
			}
			return s0;
		}
		function peg$parsemonth() {
			let s0, s1, s2, s3, s4, s5;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$parseyear();
			if (s2 !== peg$FAILED) {
				if (input.charCodeAt(peg$currPos) === 45) {
					s3 = peg$c32;
					peg$currPos++;
				} else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e43);
				}
				if (s3 !== peg$FAILED) {
					s4 = peg$parsed();
					if (s4 !== peg$FAILED) {
						s5 = peg$parsed();
						if (s5 !== peg$FAILED) {
							s2 = [
								s2,
								s3,
								s4,
								s5
							];
							s1 = s2;
						} else {
							peg$currPos = s1;
							s1 = peg$FAILED;
						}
					} else {
						peg$currPos = s1;
						s1 = peg$FAILED;
					}
				} else {
					peg$currPos = s1;
					s1 = peg$FAILED;
				}
			} else {
				peg$currPos = s1;
				s1 = peg$FAILED;
			}
			if (s1 !== peg$FAILED) s0 = input.substring(s0, peg$currPos);
			else s0 = s1;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e46);
			}
			return s0;
		}
		function peg$parseday() {
			let s0, s1, s2, s3;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$parsed();
			if (s2 !== peg$FAILED) {
				s3 = peg$parsed();
				if (s3 !== peg$FAILED) {
					s2 = [s2, s3];
					s1 = s2;
				} else {
					peg$currPos = s1;
					s1 = peg$FAILED;
				}
			} else {
				peg$currPos = s1;
				s1 = peg$FAILED;
			}
			if (s1 !== peg$FAILED) s0 = input.substring(s0, peg$currPos);
			else s0 = s1;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e47);
			}
			return s0;
		}
		function peg$parsedate() {
			let s0, s1, s2, s3, s4;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$parsemonth();
			if (s2 !== peg$FAILED) {
				if (input.charCodeAt(peg$currPos) === 45) {
					s3 = peg$c32;
					peg$currPos++;
				} else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e43);
				}
				if (s3 !== peg$FAILED) {
					s4 = peg$parseday();
					if (s4 !== peg$FAILED) {
						s2 = [
							s2,
							s3,
							s4
						];
						s1 = s2;
					} else {
						peg$currPos = s1;
						s1 = peg$FAILED;
					}
				} else {
					peg$currPos = s1;
					s1 = peg$FAILED;
				}
			} else {
				peg$currPos = s1;
				s1 = peg$FAILED;
			}
			if (s1 !== peg$FAILED) s0 = input.substring(s0, peg$currPos);
			else s0 = s1;
			return s0;
		}
		function peg$parsecurrencySymbol() {
			let s0, s1, s2;
			peg$silentFails++;
			s0 = peg$currPos;
			if (input.length > peg$currPos) {
				s1 = input.charAt(peg$currPos);
				peg$currPos++;
			} else {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e49);
			}
			if (s1 !== peg$FAILED) {
				peg$savedPos = peg$currPos;
				s2 = peg$f41(s1);
				if (s2) s2 = void 0;
				else s2 = peg$FAILED;
				if (s2 !== peg$FAILED) {
					s1 = [s1, s2];
					s0 = s1;
				} else {
					peg$currPos = s0;
					s0 = peg$FAILED;
				}
			} else {
				peg$currPos = s0;
				s0 = peg$FAILED;
			}
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e48);
			}
			return s0;
		}
		function peg$parserawScheduleName() {
			let s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = peg$currPos;
			s3 = peg$currPos;
			peg$silentFails++;
			s4 = peg$currPos;
			if (input.charCodeAt(peg$currPos) === 91) {
				s5 = peg$c4;
				peg$currPos++;
			} else {
				s5 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e4);
			}
			if (s5 !== peg$FAILED) {
				s6 = input.substr(peg$currPos, 8);
				if (s6.toLowerCase() === peg$c6) peg$currPos += 8;
				else {
					s6 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e6);
				}
				if (s6 === peg$FAILED) {
					s6 = input.substr(peg$currPos, 8);
					if (s6.toLowerCase() === peg$c7) peg$currPos += 8;
					else {
						s6 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e7);
					}
				}
				if (s6 !== peg$FAILED) {
					s5 = [s5, s6];
					s4 = s5;
				} else {
					peg$currPos = s4;
					s4 = peg$FAILED;
				}
			} else {
				peg$currPos = s4;
				s4 = peg$FAILED;
			}
			peg$silentFails--;
			if (s4 === peg$FAILED) s3 = void 0;
			else {
				peg$currPos = s3;
				s3 = peg$FAILED;
			}
			if (s3 !== peg$FAILED) {
				s4 = input.charAt(peg$currPos);
				if (peg$r3.test(s4)) peg$currPos++;
				else {
					s4 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e50);
				}
				if (s4 !== peg$FAILED) {
					s5 = [];
					s6 = peg$currPos;
					s7 = peg$currPos;
					peg$silentFails++;
					s8 = peg$currPos;
					s9 = peg$parse_();
					if (input.charCodeAt(peg$currPos) === 91) {
						s10 = peg$c4;
						peg$currPos++;
					} else {
						s10 = peg$FAILED;
						if (peg$silentFails === 0) peg$fail(peg$e4);
					}
					if (s10 !== peg$FAILED) {
						s11 = input.substr(peg$currPos, 8);
						if (s11.toLowerCase() === peg$c6) peg$currPos += 8;
						else {
							s11 = peg$FAILED;
							if (peg$silentFails === 0) peg$fail(peg$e6);
						}
						if (s11 === peg$FAILED) {
							s11 = input.substr(peg$currPos, 8);
							if (s11.toLowerCase() === peg$c7) peg$currPos += 8;
							else {
								s11 = peg$FAILED;
								if (peg$silentFails === 0) peg$fail(peg$e7);
							}
						}
						if (s11 !== peg$FAILED) {
							s9 = [
								s9,
								s10,
								s11
							];
							s8 = s9;
						} else {
							peg$currPos = s8;
							s8 = peg$FAILED;
						}
					} else {
						peg$currPos = s8;
						s8 = peg$FAILED;
					}
					peg$silentFails--;
					if (s8 === peg$FAILED) s7 = void 0;
					else {
						peg$currPos = s7;
						s7 = peg$FAILED;
					}
					if (s7 !== peg$FAILED) {
						s8 = input.charAt(peg$currPos);
						if (peg$r4.test(s8)) peg$currPos++;
						else {
							s8 = peg$FAILED;
							if (peg$silentFails === 0) peg$fail(peg$e51);
						}
						if (s8 !== peg$FAILED) {
							s7 = [s7, s8];
							s6 = s7;
						} else {
							peg$currPos = s6;
							s6 = peg$FAILED;
						}
					} else {
						peg$currPos = s6;
						s6 = peg$FAILED;
					}
					while (s6 !== peg$FAILED) {
						s5.push(s6);
						s6 = peg$currPos;
						s7 = peg$currPos;
						peg$silentFails++;
						s8 = peg$currPos;
						s9 = peg$parse_();
						if (input.charCodeAt(peg$currPos) === 91) {
							s10 = peg$c4;
							peg$currPos++;
						} else {
							s10 = peg$FAILED;
							if (peg$silentFails === 0) peg$fail(peg$e4);
						}
						if (s10 !== peg$FAILED) {
							s11 = input.substr(peg$currPos, 8);
							if (s11.toLowerCase() === peg$c6) peg$currPos += 8;
							else {
								s11 = peg$FAILED;
								if (peg$silentFails === 0) peg$fail(peg$e6);
							}
							if (s11 === peg$FAILED) {
								s11 = input.substr(peg$currPos, 8);
								if (s11.toLowerCase() === peg$c7) peg$currPos += 8;
								else {
									s11 = peg$FAILED;
									if (peg$silentFails === 0) peg$fail(peg$e7);
								}
							}
							if (s11 !== peg$FAILED) {
								s9 = [
									s9,
									s10,
									s11
								];
								s8 = s9;
							} else {
								peg$currPos = s8;
								s8 = peg$FAILED;
							}
						} else {
							peg$currPos = s8;
							s8 = peg$FAILED;
						}
						peg$silentFails--;
						if (s8 === peg$FAILED) s7 = void 0;
						else {
							peg$currPos = s7;
							s7 = peg$FAILED;
						}
						if (s7 !== peg$FAILED) {
							s8 = input.charAt(peg$currPos);
							if (peg$r4.test(s8)) peg$currPos++;
							else {
								s8 = peg$FAILED;
								if (peg$silentFails === 0) peg$fail(peg$e51);
							}
							if (s8 !== peg$FAILED) {
								s7 = [s7, s8];
								s6 = s7;
							} else {
								peg$currPos = s6;
								s6 = peg$FAILED;
							}
						} else {
							peg$currPos = s6;
							s6 = peg$FAILED;
						}
					}
					s3 = [
						s3,
						s4,
						s5
					];
					s2 = s3;
				} else {
					peg$currPos = s2;
					s2 = peg$FAILED;
				}
			} else {
				peg$currPos = s2;
				s2 = peg$FAILED;
			}
			if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
			else s1 = s2;
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f42();
			}
			s0 = s1;
			return s0;
		}
		function peg$parsename() {
			let s0, s1, s2, s3;
			peg$silentFails++;
			s0 = peg$currPos;
			s1 = peg$currPos;
			s2 = [];
			s3 = input.charAt(peg$currPos);
			if (peg$r5.test(s3)) peg$currPos++;
			else {
				s3 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e53);
			}
			if (s3 !== peg$FAILED) while (s3 !== peg$FAILED) {
				s2.push(s3);
				s3 = input.charAt(peg$currPos);
				if (peg$r5.test(s3)) peg$currPos++;
				else {
					s3 = peg$FAILED;
					if (peg$silentFails === 0) peg$fail(peg$e53);
				}
			}
			else s2 = peg$FAILED;
			if (s2 !== peg$FAILED) s1 = input.substring(s1, peg$currPos);
			else s1 = s2;
			if (s1 !== peg$FAILED) {
				peg$savedPos = s0;
				s1 = peg$f43();
			}
			s0 = s1;
			peg$silentFails--;
			if (s0 === peg$FAILED) {
				s1 = peg$FAILED;
				if (peg$silentFails === 0) peg$fail(peg$e52);
			}
			return s0;
		}
		peg$result = peg$startRuleFunction();
		const peg$success = peg$result !== peg$FAILED && peg$currPos === input.length;
		function peg$throw() {
			if (peg$result !== peg$FAILED && peg$currPos < input.length) peg$fail(peg$endExpectation());
			throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? peg$getUnicode(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
		}
		if (options.peg$library) return {
			peg$result,
			peg$currPos,
			peg$FAILED,
			peg$maxFailExpected,
			peg$maxFailPos,
			peg$success,
			peg$throw: peg$success ? void 0 : peg$throw
		};
		if (peg$success) return peg$result;
		else peg$throw();
	}
	//#endregion
	//#region ../loot-core/src/server/budget/template-notes.ts
	var TEMPLATE_PREFIX = "#template";
	var GOAL_PREFIX = "#goal";
	var CLEANUP_PREFIX = "#cleanup";
	async function storeNoteTemplates(categoryIds) {
		await storeTemplates({
			categoriesWithTemplates: await getCategoriesWithTemplates(categoryIds),
			source: "notes"
		});
		await resetCategoryGoalDefsWithNoTemplates(categoryIds);
	}
	async function checkTemplateNotes() {
		const categoryWithTemplates = await getCategoriesWithTemplates();
		const scheduleNames = (await getActiveSchedules()).map(({ name }) => name);
		const errors = [];
		categoryWithTemplates.forEach(({ name, templates }) => {
			templates.forEach((template) => {
				if (template.type === "error") if (template.error && template.error.includes("adjustment")) errors.push(`${name}: ${template.line}\nError: ${template.error}`);
				else errors.push(`${name}: ${template.line}`);
				else if (template.type === "schedule" && !scheduleNames.includes(template.name)) errors.push(`${name}: Schedule "${template.name}" does not exist`);
			});
		});
		if (errors.length) return {
			sticky: true,
			message: "There were errors interpreting some templates:",
			pre: errors.join("\n\n")
		};
		return {
			type: "message",
			message: "All templates passed! 🎉"
		};
	}
	async function getCategoriesWithTemplates(categoryIds) {
		const templatesForCategory = [];
		(await getCategoriesWithTemplateNotes(categoryIds)).forEach(({ id, name, note }) => {
			if (!note) return;
			const parsedTemplates = [];
			let descriptionLines = [];
			note.split("\n").forEach((line) => {
				const trimmedLine = line.substring(line.indexOf("#")).trim();
				if (!(trimmedLine.startsWith("#template") || trimmedLine.startsWith("#goal"))) {
					if (line.trim() === "" || trimmedLine.startsWith(CLEANUP_PREFIX)) descriptionLines = [];
					else descriptionLines.push(line.trimEnd());
					return;
				}
				const description = descriptionLines.length > 0 ? descriptionLines.join("\n") : void 0;
				descriptionLines = [];
				try {
					const parsedTemplate = peg$parse(trimmedLine);
					if ((parsedTemplate.type === "average" || parsedTemplate.type === "schedule") && parsedTemplate.adjustment !== void 0) {
						if (parsedTemplate.adjustmentType === "percent") {
							if (parsedTemplate.adjustment <= -100 || parsedTemplate.adjustment > 1e3) throw new Error(`Invalid adjustment percentage (${parsedTemplate.adjustment}%). Must be between -100% and 1000%`);
						} else if (parsedTemplate.adjustmentType === "fixed") {}
					}
					parsedTemplates.push(description ? {
						...parsedTemplate,
						description
					} : parsedTemplate);
				} catch (e) {
					const errorTemplate = {
						type: "error",
						directive: "error",
						line,
						error: e.message
					};
					parsedTemplates.push(description ? {
						...errorTemplate,
						description
					} : errorTemplate);
				}
			});
			if (!parsedTemplates.length) return;
			templatesForCategory.push({
				id,
				name,
				templates: parsedTemplates
			});
		});
		return templatesForCategory;
	}
	function prefixFromPriority(priority) {
		return priority === null || priority === 0 ? TEMPLATE_PREFIX : `${TEMPLATE_PREFIX}-${priority}`;
	}
	function templateToLine(template, refill) {
		if (template.type === "error") return null;
		if (template.type === "goal") return `${GOAL_PREFIX} ${template.amount}`;
		const prefix = prefixFromPriority(template.priority);
		switch (template.type) {
			case "simple": {
				let result = prefix;
				if (template.monthly != null) result += ` ${template.monthly}`;
				if (template.limit) result += ` ${limitToString(template.limit)}`;
				return result.trim();
			}
			case "schedule": {
				let result = `${prefix} schedule`;
				if (template.full) result += " full";
				result += ` ${template.name}`;
				if (template.adjustment !== void 0) {
					const adj = template.adjustment;
					const op = adj >= 0 ? "increase" : "decrease";
					const val = Math.abs(adj);
					const type = template.adjustmentType === "percent" ? "%" : "";
					result += ` [${op} ${val}${type}]`;
				}
				return result;
			}
			case "percentage": {
				const prev = template.previous ? "previous " : "";
				return `${prefix} ${trimTrailingZeros(template.percent)}% of ${prev}${template.category}`.trim();
			}
			case "periodic": {
				const periodPart = periodToString(template.period);
				let result = `${prefix} ${template.amount} repeat every ${periodPart} starting ${template.starting}`;
				if (template.limit) result += ` ${limitToString(template.limit)}`;
				return result;
			}
			case "by":
			case "spend": {
				let result = `${prefix} ${template.amount} by ${template.month}`;
				if (template.type === "spend" && template.from) result += ` spend from ${template.from}`;
				if (template.annual !== void 0) {
					const repeatInfo = repeatToString(template.annual, template.repeat);
					if (repeatInfo) result += ` repeat every ${repeatInfo}`;
				}
				return result;
			}
			case "remainder": {
				let result = `${prefix} remainder`;
				if (template.weight !== void 0 && template.weight !== 1) result += ` ${template.weight}`;
				if (template.limit) result += ` ${limitToString(template.limit)}`;
				return result;
			}
			case "average": {
				let result = `${prefix} average ${template.numMonths} months`;
				if (template.adjustment !== void 0) {
					const adj = template.adjustment;
					const op = adj >= 0 ? "increase" : "decrease";
					const val = Math.abs(adj);
					const type = template.adjustmentType === "percent" ? "%" : "";
					result += ` [${op} ${val}${type}]`;
				}
				return result;
			}
			case "copy": return `${prefix} copy from ${template.lookBack} months ago`;
			case "limit":
				if (!refill) return `${prefix} 0 ${limitToString(template)}`;
				return `${prefixFromPriority(refill.priority)} ${limitToString(template)}`;
			default: return null;
		}
	}
	async function unparse(templates) {
		const refill = templates.find((t) => t.type === "refill");
		return templates.filter((t) => t.type !== "refill").flatMap((template) => {
			const line = templateToLine(template, refill);
			if (line == null) return [];
			return [...(template.description ?? "").split("\n").map((descriptionLine) => descriptionLine.trimEnd()).filter((descriptionLine) => descriptionLine !== ""), line];
		}).join("\n");
	}
	function limitToString(limit) {
		switch (limit.period) {
			case "weekly": {
				const base = `up to ${limit.amount} per week starting ${limit.start}`;
				return limit.hold ? `${base} hold` : base;
			}
			case "daily": {
				const base = `up to ${limit.amount} per day`;
				return limit.hold ? `${base} hold` : base;
			}
			default: {
				const base = `up to ${limit.amount}`;
				return limit.hold ? `${base} hold` : base;
			}
		}
	}
	function periodToString(p) {
		return `${p.amount} ${p.period}s`;
	}
	function repeatToString(annual, repeat) {
		if (annual === void 0) return null;
		if (annual) {
			if (!repeat || repeat === 1) return "year";
			return `${repeat} years`;
		}
		if (!repeat || repeat === 1) return "month";
		return `${repeat} months`;
	}
	function trimTrailingZeros(n) {
		const s = n.toString();
		if (!s.includes(".")) return s;
		return s.replace(/\.0+$/, "").replace(/(\.[0-9]*[1-9])0+$/, "$1");
	}
	//#endregion
	//#region ../loot-core/src/server/budget/statements.ts
	async function resetCategoryGoalDefsWithNoTemplates(categoryIds) {
		if (categoryIds?.length === 0) return;
		await run(`
      UPDATE categories
      SET goal_def = NULL
      WHERE id NOT IN (SELECT n.id
                       FROM notes n
                       WHERE lower(note) LIKE '%${TEMPLATE_PREFIX}%'
                          OR lower(note) LIKE '%${GOAL_PREFIX}%')
        AND COALESCE(JSON_EXTRACT(template_settings, '$.source'), 'notes') <> 'ui'
        ${categoryIds ? `AND id IN (${categoryIds.map(() => "?").join(",")})` : ""}
    `, categoryIds ?? []);
	}
	async function getCategoriesWithTemplateNotes(categoryIds) {
		if (categoryIds?.length === 0) return [];
		return await all(`
      SELECT c.id AS id, c.name as name, n.note AS note
      FROM notes n
             JOIN categories c ON n.id = c.id
      WHERE c.id = n.id
        AND c.tombstone = 0
        AND COALESCE(JSON_EXTRACT(c.template_settings, '$.source'), 'notes') <> 'ui'
        AND (lower(note) LIKE '%${TEMPLATE_PREFIX}%'
        OR lower(note) LIKE '%${GOAL_PREFIX}%')
        ${categoryIds ? `AND c.id IN (${categoryIds.map(() => "?").join(",")})` : ""}
    `, categoryIds ?? []);
	}
	async function getActiveSchedules() {
		return await all("SELECT id, rule, active, completed, posts_transaction, tombstone, name from schedules WHERE name NOT NULL AND tombstone = 0");
	}
	//#endregion
	//#region ../loot-core/src/server/budget/category-template-context.ts
	var CategoryTemplateContext = class CategoryTemplateContext {
		static async init(templates, category, month, budgeted, skipAvailableClamp = false) {
			const lastMonthSheet = sheetForMonth(subMonths(month, 1));
			let fromLastMonth = await getSheetValue(lastMonthSheet, `leftover-${category.id}`);
			const carryover = await getSheetBoolean(lastMonthSheet, `carryover-${category.id}`);
			if (fromLastMonth < 0 && !carryover || category.is_income || isTrackingBudget() && !carryover) fromLastMonth = 0;
			await CategoryTemplateContext.checkByAndScheduleAndSpend(templates, month);
			await CategoryTemplateContext.checkPercentage(templates);
			const hideDecimal = await aqlQuery(q("preferences").filter({ id: "hideFraction" }).select("*"));
			const currencyPref = await aqlQuery(q("preferences").filter({ id: "defaultCurrencyCode" }).select("*"));
			const currencyCode = currencyPref.data.length > 0 ? currencyPref.data[0].value : "";
			return new CategoryTemplateContext(templates, category, month, fromLastMonth, budgeted, currencyCode, hideDecimal.data.length > 0 ? hideDecimal.data[0].value === "true" : false, skipAvailableClamp);
		}
		isGoalOnly() {
			return this.templates.length === 0 && this.remainder.length === 0 && this.goals.length > 0;
		}
		getPriorities() {
			return Array.from(this.priorities);
		}
		hasRemainder() {
			return this.remainderWeight > 0 && !this.limitMet;
		}
		getRemainderWeight() {
			return this.remainderWeight;
		}
		getLimitExcess() {
			return this.limitExcess;
		}
		async runAll(available) {
			let toBudget = 0;
			const prioritiesSorted = new Int32Array([...this.getPriorities()].sort((a, b) => a - b));
			for (let i = 0; i < prioritiesSorted.length; i++) {
				const p = prioritiesSorted[i];
				toBudget += await this.runTemplatesForPriority(p, available, available);
			}
			return toBudget;
		}
		async runTemplatesForPriority(priority, budgetAvail, availStart) {
			if (!this.priorities.has(priority)) return 0;
			if (this.limitMet) return 0;
			const t = this.templates.filter((t) => t.directive === "template" && t.priority === priority);
			let available = budgetAvail || 0;
			let toBudget = 0;
			const perTemplateLocal = /* @__PURE__ */ new Map();
			let byFlag = false;
			let remainder = 0;
			let scheduleFlag = false;
			let schedulePerTemplate = null;
			let byPerTemplate = null;
			for (const template of t) {
				let newBudget = 0;
				switch (template.type) {
					case "simple":
						newBudget = CategoryTemplateContext.runSimple(template, this);
						break;
					case "refill":
						newBudget = CategoryTemplateContext.runRefill(template, this);
						break;
					case "copy":
						newBudget = await CategoryTemplateContext.runCopy(template, this);
						break;
					case "periodic":
						newBudget = CategoryTemplateContext.runPeriodic(template, this);
						break;
					case "spend":
						newBudget = await CategoryTemplateContext.runSpend(template, this);
						break;
					case "percentage":
						newBudget = await CategoryTemplateContext.runPercentage(template, availStart, this);
						break;
					case "by":
						if (!byFlag) {
							const ret = CategoryTemplateContext.runBy(this);
							newBudget = ret.toBudget;
							byPerTemplate = ret.perTemplateNeed;
						} else newBudget = 0;
						byFlag = true;
						break;
					case "schedule":
						if (!scheduleFlag) {
							const budgeted = this.fromLastMonth + toBudget;
							const ret = await runSchedule(t, this.month, budgeted, remainder, this.fromLastMonth, toBudget, [], this.category, this.currency);
							newBudget = ret.to_budget - toBudget;
							remainder = ret.remainder;
							schedulePerTemplate = ret.perScheduleMonthly;
							scheduleFlag = true;
						}
						break;
					case "average":
						newBudget = await CategoryTemplateContext.runAverage(template, this);
						break;
					default: break;
				}
				available = available - newBudget;
				toBudget += newBudget;
				perTemplateLocal.set(template, (perTemplateLocal.get(template) ?? 0) + newBudget);
			}
			redistributeBatch(perTemplateLocal, t, "by", (template) => {
				if (template.type !== "by") return 0;
				return Math.max(0, byPerTemplate?.get(template) ?? 0);
			});
			redistributeBatch(perTemplateLocal, t, "schedule", (template) => {
				if (template.type !== "schedule") return 0;
				const monthly = schedulePerTemplate?.get(template.name.trim()) ?? 0;
				return Math.max(0, monthly);
			});
			let scale = 1;
			if (this.limitCheck) {
				if (toBudget + this.toBudgetAmount + this.fromLastMonth >= this.limitAmount) {
					const orig = toBudget;
					toBudget = this.limitAmount - this.toBudgetAmount - this.fromLastMonth;
					this.limitMet = true;
					available = available + orig - toBudget;
					if (orig > 0) scale *= toBudget / orig;
				}
			}
			if (this.hideDecimal) {
				const preRound = toBudget;
				toBudget = this.removeFraction(toBudget);
				if (preRound !== 0) scale *= toBudget / preRound;
			}
			if (priority > 0 && available < 0 && !this.category.is_income && !this.skipAvailableClamp) {
				this.fullAmount = (this.fullAmount || 0) + toBudget;
				const adjusted = Math.max(0, toBudget + available);
				if (toBudget > 0) scale *= adjusted / toBudget;
				toBudget = adjusted;
				this.toBudgetAmount += toBudget;
			} else {
				this.fullAmount = (this.fullAmount || 0) + toBudget;
				this.toBudgetAmount += toBudget;
			}
			const perRowScale = Math.max(0, scale);
			const items = Array.from(perTemplateLocal);
			let remaining = Math.max(0, toBudget);
			items.forEach(([template, value], i) => {
				const share = i === items.length - 1 ? remaining : Math.max(0, Math.min(remaining, Math.round(value * perRowScale)));
				const existing = this.perTemplateContribution.get(template) ?? 0;
				this.perTemplateContribution.set(template, existing + share);
				remaining -= share;
			});
			return this.category.is_income ? -toBudget : toBudget;
		}
		runRemainder(budgetAvail, perWeight) {
			if (this.remainder.length === 0) return 0;
			let toBudget = Math.round(this.remainderWeight * perWeight);
			let smallest = 1;
			if (this.hideDecimal) {
				toBudget = this.removeFraction(toBudget);
				smallest = 100;
			}
			if (toBudget > budgetAvail || budgetAvail - toBudget <= smallest) toBudget = budgetAvail;
			if (this.limitCheck) {
				if (toBudget + this.toBudgetAmount + this.fromLastMonth >= this.limitAmount) {
					toBudget = this.limitAmount - this.toBudgetAmount - this.fromLastMonth;
					this.limitMet = true;
				}
			}
			if (toBudget > 0 && this.remainderWeight > 0) {
				let remaining = toBudget;
				for (let i = 0; i < this.remainder.length; i++) {
					const template = this.remainder[i];
					const share = i === this.remainder.length - 1 ? remaining : Math.round(toBudget * (template.weight / this.remainderWeight));
					const allocated = Math.max(0, Math.min(share, remaining));
					const existing = this.perTemplateContribution.get(template) ?? 0;
					this.perTemplateContribution.set(template, existing + allocated);
					remaining -= allocated;
				}
			}
			this.toBudgetAmount += toBudget;
			return toBudget;
		}
		getValues() {
			this.runGoal();
			return {
				budgeted: this.toBudgetAmount,
				goal: this.goalAmount,
				longGoal: this.isLongGoal,
				perTemplateContribution: this.perTemplateContribution
			};
		}
		constructor(templates, category, month, fromLastMonth, budgeted, currencyCode, hideDecimal = false, skipAvailableClamp = false) {
			_defineProperty(this, "category", void 0);
			_defineProperty(this, "month", void 0);
			_defineProperty(this, "templates", []);
			_defineProperty(this, "remainder", []);
			_defineProperty(this, "goals", []);
			_defineProperty(this, "priorities", /* @__PURE__ */ new Set());
			_defineProperty(this, "hideDecimal", false);
			_defineProperty(this, "skipAvailableClamp", false);
			_defineProperty(this, "remainderWeight", 0);
			_defineProperty(this, "toBudgetAmount", 0);
			_defineProperty(this, "perTemplateContribution", /* @__PURE__ */ new Map());
			_defineProperty(this, "fullAmount", null);
			_defineProperty(this, "isLongGoal", null);
			_defineProperty(this, "goalAmount", null);
			_defineProperty(this, "fromLastMonth", 0);
			_defineProperty(this, "limitMet", false);
			_defineProperty(this, "limitExcess", 0);
			_defineProperty(this, "limitAmount", 0);
			_defineProperty(this, "limitCheck", false);
			_defineProperty(this, "limitHold", false);
			_defineProperty(this, "previouslyBudgeted", 0);
			_defineProperty(this, "currency", void 0);
			this.category = category;
			this.month = month;
			this.fromLastMonth = fromLastMonth;
			this.previouslyBudgeted = budgeted;
			this.currency = getCurrency(currencyCode);
			this.hideDecimal = hideDecimal;
			this.skipAvailableClamp = skipAvailableClamp;
			if (templates) templates.forEach((t) => {
				if (t.directive === "template" && t.type !== "remainder" && t.type !== "limit") {
					this.templates.push(t);
					if (t.priority !== null) this.priorities.add(t.priority);
				} else if (t.directive === "template" && t.type === "remainder") {
					this.remainder.push(t);
					this.remainderWeight += t.weight;
				} else if (t.directive === "goal" && t.type === "goal") this.goals.push(t);
			});
			this.checkLimit(templates);
			this.checkSpend();
			this.checkGoal();
		}
		runGoal() {
			if (this.goals.length > 0) {
				if (this.isGoalOnly()) this.toBudgetAmount = this.previouslyBudgeted;
				this.isLongGoal = true;
				this.goalAmount = amountToInteger(this.goals[0].amount, this.currency.decimalPlaces);
				return;
			}
			this.goalAmount = this.fullAmount;
		}
		static async checkByAndScheduleAndSpend(templates, month) {
			if (templates.filter((t) => t.type === "schedule" || t.type === "by").length === 0) return;
			const scheduleNames = (await getActiveSchedules()).map(({ name }) => name.trim());
			templates.filter((t) => t.type === "schedule").forEach((t) => {
				if (!scheduleNames.includes(t.name.trim())) throw new Error(`Schedule ${t.name.trim()} does not exist`);
			});
			const lowestPriority = Math.min(...templates.filter((t) => t.type === "schedule" || t.type === "by").map((t) => t.priority));
			templates.filter((t) => t.type === "schedule" || t.type === "by").forEach((t) => {
				if (t.priority !== lowestPriority) throw new Error(`Schedule and By templates must be the same priority level. Fix by setting all Schedule and By templates to priority level ${lowestPriority}`);
			});
			templates.filter((t) => t.type === "by" || t.type === "spend").forEach((t) => {
				if (differenceInCalendarMonths(`${t.month}`, month) < 0 && !(t.repeat || t.annual)) throw new Error(`Target month has passed, remove or update the target month`);
			});
		}
		static async checkPercentage(templates) {
			const pt = templates.filter((t) => t.type === "percentage");
			if (pt.length === 0) return;
			const incomeCategories = (await getCategories$2()).filter((c) => c.is_income);
			const availNames = new Set(incomeCategories.map((c) => c.name.toLocaleLowerCase()));
			const availIds = new Set(incomeCategories.map((c) => c.id));
			const specialSources = new Set(["all income", "available funds"]);
			pt.forEach((t) => {
				const raw = t.category;
				const lowered = raw.toLocaleLowerCase();
				if (specialSources.has(lowered) || availNames.has(lowered) || availIds.has(raw)) return;
				throw new Error(`Category \x22${raw}\x22 is not found in available income categories`);
			});
		}
		checkLimit(templates) {
			for (const template of templates.filter((t) => t.type === "simple" || t.type === "periodic" || t.type === "limit" || t.type === "remainder")) {
				let limitDef;
				if (template.type === "limit") limitDef = template;
				else if (template.limit) limitDef = template.limit;
				else continue;
				if (this.limitCheck) throw new Error("Only one `up to` allowed per category");
				if (limitDef.period === "daily") {
					const numDays = differenceInCalendarDays(addMonths(this.month, 1), this.month);
					this.limitAmount += amountToInteger(limitDef.amount, this.currency.decimalPlaces) * numDays;
				} else if (limitDef.period === "weekly") {
					if (!limitDef.start) throw new Error("Weekly limit requires a start date (YYYY-MM-DD)");
					const nextMonth$1 = nextMonth(this.month);
					let week = limitDef.start;
					const baseLimit = amountToInteger(limitDef.amount, this.currency.decimalPlaces);
					while (week < nextMonth$1) {
						if (week >= this.month) this.limitAmount += baseLimit;
						week = addWeeks(week, 1);
					}
				} else if (limitDef.period === "monthly") this.limitAmount = amountToInteger(limitDef.amount, this.currency.decimalPlaces);
				else throw new Error("Invalid limit period. Check template syntax");
				this.limitCheck = true;
				this.limitHold = limitDef.hold ? true : false;
				if (this.fromLastMonth >= this.limitAmount) {
					this.limitMet = true;
					if (this.limitHold) {
						this.limitExcess = 0;
						this.toBudgetAmount = 0;
						this.fullAmount = 0;
					} else {
						this.limitExcess = this.fromLastMonth - this.limitAmount;
						this.toBudgetAmount = -this.limitExcess;
						this.fullAmount = -this.limitExcess;
					}
				}
			}
		}
		checkSpend() {
			if (this.templates.filter((t) => t.type === "spend").length > 1) throw new Error("Only one spend template is allowed per category");
		}
		checkGoal() {
			if (this.goals.length > 1) throw new Error(`Only one #goal is allowed per category`);
		}
		removeFraction(amount) {
			return amountToInteger(Math.round(integerToAmount(amount, this.currency.decimalPlaces)), this.currency.decimalPlaces);
		}
		static runSimple(template, templateContext) {
			if (template.monthly != null) return amountToInteger(template.monthly, templateContext.currency.decimalPlaces);
			else return templateContext.limitAmount - templateContext.fromLastMonth;
		}
		static runRefill(template, templateContext) {
			return templateContext.limitAmount - templateContext.fromLastMonth;
		}
		static async runCopy(template, templateContext) {
			return await getSheetValue(sheetForMonth(subMonths(templateContext.month, template.lookBack)), `budget-${templateContext.category.id}`);
		}
		static runPeriodic(template, templateContext) {
			let toBudget = 0;
			const amount = amountToInteger(template.amount, templateContext.currency.decimalPlaces);
			const period = template.period.period;
			const numPeriods = template.period.amount;
			let date = template.starting && template.starting.length > 0 ? template.starting : firstDayOfMonth(templateContext.month);
			let dateShiftFunction;
			switch (period) {
				case "day":
					dateShiftFunction = addDays;
					break;
				case "week":
					dateShiftFunction = addWeeks;
					break;
				case "month":
					dateShiftFunction = addMonths;
					break;
				case "year":
					dateShiftFunction = (date, numPeriods) => addMonths(date, numPeriods * 12);
					break;
				default: throw new Error(`Unrecognized periodic period: ${String(period)}`);
			}
			while (templateContext.month > date) date = dateShiftFunction(date, numPeriods);
			if (differenceInCalendarMonths(templateContext.month, date) < 0) return 0;
			const nextMonth = addMonths(templateContext.month, 1);
			while (date < nextMonth) {
				toBudget += amount;
				date = dateShiftFunction(date, numPeriods);
			}
			return toBudget;
		}
		static async runSpend(template, templateContext) {
			let fromMonth = `${template.from}`;
			let toMonth = `${template.month}`;
			let alreadyBudgeted = templateContext.fromLastMonth;
			let firstMonth = true;
			const repeat = template.annual ? (template.repeat || 1) * 12 : template.repeat;
			let m = differenceInCalendarMonths(toMonth, templateContext.month);
			if (repeat && m < 0) while (m < 0) {
				toMonth = addMonths(toMonth, repeat);
				fromMonth = addMonths(fromMonth, repeat);
				m = differenceInCalendarMonths(toMonth, templateContext.month);
			}
			for (let m = fromMonth; differenceInCalendarMonths(templateContext.month, m) > 0; m = addMonths(m, 1)) {
				const sheetName = sheetForMonth(m);
				if (firstMonth) {
					const spent = await getSheetValue(sheetName, `sum-amount-${templateContext.category.id}`);
					alreadyBudgeted = await getSheetValue(sheetName, `leftover-${templateContext.category.id}`) - spent;
					firstMonth = false;
				} else alreadyBudgeted += await getSheetValue(sheetName, `budget-${templateContext.category.id}`);
			}
			const numMonths = differenceInCalendarMonths(toMonth, templateContext.month);
			const target = amountToInteger(template.amount, templateContext.currency.decimalPlaces);
			if (numMonths < 0) return 0;
			else return Math.round((target - alreadyBudgeted) / (numMonths + 1));
		}
		static async runPercentage(template, availableFunds, templateContext) {
			const percent = template.percent;
			const cat = template.category.toLocaleLowerCase();
			const prev = template.previous;
			let sheetName;
			let monthlyIncome;
			if (prev) sheetName = sheetForMonth(subMonths(templateContext.month, 1));
			else sheetName = sheetForMonth(templateContext.month);
			if (cat === "all income") monthlyIncome = await getSheetValue(sheetName, `total-income`);
			else if (cat === "available funds") monthlyIncome = availableFunds;
			else {
				const incomeCat = (await getCategories$2()).find((c) => c.is_income && (c.id === template.category || c.name.toLocaleLowerCase() === cat));
				if (!incomeCat) throw new Error(`Income category "${template.category}" not found for percentage template`);
				monthlyIncome = await getSheetValue(sheetName, `sum-amount-${incomeCat.id}`);
			}
			return Math.max(0, Math.round(monthlyIncome * (percent / 100)));
		}
		static async runAverage(template, templateContext) {
			let sum = 0;
			for (let i = 1; i <= template.numMonths; i++) {
				const sheetName = sheetForMonth(subMonths(templateContext.month, i));
				sum += await getSheetValue(sheetName, `sum-amount-${templateContext.category.id}`);
			}
			let average = -(sum / template.numMonths);
			if (template.adjustment !== void 0 && template.adjustmentType) switch (template.adjustmentType) {
				case "percent":
					average = (1 + template.adjustment / 100) * average;
					break;
				case "fixed":
					average += amountToInteger(template.adjustment, templateContext.currency.decimalPlaces);
					break;
				default:
			}
			return Math.round(average);
		}
		static runBy(templateContext) {
			const byTemplates = templateContext.templates.filter((t) => t.type === "by");
			const savedInfo = [];
			let totalNeeded = 0;
			let workingShortNumMonths;
			for (let i = 0; i < byTemplates.length; i++) {
				const template = byTemplates[i];
				let targetMonth = `${template.month}`;
				const period = template.annual ? (template.repeat || 1) * 12 : template.repeat != null ? template.repeat : null;
				let numMonths = differenceInCalendarMonths(targetMonth, templateContext.month);
				while (numMonths < 0 && period) {
					targetMonth = addMonths(targetMonth, period);
					numMonths = differenceInCalendarMonths(targetMonth, templateContext.month);
				}
				savedInfo.push({
					numMonths,
					period
				});
				if (workingShortNumMonths === void 0 || numMonths < workingShortNumMonths) workingShortNumMonths = numMonths;
			}
			const shortNumMonths = workingShortNumMonths || 0;
			const perTemplateNeed = /* @__PURE__ */ new Map();
			for (let i = 0; i < byTemplates.length; i++) {
				const template = byTemplates[i];
				const numMonths = savedInfo[i].numMonths;
				const period = savedInfo[i].period;
				let amount;
				if (numMonths > shortNumMonths && period) amount = Math.round(amountToInteger(template.amount, templateContext.currency.decimalPlaces) / period * (period - numMonths + shortNumMonths));
				else if (numMonths > shortNumMonths) amount = Math.round(amountToInteger(template.amount, templateContext.currency.decimalPlaces) / (numMonths + 1) * (shortNumMonths + 1));
				else amount = amountToInteger(template.amount, templateContext.currency.decimalPlaces);
				perTemplateNeed.set(template, amount);
				totalNeeded += amount;
			}
			return {
				toBudget: Math.round((totalNeeded - templateContext.fromLastMonth) / (shortNumMonths + 1)),
				perTemplateNeed
			};
		}
	};
	function redistributeBatch(perTemplateLocal, templates, type, weightOf) {
		const siblings = templates.filter((template) => template.type === type);
		if (siblings.length < 2) return;
		let total = 0;
		for (const sibling of siblings) {
			total += perTemplateLocal.get(sibling) ?? 0;
			perTemplateLocal.set(sibling, 0);
		}
		if (total === 0) return;
		const totalWeight = siblings.reduce((sum, s) => sum + weightOf(s), 0);
		if (totalWeight <= 0) {
			let remaining = total;
			siblings.forEach((sibling, i) => {
				const share = i === siblings.length - 1 ? remaining : Math.round(total / siblings.length);
				const allocated = Math.max(0, Math.min(share, remaining));
				perTemplateLocal.set(sibling, (perTemplateLocal.get(sibling) ?? 0) + allocated);
				remaining -= allocated;
			});
			return;
		}
		let remaining = total;
		siblings.forEach((sibling, i) => {
			const share = i === siblings.length - 1 ? remaining : Math.round(total * weightOf(sibling) / totalWeight);
			const allocated = Math.max(0, Math.min(share, remaining));
			perTemplateLocal.set(sibling, (perTemplateLocal.get(sibling) ?? 0) + allocated);
			remaining -= allocated;
		});
	}
	//#endregion
	//#region ../loot-core/src/server/budget/goal-template.ts
	function distributeRemainder(templateContexts, availBudget) {
		let remainderContexts = templateContexts.filter((c) => c.hasRemainder());
		while (availBudget > 0 && remainderContexts.length > 0) {
			let remainderWeight = 0;
			remainderContexts.forEach((context) => remainderWeight += context.getRemainderWeight());
			const perWeight = availBudget / remainderWeight;
			const beforePass = availBudget;
			remainderContexts.forEach((context) => {
				availBudget -= context.runRemainder(availBudget, perWeight);
			});
			if (availBudget === beforePass) break;
			remainderContexts = templateContexts.filter((c) => c.hasRemainder());
		}
		return availBudget;
	}
	async function storeTemplates({ categoriesWithTemplates, source }) {
		let touchedCleanup = false;
		await batchMessages(async () => {
			for (const { id, templates, cleanup } of categoriesWithTemplates) {
				const update = {
					id,
					goal_def: templates.length > 0 ? JSON.stringify(templates) : null,
					template_settings: { source }
				};
				if (cleanup !== void 0) {
					update.cleanup_def = cleanup.length > 0 ? JSON.stringify(cleanup) : null;
					touchedCleanup = true;
				}
				await updateWithSchema("categories", update);
			}
		});
		if (touchedCleanup) await tombstoneOrphanCleanupGroups();
	}
	async function applyTemplate({ month }) {
		await storeNoteTemplates();
		return await processTemplate(month, false, await getTemplates(), []);
	}
	async function overwriteTemplate({ month }) {
		await storeNoteTemplates();
		return await processTemplate(month, true, await getTemplates(), []);
	}
	async function applyMultipleCategoryTemplates({ month, categoryIds }) {
		const { data: categoryData } = await aqlQuery(q("categories").filter({ id: { $oneof: categoryIds } }).select("*"));
		await storeNoteTemplates();
		return await processTemplate(month, true, await getTemplates((c) => categoryIds.includes(c.id)), categoryData);
	}
	async function applySingleCategoryTemplate({ month, category }) {
		const { data: categoryData } = await aqlQuery(q("categories").filter({ id: category }).select("*"));
		await storeNoteTemplates();
		return await processTemplate(month, true, await getTemplates((c) => c.id === category), categoryData);
	}
	function runCheckTemplates() {
		return checkTemplateNotes();
	}
	async function getCategories$1() {
		const { data: categoryGroups } = await aqlQuery(q("category_groups").filter({ hidden: false }).select("*"));
		return categoryGroups.flatMap((g) => g.categories || []).filter((c) => !c.hidden);
	}
	async function getTemplates(filter = () => true) {
		const { data: categoriesWithGoalDef } = await aqlQuery(q("categories").filter({ goal_def: { $ne: null } }).select("*"));
		const categoryTemplates = {};
		for (const categoryWithGoalDef of categoriesWithGoalDef.filter(filter)) {
			if (!categoryWithGoalDef.goal_def) continue;
			categoryTemplates[categoryWithGoalDef.id] = JSON.parse(categoryWithGoalDef.goal_def);
		}
		return categoryTemplates;
	}
	async function getTemplatesForCategory(categoryId) {
		return getTemplates((c) => c.id === categoryId);
	}
	async function setBudgets(month, templateBudget) {
		await batchMessages(async () => {
			templateBudget.forEach((element) => {
				setBudget({
					category: element.category,
					month,
					amount: element.budgeted
				});
			});
		});
	}
	async function setGoals(month, templateGoal) {
		await batchMessages(async () => {
			templateGoal.forEach((element) => {
				setGoal({
					month,
					category: element.category,
					goal: element.goal,
					long_goal: element.longGoal
				});
			});
		});
	}
	async function computeTemplates(month, force, categoryTemplates, categories = [], skipAvailableClamp = false) {
		const isTracking = isTrackingBudget();
		if (!categories.length) categories = (await getCategories$1()).filter((c) => isTracking || !c.is_income);
		const templateContexts = [];
		let availBudget = await getSheetValue(sheetForMonth(month), `to-budget`);
		const prioritiesSet = /* @__PURE__ */ new Set();
		const errors = [];
		const orphanGoals = [];
		for (const category of categories) {
			const { id } = category;
			const sheetName = sheetForMonth(month);
			const templates = categoryTemplates[id];
			const budgeted = await getSheetValue(sheetName, `budget-${id}`);
			const existingGoal = await getSheetValue(sheetName, `goal-${id}`);
			if ((budgeted === 0 || force) && templates) try {
				const templateContext = await CategoryTemplateContext.init(templates, category, month, budgeted, skipAvailableClamp);
				if (!templateContext.isGoalOnly()) availBudget += budgeted;
				availBudget += templateContext.getLimitExcess();
				templateContext.getPriorities().forEach((p) => prioritiesSet.add(p));
				templateContexts.push(templateContext);
			} catch (e) {
				errors.push(`${category.name}: ${e.message}`);
			}
			else if (existingGoal !== null && !templates) orphanGoals.push({
				category: id,
				goal: null,
				longGoal: null
			});
		}
		if (errors.length > 0) return {
			contexts: templateContexts,
			errors,
			orphanGoals
		};
		const priorities = new Int32Array([...prioritiesSet]).sort((a, b) => a - b);
		for (const priority of priorities) {
			const availStart = availBudget;
			for (const templateContext of templateContexts) {
				const budget = await templateContext.runTemplatesForPriority(priority, availBudget, availStart);
				availBudget -= budget;
			}
		}
		distributeRemainder(templateContexts, availBudget);
		return {
			contexts: templateContexts,
			errors,
			orphanGoals
		};
	}
	async function processTemplate(month, force, categoryTemplates, categories = []) {
		const { contexts, errors, orphanGoals } = await computeTemplates(month, force, categoryTemplates, categories);
		if (contexts.length === 0 && errors.length === 0) {
			if (orphanGoals.length > 0) await setGoals(month, orphanGoals);
			return {
				type: "message",
				message: "Everything is up to date"
			};
		}
		if (errors.length > 0) return {
			sticky: true,
			message: "There were errors interpreting some templates:",
			pre: errors.join(`\n\n`)
		};
		const budgetList = [];
		const goalList = [...orphanGoals];
		contexts.forEach((context) => {
			const values = context.getValues();
			budgetList.push({
				category: context.category.id,
				budgeted: values.budgeted
			});
			goalList.push({
				category: context.category.id,
				goal: values.goal,
				longGoal: values.longGoal ? 1 : null
			});
		});
		await setBudgets(month, budgetList);
		await setGoals(month, goalList);
		return {
			type: "message",
			message: `Successfully applied templates to ${contexts.length} categories`
		};
	}
	async function dryRunCategoryTemplate({ month, categoryId, templates }) {
		const { data: categoryData } = await aqlQuery(q("categories").filter({ id: categoryId }).select("*"));
		if (categoryData.length === 0) return {
			budgeted: 0,
			perTemplate: templates.map(() => 0)
		};
		const { contexts } = await computeTemplates(month, true, { [categoryId]: templates }, categoryData, true);
		const ctx = contexts.find((c) => c.category.id === categoryId);
		if (!ctx) return {
			budgeted: 0,
			perTemplate: templates.map(() => 0)
		};
		const values = ctx.getValues();
		return {
			budgeted: values.budgeted,
			perTemplate: templates.map((t) => values.perTemplateContribution.get(t) ?? 0)
		};
	}
	//#endregion
	//#region ../loot-core/src/server/budget/app.ts
	var app$15 = createApp();
	app$15.method("budget/budget-amount", mutator(undoable(setBudget)));
	app$15.method("budget/copy-previous-month", mutator(undoable(copyPreviousMonth)));
	app$15.method("budget/copy-single-month", mutator(undoable(copySinglePreviousMonth)));
	app$15.method("budget/set-zero", mutator(undoable(setZero)));
	app$15.method("budget/set-3month-avg", mutator(undoable(set3MonthAvg)));
	app$15.method("budget/set-6month-avg", mutator(undoable(set6MonthAvg)));
	app$15.method("budget/set-12month-avg", mutator(undoable(set12MonthAvg)));
	app$15.method("budget/set-n-month-avg", mutator(undoable(setNMonthAvg)));
	app$15.method("budget/check-templates", mutator(undoable(runCheckTemplates)));
	app$15.method("budget/apply-goal-template", mutator(undoable(applyTemplate)));
	app$15.method("budget/apply-multiple-templates", mutator(undoable(applyMultipleCategoryTemplates)));
	app$15.method("budget/overwrite-goal-template", mutator(undoable(overwriteTemplate)));
	app$15.method("budget/apply-single-template", mutator(undoable(applySingleCategoryTemplate)));
	app$15.method("budget/cleanup-goal-template", mutator(undoable(cleanupTemplate)));
	app$15.method("budget/hold-for-next-month", mutator(undoable(holdForNextMonth)));
	app$15.method("budget/reset-hold", mutator(undoable(resetHold)));
	app$15.method("budget/cover-overspending", mutator(undoable(coverOverspending)));
	app$15.method("budget/transfer-available", mutator(undoable(transferAvailable)));
	app$15.method("budget/cover-overbudgeted", mutator(undoable(coverOverbudgeted)));
	app$15.method("budget/transfer-category", mutator(undoable(transferCategory)));
	app$15.method("budget/copy-until-year-end", mutator(undoable(copyUntilYearEnd)));
	app$15.method("budget/set-carryover", mutator(undoable(setCategoryCarryover)));
	app$15.method("budget/reset-income-carryover", mutator(undoable(resetIncomeCarryover)));
	app$15.method("get-categories", getCategories);
	app$15.method("get-budget-bounds", getBudgetBounds);
	app$15.method("envelope-budget-month", envelopeBudgetMonth);
	app$15.method("tracking-budget-month", trackingBudgetMonth);
	app$15.method("category-create", mutator(undoable(createCategory)));
	app$15.method("category-update", mutator(undoable(updateCategory)));
	app$15.method("category-move", mutator(undoable(moveCategory)));
	app$15.method("category-delete", mutator(undoable(deleteCategory)));
	app$15.method("get-category-groups", getCategoryGroups);
	app$15.method("category-group-create", mutator(undoable(createCategoryGroup)));
	app$15.method("category-group-update", mutator(undoable(updateCategoryGroup)));
	app$15.method("category-group-move", mutator(undoable(moveCategoryGroup)));
	app$15.method("category-group-delete", mutator(undoable(deleteCategoryGroup)));
	app$15.method("must-category-transfer", isCategoryTransferRequired);
	app$15.method("budget/get-category-automations", getTemplatesForCategory);
	app$15.method("budget/set-category-automations", mutator(undoable(storeTemplates)));
	app$15.method("budget/dry-run-category-template", dryRunCategoryTemplate);
	app$15.method("budget/store-note-templates", mutator(storeNoteTemplates));
	app$15.method("budget/store-note-cleanups", mutator(storeNoteCleanups));
	app$15.method("budget/render-note-templates", unparse);
	app$15.method("budget/create-cleanup-group", mutator(undoable(createCleanupGroup)));
	async function getCategories({ hidden } = {}) {
		const categoryGroups = await getCategoryGroups({ hidden });
		let list;
		if (hidden === true) {
			const { data } = await aqlQuery(q("categories").filter({ hidden: true }).select("*"));
			list = data;
		} else list = categoryGroups.flatMap((g) => g.categories ?? []);
		return {
			grouped: categoryGroups,
			list
		};
	}
	async function getBudgetBounds() {
		return await createAllBudgets();
	}
	async function envelopeBudgetMonth({ month }) {
		const groups = await getCategoriesGrouped();
		const sheetName = sheetForMonth(month);
		function value(name) {
			const v = getCellValue(sheetName, name);
			return {
				value: v === "" ? 0 : v,
				name: resolveName(sheetName, name)
			};
		}
		let values = [
			value("available-funds"),
			value("last-month-overspent"),
			value("buffered"),
			value("total-budgeted"),
			value("to-budget"),
			value("from-last-month"),
			value("total-income"),
			value("total-spent"),
			value("total-leftover")
		];
		for (const group of groups) {
			const categories = group.categories ?? [];
			if (group.is_income) {
				values.push(value("total-income"));
				for (const cat of categories) values.push(value(`sum-amount-${cat.id}`));
			} else {
				values = values.concat([
					value(`group-budget-${group.id}`),
					value(`group-sum-amount-${group.id}`),
					value(`group-leftover-${group.id}`)
				]);
				for (const cat of categories) values = values.concat([
					value(`budget-${cat.id}`),
					value(`sum-amount-${cat.id}`),
					value(`leftover-${cat.id}`),
					value(`carryover-${cat.id}`),
					value(`goal-${cat.id}`),
					value(`long-goal-${cat.id}`)
				]);
			}
		}
		return values;
	}
	async function trackingBudgetMonth({ month }) {
		const groups = await getCategoriesGrouped();
		const sheetName = sheetForMonth(month);
		function value(name) {
			const v = getCellValue(sheetName, name);
			return {
				value: v === "" ? 0 : v,
				name: resolveName(sheetName, name)
			};
		}
		let values = [
			value("total-budgeted"),
			value("total-budget-income"),
			value("total-saved"),
			value("total-income"),
			value("total-spent"),
			value("real-saved"),
			value("total-leftover")
		];
		for (const group of groups) {
			values = values.concat([
				value(`group-budget-${group.id}`),
				value(`group-sum-amount-${group.id}`),
				value(`group-leftover-${group.id}`)
			]);
			const categories = group.categories ?? [];
			for (const cat of categories) {
				values = values.concat([
					value(`budget-${cat.id}`),
					value(`sum-amount-${cat.id}`),
					value(`leftover-${cat.id}`),
					value(`goal-${cat.id}`),
					value(`long-goal-${cat.id}`)
				]);
				if (!group.is_income) values.push(value(`carryover-${cat.id}`));
			}
		}
		return values;
	}
	async function createCategory({ name, groupId, isIncome, hidden }) {
		if (!groupId) throw APIError("Creating a category: groupId is required");
		return await insertCategory({
			name: name.trim(),
			cat_group: groupId,
			is_income: isIncome ? 1 : 0,
			hidden: hidden ? 1 : 0
		});
	}
	async function updateCategory(category) {
		try {
			await updateCategory$1(categoryModel$1.toDb({
				...category,
				name: category.name.trim()
			}));
		} catch (e) {
			if (e instanceof Error && e.message.toLowerCase().includes("unique constraint")) throw new Error(`A category with the name "${category.name}" already exists.`, { cause: e });
			throw e;
		}
	}
	async function moveCategory({ id, groupId, targetId }) {
		await batchMessages(async () => {
			await moveCategory$1(id, groupId, targetId);
		});
	}
	async function deleteCategory({ id, transferId }) {
		await batchMessages(async () => {
			const row = await first$2("SELECT is_income FROM categories WHERE id = ?", [id]);
			if (!row) throw new Error(`Category with id ${id} not found.`);
			const transfer = transferId && await first$2("SELECT is_income FROM categories WHERE id = ?", [transferId]);
			if (transferId && !transfer) throw new Error(`Transfer category with id ${transferId} not found.`);
			else if (transferId && row && transfer && row.is_income !== transfer.is_income) throw new Error("Cannot transfer between income and expense categories.");
			if (row.is_income === 0) {
				if (transferId) await doTransfer([id], transferId);
			}
			await deleteCategory$1({ id }, transferId);
		});
	}
	async function getCategoryGroups({ hidden } = {}) {
		const baseQuery = q("category_groups").select("*");
		const { data: categoryGroups } = await aqlQuery(hidden === void 0 ? baseQuery : baseQuery.filter({ hidden }));
		if (hidden === void 0) return categoryGroups;
		return categoryGroups.map((g) => ({
			...g,
			categories: g.categories?.filter((c) => Boolean(c.hidden) === hidden)
		}));
	}
	async function createCategoryGroup({ name, isIncome, hidden }) {
		return await insertCategoryGroup({
			name,
			is_income: isIncome ? 1 : 0,
			hidden: hidden ? 1 : 0
		});
	}
	async function updateCategoryGroup(group) {
		await updateCategoryGroup$1(categoryGroupModel$1.toDb(group));
	}
	async function moveCategoryGroup({ id, targetId }) {
		await batchMessages(async () => {
			await moveCategoryGroup$1(id, targetId);
		});
	}
	async function deleteCategoryGroup({ id, transferId }) {
		const groupCategories = await all("SELECT id FROM categories WHERE cat_group = ? AND tombstone = 0", [id]);
		await batchMessages(async () => {
			if (transferId) await doTransfer(groupCategories.map((c) => c.id), transferId);
			await deleteCategoryGroup$1({ id }, transferId);
		});
	}
	async function isCategoryTransferRequired({ id }) {
		if (runQuery(`SELECT count(t.id) as count FROM transactions t
       LEFT JOIN category_mapping cm ON cm.id = t.category
       WHERE cm.transferId = ? AND t.tombstone = 0`, [id], true)[0].count !== 0) return true;
		return [...get$2().meta().createdMonths].some((month) => {
			const sheetName = sheetForMonth(month);
			const value = get$2().getCellValue(sheetName, "budget-" + id);
			return value != null && value !== 0;
		});
	}
	//#endregion
	//#region ../loot-core/src/mocks/random.ts
	var pseudoRandomIterator = 0;
	function pseudoRandom() {
		pseudoRandomIterator += .45;
		if (pseudoRandomIterator > 1) pseudoRandomIterator = 0;
		return pseudoRandomIterator;
	}
	var random = isPlaywright ? pseudoRandom : Math.random;
	//#endregion
	//#region ../loot-core/src/mocks/budget.ts
	function pickRandom(list) {
		return list[Math.floor(random() * list.length) % list.length];
	}
	function number(start, end) {
		return start + (end - start) * random();
	}
	function integer(start, end) {
		return Math.round(number(start, end));
	}
	function findMin(items, field) {
		let item = items[0];
		for (let i = 0; i < items.length; i++) if (items[i][field] < item[field]) item = items[i];
		return item;
	}
	function getStartingBalanceCat(categories) {
		return categories.find((c) => c.name === "Starting Balances").id;
	}
	function extractCommonThings(payees, groups) {
		const incomePayee = payees.find((p) => p.name === "Deposit");
		const expensePayees = payees.filter((p) => p.name !== "Deposit" && p.name !== "Starting Balance");
		const expenseGroup = groups.find((g) => !g.is_income);
		const incomeGroup = groups.find((g) => g.is_income);
		const categories = expenseGroup.categories.filter((c) => [
			"Food",
			"Restaurants",
			"Entertainment",
			"Clothing",
			"General",
			"Gift",
			"Medical"
		].indexOf(c.name) !== -1);
		return {
			incomePayee,
			expensePayees: expensePayees.filter((p) => !p.bill),
			incomeGroup,
			expenseCategories: categories,
			billCategories: groups.find((g) => g.name === "Bills").categories,
			billPayees: expensePayees.filter((p) => p.bill)
		};
	}
	async function fillPrimaryChecking(handlers, account, payees, groups) {
		const { incomePayee, expensePayees, incomeGroup, expenseCategories, billCategories, billPayees } = extractCommonThings(payees, groups);
		const numTransactions = integer(100, 200);
		const transactions = [];
		for (let i = 0; i < numTransactions; i++) {
			let payee;
			if (random() < .09) payee = incomePayee;
			else payee = pickRandom(expensePayees);
			let category;
			if (payee.name === "Deposit") category = incomeGroup.categories.find((c) => c.name === "Income");
			else category = pickRandom(expenseCategories);
			let amount;
			if (payee.name === "Deposit") amount = integer(5e4, 7e4);
			else amount = integer(0, random() < .05 ? -8e3 : -700);
			const currentDate = subDays(currentDay(), Math.floor(i / 3));
			const transaction = {
				id: v4(),
				amount,
				payee: payee.id,
				account: account.id,
				date: currentDate,
				category: category.id
			};
			transactions.push(transaction);
			if (random() < .2) {
				const a = Math.round(transaction.amount / 3);
				const pick = () => payee === incomePayee ? incomeGroup.categories.find((c) => c.name === "Income").id : pickRandom(expenseCategories).id;
				transaction.subtransactions = [
					{
						id: v4(),
						date: currentDate,
						account: account.id,
						amount: a,
						category: pick()
					},
					{
						id: v4(),
						date: currentDate,
						account: account.id,
						amount: a,
						category: pick()
					},
					{
						id: v4(),
						date: currentDate,
						account: account.id,
						amount: transaction.amount - a * 2,
						category: pick()
					}
				];
			}
		}
		const months = rangeInclusive(monthFromDate(transactions[transactions.length - 1].date), currentMonth());
		const currentDay$1 = currentDay();
		for (const month of months) {
			let date = addDays(month, 12);
			if (isBefore(date, currentDay$1)) transactions.push({
				amount: -1e4,
				payee: billPayees.find((p) => p.name.toLowerCase().includes("power")).id,
				account: account.id,
				date,
				category: billCategories.find((c) => c.name === "Power").id
			});
			date = addDays(month, 18);
			if (isBefore(date, currentDay$1)) transactions.push({
				amount: -9e3,
				payee: billPayees.find((p) => p.name.toLowerCase().includes("water")).id,
				account: account.id,
				date,
				category: billCategories.find((c) => c.name === "Water").id
			});
			date = addDays(month, 2);
			if (isBefore(date, currentDay$1)) transactions.push({
				amount: -12e4,
				payee: billPayees.find((p) => p.name.toLowerCase().includes("housy")).id,
				account: account.id,
				date,
				category: billCategories.find((c) => c.name === "Mortgage").id
			});
			date = addDays(month, 20);
			if (isBefore(date, currentDay$1)) transactions.push({
				amount: -6e3,
				payee: billPayees.find((p) => p.name.toLowerCase().includes("internet")).id,
				account: account.id,
				date,
				category: billCategories.find((c) => c.name === "Internet").id
			});
			date = addDays(month, 23);
			if (isBefore(date, currentDay$1)) transactions.push({
				amount: -7500,
				payee: billPayees.find((p) => p.name.toLowerCase().includes("t-mobile")).id,
				account: account.id,
				date,
				category: billCategories.find((c) => c.name === "Cell").id
			});
		}
		let earliestDate = null;
		transactions.forEach((t) => {
			if (earliestDate == null || t.date < earliestDate) earliestDate = t.date;
		});
		transactions.unshift({
			amount: 1e5,
			payee: payees.find((p) => p.name === "Starting Balance").id,
			account: account.id,
			date: earliestDate,
			category: getStartingBalanceCat(incomeGroup.categories),
			starting_balance_flag: true
		});
		return addTransactions(account.id, transactions);
	}
	async function fillChecking(handlers, account, payees, groups) {
		const { incomePayee, expensePayees, incomeGroup, expenseCategories } = extractCommonThings(payees, groups);
		const numTransactions = integer(20, 40);
		const transactions = [];
		for (let i = 0; i < numTransactions; i++) {
			let payee;
			if (random() < .04) payee = incomePayee;
			else payee = pickRandom(expensePayees);
			let category;
			if (payee.name === "Deposit") category = incomeGroup.categories.find((c) => c.name === "Income");
			else category = pickRandom(expenseCategories);
			const amount = payee.name === "Deposit" ? integer(5e4, 7e4) : integer(0, -1e4);
			transactions.push({
				amount,
				payee: payee.id,
				account: account.id,
				date: subDays(currentDay(), i * 2),
				category: category.id
			});
		}
		transactions.unshift({
			amount: integer(9e4, 12e4),
			payee: payees.find((p) => p.name === "Starting Balance").id,
			account: account.id,
			date: transactions[transactions.length - 1].date,
			category: getStartingBalanceCat(incomeGroup.categories),
			starting_balance_flag: true
		});
		await handlers["transactions-batch-update"]({
			added: transactions,
			fastMode: true
		});
	}
	async function fillInvestment(handlers, account, payees, groups) {
		const { incomePayee, incomeGroup } = extractCommonThings(payees, groups);
		const numTransactions = integer(10, 30);
		const transactions = [];
		for (let i = 0; i < numTransactions; i++) {
			const payee = incomePayee;
			const category = incomeGroup.categories.find((c) => c.name === "Income");
			const amount = integer(1e4, 2e4);
			transactions.push({
				amount,
				payee: payee.id,
				account: account.id,
				date: subDays(currentDay(), integer(10, 360)),
				category: category.id
			});
		}
		transactions.unshift({
			amount: integer(1e4, 2e4),
			payee: payees.find((p) => p.name === "Starting Balance").id,
			account: account.id,
			date: findMin(transactions, "date").date,
			category: getStartingBalanceCat(incomeGroup.categories),
			starting_balance_flag: true
		});
		await handlers["transactions-batch-update"]({
			added: transactions,
			fastMode: true
		});
	}
	async function fillSavings(handlers, account, payees, groups) {
		const { incomePayee, expensePayees, incomeGroup, expenseCategories } = extractCommonThings(payees, groups);
		const numTransactions = integer(15, 40);
		const transactions = [];
		for (let i = 0; i < numTransactions; i++) {
			let payee;
			if (random() < .3) payee = incomePayee;
			else payee = pickRandom(expensePayees);
			const category = payee === incomePayee ? incomeGroup.categories.find((c) => c.name === "Income") : pickRandom(expenseCategories);
			const amount = payee === incomePayee ? integer(1e4, 8e4) : integer(-1e4, -2e3);
			transactions.push({
				amount,
				payee: payee.id,
				account: account.id,
				date: subDays(currentDay(), i * 5),
				category: category.id
			});
		}
		transactions.unshift({
			amount: 3e4,
			payee: payees.find((p) => p.name === "Starting Balance").id,
			account: account.id,
			date: transactions[transactions.length - 1].date,
			category: getStartingBalanceCat(incomeGroup.categories),
			starting_balance_flag: true
		});
		await handlers["transactions-batch-update"]({
			added: transactions,
			fastMode: true
		});
	}
	async function fillMortgage(handlers, account, payees, groups) {
		const { incomePayee, incomeGroup } = extractCommonThings(payees, groups);
		const numTransactions = integer(7, 10);
		const amount = integer(1e5, 2e5);
		const category = incomeGroup.categories.find((c) => c.name === "Income");
		const transactions = [{
			amount: integer(-3e3, -3500) * 100 * 100,
			payee: payees.find((p) => p.name === "Starting Balance").id,
			account: account.id,
			date: subMonths(currentDay(), numTransactions) + "-02",
			category: getStartingBalanceCat(incomeGroup.categories),
			starting_balance_flag: true
		}];
		for (let i = 0; i < numTransactions; i++) {
			const payee = incomePayee;
			transactions.push({
				amount,
				payee: payee.id,
				account: account.id,
				date: subMonths(currentDay(), i) + "-02",
				category: category.id,
				starting_balance_flag: true
			});
		}
		await handlers["transactions-batch-update"]({
			added: transactions,
			fastMode: true
		});
	}
	async function fillOther(handlers, account, payees, groups) {
		const { incomePayee, incomeGroup } = extractCommonThings(payees, groups);
		const numTransactions = integer(3, 6);
		const category = incomeGroup.categories.find((c) => c.name === "Income");
		const transactions = [{
			id: v4(),
			amount: integer(3250, 3700) * 100 * 100,
			payee: payees.find((p) => p.name === "Starting Balance").id,
			account: account.id,
			date: subMonths(currentDay(), numTransactions) + "-02",
			category: getStartingBalanceCat(incomeGroup.categories),
			starting_balance_flag: true
		}];
		for (let i = 0; i < numTransactions; i++) {
			const payee = incomePayee;
			const amount = integer(4, 9) * 100 * 100;
			transactions.push({
				id: v4(),
				amount,
				payee: payee.id,
				account: account.id,
				date: subMonths(currentDay(), i) + "-02",
				category: category.id
			});
		}
		await handlers["transactions-batch-update"]({
			added: transactions,
			fastMode: true
		});
	}
	async function createBudget$1(accounts, payees, groups) {
		const primaryAccount = accounts.find((a) => a.name = "Bank of America");
		const earliestDate = (await first$2(`SELECT t.date FROM v_transactions t LEFT JOIN accounts a ON t.account = a.id
       WHERE a.offbudget = 0 AND t.is_child = 0 ORDER BY date ASC LIMIT 1`)).date;
		const earliestPrimaryDate = (await first$2(`SELECT t.date FROM v_transactions t LEFT JOIN accounts a ON t.account = a.id
       WHERE a.id = ? AND a.offbudget = 0 AND t.is_child = 0 ORDER BY date ASC LIMIT 1`, [primaryAccount.id])).date;
		const months = rangeInclusive(monthFromDate(fromDateRepr(earliestDate)), currentMonth());
		function category(name) {
			for (const group of groups) {
				const cat = group.categories.find((c) => c.name === name);
				if (cat) return cat;
			}
		}
		function setBudget$1(month, category, amount) {
			return setBudget({
				month,
				category: category.id,
				amount
			});
		}
		function setBudgetIfSpent(month, cat) {
			const spent = getCellValue(sheetForMonth(month), `sum-amount-${cat.id}`);
			if (spent < 0) setBudget$1(month, cat, -spent);
		}
		await runMutator(() => batchMessages(async () => {
			for (const month of months) if (month >= monthFromDate(fromDateRepr(earliestPrimaryDate))) {
				setBudget$1(month, category("Food"), 4e4);
				setBudget$1(month, category("Restaurants"), 3e4);
				setBudget$1(month, category("Entertainment"), 1e4);
				setBudget$1(month, category("Clothing"), 3e3);
				setBudget$1(month, category("General"), 5e4);
				setBudget$1(month, category("Gift"), 7500);
				setBudget$1(month, category("Medical"), 1e4);
				setBudget$1(month, category("Cell"), 7500);
				setBudget$1(month, category("Internet"), 6e3);
				setBudget$1(month, category("Mortgage"), 12e4);
				setBudget$1(month, category("Water"), 9e3);
				setBudget$1(month, category("Power"), 1e4);
			} else {
				setBudgetIfSpent(month, category("Food"));
				setBudgetIfSpent(month, category("Restaurants"));
				setBudgetIfSpent(month, category("Entertainment"));
				setBudgetIfSpent(month, category("Clothing"));
				setBudgetIfSpent(month, category("General"));
				setBudgetIfSpent(month, category("Gift"));
				setBudgetIfSpent(month, category("Medical"));
				setBudgetIfSpent(month, category("Cell"));
				setBudgetIfSpent(month, category("Internet"));
				setBudgetIfSpent(month, category("Mortgage"));
				setBudgetIfSpent(month, category("Water"));
				setBudgetIfSpent(month, category("Power"));
			}
		}));
		await waitOnSpreadsheet();
		await runMutator(() => batchMessages(async () => {
			let prevSaved = 0;
			for (const month of months) if (month >= monthFromDate(fromDateRepr(earliestPrimaryDate)) && month <= currentMonth()) {
				const available = getCellValue(sheetForMonth(month), "to-budget") - prevSaved;
				if (available - 403e3 > 0) {
					setBudget$1(month, category("Savings"), available - 403e3);
					setBuffer(month, 403e3);
					prevSaved += available - 403e3;
				} else if (available > 0) setBuffer(month, available);
			}
		}));
		await waitOnSpreadsheet();
		const toBudget = getCellValue(sheetForMonth(currentMonth()), "to-budget");
		if (toBudget < 0) await addTransactions(primaryAccount.id, [{
			amount: -toBudget,
			category: category("Income").id,
			date: currentMonth() + "-01"
		}]);
		await waitOnSpreadsheet();
	}
	async function createTestBudget(handlers) {
		setSyncingMode("import");
		execQuery("PRAGMA journal_mode = OFF");
		runQuery("DELETE FROM categories;");
		runQuery("DELETE FROM category_groups");
		const accounts = [
			{ name: "Bank of America" },
			{ name: "Ally Savings" },
			{ name: "Capital One Checking" },
			{ name: "HSBC" },
			{
				name: "Vanguard 401k",
				offBudget: true
			},
			{
				name: "Mortgage",
				offBudget: true
			},
			{
				name: "House Asset",
				offBudget: true
			},
			{
				name: "Roth IRA",
				offBudget: true
			}
		];
		await runMutator(async () => {
			for (const account of accounts) account.id = await handlers["account-create"](account);
		});
		const newPayees = [
			{ name: "Starting Balance" },
			{ name: "Kroger" },
			{ name: "Publix" },
			{ name: "Home Depot" },
			{ name: "Movies" },
			{ name: "Online store" },
			{ name: "Deposit" },
			{
				name: "Dominion Power",
				bill: true
			},
			{
				name: "Extra Watery",
				bill: true
			},
			{
				name: "Housy House",
				bill: true
			},
			{
				name: "Fast Internet",
				bill: true
			},
			{
				name: "T-mobile",
				bill: true
			}
		];
		const payees = [];
		await runMutator(() => batchMessages(async () => {
			for (const newPayee of newPayees) {
				const id = await handlers["payee-create"]({ name: newPayee.name });
				payees.push({
					id,
					name: newPayee.name,
					...newPayee
				});
			}
		}));
		const newCategoryGroups = [
			{
				name: "Usual Expenses",
				categories: [
					{ name: "Savings" },
					{ name: "Medical" },
					{ name: "Gift" },
					{ name: "General" },
					{ name: "Clothing" },
					{ name: "Entertainment" },
					{ name: "Restaurants" },
					{ name: "Food" }
				]
			},
			{
				name: "Bills",
				categories: [
					{ name: "Power" },
					{ name: "Water" },
					{ name: "Mortgage" },
					{ name: "Internet" },
					{ name: "Cell" }
				]
			},
			{
				name: "Income",
				is_income: true,
				categories: [
					{
						name: "Income",
						is_income: true
					},
					{
						name: "Misc",
						is_income: true
					},
					{
						name: "Starting Balances",
						is_income: true
					}
				]
			}
		];
		const categoryGroups = [];
		await runMutator(async () => {
			for (const group of newCategoryGroups) {
				const groupId = await handlers["category-group-create"]({
					name: group.name,
					isIncome: group.is_income
				});
				categoryGroups.push({
					...group,
					id: groupId,
					categories: []
				});
				for (const category of group.categories) {
					const categoryId = await handlers["category-create"]({
						...category,
						isIncome: category.is_income,
						groupId
					});
					categoryGroups[categoryGroups.length - 1].categories.push({
						...category,
						id: categoryId,
						group: groupId
					});
				}
			}
		});
		const allGroups = (await runHandler(handlers["get-categories"])).grouped;
		setSyncingMode("import");
		await runMutator(() => batchMessages(async () => {
			for (const account of accounts) if (account.name === "Bank of America") await fillPrimaryChecking(handlers, account, payees, allGroups);
			else if (account.name === "Capital One Checking" || account.name === "HSBC") await fillChecking(handlers, account, payees, allGroups);
			else if (account.name === "Ally Savings") await fillSavings(handlers, account, payees, allGroups);
			else if (account.name === "Vanguard 401k" || account.name === "Roth IRA") await fillInvestment(handlers, account, payees, allGroups);
			else if (account.name === "Mortgage") await fillMortgage(handlers, account, payees, allGroups);
			else if (account.name === "House Asset") await fillOther(handlers, account, payees, allGroups);
			else {
				console.error("Unknown account name for test budget: ", account.name);
				await fillChecking(handlers, account, payees, allGroups);
			}
		}));
		setSyncingMode("import");
		const primaryAccount = accounts.find((a) => a.name = "Bank of America");
		const { data: primaryBalance } = await aqlQuery(q("transactions").filter({ account: primaryAccount.id }).calculate({ $sum: "$amount" }).serialize());
		if (primaryBalance < 0) {
			const { data: results } = await aqlQuery(q("transactions").filter({
				account: primaryAccount.id,
				amount: { $gt: 0 }
			}).limit(1).select(["id", "amount"]).serialize());
			const lastDeposit = results[0];
			await runHandler(handlers["transaction-update"], {
				...lastDeposit,
				amount: lastDeposit.amount + -primaryBalance + integer(1e4, 2e4)
			});
		}
		setSyncingMode("disabled");
		await reloadSpreadsheet(db_exports);
		await createAllBudgets();
		await waitOnSpreadsheet();
		await runMutator(() => batchMessages(async () => {
			const account = accounts.find((acc) => acc.name === "Bank of America");
			await runHandler(handlers["schedule/create"], {
				schedule: {
					name: "Phone bills",
					posts_transaction: false
				},
				conditions: [
					{
						op: "is",
						field: "payee",
						value: payees.find((item) => item.name === "Dominion Power").id
					},
					{
						op: "is",
						field: "account",
						value: account.id
					},
					{
						op: "is",
						field: "date",
						value: {
							start: currentDay(),
							frequency: "monthly",
							patterns: [],
							skipWeekend: false,
							weekendSolveMode: "after"
						}
					},
					{
						op: "isapprox",
						field: "amount",
						value: -12e3
					}
				]
			});
			await runHandler(handlers["schedule/create"], {
				schedule: {
					name: "Internet bill",
					posts_transaction: false
				},
				conditions: [
					{
						op: "is",
						field: "payee",
						value: payees.find((item) => item.name === "Fast Internet").id
					},
					{
						op: "is",
						field: "account",
						value: account.id
					},
					{
						op: "is",
						field: "date",
						value: subDays(currentDay(), 1)
					},
					{
						op: "isapprox",
						field: "amount",
						value: -14e3
					}
				]
			});
			await runHandler(handlers["schedule/create"], {
				schedule: {
					name: "Wedding",
					posts_transaction: false
				},
				conditions: [{
					op: "is",
					field: "date",
					value: {
						start: subDays(currentDay(), 3),
						frequency: "monthly",
						patterns: [],
						skipWeekend: false,
						weekendSolveMode: "after"
					}
				}, {
					op: "is",
					field: "amount",
					value: -27e5
				}]
			});
			await runHandler(handlers["schedule/create"], {
				schedule: {
					name: "Utilities",
					posts_transaction: false
				},
				conditions: [
					{
						op: "is",
						field: "account",
						value: account.id
					},
					{
						op: "is",
						field: "date",
						value: {
							start: addDays(currentDay(), 1),
							frequency: "monthly",
							patterns: [],
							skipWeekend: false,
							weekendSolveMode: "after"
						}
					},
					{
						op: "is",
						field: "amount",
						value: -19e4
					}
				]
			});
		}));
		await createBudget$1(accounts, payees, allGroups);
	}
	//#endregion
	//#region ../loot-core/src/server/importers/actual.ts
	async function importActual(_filepath, buffer) {
		await handlers["close-budget"]();
		let id;
		try {
			({id} = await importBuffer({
				cloudFileId: null,
				groupId: null
			}, buffer));
		} catch (e) {
			if (e.type === "FileDownloadError") return { error: e.reason };
			throw e;
		}
		const sqliteDb = await openDatabase$1(join$1(getBudgetDir(id), "db.sqlite"));
		execQuery$2(sqliteDb, `
          DELETE FROM kvcache;
          DELETE FROM kvcache_key;
        `);
		closeDatabase$1(sqliteDb);
		await handlers["load-budget"]({ id });
		await handlers["get-budget-bounds"]();
		await waitOnSpreadsheet();
		await upload().catch(() => {});
	}
	//#endregion
	//#region ../loot-core/src/server/importers/ynab4.ts
	var ynab4_exports = /* @__PURE__ */ __exportAll({
		doImport: () => doImport$1,
		getBudgetName: () => getBudgetName$1,
		parseFile: () => parseFile$2
	});
	async function importAccounts$1(data, entityIdMap) {
		const accounts = sortByKey(data.accounts, "sortableIndex");
		return Promise.all(accounts.map(async (account) => {
			if (!account.isTombstone) {
				const id = await send("api/account-create", { account: {
					name: account.accountName,
					offbudget: account.onBudget ? false : true,
					closed: account.hidden ? true : false
				} });
				entityIdMap.set(account.entityId, id);
			}
		}));
	}
	async function importCategories$1(data, entityIdMap) {
		const masterCategories = sortByKey(data.masterCategories, "sortableIndex");
		await Promise.all(masterCategories.map(async (masterCategory) => {
			if (masterCategory.type === "OUTFLOW" && !masterCategory.isTombstone && masterCategory.subCategories && masterCategory.subCategories.some((cat) => !cat.isTombstone)) {
				const id = await send("api/category-group-create", { group: {
					name: masterCategory.name,
					is_income: false
				} });
				entityIdMap.set(masterCategory.entityId, id);
				if (masterCategory.note) send("notes-save", {
					id,
					note: masterCategory.note
				});
				if (masterCategory.subCategories) {
					const subCategories = sortByKey(masterCategory.subCategories, "sortableIndex");
					subCategories.reverse();
					for (const category of subCategories) if (!category.isTombstone) {
						let categoryName = category.name;
						if (masterCategory.name === "Hidden Categories") {
							const categoryNameParts = categoryName.split(" ` ");
							categoryNameParts.pop();
							categoryName = categoryNameParts.join("/").trim();
						}
						const id = await send("api/category-create", { category: {
							name: categoryName,
							group_id: entityIdMap.get(category.masterCategoryId)
						} });
						entityIdMap.set(category.entityId, id);
						if (category.note) send("notes-save", {
							id,
							note: category.note
						});
					}
				}
			}
		}));
	}
	async function importPayees$1(data, entityIdMap) {
		for (const payee of data.payees) if (!payee.isTombstone) {
			const id = await send("api/payee-create", { payee: {
				name: payee.name,
				transfer_acct: entityIdMap.get(payee.targetAccountId) || null
			} });
			entityIdMap.set(payee.entityId, id);
		}
	}
	async function importTransactions$1(data, entityIdMap) {
		const incomeCategoryId = (await send("api/categories-get", { grouped: false })).find((cat) => cat.name === "Income").id;
		const accounts = await send("api/accounts-get");
		const payees = await send("api/payees-get");
		function getCategory(id) {
			if (id == null || id === "Category/__Split__") return null;
			else if (id === "Category/__ImmediateIncome__" || id === "Category/__DeferredIncome__") return incomeCategoryId;
			return entityIdMap.get(id);
		}
		function isOffBudget(acctId) {
			const acct = accounts.find((acct) => acct.id === acctId);
			if (!acct) throw new Error("Could not find account for transaction when importing");
			return acct.offbudget;
		}
		for (const transaction of data.transactions) {
			entityIdMap.set(transaction.entityId, v4());
			if (transaction.subTransactions) for (const subTransaction of transaction.subTransactions) entityIdMap.set(subTransaction.entityId, v4());
		}
		const transactionsGrouped = groupBy$1(data.transactions, "accountId");
		await Promise.all([...transactionsGrouped.keys()].map(async (accountId) => {
			const toImport = transactionsGrouped.get(accountId).map((transaction) => {
				if (transaction.isTombstone) return null;
				const id = entityIdMap.get(transaction.entityId);
				function transferProperties(t) {
					const transferId = entityIdMap.get(t.transferTransactionId) || null;
					let payee = null;
					let imported_payee = null;
					if (transferId) payee = payees.find((p) => p.transfer_acct === entityIdMap.get(t.targetAccountId)).id;
					else {
						payee = entityIdMap.get(t.payeeId);
						imported_payee = data.payees.find((p) => p.entityId === t.payeeId)?.name;
					}
					return {
						transfer_id: transferId,
						payee,
						imported_payee
					};
				}
				return {
					id,
					amount: amountToInteger(transaction.amount),
					category: isOffBudget(entityIdMap.get(accountId)) ? null : getCategory(transaction.categoryId),
					date: transaction.date,
					notes: transaction.memo || null,
					cleared: transaction.cleared === "Cleared" || transaction.cleared === "Reconciled",
					reconciled: transaction.cleared === "Reconciled",
					...transferProperties(transaction),
					subtransactions: transaction.subTransactions && transaction.subTransactions.filter((st) => !st.isTombstone).map((t) => {
						return {
							id: entityIdMap.get(t.entityId),
							amount: amountToInteger(t.amount),
							category: getCategory(t.categoryId),
							notes: t.memo || null,
							...transferProperties(t)
						};
					})
				};
			}).filter((x) => x);
			await send("api/transactions-add", {
				accountId: entityIdMap.get(accountId),
				transactions: toImport,
				learnCategories: true,
				runTransfers: false
			});
		}));
	}
	function fillInBudgets(data, categoryBudgets) {
		const budgets = [...categoryBudgets];
		data.masterCategories.forEach((masterCategory) => {
			if (masterCategory.subCategories) masterCategory.subCategories.forEach((category) => {
				if (!budgets.find((b) => b.categoryId === category.entityId)) budgets.push({
					budgeted: 0,
					categoryId: category.entityId
				});
			});
		});
		return budgets;
	}
	async function importBudgets$1(data, entityIdMap) {
		const budgets = sortByKey(data.monthlyBudgets, "month");
		await send("api/batch-budget-start");
		try {
			for (const budget of budgets) {
				const filled = fillInBudgets(data, budget.monthlySubCategoryBudgets.filter((b) => !b.isTombstone));
				await Promise.all(filled.map(async (catBudget) => {
					const amount = amountToInteger(catBudget.budgeted);
					const catId = entityIdMap.get(catBudget.categoryId);
					const month = monthFromDate(budget.month);
					if (!catId) return;
					await send("api/budget-set-amount", {
						month,
						categoryId: catId,
						amount
					});
					if (catBudget.overspendingHandling === "AffectsBuffer") await send("api/budget-set-carryover", {
						month,
						categoryId: catId,
						flag: false
					});
					else if (catBudget.overspendingHandling === "Confined") await send("api/budget-set-carryover", {
						month,
						categoryId: catId,
						flag: true
					});
				}));
			}
		} finally {
			await send("api/batch-budget-end");
		}
	}
	function estimateRecentness(str) {
		return str.split(",").reduce((total, version) => {
			const [_, number] = version.split("-");
			return total + parseInt(number);
		}, 0);
	}
	function findLatestDevice(zipped, entries) {
		let devices = entries.map((entry) => {
			const contents = zipped.readFile(entry).toString("utf8");
			let data;
			try {
				data = JSON.parse(contents);
			} catch {
				return null;
			}
			if (data.hasFullKnowledge) return {
				deviceGUID: data.deviceGUID,
				shortName: data.shortDeviceId,
				recentness: estimateRecentness(data.knowledge)
			};
			return null;
		}).filter((x) => x);
		devices = sortByKey(devices, "recentness");
		return devices[devices.length - 1].deviceGUID;
	}
	async function doImport$1(data) {
		const entityIdMap = /* @__PURE__ */ new Map();
		logger.log("Importing Accounts...");
		await importAccounts$1(data, entityIdMap);
		logger.log("Importing Categories...");
		await importCategories$1(data, entityIdMap);
		logger.log("Importing Payees...");
		await importPayees$1(data, entityIdMap);
		logger.log("Importing Transactions...");
		await importTransactions$1(data, entityIdMap);
		logger.log("Importing Budgets...");
		await importBudgets$1(data, entityIdMap);
		logger.log("Setting up...");
	}
	function getBudgetName$1(filepath) {
		let unixFilepath = filepath.replace(/\\/g, "/");
		if (!/\.zip/.test(unixFilepath)) return null;
		unixFilepath = unixFilepath.replace(/\.zip$/, "").replace(/.ynab4$/, "");
		const m = unixFilepath.match(/([^/~]+)[^/]*$/);
		if (!m) return null;
		return m[1];
	}
	function getFile(entries, path) {
		const files = entries.filter((e) => e.entryName === path);
		if (files.length === 0) throw new Error("Could not find file: " + path);
		if (files.length >= 2) throw new Error("File name matches multiple files: " + path);
		return files[0];
	}
	function join(...paths) {
		return paths.slice(1).reduce((full, path) => {
			return full + "/" + path.replace(/^\//, "");
		}, paths[0].replace(/\/$/, ""));
	}
	function parseFile$2(buffer) {
		const zipped = new import_adm_zip.default(buffer);
		const entries = zipped.getEntries();
		let root = "";
		const dirMatch = entries[0].entryName.match(/([^/]*\.ynab4)/);
		if (dirMatch) root = dirMatch[1] + "/";
		const metaStr = zipped.readFile(getFile(entries, root + "Budget.ymeta"));
		const meta = JSON.parse(metaStr.toString("utf8"));
		const budgetPath = join(root, meta.relativeDataFolderName);
		const yfullPath = join(budgetPath, findLatestDevice(zipped, entries.filter((e) => e.entryName.startsWith(join(budgetPath, "devices")))), "Budget.yfull");
		let contents;
		try {
			contents = zipped.readFile(getFile(entries, yfullPath)).toString("utf8");
		} catch (e) {
			logger.log(e);
			throw new Error("Error reading Budget.yfull file");
		}
		try {
			return JSON.parse(contents);
		} catch {
			throw new Error("Error parsing Budget.yfull file");
		}
	}
	//#endregion
	//#region ../loot-core/src/server/importers/ynab5.ts
	var ynab5_exports = /* @__PURE__ */ __exportAll({
		doImport: () => doImport,
		getBudgetName: () => getBudgetName,
		parseFile: () => parseFile$1
	});
	var MAX_RETRY = 20;
	function normalizeError(e) {
		if (e instanceof Error) return e.message;
		if (typeof e === "string") return e;
		return String(e);
	}
	var flagColorMap = {
		red: "#FF6666",
		orange: "#F57C00",
		yellow: "#FBC02D",
		green: "#689F38",
		blue: "#1976D2",
		purple: "#512DA8",
		null: null,
		"": null
	};
	function equalsIgnoreCase(stringa, stringb) {
		return stringa.localeCompare(stringb, void 0, { sensitivity: "base" }) === 0;
	}
	function findByNameIgnoreCase(categories, name) {
		return categories.find((cat) => equalsIgnoreCase(cat.name, name));
	}
	function findIdByName(categories, name) {
		return findByNameIgnoreCase(categories, name)?.id;
	}
	function amountFromYnab(amount) {
		return Math.round(amount / 10);
	}
	function getDayOfMonth(date) {
		return parseDate(date).getDate();
	}
	function getYnabMonthlyPatterns(dateFirst) {
		if (getDayOfMonth(dateFirst) !== 31) return;
		return [{
			type: "day",
			value: -1
		}];
	}
	function getYnabTwiceMonthlyPatterns(dateFirst) {
		const firstDay = getDayOfMonth(dateFirst);
		const secondDay = getDayOfMonth(addDays(dateFirst, 15));
		return [{
			type: "day",
			value: firstDay === 31 ? -1 : firstDay
		}, {
			type: "day",
			value: secondDay === 31 ? -1 : secondDay
		}];
	}
	function mapYnabFrequency(frequency, dateFirst) {
		switch (frequency) {
			case "daily": return { frequency: "daily" };
			case "weekly": return { frequency: "weekly" };
			case "monthly": return {
				frequency: "monthly",
				patterns: getYnabMonthlyPatterns(dateFirst)
			};
			case "yearly": return { frequency: "yearly" };
			case "everyOtherWeek": return {
				frequency: "weekly",
				interval: 2
			};
			case "every4Weeks": return {
				frequency: "weekly",
				interval: 4
			};
			case "everyOtherMonth": return {
				frequency: "monthly",
				interval: 2,
				patterns: getYnabMonthlyPatterns(dateFirst)
			};
			case "every3Months": return {
				frequency: "monthly",
				interval: 3,
				patterns: getYnabMonthlyPatterns(dateFirst)
			};
			case "every4Months": return {
				frequency: "monthly",
				interval: 4,
				patterns: getYnabMonthlyPatterns(dateFirst)
			};
			case "everyOtherYear": return {
				frequency: "yearly",
				interval: 2
			};
			case "twiceAMonth": return {
				frequency: "monthly",
				patterns: getYnabTwiceMonthlyPatterns(dateFirst)
			};
			case "twiceAYear": return {
				frequency: "monthly",
				interval: 6,
				patterns: getYnabMonthlyPatterns(dateFirst)
			};
			default: throw new Error(`Unsupported scheduled frequency: ${frequency}`);
		}
	}
	function getScheduleDateValue(scheduled) {
		const dateFirst = scheduled.date_first;
		const frequency = scheduled.frequency;
		if (frequency === "never") return scheduled.date_next;
		const mapped = mapYnabFrequency(frequency, dateFirst);
		return {
			frequency: mapped.frequency,
			interval: mapped.interval,
			patterns: mapped.patterns,
			skipWeekend: false,
			weekendSolveMode: "after",
			endMode: "never",
			start: dateFirst
		};
	}
	function getFlaggedTransactions(data) {
		return [...data.transactions, ...data.scheduled_transactions];
	}
	function getFlagTag(transaction, flagNameConflicts) {
		const tagName = transaction.flag_name?.trim() ?? "";
		const colorKey = transaction.flag_color?.trim() ?? "";
		if (tagName.length === 0) return colorKey.length > 0 ? `#${colorKey}` : "";
		if (flagNameConflicts.has(tagName)) return `#${tagName}-${colorKey}`;
		return `#${tagName}`;
	}
	function getFlagNameConflicts(data) {
		const colorsByName = /* @__PURE__ */ new Map();
		const flaggedTransactions = getFlaggedTransactions(data);
		for (const transaction of flaggedTransactions) {
			if (transaction.deleted) continue;
			const tagName = transaction.flag_name?.trim() ?? "";
			const colorKey = transaction.flag_color?.trim() ?? "";
			if (tagName.length === 0 || !flagColorMap[colorKey]) continue;
			let colors = colorsByName.get(tagName);
			if (!colors) {
				colors = /* @__PURE__ */ new Set();
				colorsByName.set(tagName, colors);
			}
			colors.add(colorKey);
		}
		const conflicts = /* @__PURE__ */ new Set();
		colorsByName.forEach((colors, name) => {
			if (colors.size > 1) conflicts.add(name);
		});
		return conflicts;
	}
	function buildTransactionNotes(transaction, flagNameConflicts) {
		const notes = `${transaction.memo?.trim() ?? ""} ${getFlagTag(transaction, flagNameConflicts)}`.trim();
		return notes.length > 0 ? notes : null;
	}
	function buildRuleUpdate(rule, actions) {
		return {
			id: rule.id,
			stage: rule.stage ?? null,
			conditionsOp: rule.conditionsOp ?? "and",
			conditions: rule.conditions,
			actions
		};
	}
	function importAccounts(data, entityIdMap) {
		return Promise.all(data.accounts.map(async (account) => {
			if (!account.deleted) {
				const id = await send("api/account-create", { account: {
					name: account.name,
					offbudget: account.on_budget ? false : true,
					closed: account.closed
				} });
				entityIdMap.set(account.id, id);
			}
		}));
	}
	async function importCategories(data, entityIdMap) {
		const incomeCatId = findIdByName(await send("api/categories-get", { grouped: false }), "Income");
		const ynabIncomeCategories = ["To be Budgeted", "Inflow: Ready to Assign"];
		function checkSpecialCat(cat) {
			if (cat.category_group_id === findIdByName(data.category_groups, "Internal Master Category")) if (ynabIncomeCategories.some((ynabIncomeCategory) => equalsIgnoreCase(cat.name, ynabIncomeCategory))) return "income";
			else return "internal";
			else if (cat.category_group_id === findIdByName(data.category_groups, "Credit Card Payments")) return "creditCard";
			else if (cat.category_group_id === findIdByName(data.category_groups, "Income")) return "income";
		}
		async function createCategoryGroupWithUniqueName(params) {
			const baseName = params.hidden ? `${params.name} (hidden)` : params.name;
			let count = 0;
			while (true) {
				const name = count === 0 ? baseName : `${baseName} (${count})`;
				try {
					return {
						id: await send("api/category-group-create", { group: {
							...params,
							name
						} }),
						name
					};
				} catch (e) {
					if (count >= MAX_RETRY) {
						const errorMsg = normalizeError(e);
						throw Error("Unable to create category group: " + errorMsg);
					}
					count += 1;
				}
			}
		}
		async function createCategoryWithUniqueName(params) {
			const baseName = params.hidden ? `${params.name} (hidden)` : params.name;
			let count = 0;
			while (true) {
				const name = count === 0 ? baseName : `${baseName} (${count})`;
				try {
					return {
						id: await send("api/category-create", { category: {
							...params,
							name
						} }),
						name
					};
				} catch (e) {
					if (count >= MAX_RETRY) {
						const errorMsg = normalizeError(e);
						throw Error("Unable to create category: " + errorMsg);
					}
					count += 1;
				}
			}
		}
		for (const group of data.category_groups) if (!group.deleted) {
			let groupId;
			if (!equalsIgnoreCase(group.name, "Internal Master Category") && !equalsIgnoreCase(group.name, "Credit Card Payments") && !equalsIgnoreCase(group.name, "Hidden Categories") && !equalsIgnoreCase(group.name, "Income")) {
				groupId = (await createCategoryGroupWithUniqueName({
					name: group.name,
					is_income: false,
					hidden: group.hidden
				})).id;
				entityIdMap.set(group.id, groupId);
				if (group.note) send("notes-save", {
					id: groupId,
					note: group.note
				});
			}
			if (equalsIgnoreCase(group.name, "Income")) {
				groupId = incomeCatId;
				entityIdMap.set(group.id, groupId);
			}
			const cats = data.categories.filter((cat) => cat.category_group_id === group.id);
			for (const cat of cats.reverse()) if (!cat.deleted) switch (checkSpecialCat(cat)) {
				case "income": {
					const id = incomeCatId;
					entityIdMap.set(cat.id, id);
					break;
				}
				case "creditCard":
				case "internal": break;
				default: {
					if (!groupId) break;
					const createdCategory = await createCategoryWithUniqueName({
						name: cat.name,
						group_id: groupId,
						hidden: cat.hidden
					});
					entityIdMap.set(cat.id, createdCategory.id);
					if (cat.note) send("notes-save", {
						id: createdCategory.id,
						note: cat.note
					});
				}
			}
		}
	}
	function importPayees(data, entityIdMap) {
		return Promise.all(data.payees.map(async (payee) => {
			if (!payee.deleted) {
				const id = await send("api/payee-create", { payee: { name: payee.name } });
				entityIdMap.set(payee.id, id);
			}
		}));
	}
	async function importPayeeLocations(data, entityIdMap) {
		if (!data?.payee_locations) {
			logger.log("No payee locations data provided, skipping...");
			return;
		}
		const payeeLocations = data.payee_locations;
		for (const location of payeeLocations) {
			if (location.deleted) continue;
			const actualPayeeId = entityIdMap.get(location.payee_id);
			if (!actualPayeeId) {
				logger.log(`Skipping location for unknown payee: ${location.payee_id}`);
				continue;
			}
			const latitude = parseFloat(location.latitude);
			const longitude = parseFloat(location.longitude);
			if (isNaN(latitude) || isNaN(longitude)) {
				logger.log(`Skipping location with invalid coordinates for payee ${actualPayeeId}: lat=${location.latitude}, lng=${location.longitude}`);
				continue;
			}
			try {
				await send("payee-location-create", {
					payeeId: actualPayeeId,
					latitude,
					longitude
				});
			} catch (error) {
				const errorMessage = error instanceof Error ? error.message : String(error ?? "Unknown error");
				logger.error(`Failed to import location for payee ${actualPayeeId} at (${latitude}, ${longitude}): ${errorMessage}`);
			}
		}
	}
	async function importFlagsAsTags(data, flagNameConflicts) {
		const tagsToCreate = /* @__PURE__ */ new Map();
		const flaggedTransactions = getFlaggedTransactions(data);
		for (const transaction of flaggedTransactions) {
			if (transaction.deleted) continue;
			const tagName = transaction.flag_name?.trim() ?? "";
			const colorKey = transaction.flag_color?.trim() ?? "";
			const tagColor = flagColorMap[colorKey] ?? null;
			if (!tagColor) continue;
			if (tagName.length === 0) {
				if (!tagsToCreate.has(colorKey)) tagsToCreate.set(colorKey, tagColor);
				continue;
			}
			const mappedName = flagNameConflicts.has(tagName) ? `${tagName}-${colorKey}` : tagName;
			if (!tagsToCreate.has(mappedName)) tagsToCreate.set(mappedName, tagColor);
		}
		if (tagsToCreate.size === 0) return;
		await Promise.all([...tagsToCreate.entries()].map(async ([tag, color]) => {
			await send("tags-create", {
				tag,
				color,
				description: "Imported from YNAB"
			});
		}));
	}
	async function importTransactions(data, entityIdMap, flagNameConflicts) {
		const payees = await send("api/payees-get");
		const categories = await send("api/categories-get", { grouped: false });
		const incomeCatId = findIdByName(categories, "Income");
		const startingBalanceCatId = findIdByName(categories, "Starting Balances");
		const startingPayeeYNAB = findIdByName(data.payees, "Starting Balance");
		const transactionsGrouped = groupBy$1(data.transactions, "account_id");
		const subtransactionsGrouped = groupBy$1(data.subtransactions, "transaction_id");
		const payeesByTransferAcct = payees.filter((payee) => payee?.transfer_acct).map((payee) => [payee.transfer_acct, payee]);
		const payeeTransferAcctHashMap = new Map(payeesByTransferAcct);
		const orphanTransferMap = /* @__PURE__ */ new Map();
		const orphanSubtransfer = [];
		const orphanSubtransferTrxId = [];
		const orphanSubtransferAcctIdByTrxIdMap = /* @__PURE__ */ new Map();
		const orphanSubtransferDateByTrxIdMap = /* @__PURE__ */ new Map();
		for (const transaction of data.subtransactions) {
			entityIdMap.set(transaction.id, v4());
			if (transaction.transfer_account_id) {
				orphanSubtransfer.push(transaction);
				orphanSubtransferTrxId.push(transaction.transaction_id);
			}
		}
		for (const transaction of data.transactions) {
			entityIdMap.set(transaction.id, v4());
			if (transaction.transfer_account_id && !transaction.transfer_transaction_id) {
				const key = transaction.account_id + "#" + transaction.transfer_account_id;
				if (!orphanTransferMap.has(key)) orphanTransferMap.set(key, [transaction]);
				else orphanTransferMap.get(key).push(transaction);
			}
			if (orphanSubtransferTrxId.includes(transaction.id)) {
				orphanSubtransferAcctIdByTrxIdMap.set(transaction.id, transaction.account_id);
				orphanSubtransferDateByTrxIdMap.set(transaction.id, transaction.date);
			}
		}
		const orphanSubtransferMap = orphanSubtransfer.reduce((map, subtransaction) => {
			const key = subtransaction.transfer_account_id + "#" + orphanSubtransferAcctIdByTrxIdMap.get(subtransaction.transaction_id);
			if (!map.has(key)) map.set(key, [subtransaction]);
			else map.get(key).push(subtransaction);
			return map;
		}, /* @__PURE__ */ new Map());
		function orphanTransferComparator(a, b) {
			const date_a = "date" in a ? a.date : orphanSubtransferDateByTrxIdMap.get(a.transaction_id);
			const date_b = "date" in b ? b.date : orphanSubtransferDateByTrxIdMap.get(b.transaction_id);
			const amount_a = "date" in a ? a.amount : -a.amount;
			const amount_b = "date" in b ? b.amount : -b.amount;
			if (date_a > date_b) return 1;
			if (date_a < date_b) return -1;
			if (amount_a > amount_b) return 1;
			if (amount_a < amount_b) return -1;
			if (a.memo > b.memo) return 1;
			if (a.memo < b.memo) return -1;
			return 0;
		}
		const orphanTrxIdSubtrxIdMap = /* @__PURE__ */ new Map();
		orphanTransferMap.forEach((transactions, key) => {
			const subtransactions = orphanSubtransferMap.get(key);
			if (subtransactions) {
				transactions.sort(orphanTransferComparator);
				subtransactions.sort(orphanTransferComparator);
				let transactionIdx = 0;
				let subtransactionIdx = 0;
				do
					switch (orphanTransferComparator(transactions[transactionIdx], subtransactions[subtransactionIdx])) {
						case 0:
							orphanTrxIdSubtrxIdMap.set(transactions[transactionIdx].id, entityIdMap.get(subtransactions[subtransactionIdx].id));
							orphanTrxIdSubtrxIdMap.set(subtransactions[subtransactionIdx].id, entityIdMap.get(transactions[transactionIdx].id));
							transactionIdx++;
							subtransactionIdx++;
							break;
						case -1:
							transactionIdx++;
							break;
						case 1:
							subtransactionIdx++;
							break;
						default: throw new Error(`Unrecognized orphan transfer comparator result`);
					}
				while (transactionIdx < transactions.length && subtransactionIdx < subtransactions.length);
			}
		});
		await Promise.all([...transactionsGrouped.keys()].map(async (accountId) => {
			const toImport = transactionsGrouped.get(accountId).map((transaction) => {
				if (transaction.deleted) return null;
				const subtransactions = subtransactionsGrouped.get(transaction.id);
				const newTransaction = {
					id: entityIdMap.get(transaction.id),
					account: entityIdMap.get(transaction.account_id),
					date: transaction.date,
					amount: amountFromYnab(transaction.amount),
					category: entityIdMap.get(transaction.category_id) || null,
					cleared: ["cleared", "reconciled"].includes(transaction.cleared),
					reconciled: transaction.cleared === "reconciled",
					notes: buildTransactionNotes(transaction, flagNameConflicts),
					imported_id: transaction.import_id || null,
					transfer_id: entityIdMap.get(transaction.transfer_transaction_id) || orphanTrxIdSubtrxIdMap.get(transaction.id) || null,
					subtransactions: subtransactions ? subtransactions.map((subtrans) => {
						return {
							id: entityIdMap.get(subtrans.id),
							amount: amountFromYnab(subtrans.amount),
							category: entityIdMap.get(subtrans.category_id) || null,
							notes: subtrans.memo,
							transfer_id: orphanTrxIdSubtrxIdMap.get(subtrans.id) || null,
							payee: null,
							imported_payee: null
						};
					}) : null,
					payee: null,
					imported_payee: null
				};
				function transactionPayeeUpdate(trx, newTrx, fallbackPayeeId) {
					if (trx.transfer_account_id) {
						const mappedTransferAccountId = entityIdMap.get(trx.transfer_account_id);
						newTrx.payee = payeeTransferAcctHashMap.get(mappedTransferAccountId)?.id;
					} else if (trx.payee_id) {
						newTrx.payee = entityIdMap.get(trx.payee_id);
						newTrx.imported_payee = data.payees.find((p) => !p.deleted && p.id === trx.payee_id)?.name;
					} else if (fallbackPayeeId) newTrx.payee = fallbackPayeeId;
				}
				transactionPayeeUpdate(transaction, newTransaction);
				if (newTransaction.subtransactions) subtransactions.forEach((subtrans) => {
					transactionPayeeUpdate(subtrans, newTransaction.subtransactions.find((newSubtrans) => newSubtrans.id === entityIdMap.get(subtrans.id)), newTransaction.payee);
				});
				if (transaction.payee_id === startingPayeeYNAB && entityIdMap.get(transaction.category_id) === incomeCatId) {
					newTransaction.category = startingBalanceCatId;
					newTransaction.payee = null;
				}
				return newTransaction;
			}).filter((x) => x);
			await send("api/transactions-add", {
				accountId: entityIdMap.get(accountId),
				transactions: toImport,
				learnCategories: true,
				runTransfers: false
			});
		}));
	}
	async function importScheduledTransactions(data, entityIdMap, flagNameConflicts) {
		const scheduledTransactions = data.scheduled_transactions;
		const scheduledSubtransactionsGrouped = groupBy$1(data.scheduled_subtransactions, "scheduled_transaction_id");
		if (scheduledTransactions.length === 0) return;
		const payeesByTransferAcct = (await send("api/payees-get")).filter((payee) => payee?.transfer_acct).map((payee) => [payee.transfer_acct, payee]);
		const payeeTransferAcctHashMap = new Map(payeesByTransferAcct);
		const scheduleCategoryMap = /* @__PURE__ */ new Map();
		const scheduleSplitsMap = /* @__PURE__ */ new Map();
		const schedulePayeeMap = /* @__PURE__ */ new Map();
		async function createScheduleWithUniqueName(params) {
			const baseName = params.name;
			let count = 1;
			while (true) try {
				return await send("api/schedule-create", {
					...params,
					name: params.name
				});
			} catch (e) {
				if (count >= MAX_RETRY) {
					const errorMsg = normalizeError(e);
					throw Error(errorMsg);
				}
				params.name = `${baseName} (${count})`;
				count += 1;
			}
		}
		async function getRuleForSchedule(scheduleId) {
			const { data: ruleId } = await send("api/query", { query: q("schedules").filter({ id: scheduleId }).calculate("rule").serialize() });
			if (!ruleId) return null;
			const { data: ruleData } = await send("api/query", { query: q("rules").filter({ id: ruleId }).select("*").serialize() });
			const ruleRow = ruleData?.[0];
			if (!ruleRow) return null;
			return ruleModel.toJS(ruleRow);
		}
		for (const scheduled of scheduledTransactions) {
			if (scheduled.deleted) continue;
			const mappedAccountId = entityIdMap.get(scheduled.account_id);
			if (!mappedAccountId) continue;
			const scheduleDate = getScheduleDateValue(scheduled);
			let mappedPayeeId;
			if (scheduled.transfer_account_id) {
				const mappedTransferAccountId = entityIdMap.get(scheduled.transfer_account_id);
				mappedPayeeId = mappedTransferAccountId ? payeeTransferAcctHashMap.get(mappedTransferAccountId)?.id : void 0;
			} else if (scheduled.payee_id) mappedPayeeId = entityIdMap.get(scheduled.payee_id);
			if (!mappedPayeeId) continue;
			const scheduleId = await createScheduleWithUniqueName({
				name: scheduled.memo,
				posts_transaction: false,
				payee: mappedPayeeId,
				account: mappedAccountId,
				amount: amountFromYnab(scheduled.amount),
				amountOp: "is",
				date: scheduleDate
			});
			schedulePayeeMap.set(scheduleId, mappedPayeeId);
			const scheduleNotes = buildTransactionNotes(scheduled, flagNameConflicts);
			if (scheduleNotes) {
				const rule = await getRuleForSchedule(scheduleId);
				if (rule) {
					const actions = rule.actions ? [...rule.actions] : [];
					actions.push({
						op: "set",
						field: "notes",
						value: scheduleNotes
					});
					await send("api/rule-update", { rule: buildRuleUpdate(rule, actions) });
				}
			}
			const scheduledSubtransactions = scheduledSubtransactionsGrouped.get(scheduled.id)?.filter((subtransaction) => !subtransaction.deleted) || [];
			if (scheduledSubtransactions.length > 0) scheduleSplitsMap.set(scheduleId, scheduledSubtransactions);
			else if (!scheduled.transfer_account_id && scheduled.category_id) {
				const mappedCategoryId = entityIdMap.get(scheduled.category_id);
				if (mappedCategoryId) scheduleCategoryMap.set(scheduleId, mappedCategoryId);
			}
		}
		if (scheduleCategoryMap.size > 0 || scheduleSplitsMap.size > 0) {
			for (const [scheduleId, categoryId] of scheduleCategoryMap.entries()) {
				const rule = await getRuleForSchedule(scheduleId);
				if (!rule) continue;
				const actions = rule.actions ? [...rule.actions] : [];
				actions.push({
					op: "set",
					field: "category",
					value: categoryId
				});
				await send("api/rule-update", { rule: buildRuleUpdate(rule, actions) });
			}
			for (const [scheduleId, subtransactions] of scheduleSplitsMap.entries()) {
				const rule = await getRuleForSchedule(scheduleId);
				if (!rule) continue;
				const actions = rule.actions ? [...rule.actions] : [];
				const parentPayeeId = schedulePayeeMap.get(scheduleId);
				subtransactions.forEach((subtransaction, index) => {
					const splitIndex = index + 1;
					actions.push({
						op: "set-split-amount",
						value: amountFromYnab(subtransaction.amount),
						options: {
							splitIndex,
							method: "fixed-amount"
						}
					});
					if (subtransaction.memo) actions.push({
						op: "set",
						field: "notes",
						value: subtransaction.memo,
						options: { splitIndex }
					});
					if (subtransaction.transfer_account_id) {
						const mappedTransferAccountId = entityIdMap.get(subtransaction.transfer_account_id);
						const transferPayeeId = mappedTransferAccountId ? payeeTransferAcctHashMap.get(mappedTransferAccountId)?.id : void 0;
						if (transferPayeeId) actions.push({
							op: "set",
							field: "payee",
							value: transferPayeeId,
							options: { splitIndex }
						});
					} else if (subtransaction.payee_id) {
						const mappedPayeeId = entityIdMap.get(subtransaction.payee_id);
						if (mappedPayeeId) actions.push({
							op: "set",
							field: "payee",
							value: mappedPayeeId,
							options: { splitIndex }
						});
					} else if (parentPayeeId) actions.push({
						op: "set",
						field: "payee",
						value: parentPayeeId,
						options: { splitIndex }
					});
					if (!subtransaction.transfer_account_id && subtransaction.category_id) {
						const mappedCategoryId = entityIdMap.get(subtransaction.category_id);
						if (mappedCategoryId) actions.push({
							op: "set",
							field: "category",
							value: mappedCategoryId,
							options: { splitIndex }
						});
					}
				});
				await send("api/rule-update", { rule: buildRuleUpdate(rule, actions) });
			}
		}
	}
	async function importBudgets(data, entityIdMap) {
		const budgets = sortByKey(data.months, "month");
		const internalCatIdYnab = findIdByName(data.category_groups, "Internal Master Category");
		const creditcardCatIdYnab = findIdByName(data.category_groups, "Credit Card Payments");
		await send("api/batch-budget-start");
		try {
			for (const budget of budgets) {
				const month = monthFromDate(budget.month);
				await Promise.all(budget.categories.map(async (catBudget) => {
					const catId = entityIdMap.get(catBudget.id);
					const amount = Math.round(catBudget.budgeted / 10);
					if (!catId || catBudget.category_group_id === internalCatIdYnab || catBudget.category_group_id === creditcardCatIdYnab) return;
					await send("api/budget-set-amount", {
						month,
						categoryId: catId,
						amount
					});
				}));
			}
		} finally {
			await send("api/batch-budget-end");
		}
	}
	function parseFile$1(buffer) {
		let data = JSON.parse(buffer.toString());
		if (data.data) data = data.data;
		if (data.budget) data = data.budget;
		return data;
	}
	function getBudgetName(_filepath, data) {
		return data.budget_name || data.name;
	}
	async function doImport(data) {
		const entityIdMap = /* @__PURE__ */ new Map();
		const flagNameConflicts = getFlagNameConflicts(data);
		logger.log("Importing Accounts...");
		await importAccounts(data, entityIdMap);
		logger.log("Importing Categories...");
		await importCategories(data, entityIdMap);
		logger.log("Importing Payees...");
		await importPayees(data, entityIdMap);
		logger.log("Importing Payee Locations...");
		await importPayeeLocations(data, entityIdMap);
		logger.log("Importing Tags...");
		await importFlagsAsTags(data, flagNameConflicts);
		logger.log("Importing Transactions...");
		await importTransactions(data, entityIdMap, flagNameConflicts);
		logger.log("Importing Scheduled Transactions...");
		await importScheduledTransactions(data, entityIdMap, flagNameConflicts);
		logger.log("Importing Budgets...");
		await importBudgets(data, entityIdMap);
		logger.log("Setting up...");
	}
	//#endregion
	//#region ../loot-core/src/server/importers/index.ts
	var importers = {
		ynab4: ynab4_exports,
		ynab5: ynab5_exports
	};
	async function handleBudgetImport(type, filepath, buffer) {
		if (type === "actual") return importActual(filepath, buffer);
		const importer = importers[type];
		try {
			let data;
			let budgetName;
			try {
				data = importer.parseFile(buffer);
				budgetName = importer.getBudgetName(filepath, data);
			} catch (e) {
				logger.error("failed to parse file", e);
			}
			if (!budgetName) return { error: "not-" + type };
			try {
				await handlers["api/start-import"]({ budgetName });
			} catch (e) {
				logger.error("failed to start import", e);
				return { error: "unknown" };
			}
			await importer.doImport(data);
		} catch (e) {
			await handlers["api/abort-import"]();
			logger.error("failed to run import", e);
			return { error: "unknown" };
		}
		await handlers["api/finish-import"]();
	}
	//#endregion
	//#region ../loot-core/src/server/sync/migrate.ts
	function migrateParentIds(_oldValues, newValues) {
		newValues.forEach((items, table) => {
			if (table === "transactions") {
				const toApply = [];
				items.forEach((newValue) => {
					if (newValue.isChild === 1 && newValue.parent_id == null && newValue.id.includes("/")) {
						const parentId = newValue.id.split("/")[0];
						toApply.push({
							dataset: "transactions",
							row: newValue.id,
							column: "parent_id",
							value: parentId,
							timestamp: Timestamp.send()
						});
					}
				});
				if (toApply.length > 0) applyMessages(toApply);
			}
		});
	}
	var _unlisten = null;
	function listen() {
		unlisten();
		_unlisten = addSyncListener(migrateParentIds);
	}
	function unlisten() {
		if (_unlisten) {
			_unlisten();
			_unlisten = null;
		}
	}
	//#endregion
	//#region ../loot-core/migrations/1632571489012_remove_cache.js
	var import_crypto_browserify = require_crypto_browserify();
	async function runMigration$4(db) {
		function getValue(node) {
			return node.expr != null ? node.expr : node.cachedValue;
		}
		db.execQuery(`
CREATE TABLE zero_budget_months
  (id TEXT PRIMARY KEY,
   buffered INTEGER DEFAULT 0);

CREATE TABLE zero_budgets
  (id TEXT PRIMARY KEY,
   month INTEGER,
   category TEXT,
   amount INTEGER DEFAULT 0,
   carryover INTEGER DEFAULT 0);

CREATE TABLE reflect_budgets
  (id TEXT PRIMARY KEY,
   month INTEGER,
   category TEXT,
   amount INTEGER DEFAULT 0,
   carryover INTEGER DEFAULT 0);

CREATE TABLE notes
  (id TEXT PRIMARY KEY,
   note TEXT);

CREATE TABLE kvcache (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE kvcache_key (id INTEGER PRIMARY KEY, key REAL);
`);
		const budget = db.runQuery(`SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!budget-%'`, [], true);
		db.transaction(() => {
			budget.forEach((monthBudget) => {
				const match = monthBudget.name.match(/^(budget-report|budget)(\d+)!budget-(.+)$/);
				if (match == null) {
					console.log("Warning: invalid budget month name", monthBudget.name);
					return;
				}
				const type = match[1];
				const month = match[2].slice(0, 4) + "-" + match[2].slice(4);
				const dbmonth = parseInt(match[2]);
				const cat = match[3];
				let amount = parseInt(getValue(monthBudget));
				if (isNaN(amount)) amount = 0;
				const sheetName = monthBudget.name.split("!")[0];
				const carryover = db.runQuery("SELECT * FROM spreadsheet_cells WHERE name = ?", [`${sheetName}!carryover-${cat}`], true);
				const table = type === "budget-report" ? "reflect_budgets" : "zero_budgets";
				db.runQuery(`INSERT INTO ${table} (id, month, category, amount, carryover) VALUES (?, ?, ?, ?, ?)`, [
					`${month}-${cat}`,
					dbmonth,
					cat,
					amount,
					carryover.length > 0 && getValue(carryover[0]) === "true" ? 1 : 0
				]);
			});
		});
		const buffers = db.runQuery(`SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!buffered'`, [], true);
		db.transaction(() => {
			buffers.forEach((buffer) => {
				const match = buffer.name.match(/^budget(\d+)!buffered$/);
				if (match) {
					const month = match[1].slice(0, 4) + "-" + match[1].slice(4);
					let amount = parseInt(getValue(buffer));
					if (isNaN(amount)) amount = 0;
					db.runQuery(`INSERT INTO zero_budget_months (id, buffered) VALUES (?, ?)`, [month, amount]);
				}
			});
		});
		const notes = db.runQuery(`SELECT * FROM spreadsheet_cells WHERE name LIKE 'notes!%'`, [], true);
		const parseNote = (str) => {
			try {
				const value = JSON.parse(str);
				return value && value !== "" ? value : null;
			} catch {
				return null;
			}
		};
		db.transaction(() => {
			notes.forEach((note) => {
				const parsed = parseNote(getValue(note));
				if (parsed) {
					const [, id] = note.name.split("!");
					db.runQuery(`INSERT INTO notes (id, note) VALUES (?, ?)`, [id, parsed]);
				}
			});
		});
		db.execQuery(`
    DROP TABLE spreadsheet_cells;
    ANALYZE;
    VACUUM;
  `);
	}
	//#endregion
	//#region ../loot-core/migrations/1722717601000_reports_move_selected_categories.js
	async function runMigration$3(db) {
		const categories = db.runQuery("SELECT id FROM categories WHERE tombstone = 0", [], true);
		const customReports = db.runQuery("SELECT id, selected_categories, conditions FROM custom_reports WHERE tombstone = 0 AND selected_categories IS NOT NULL", [], true);
		for (const report of customReports) {
			const conditions = report.conditions ? JSON.parse(report.conditions) : [];
			const selectedCategoryIds = (report.selected_categories ? JSON.parse(report.selected_categories) : []).map(({ id }) => id);
			if (!categories.find(({ id }) => !selectedCategoryIds.includes(id))) continue;
			if (conditions.find(({ field }) => field === "category")) continue;
			db.runQuery("UPDATE custom_reports SET conditions = ? WHERE id = ?", [JSON.stringify([...conditions, {
				field: "category",
				op: "oneOf",
				value: selectedCategoryIds,
				type: "id"
			}]), report.id]);
		}
		db.runQuery("UPDATE custom_reports SET selected_categories = NULL WHERE tombstone = 0");
	}
	//#endregion
	//#region ../loot-core/src/shared/dashboard.ts
	var DEFAULT_DASHBOARD_STATE = [
		{
			type: "summary-card",
			width: 3,
			height: 2,
			x: 0,
			y: 0,
			meta: {
				name: "Total Income (YTD)",
				content: JSON.stringify({
					type: "sum",
					fontSize: 20
				}),
				timeFrame: {
					start: "2024-01-01",
					end: "2024-12-31",
					mode: "yearToDate"
				},
				conditions: [
					{
						field: "amount",
						op: "gt",
						value: 0
					},
					{
						field: "account",
						op: "onBudget",
						value: ""
					},
					{
						field: "transfer",
						op: "is",
						value: false
					}
				],
				conditionsOp: "and"
			}
		},
		{
			type: "summary-card",
			width: 3,
			height: 2,
			x: 3,
			y: 0,
			meta: {
				name: "Total Expenses (YTD)",
				content: JSON.stringify({
					type: "sum",
					fontSize: 20
				}),
				timeFrame: {
					start: "2024-01-01",
					end: "2024-12-31",
					mode: "yearToDate"
				},
				conditions: [
					{
						field: "amount",
						op: "lt",
						value: 0
					},
					{
						field: "account",
						op: "onBudget",
						value: ""
					},
					{
						field: "transfer",
						op: "is",
						value: false
					}
				],
				conditionsOp: "and"
			}
		},
		{
			type: "summary-card",
			width: 3,
			height: 2,
			x: 6,
			y: 0,
			meta: {
				name: "Avg Per Month",
				content: JSON.stringify({
					type: "avgPerMonth",
					fontSize: 20
				}),
				timeFrame: {
					start: "2024-01-01",
					end: "2024-12-31",
					mode: "yearToDate"
				},
				conditions: [
					{
						field: "amount",
						op: "lt",
						value: 0
					},
					{
						field: "account",
						op: "onBudget",
						value: ""
					},
					{
						field: "transfer",
						op: "is",
						value: false
					}
				],
				conditionsOp: "and"
			}
		},
		{
			type: "summary-card",
			width: 3,
			height: 2,
			x: 9,
			y: 0,
			meta: {
				name: "Avg Per Transaction",
				content: JSON.stringify({
					type: "avgPerTransact",
					fontSize: 20
				}),
				timeFrame: {
					start: "2024-01-01",
					end: "2024-12-31",
					mode: "yearToDate"
				},
				conditions: [
					{
						field: "amount",
						op: "lt",
						value: 0
					},
					{
						field: "account",
						op: "onBudget",
						value: ""
					},
					{
						field: "transfer",
						op: "is",
						value: false
					}
				],
				conditionsOp: "and"
			}
		},
		{
			type: "net-worth-card",
			width: 6,
			height: 2,
			x: 0,
			y: 2,
			meta: null
		},
		{
			type: "cash-flow-card",
			width: 6,
			height: 2,
			x: 6,
			y: 2,
			meta: null
		},
		{
			type: "spending-card",
			width: 4,
			height: 2,
			x: 0,
			y: 5,
			meta: {
				name: "This Month",
				mode: "single-month"
			}
		},
		{
			type: "spending-card",
			width: 4,
			height: 2,
			x: 4,
			y: 5,
			meta: {
				name: "Budget Overview",
				mode: "budget"
			}
		},
		{
			type: "spending-card",
			width: 4,
			height: 2,
			x: 8,
			y: 5,
			meta: {
				name: "3-Month Average",
				mode: "average"
			}
		},
		{
			type: "calendar-card",
			width: 8,
			height: 4,
			x: 0,
			y: 8,
			meta: {
				name: "Transaction Calendar",
				timeFrame: {
					start: "2024-01-01",
					end: "2024-03-31",
					mode: "sliding-window"
				},
				conditions: [{
					field: "transfer",
					op: "is",
					value: false
				}],
				conditionsOp: "and"
			}
		},
		{
			type: "summary-card",
			width: 4,
			height: 2,
			x: 8,
			y: 8,
			meta: {
				name: "Recent Net Worth Change",
				content: JSON.stringify({
					type: "sum",
					fontSize: 32
				}),
				timeFrame: {
					start: "2024-01-01",
					end: "2024-03-31",
					mode: "sliding-window"
				},
				conditions: [],
				conditionsOp: "and"
			}
		},
		{
			type: "markdown-card",
			width: 4,
			height: 2,
			x: 8,
			y: 10,
			meta: { content: "## Dashboard Tips\n\nYou can add new widgets or edit existing widgets by using the buttons at the top of the page. Choose a widget type and customize it to fit your needs.\n\n**Moving cards:** Drag any card by its header to reposition it.\n\n**Deleting cards:** Click the three-dot menu on any card and select \"Remove\"." }
		}
	];
	//#endregion
	//#region ../loot-core/migrations/1722804019000_create_dashboard_table.js
	async function runMigration$2(db) {
		db.transaction(() => {
			const reports = db.runQuery("SELECT id FROM custom_reports WHERE tombstone = 0 ORDER BY name COLLATE NOCASE ASC", [], true);
			db.execQuery(`
      CREATE TABLE dashboard
        (id TEXT PRIMARY KEY,
         type TEXT,
         width INTEGER,
         height INTEGER,
         x INTEGER,
         y INTEGER,
         meta TEXT,
         tombstone INTEGER DEFAULT 0);
    `);
			if (reports.length === 0) {
				DEFAULT_DASHBOARD_STATE.forEach((widget) => {
					db.runQuery(`INSERT INTO dashboard (id, type, width, height, x, y, meta) VALUES (?, ?, ?, ?, ?, ?, ?)`, [
						v4(),
						widget.type,
						widget.width,
						widget.height,
						widget.x,
						widget.y,
						widget.meta !== void 0 && widget.meta !== null ? JSON.stringify(widget.meta) : null
					]);
				});
				return;
			}
			db.execQuery(`
      INSERT INTO dashboard (id, type, width, height, x, y)
      VALUES
        ('${v4()}', 'net-worth-card', 8, 2, 0, 0),
        ('${v4()}', 'cash-flow-card', 4, 2, 8, 0),
        ('${v4()}', 'spending-card', 4, 2, 0, 2);
    `);
			reports.forEach((report, id) => {
				db.runQuery(`INSERT INTO dashboard (id, type, width, height, x, y, meta) VALUES (?, ?, ?, ?, ?, ?, ?)`, [
					v4(),
					"custom-report",
					4,
					2,
					id * 4 % 12,
					2 + Math.floor(id / 3) * 2,
					JSON.stringify({ id: report.id })
				]);
			});
		});
	}
	//#endregion
	//#region ../loot-core/migrations/1723665565000_prefs.js
	var SYNCED_PREF_KEYS = [
		"firstDayOfWeekIdx",
		"dateFormat",
		"numberFormat",
		"hideFraction",
		"isPrivacyEnabled",
		/^show-extra-balances-/,
		/^hide-cleared-/,
		/^parse-date-/,
		/^csv-mappings-/,
		/^csv-delimiter-/,
		/^csv-has-header-/,
		/^ofx-fallback-missing-payee-/,
		/^flip-amount-/,
		"budgetType",
		/^flags\./
	];
	async function runMigration$1(db, { fs, fileId }) {
		await db.execQuery(`
    CREATE TABLE preferences
       (id TEXT PRIMARY KEY,
        value TEXT);
  `);
		try {
			const budgetDir = fs.getBudgetDir(fileId);
			const fullpath = fs.join(budgetDir, "metadata.json");
			const prefs = JSON.parse(await fs.readFile(fullpath));
			if (typeof prefs !== "object") return;
			await Promise.all(Object.keys(prefs).map(async (key) => {
				if (!SYNCED_PREF_KEYS.find((keyMatcher) => keyMatcher instanceof RegExp ? keyMatcher.test(key) : keyMatcher === key)) return;
				db.runQuery("INSERT INTO preferences (id, value) VALUES (?, ?)", [key, String(prefs[key])]);
			}));
		} catch {}
	}
	//#endregion
	//#region ../loot-core/migrations/1765518577215_multiple_dashboards.js
	async function runMigration(db) {
		db.transaction(() => {
			db.execQuery(`
      CREATE TABLE dashboard_pages
        (id TEXT PRIMARY KEY,
         name TEXT,
         tombstone INTEGER DEFAULT 0);
    `);
			db.execQuery(`
      ALTER TABLE dashboard ADD COLUMN dashboard_page_id TEXT;
    `);
			const defaultDashboardId = v4();
			db.runQuery(`INSERT INTO dashboard_pages (id, name) VALUES (?, ?)`, [defaultDashboardId, "Main"]);
			db.runQuery(`UPDATE dashboard SET dashboard_page_id = ?`, [defaultDashboardId]);
		});
	}
	//#endregion
	//#region ../loot-core/src/server/migrate/migrations.ts
	var MIGRATIONS_DIR = migrationsPath;
	var javascriptMigrations = {
		1632571489012: runMigration$4,
		1722717601e3: runMigration$3,
		1722804019e3: runMigration$2,
		1723665565e3: runMigration$1,
		1765518577215: runMigration
	};
	function getMigrationId(name) {
		return parseInt(name.match(/^(\d)+/)[0]);
	}
	async function patchBadMigrations(db) {
		const badFiltersMigration = 1685375406832;
		const newFiltersMigration = 1688749527273;
		if ((await getAppliedMigrations(db)).includes(badFiltersMigration)) {
			runQuery$1(db, "DELETE FROM __migrations__ WHERE id = ?", [badFiltersMigration]);
			runQuery$1(db, "INSERT INTO __migrations__ (id) VALUES (?)", [newFiltersMigration]);
		}
	}
	async function getAppliedMigrations(db) {
		return runQuery$1(db, "SELECT * FROM __migrations__ ORDER BY id ASC", [], true).map((row) => row.id);
	}
	async function getMigrationList(migrationsDir) {
		return (await listDir(migrationsDir)).filter((name) => name.match(/(\.sql|\.js)$/)).sort((m1, m2) => {
			const id1 = getMigrationId(m1);
			const id2 = getMigrationId(m2);
			if (id1 < id2) return -1;
			else if (id1 > id2) return 1;
			return 0;
		});
	}
	function getPending(appliedIds, all) {
		return all.filter((name) => {
			const id = getMigrationId(name);
			return appliedIds.indexOf(id) === -1;
		});
	}
	async function applyJavaScript(db, id) {
		const dbInterface = {
			runQuery: (query, params, fetchAll) => runQuery$1(db, query, params, fetchAll),
			execQuery: (query) => execQuery$2(db, query),
			transaction: (func) => transaction$1(db, func)
		};
		if (javascriptMigrations[id] == null) throw new Error("Could not find JS migration code to run for " + id);
		const run = javascriptMigrations[id];
		return run(dbInterface, {
			fs: fs_exports,
			fileId: getPrefs()?.id
		});
	}
	async function applySql(db, sql) {
		try {
			execQuery$2(db, sql);
		} catch (e) {
			logger.log("Error applying sql:", sql);
			throw e;
		}
	}
	async function applyMigration(db, name, migrationsDir) {
		const code = await readFile(join$1(migrationsDir, name));
		if (name.match(/\.js$/)) await applyJavaScript(db, getMigrationId(name));
		else await applySql(db, code);
		runQuery$1(db, "INSERT INTO __migrations__ (id) VALUES (?)", [getMigrationId(name)]);
	}
	function checkDatabaseValidity(appliedIds, available) {
		if (appliedIds.length > available.length) {
			logger.error("Database is out of sync with migrations (index past available):", {
				appliedIds,
				available
			});
			throw new Error("out-of-sync-migrations");
		}
		for (let i = 0; i < appliedIds.length; i++) if (appliedIds[i] !== getMigrationId(available[i])) {
			logger.error("Database is out of sync with migrations (migration id mismatch):", {
				appliedIds,
				available,
				missing: available.filter((m) => !appliedIds.includes(getMigrationId(m)))
			});
			throw new Error("out-of-sync-migrations");
		}
	}
	async function migrate(db) {
		await patchBadMigrations(db);
		const appliedIds = await getAppliedMigrations(db);
		const available = await getMigrationList(MIGRATIONS_DIR);
		checkDatabaseValidity(appliedIds, available);
		const pending = getPending(appliedIds, available);
		for (const migration of pending) await applyMigration(db, migration, MIGRATIONS_DIR);
		return pending;
	}
	//#endregion
	//#region ../loot-core/src/server/update.ts
	async function runMigrations() {
		await migrate(getDatabase());
	}
	async function updateViews() {
		const hashKey = "view-hash";
		const { value: hash } = await first$2("SELECT value FROM __meta__ WHERE key = ?", [hashKey]) || {};
		const views = makeViews(schema, schemaConfig);
		const currentHash = (0, import_crypto_browserify.createHash)("md5").update(views).digest("hex");
		if (hash !== currentHash) {
			execQuery(views);
			runQuery("INSERT OR REPLACE INTO __meta__ (key, value) VALUES (?, ?)", [hashKey, currentHash]);
		}
	}
	async function updateVersion() {
		await runMigrations();
		await updateViews();
	}
	//#endregion
	//#region ../loot-core/src/server/util/budget-name.ts
	async function uniqueBudgetName(initialName = "My Finances") {
		const budgets = await handlers["get-budgets"]();
		let idx = 1;
		let newName = initialName;
		while (budgets.find((file) => file.name === newName)) {
			newName = `${initialName} ${idx}`;
			idx++;
		}
		return newName;
	}
	async function validateBudgetName(name) {
		const trimmedName = name.trim();
		const uniqueName = await uniqueBudgetName(trimmedName);
		let message = null;
		if (trimmedName === "") message = "Budget name cannot be blank";
		if (trimmedName.length > 100) message = "Budget name is too long (max length 100)";
		if (uniqueName !== trimmedName) message = `"${name}" already exists, try "${uniqueName}" instead`;
		return message ? {
			valid: false,
			message
		} : { valid: true };
	}
	async function idFromBudgetName(name) {
		let id = name.replace(/( |[^A-Za-z0-9])/g, "-") + "-" + v4().slice(0, 7);
		let index = 0;
		let budgetDir = getBudgetDir(id);
		while (await exists$1(budgetDir)) {
			index++;
			budgetDir = getBudgetDir(id + index.toString());
		}
		if (index > 0) id = id + index.toString();
		return id;
	}
	//#endregion
	//#region ../loot-core/src/server/budgetfiles/backups.ts
	var LATEST_BACKUP_FILENAME = "db.latest.sqlite";
	var serviceInterval = null;
	async function getBackups$1(id) {
		const backupDir = join$1(getBudgetDir(id), "backups");
		let paths = [];
		if (await exists$1(backupDir)) {
			paths = await listDir(backupDir);
			paths = paths.filter((file) => file.match(/\.zip$/));
		}
		const backups = await Promise.all(paths.map(async (path) => {
			const mtime = await getModifiedTime(join$1(backupDir, path));
			return {
				id: path,
				date: new Date(mtime)
			};
		}));
		backups.sort((b1, b2) => {
			if (b1.date < b2.date) return 1;
			else if (b1.date > b2.date) return -1;
			return 0;
		});
		return backups;
	}
	async function getLatestBackup(id) {
		if (await exists$1(join$1(getBudgetDir(id), LATEST_BACKUP_FILENAME))) return {
			id: LATEST_BACKUP_FILENAME,
			date: null,
			isLatest: true
		};
		return null;
	}
	async function getAvailableBackups(id) {
		const backups = await getBackups$1(id);
		const latestBackup = await getLatestBackup(id);
		if (latestBackup) backups.unshift(latestBackup);
		return backups.map((backup) => ({
			...backup,
			date: backup.date ? format$2(backup.date, "yyyy-MM-dd H:mm") : null
		}));
	}
	async function updateBackups(backups) {
		const byDay = backups.reduce((groups, backup) => {
			const day = format$2(backup.date, "yyyy-MM-dd");
			groups[day] = groups[day] || [];
			groups[day].push(backup);
			return groups;
		}, {});
		const removed = [];
		for (const day of Object.keys(byDay)) {
			const dayBackups = byDay[day];
			const isToday = day === currentDay();
			for (const backup of dayBackups.slice(isToday ? 3 : 1)) removed.push(backup.id);
		}
		const currentBackups = backups.filter((backup) => !removed.includes(backup.id));
		return removed.concat(currentBackups.slice(10).map((backup) => backup.id));
	}
	async function makeBackup$1(id) {
		const budgetDir = getBudgetDir(id);
		if (await exists$1(join$1(budgetDir, LATEST_BACKUP_FILENAME))) await removeFile$1(join$1(getBudgetDir(id), LATEST_BACKUP_FILENAME));
		const backupPath = join$1(budgetDir, "backups", `${format$2(/* @__PURE__ */ new Date(), "yyyy-MM-dd_HH-mm-ss")}.zip`);
		if (!await exists$1(join$1(budgetDir, "backups"))) await mkdir(join$1(budgetDir, "backups"));
		const tempDbPath = join$1(budgetDir, "backups", `db.${Date.now()}.sqlite.tmp`);
		await copyFile(join$1(budgetDir, "db.sqlite"), tempDbPath);
		let db;
		try {
			db = await openDatabase$1(tempDbPath);
			runQuery$1(db, "DELETE FROM messages_crdt");
			runQuery$1(db, "DELETE FROM messages_clock");
			const zip = new import_adm_zip.default();
			zip.addLocalFile(tempDbPath, "", "db.sqlite");
			zip.addLocalFile(join$1(budgetDir, "metadata.json"));
			zip.writeZip(backupPath);
		} finally {
			if (db) closeDatabase$1(db);
			if (await exists$1(tempDbPath)) await removeFile$1(tempDbPath);
		}
		const toRemove = await updateBackups(await getBackups$1(id));
		for (const id of toRemove) await removeFile$1(join$1(budgetDir, "backups", id));
		send$1("backups-updated", await getAvailableBackups(id));
	}
	async function loadBackup$1(id, backupId) {
		const budgetDir = getBudgetDir(id);
		if (!await exists$1(join$1(budgetDir, LATEST_BACKUP_FILENAME))) {
			await copyFile(join$1(budgetDir, "db.sqlite"), join$1(budgetDir, LATEST_BACKUP_FILENAME));
			await copyFile(join$1(budgetDir, "metadata.json"), join$1(budgetDir, "metadata.latest.json"));
			stopBackupService();
			startBackupService(id);
			await loadPrefs(id);
		}
		if (backupId === LATEST_BACKUP_FILENAME) {
			logger.log("Reverting backup");
			await copyFile(join$1(budgetDir, LATEST_BACKUP_FILENAME), join$1(budgetDir, "db.sqlite"));
			await copyFile(join$1(budgetDir, "metadata.latest.json"), join$1(budgetDir, "metadata.json"));
			await removeFile$1(join$1(budgetDir, LATEST_BACKUP_FILENAME));
			await removeFile$1(join$1(budgetDir, "metadata.latest.json"));
			try {
				await upload();
			} catch {}
			unloadPrefs();
		} else {
			logger.log("Loading backup", backupId);
			await loadPrefs(id);
			await savePrefs({
				groupId: null,
				lastSyncedTimestamp: null,
				lastUploaded: null
			});
			try {
				await upload();
			} catch {}
			unloadPrefs();
			const zip = new import_adm_zip.default(join$1(budgetDir, "backups", backupId));
			zip.extractEntryTo("db.sqlite", budgetDir, false, true);
			zip.extractEntryTo("metadata.json", budgetDir, false, true);
		}
	}
	function startBackupService(id) {
		if (serviceInterval) clearInterval(serviceInterval);
		serviceInterval = setInterval(async () => {
			logger.log("Making backup");
			await makeBackup$1(id);
		}, 1e3 * 60 * 15);
	}
	function stopBackupService() {
		clearInterval(serviceInterval);
		serviceInterval = null;
	}
	//#endregion
	//#region ../loot-core/src/server/budgetfiles/app.ts
	init_dist();
	init_dist$1();
	var DEMO_BUDGET_ID = "_demo-budget";
	var TEST_BUDGET_ID = "_test-budget";
	var app$14 = createApp();
	app$14.method("validate-budget-name", handleValidateBudgetName);
	app$14.method("unique-budget-name", handleUniqueBudgetName);
	app$14.method("get-budgets", getBudgets);
	app$14.method("get-remote-files", getRemoteFiles);
	app$14.method("reset-budget-cache", mutator(resetBudgetCache));
	app$14.method("upload-budget", uploadBudget);
	app$14.method("download-budget", downloadBudget);
	app$14.method("sync-budget", syncBudget);
	app$14.method("load-budget", loadBudget);
	app$14.method("create-demo-budget", createDemoBudget);
	app$14.method("close-budget", closeBudget);
	app$14.method("delete-budget", deleteBudget);
	app$14.method("duplicate-budget", duplicateBudget);
	app$14.method("create-budget", createBudget);
	app$14.method("import-budget", importBudget);
	app$14.method("export-budget", exportBudget);
	app$14.method("upload-file-web", uploadFileWeb);
	app$14.method("backups-get", getBackups);
	app$14.method("backup-load", loadBackup);
	app$14.method("backup-make", makeBackup);
	app$14.method("get-last-opened-backup", getLastOpenedBackup);
	async function handleValidateBudgetName({ name }) {
		return validateBudgetName(name);
	}
	async function handleUniqueBudgetName({ name }) {
		return uniqueBudgetName(name);
	}
	async function getBudgets() {
		const paths = await listDir(getDocumentDir());
		return (await Promise.all(paths.map(async (name) => {
			const prefsPath = join$1(getDocumentDir(), name, "metadata.json");
			if (await exists$1(prefsPath)) {
				let prefs;
				try {
					prefs = JSON.parse(await readFile(prefsPath));
				} catch (e) {
					logger.log("Error parsing metadata:", e.stack);
					return null;
				}
				if (name !== DEMO_BUDGET_ID) return {
					id: name,
					...prefs.cloudFileId ? { cloudFileId: prefs.cloudFileId } : {},
					...prefs.encryptKeyId ? { encryptKeyId: prefs.encryptKeyId } : {},
					...prefs.groupId ? { groupId: prefs.groupId } : {},
					...prefs.owner ? { owner: prefs.owner } : {},
					name: prefs.budgetName || "(no name)"
				};
			}
			return null;
		}))).filter(Boolean);
	}
	async function getRemoteFiles() {
		return listRemoteFiles();
	}
	async function resetBudgetCache() {
		await loadUserBudgets(db_exports);
		get$2().recomputeAll();
		await waitOnSpreadsheet();
	}
	async function uploadBudget({ id } = {}) {
		if (id) {
			if (getPrefs()) throw new Error("upload-budget: id given but prefs already loaded");
			await loadPrefs(id);
		}
		try {
			await upload();
		} catch (e) {
			logger.log(e);
			if (e.type === "FileUploadError") return { error: e };
			captureException(e);
			return { error: { reason: "internal" } };
		} finally {
			if (id) unloadPrefs();
		}
		return {};
	}
	async function downloadBudget({ cloudFileId }) {
		let result;
		try {
			result = await download(cloudFileId);
		} catch (e) {
			if (e.type === "FileDownloadError") {
				if (e.reason === "file-exists" && e.meta.id) {
					await loadPrefs(e.meta.id);
					const name = getPrefs().budgetName;
					unloadPrefs();
					e.meta = {
						...e.meta,
						name
					};
				}
				return { error: e };
			} else {
				captureException(e);
				return { error: { reason: "internal" } };
			}
		}
		const id = result.id;
		await closeBudget();
		await loadBudget({ id });
		result = await syncBudget();
		if (result.error) return result;
		return { id };
	}
	async function syncBudget() {
		setSyncingMode("enabled");
		return await initialFullSync();
	}
	async function loadBudget({ id }) {
		const currentPrefs = getPrefs();
		if (currentPrefs) if (currentPrefs.id === id) return {};
		else await closeBudget();
		return await _loadBudget(id);
	}
	async function createDemoBudget() {
		await setItem("readOnly", "");
		return createBudget({
			budgetName: "Demo Budget",
			testMode: true,
			testBudgetId: DEMO_BUDGET_ID
		});
	}
	async function closeBudget() {
		captureBreadcrumb({ message: "Closing budget" });
		await waitOnSpreadsheet();
		unloadSpreadsheet();
		clearFullSyncTimeout();
		await app$20.stopServices();
		closeDatabase();
		try {
			await setItem("lastBudget", "");
		} catch {}
		unloadPrefs();
		stopBackupService();
		return "ok";
	}
	async function deleteBudget({ id, cloudFileId }) {
		if (cloudFileId) await removeFile(cloudFileId).catch(() => {});
		if (id) try {
			await openDatabase(id);
			closeDatabase();
			await removeDirRecursively(getBudgetDir(id));
		} catch {
			return "fail";
		}
		return "ok";
	}
	async function duplicateBudget({ id, newName, cloudSync, open }) {
		const { valid, message } = await validateBudgetName(newName);
		if (!valid) throw new Error(message);
		const budgetDir = getBudgetDir(id);
		const newId = await idFromBudgetName(newName);
		const metadataText = await readFile(join$1(budgetDir, "metadata.json"));
		const metadata = JSON.parse(metadataText);
		metadata.id = newId;
		metadata.budgetName = newName;
		[
			"cloudFileId",
			"groupId",
			"lastUploaded",
			"encryptKeyId",
			"lastSyncedTimestamp"
		].forEach((item) => {
			if (metadata[item]) delete metadata[item];
		});
		try {
			const newBudgetDir = getBudgetDir(newId);
			await mkdir(newBudgetDir);
			await writeFile(join$1(newBudgetDir, "metadata.json"), JSON.stringify(metadata));
			await copyFile(join$1(budgetDir, "db.sqlite"), join$1(newBudgetDir, "db.sqlite"));
		} catch (error) {
			try {
				const newBudgetDir = getBudgetDir(newId);
				if (await exists$1(newBudgetDir)) await removeDirRecursively(newBudgetDir);
			} catch {}
			throw new Error(`Failed to duplicate budget file: ${error.message}`);
		}
		const { error } = await _loadBudget(newId);
		if (error) {
			logger.log("Error duplicating budget: " + error);
			return error;
		}
		if (cloudSync) try {
			await upload();
		} catch (error) {
			logger.warn("Failed to sync duplicated budget to cloud:", error);
		}
		await closeBudget();
		if (open === "original") await _loadBudget(id);
		if (open === "copy") await _loadBudget(newId);
		return newId;
	}
	async function createBudget({ budgetName, avoidUpload, testMode, testBudgetId } = {}) {
		let id;
		if (testMode) {
			budgetName = budgetName || "Test Budget";
			id = testBudgetId || TEST_BUDGET_ID;
			if (await exists$1(getBudgetDir(id))) {
				if (getPrefs()?.id === id) await closeBudget();
				await removeDirRecursively(getBudgetDir(id));
			}
		} else {
			if (!budgetName) budgetName = await uniqueBudgetName();
			id = await idFromBudgetName(budgetName);
		}
		const budgetDir = getBudgetDir(id);
		await mkdir(budgetDir);
		await copyFile(bundledDatabasePath, join$1(budgetDir, "db.sqlite"));
		await writeFile(join$1(budgetDir, "metadata.json"), JSON.stringify(getDefaultPrefs(id, budgetName)));
		const { error } = await _loadBudget(id);
		if (error) {
			logger.log("Error creating budget: " + error);
			return { error };
		}
		if (!avoidUpload && !testMode) try {
			await upload();
		} catch {}
		if (testMode) await createTestBudget(app$20.handlers);
		return {};
	}
	async function importBudget({ filepath, type }) {
		try {
			if (!await exists$1(filepath)) throw new Error(`File not found at the provided path: ${filepath}`);
			return await handleBudgetImport(type, filepath, Buffer$1.from(await readFile(filepath, "binary"))) || {};
		} catch (err) {
			err.message = "Error importing budget: " + err.message;
			captureException(err);
			return { error: "internal-error" };
		}
	}
	async function exportBudget() {
		try {
			return { data: await exportBuffer() };
		} catch (err) {
			err.message = "Error exporting budget: " + err.message;
			captureException(err);
			return { error: "internal-error" };
		}
	}
	function onSheetChange({ names }) {
		send$1("cells-changed", names.map((name) => {
			const node = get$2()._getNode(name);
			return {
				name: node.name,
				value: node.value
			};
		}));
	}
	async function _loadBudget(id) {
		let dir;
		try {
			dir = getBudgetDir(id);
		} catch (e) {
			captureException(/* @__PURE__ */ new Error("`getBudgetDir` failed in `loadBudget`: " + e.message));
			return { error: "budget-not-found" };
		}
		captureBreadcrumb({ message: "Loading budget " + dir });
		if (!await exists$1(dir)) {
			captureException(/* @__PURE__ */ new Error("budget directory does not exist"));
			return { error: "budget-not-found" };
		}
		try {
			await loadPrefs(id);
			await openDatabase(id);
		} catch (e) {
			captureBreadcrumb({ message: "Error loading budget " + id });
			captureException(e);
			await closeBudget();
			return { error: "opening-budget" };
		}
		if (!getPrefs().userId) await savePrefs({ userId: await getItem("user-token") });
		try {
			await updateVersion();
		} catch (e) {
			logger.warn("Error updating", e);
			let result;
			if (e.message.includes("out-of-sync-migrations")) result = { error: "out-of-sync-migrations" };
			else if (e.message.includes("out-of-sync-data")) result = { error: "out-of-sync-data" };
			else {
				captureException(e);
				logger.info("Error updating budget " + id, e);
				logger.log("Error updating budget", e);
				result = { error: "loading-budget" };
			}
			await closeBudget();
			return result;
		}
		await loadClock();
		if (getPrefs().resetClock) {
			getClock().timestamp.setNode(makeClientId());
			runQuery("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)", [serializeClock(getClock())]);
			await savePrefs({ resetClock: false });
		}
		try {
			await loadSpreadsheet(db_exports, onSheetChange);
		} catch (e) {
			captureException(e);
			await closeBudget();
			return { error: "opening-budget" };
		}
		const { value: budgetType = "envelope" } = await first$2("SELECT value from preferences WHERE id = ?", ["budgetType"]) ?? {};
		get$2().meta().budgetType = budgetType;
		await createAllBudgets();
		await loadMappings();
		await loadRules();
		listen();
		app$20.startServices();
		clearUndo();
		if (process$1.env.NODE_ENV !== "test") if (id === DEMO_BUDGET_ID) setSyncingMode("disabled");
		else {
			if (getServer()) setSyncingMode("enabled");
			else setSyncingMode("disabled");
			await setItem("lastBudget", id);
			await possiblyUpload();
		}
		else setSyncingMode("disabled");
		app$14.events.emit("load-budget", { id });
		return {};
	}
	async function uploadFileWeb({ filename, contents }) {
		const safeName = filename.split(/[/\\]/).pop()?.replaceAll("\0", "");
		if (!safeName || safeName === "." || safeName === "..") throw new Error("Invalid upload filename");
		await writeFile(join$1("/uploads", safeName), contents);
		return {};
	}
	async function getBackups({ id }) {
		return getAvailableBackups(id);
	}
	async function loadBackup({ id, backupId }) {
		await loadBackup$1(id, backupId);
	}
	async function makeBackup({ id }) {
		await makeBackup$1(id);
	}
	async function getLastOpenedBackup() {
		const id = await getItem("lastBudget");
		if (id && id !== "") {
			if (await exists$1(getBudgetDir(id))) return id;
		}
		return null;
	}
	//#endregion
	//#region ../../node_modules/lodash/_listCacheClear.js
	var require__listCacheClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Removes all key-value entries from the list cache.
		*
		* @private
		* @name clear
		* @memberOf ListCache
		*/
		function listCacheClear() {
			this.__data__ = [];
			this.size = 0;
		}
		module.exports = listCacheClear;
	}));
	//#endregion
	//#region ../../node_modules/lodash/eq.js
	var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Performs a
		* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
		* comparison between two values to determine if they are equivalent.
		*
		* @static
		* @memberOf _
		* @since 4.0.0
		* @category Lang
		* @param {*} value The value to compare.
		* @param {*} other The other value to compare.
		* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
		* @example
		*
		* var object = { 'a': 1 };
		* var other = { 'a': 1 };
		*
		* _.eq(object, object);
		* // => true
		*
		* _.eq(object, other);
		* // => false
		*
		* _.eq('a', 'a');
		* // => true
		*
		* _.eq('a', Object('a'));
		* // => false
		*
		* _.eq(NaN, NaN);
		* // => true
		*/
		function eq(value, other) {
			return value === other || value !== value && other !== other;
		}
		module.exports = eq;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_assocIndexOf.js
	var require__assocIndexOf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var eq = require_eq();
		/**
		* Gets the index at which the `key` is found in `array` of key-value pairs.
		*
		* @private
		* @param {Array} array The array to inspect.
		* @param {*} key The key to search for.
		* @returns {number} Returns the index of the matched value, else `-1`.
		*/
		function assocIndexOf(array, key) {
			var length = array.length;
			while (length--) if (eq(array[length][0], key)) return length;
			return -1;
		}
		module.exports = assocIndexOf;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_listCacheDelete.js
	var require__listCacheDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assocIndexOf = require__assocIndexOf();
		/** Built-in value references. */
		var splice = Array.prototype.splice;
		/**
		* Removes `key` and its value from the list cache.
		*
		* @private
		* @name delete
		* @memberOf ListCache
		* @param {string} key The key of the value to remove.
		* @returns {boolean} Returns `true` if the entry was removed, else `false`.
		*/
		function listCacheDelete(key) {
			var data = this.__data__, index = assocIndexOf(data, key);
			if (index < 0) return false;
			if (index == data.length - 1) data.pop();
			else splice.call(data, index, 1);
			--this.size;
			return true;
		}
		module.exports = listCacheDelete;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_listCacheGet.js
	var require__listCacheGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assocIndexOf = require__assocIndexOf();
		/**
		* Gets the list cache value for `key`.
		*
		* @private
		* @name get
		* @memberOf ListCache
		* @param {string} key The key of the value to get.
		* @returns {*} Returns the entry value.
		*/
		function listCacheGet(key) {
			var data = this.__data__, index = assocIndexOf(data, key);
			return index < 0 ? void 0 : data[index][1];
		}
		module.exports = listCacheGet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_listCacheHas.js
	var require__listCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assocIndexOf = require__assocIndexOf();
		/**
		* Checks if a list cache value for `key` exists.
		*
		* @private
		* @name has
		* @memberOf ListCache
		* @param {string} key The key of the entry to check.
		* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		*/
		function listCacheHas(key) {
			return assocIndexOf(this.__data__, key) > -1;
		}
		module.exports = listCacheHas;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_listCacheSet.js
	var require__listCacheSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var assocIndexOf = require__assocIndexOf();
		/**
		* Sets the list cache `key` to `value`.
		*
		* @private
		* @name set
		* @memberOf ListCache
		* @param {string} key The key of the value to set.
		* @param {*} value The value to set.
		* @returns {Object} Returns the list cache instance.
		*/
		function listCacheSet(key, value) {
			var data = this.__data__, index = assocIndexOf(data, key);
			if (index < 0) {
				++this.size;
				data.push([key, value]);
			} else data[index][1] = value;
			return this;
		}
		module.exports = listCacheSet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_ListCache.js
	var require__ListCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var listCacheClear = require__listCacheClear(), listCacheDelete = require__listCacheDelete(), listCacheGet = require__listCacheGet(), listCacheHas = require__listCacheHas(), listCacheSet = require__listCacheSet();
		/**
		* Creates an list cache object.
		*
		* @private
		* @constructor
		* @param {Array} [entries] The key-value pairs to cache.
		*/
		function ListCache(entries) {
			var index = -1, length = entries == null ? 0 : entries.length;
			this.clear();
			while (++index < length) {
				var entry = entries[index];
				this.set(entry[0], entry[1]);
			}
		}
		ListCache.prototype.clear = listCacheClear;
		ListCache.prototype["delete"] = listCacheDelete;
		ListCache.prototype.get = listCacheGet;
		ListCache.prototype.has = listCacheHas;
		ListCache.prototype.set = listCacheSet;
		module.exports = ListCache;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_stackClear.js
	var require__stackClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ListCache = require__ListCache();
		/**
		* Removes all key-value entries from the stack.
		*
		* @private
		* @name clear
		* @memberOf Stack
		*/
		function stackClear() {
			this.__data__ = new ListCache();
			this.size = 0;
		}
		module.exports = stackClear;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_stackDelete.js
	var require__stackDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Removes `key` and its value from the stack.
		*
		* @private
		* @name delete
		* @memberOf Stack
		* @param {string} key The key of the value to remove.
		* @returns {boolean} Returns `true` if the entry was removed, else `false`.
		*/
		function stackDelete(key) {
			var data = this.__data__, result = data["delete"](key);
			this.size = data.size;
			return result;
		}
		module.exports = stackDelete;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_stackGet.js
	var require__stackGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Gets the stack value for `key`.
		*
		* @private
		* @name get
		* @memberOf Stack
		* @param {string} key The key of the value to get.
		* @returns {*} Returns the entry value.
		*/
		function stackGet(key) {
			return this.__data__.get(key);
		}
		module.exports = stackGet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_stackHas.js
	var require__stackHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Checks if a stack value for `key` exists.
		*
		* @private
		* @name has
		* @memberOf Stack
		* @param {string} key The key of the entry to check.
		* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		*/
		function stackHas(key) {
			return this.__data__.has(key);
		}
		module.exports = stackHas;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_freeGlobal.js
	var require__freeGlobal = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		init_dist$2();
		module.exports = typeof global == "object" && global && global.Object === Object && global;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_root.js
	var require__root = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var freeGlobal = require__freeGlobal();
		/** Detect free variable `self`. */
		var freeSelf = typeof self == "object" && self && self.Object === Object && self;
		module.exports = freeGlobal || freeSelf || Function("return this")();
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Symbol.js
	var require__Symbol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__root().Symbol;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getRawTag.js
	var require__getRawTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Symbol = require__Symbol();
		/** Used for built-in method references. */
		var objectProto = Object.prototype;
		/** Used to check objects for own properties. */
		var hasOwnProperty = objectProto.hasOwnProperty;
		/**
		* Used to resolve the
		* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
		* of values.
		*/
		var nativeObjectToString = objectProto.toString;
		/** Built-in value references. */
		var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
		/**
		* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
		*
		* @private
		* @param {*} value The value to query.
		* @returns {string} Returns the raw `toStringTag`.
		*/
		function getRawTag(value) {
			var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
			try {
				value[symToStringTag] = void 0;
				var unmasked = true;
			} catch (e) {}
			var result = nativeObjectToString.call(value);
			if (unmasked) if (isOwn) value[symToStringTag] = tag;
			else delete value[symToStringTag];
			return result;
		}
		module.exports = getRawTag;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_objectToString.js
	var require__objectToString = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Used to resolve the
		* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
		* of values.
		*/
		var nativeObjectToString = Object.prototype.toString;
		/**
		* Converts `value` to a string using `Object.prototype.toString`.
		*
		* @private
		* @param {*} value The value to convert.
		* @returns {string} Returns the converted string.
		*/
		function objectToString(value) {
			return nativeObjectToString.call(value);
		}
		module.exports = objectToString;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseGetTag.js
	var require__baseGetTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Symbol = require__Symbol(), getRawTag = require__getRawTag(), objectToString = require__objectToString();
		/** `Object#toString` result references. */
		var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
		/** Built-in value references. */
		var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
		/**
		* The base implementation of `getTag` without fallbacks for buggy environments.
		*
		* @private
		* @param {*} value The value to query.
		* @returns {string} Returns the `toStringTag`.
		*/
		function baseGetTag(value) {
			if (value == null) return value === void 0 ? undefinedTag : nullTag;
			return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
		}
		module.exports = baseGetTag;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isObject.js
	var require_isObject = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Checks if `value` is the
		* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
		* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
		*
		* @static
		* @memberOf _
		* @since 0.1.0
		* @category Lang
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is an object, else `false`.
		* @example
		*
		* _.isObject({});
		* // => true
		*
		* _.isObject([1, 2, 3]);
		* // => true
		*
		* _.isObject(_.noop);
		* // => true
		*
		* _.isObject(null);
		* // => false
		*/
		function isObject(value) {
			var type = typeof value;
			return value != null && (type == "object" || type == "function");
		}
		module.exports = isObject;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isFunction.js
	var require_isFunction = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseGetTag = require__baseGetTag(), isObject = require_isObject();
		/** `Object#toString` result references. */
		var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
		/**
		* Checks if `value` is classified as a `Function` object.
		*
		* @static
		* @memberOf _
		* @since 0.1.0
		* @category Lang
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is a function, else `false`.
		* @example
		*
		* _.isFunction(_);
		* // => true
		*
		* _.isFunction(/abc/);
		* // => false
		*/
		function isFunction(value) {
			if (!isObject(value)) return false;
			var tag = baseGetTag(value);
			return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
		}
		module.exports = isFunction;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_coreJsData.js
	var require__coreJsData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__root()["__core-js_shared__"];
	}));
	//#endregion
	//#region ../../node_modules/lodash/_isMasked.js
	var require__isMasked = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var coreJsData = require__coreJsData();
		/** Used to detect methods masquerading as native. */
		var maskSrcKey = function() {
			var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
			return uid ? "Symbol(src)_1." + uid : "";
		}();
		/**
		* Checks if `func` has its source masked.
		*
		* @private
		* @param {Function} func The function to check.
		* @returns {boolean} Returns `true` if `func` is masked, else `false`.
		*/
		function isMasked(func) {
			return !!maskSrcKey && maskSrcKey in func;
		}
		module.exports = isMasked;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_toSource.js
	var require__toSource = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** Used to resolve the decompiled source of functions. */
		var funcToString = Function.prototype.toString;
		/**
		* Converts `func` to its source code.
		*
		* @private
		* @param {Function} func The function to convert.
		* @returns {string} Returns the source code.
		*/
		function toSource(func) {
			if (func != null) {
				try {
					return funcToString.call(func);
				} catch (e) {}
				try {
					return func + "";
				} catch (e) {}
			}
			return "";
		}
		module.exports = toSource;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseIsNative.js
	var require__baseIsNative = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isFunction = require_isFunction(), isMasked = require__isMasked(), isObject = require_isObject(), toSource = require__toSource();
		/**
		* Used to match `RegExp`
		* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
		*/
		var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
		/** Used to detect host constructors (Safari). */
		var reIsHostCtor = /^\[object .+?Constructor\]$/;
		/** Used for built-in method references. */
		var funcProto = Function.prototype, objectProto = Object.prototype;
		/** Used to resolve the decompiled source of functions. */
		var funcToString = funcProto.toString;
		/** Used to check objects for own properties. */
		var hasOwnProperty = objectProto.hasOwnProperty;
		/** Used to detect if a method is native. */
		var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
		/**
		* The base implementation of `_.isNative` without bad shim checks.
		*
		* @private
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is a native function,
		*  else `false`.
		*/
		function baseIsNative(value) {
			if (!isObject(value) || isMasked(value)) return false;
			return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
		}
		module.exports = baseIsNative;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getValue.js
	var require__getValue = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Gets the value at `key` of `object`.
		*
		* @private
		* @param {Object} [object] The object to query.
		* @param {string} key The key of the property to get.
		* @returns {*} Returns the property value.
		*/
		function getValue(object, key) {
			return object == null ? void 0 : object[key];
		}
		module.exports = getValue;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getNative.js
	var require__getNative = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseIsNative = require__baseIsNative(), getValue = require__getValue();
		/**
		* Gets the native function at `key` of `object`.
		*
		* @private
		* @param {Object} object The object to query.
		* @param {string} key The key of the method to get.
		* @returns {*} Returns the function if it's native, else `undefined`.
		*/
		function getNative(object, key) {
			var value = getValue(object, key);
			return baseIsNative(value) ? value : void 0;
		}
		module.exports = getNative;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Map.js
	var require__Map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__getNative()(require__root(), "Map");
	}));
	//#endregion
	//#region ../../node_modules/lodash/_nativeCreate.js
	var require__nativeCreate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__getNative()(Object, "create");
	}));
	//#endregion
	//#region ../../node_modules/lodash/_hashClear.js
	var require__hashClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var nativeCreate = require__nativeCreate();
		/**
		* Removes all key-value entries from the hash.
		*
		* @private
		* @name clear
		* @memberOf Hash
		*/
		function hashClear() {
			this.__data__ = nativeCreate ? nativeCreate(null) : {};
			this.size = 0;
		}
		module.exports = hashClear;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_hashDelete.js
	var require__hashDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Removes `key` and its value from the hash.
		*
		* @private
		* @name delete
		* @memberOf Hash
		* @param {Object} hash The hash to modify.
		* @param {string} key The key of the value to remove.
		* @returns {boolean} Returns `true` if the entry was removed, else `false`.
		*/
		function hashDelete(key) {
			var result = this.has(key) && delete this.__data__[key];
			this.size -= result ? 1 : 0;
			return result;
		}
		module.exports = hashDelete;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_hashGet.js
	var require__hashGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var nativeCreate = require__nativeCreate();
		/** Used to stand-in for `undefined` hash values. */
		var HASH_UNDEFINED = "__lodash_hash_undefined__";
		/** Used to check objects for own properties. */
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/**
		* Gets the hash value for `key`.
		*
		* @private
		* @name get
		* @memberOf Hash
		* @param {string} key The key of the value to get.
		* @returns {*} Returns the entry value.
		*/
		function hashGet(key) {
			var data = this.__data__;
			if (nativeCreate) {
				var result = data[key];
				return result === HASH_UNDEFINED ? void 0 : result;
			}
			return hasOwnProperty.call(data, key) ? data[key] : void 0;
		}
		module.exports = hashGet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_hashHas.js
	var require__hashHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var nativeCreate = require__nativeCreate();
		/** Used to check objects for own properties. */
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/**
		* Checks if a hash value for `key` exists.
		*
		* @private
		* @name has
		* @memberOf Hash
		* @param {string} key The key of the entry to check.
		* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		*/
		function hashHas(key) {
			var data = this.__data__;
			return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
		}
		module.exports = hashHas;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_hashSet.js
	var require__hashSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var nativeCreate = require__nativeCreate();
		/** Used to stand-in for `undefined` hash values. */
		var HASH_UNDEFINED = "__lodash_hash_undefined__";
		/**
		* Sets the hash `key` to `value`.
		*
		* @private
		* @name set
		* @memberOf Hash
		* @param {string} key The key of the value to set.
		* @param {*} value The value to set.
		* @returns {Object} Returns the hash instance.
		*/
		function hashSet(key, value) {
			var data = this.__data__;
			this.size += this.has(key) ? 0 : 1;
			data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
			return this;
		}
		module.exports = hashSet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Hash.js
	var require__Hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var hashClear = require__hashClear(), hashDelete = require__hashDelete(), hashGet = require__hashGet(), hashHas = require__hashHas(), hashSet = require__hashSet();
		/**
		* Creates a hash object.
		*
		* @private
		* @constructor
		* @param {Array} [entries] The key-value pairs to cache.
		*/
		function Hash(entries) {
			var index = -1, length = entries == null ? 0 : entries.length;
			this.clear();
			while (++index < length) {
				var entry = entries[index];
				this.set(entry[0], entry[1]);
			}
		}
		Hash.prototype.clear = hashClear;
		Hash.prototype["delete"] = hashDelete;
		Hash.prototype.get = hashGet;
		Hash.prototype.has = hashHas;
		Hash.prototype.set = hashSet;
		module.exports = Hash;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_mapCacheClear.js
	var require__mapCacheClear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Hash = require__Hash(), ListCache = require__ListCache(), Map = require__Map();
		/**
		* Removes all key-value entries from the map.
		*
		* @private
		* @name clear
		* @memberOf MapCache
		*/
		function mapCacheClear() {
			this.size = 0;
			this.__data__ = {
				"hash": new Hash(),
				"map": new (Map || ListCache)(),
				"string": new Hash()
			};
		}
		module.exports = mapCacheClear;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_isKeyable.js
	var require__isKeyable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Checks if `value` is suitable for use as unique object key.
		*
		* @private
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
		*/
		function isKeyable(value) {
			var type = typeof value;
			return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
		}
		module.exports = isKeyable;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getMapData.js
	var require__getMapData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isKeyable = require__isKeyable();
		/**
		* Gets the data for `map`.
		*
		* @private
		* @param {Object} map The map to query.
		* @param {string} key The reference key.
		* @returns {*} Returns the map data.
		*/
		function getMapData(map, key) {
			var data = map.__data__;
			return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
		}
		module.exports = getMapData;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_mapCacheDelete.js
	var require__mapCacheDelete = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getMapData = require__getMapData();
		/**
		* Removes `key` and its value from the map.
		*
		* @private
		* @name delete
		* @memberOf MapCache
		* @param {string} key The key of the value to remove.
		* @returns {boolean} Returns `true` if the entry was removed, else `false`.
		*/
		function mapCacheDelete(key) {
			var result = getMapData(this, key)["delete"](key);
			this.size -= result ? 1 : 0;
			return result;
		}
		module.exports = mapCacheDelete;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_mapCacheGet.js
	var require__mapCacheGet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getMapData = require__getMapData();
		/**
		* Gets the map value for `key`.
		*
		* @private
		* @name get
		* @memberOf MapCache
		* @param {string} key The key of the value to get.
		* @returns {*} Returns the entry value.
		*/
		function mapCacheGet(key) {
			return getMapData(this, key).get(key);
		}
		module.exports = mapCacheGet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_mapCacheHas.js
	var require__mapCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getMapData = require__getMapData();
		/**
		* Checks if a map value for `key` exists.
		*
		* @private
		* @name has
		* @memberOf MapCache
		* @param {string} key The key of the entry to check.
		* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		*/
		function mapCacheHas(key) {
			return getMapData(this, key).has(key);
		}
		module.exports = mapCacheHas;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_mapCacheSet.js
	var require__mapCacheSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getMapData = require__getMapData();
		/**
		* Sets the map `key` to `value`.
		*
		* @private
		* @name set
		* @memberOf MapCache
		* @param {string} key The key of the value to set.
		* @param {*} value The value to set.
		* @returns {Object} Returns the map cache instance.
		*/
		function mapCacheSet(key, value) {
			var data = getMapData(this, key), size = data.size;
			data.set(key, value);
			this.size += data.size == size ? 0 : 1;
			return this;
		}
		module.exports = mapCacheSet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_MapCache.js
	var require__MapCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var mapCacheClear = require__mapCacheClear(), mapCacheDelete = require__mapCacheDelete(), mapCacheGet = require__mapCacheGet(), mapCacheHas = require__mapCacheHas(), mapCacheSet = require__mapCacheSet();
		/**
		* Creates a map cache object to store key-value pairs.
		*
		* @private
		* @constructor
		* @param {Array} [entries] The key-value pairs to cache.
		*/
		function MapCache(entries) {
			var index = -1, length = entries == null ? 0 : entries.length;
			this.clear();
			while (++index < length) {
				var entry = entries[index];
				this.set(entry[0], entry[1]);
			}
		}
		MapCache.prototype.clear = mapCacheClear;
		MapCache.prototype["delete"] = mapCacheDelete;
		MapCache.prototype.get = mapCacheGet;
		MapCache.prototype.has = mapCacheHas;
		MapCache.prototype.set = mapCacheSet;
		module.exports = MapCache;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_stackSet.js
	var require__stackSet = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ListCache = require__ListCache(), Map = require__Map(), MapCache = require__MapCache();
		/** Used as the size to enable large array optimizations. */
		var LARGE_ARRAY_SIZE = 200;
		/**
		* Sets the stack `key` to `value`.
		*
		* @private
		* @name set
		* @memberOf Stack
		* @param {string} key The key of the value to set.
		* @param {*} value The value to set.
		* @returns {Object} Returns the stack cache instance.
		*/
		function stackSet(key, value) {
			var data = this.__data__;
			if (data instanceof ListCache) {
				var pairs = data.__data__;
				if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
					pairs.push([key, value]);
					this.size = ++data.size;
					return this;
				}
				data = this.__data__ = new MapCache(pairs);
			}
			data.set(key, value);
			this.size = data.size;
			return this;
		}
		module.exports = stackSet;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Stack.js
	var require__Stack = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var ListCache = require__ListCache(), stackClear = require__stackClear(), stackDelete = require__stackDelete(), stackGet = require__stackGet(), stackHas = require__stackHas(), stackSet = require__stackSet();
		/**
		* Creates a stack cache object to store key-value pairs.
		*
		* @private
		* @constructor
		* @param {Array} [entries] The key-value pairs to cache.
		*/
		function Stack(entries) {
			this.size = (this.__data__ = new ListCache(entries)).size;
		}
		Stack.prototype.clear = stackClear;
		Stack.prototype["delete"] = stackDelete;
		Stack.prototype.get = stackGet;
		Stack.prototype.has = stackHas;
		Stack.prototype.set = stackSet;
		module.exports = Stack;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_setCacheAdd.js
	var require__setCacheAdd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** Used to stand-in for `undefined` hash values. */
		var HASH_UNDEFINED = "__lodash_hash_undefined__";
		/**
		* Adds `value` to the array cache.
		*
		* @private
		* @name add
		* @memberOf SetCache
		* @alias push
		* @param {*} value The value to cache.
		* @returns {Object} Returns the cache instance.
		*/
		function setCacheAdd(value) {
			this.__data__.set(value, HASH_UNDEFINED);
			return this;
		}
		module.exports = setCacheAdd;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_setCacheHas.js
	var require__setCacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Checks if `value` is in the array cache.
		*
		* @private
		* @name has
		* @memberOf SetCache
		* @param {*} value The value to search for.
		* @returns {boolean} Returns `true` if `value` is found, else `false`.
		*/
		function setCacheHas(value) {
			return this.__data__.has(value);
		}
		module.exports = setCacheHas;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_SetCache.js
	var require__SetCache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var MapCache = require__MapCache(), setCacheAdd = require__setCacheAdd(), setCacheHas = require__setCacheHas();
		/**
		*
		* Creates an array cache object to store unique values.
		*
		* @private
		* @constructor
		* @param {Array} [values] The values to cache.
		*/
		function SetCache(values) {
			var index = -1, length = values == null ? 0 : values.length;
			this.__data__ = new MapCache();
			while (++index < length) this.add(values[index]);
		}
		SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
		SetCache.prototype.has = setCacheHas;
		module.exports = SetCache;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_arraySome.js
	var require__arraySome = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* A specialized version of `_.some` for arrays without support for iteratee
		* shorthands.
		*
		* @private
		* @param {Array} [array] The array to iterate over.
		* @param {Function} predicate The function invoked per iteration.
		* @returns {boolean} Returns `true` if any element passes the predicate check,
		*  else `false`.
		*/
		function arraySome(array, predicate) {
			var index = -1, length = array == null ? 0 : array.length;
			while (++index < length) if (predicate(array[index], index, array)) return true;
			return false;
		}
		module.exports = arraySome;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_cacheHas.js
	var require__cacheHas = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Checks if a `cache` value for `key` exists.
		*
		* @private
		* @param {Object} cache The cache to query.
		* @param {string} key The key of the entry to check.
		* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
		*/
		function cacheHas(cache, key) {
			return cache.has(key);
		}
		module.exports = cacheHas;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_equalArrays.js
	var require__equalArrays = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var SetCache = require__SetCache(), arraySome = require__arraySome(), cacheHas = require__cacheHas();
		/** Used to compose bitmasks for value comparisons. */
		var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
		/**
		* A specialized version of `baseIsEqualDeep` for arrays with support for
		* partial deep comparisons.
		*
		* @private
		* @param {Array} array The array to compare.
		* @param {Array} other The other array to compare.
		* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
		* @param {Function} customizer The function to customize comparisons.
		* @param {Function} equalFunc The function to determine equivalents of values.
		* @param {Object} stack Tracks traversed `array` and `other` objects.
		* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
		*/
		function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
			var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
			if (arrLength != othLength && !(isPartial && othLength > arrLength)) return false;
			var arrStacked = stack.get(array);
			var othStacked = stack.get(other);
			if (arrStacked && othStacked) return arrStacked == other && othStacked == array;
			var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
			stack.set(array, other);
			stack.set(other, array);
			while (++index < arrLength) {
				var arrValue = array[index], othValue = other[index];
				if (customizer) var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
				if (compared !== void 0) {
					if (compared) continue;
					result = false;
					break;
				}
				if (seen) {
					if (!arraySome(other, function(othValue, othIndex) {
						if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) return seen.push(othIndex);
					})) {
						result = false;
						break;
					}
				} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
					result = false;
					break;
				}
			}
			stack["delete"](array);
			stack["delete"](other);
			return result;
		}
		module.exports = equalArrays;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Uint8Array.js
	var require__Uint8Array = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__root().Uint8Array;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_mapToArray.js
	var require__mapToArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Converts `map` to its key-value pairs.
		*
		* @private
		* @param {Object} map The map to convert.
		* @returns {Array} Returns the key-value pairs.
		*/
		function mapToArray(map) {
			var index = -1, result = Array(map.size);
			map.forEach(function(value, key) {
				result[++index] = [key, value];
			});
			return result;
		}
		module.exports = mapToArray;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_setToArray.js
	var require__setToArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Converts `set` to an array of its values.
		*
		* @private
		* @param {Object} set The set to convert.
		* @returns {Array} Returns the values.
		*/
		function setToArray(set) {
			var index = -1, result = Array(set.size);
			set.forEach(function(value) {
				result[++index] = value;
			});
			return result;
		}
		module.exports = setToArray;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_equalByTag.js
	var require__equalByTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Symbol = require__Symbol(), Uint8Array = require__Uint8Array(), eq = require_eq(), equalArrays = require__equalArrays(), mapToArray = require__mapToArray(), setToArray = require__setToArray();
		/** Used to compose bitmasks for value comparisons. */
		var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
		/** `Object#toString` result references. */
		var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
		var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
		/** Used to convert symbols to primitives and strings. */
		var symbolProto = Symbol ? Symbol.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
		/**
		* A specialized version of `baseIsEqualDeep` for comparing objects of
		* the same `toStringTag`.
		*
		* **Note:** This function only supports comparing values with tags of
		* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
		*
		* @private
		* @param {Object} object The object to compare.
		* @param {Object} other The other object to compare.
		* @param {string} tag The `toStringTag` of the objects to compare.
		* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
		* @param {Function} customizer The function to customize comparisons.
		* @param {Function} equalFunc The function to determine equivalents of values.
		* @param {Object} stack Tracks traversed `object` and `other` objects.
		* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
		*/
		function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
			switch (tag) {
				case dataViewTag:
					if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) return false;
					object = object.buffer;
					other = other.buffer;
				case arrayBufferTag:
					if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) return false;
					return true;
				case boolTag:
				case dateTag:
				case numberTag: return eq(+object, +other);
				case errorTag: return object.name == other.name && object.message == other.message;
				case regexpTag:
				case stringTag: return object == other + "";
				case mapTag: var convert = mapToArray;
				case setTag:
					var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
					convert || (convert = setToArray);
					if (object.size != other.size && !isPartial) return false;
					var stacked = stack.get(object);
					if (stacked) return stacked == other;
					bitmask |= COMPARE_UNORDERED_FLAG;
					stack.set(object, other);
					var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
					stack["delete"](object);
					return result;
				case symbolTag: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other);
			}
			return false;
		}
		module.exports = equalByTag;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_arrayPush.js
	var require__arrayPush = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Appends the elements of `values` to `array`.
		*
		* @private
		* @param {Array} array The array to modify.
		* @param {Array} values The values to append.
		* @returns {Array} Returns `array`.
		*/
		function arrayPush(array, values) {
			var index = -1, length = values.length, offset = array.length;
			while (++index < length) array[offset + index] = values[index];
			return array;
		}
		module.exports = arrayPush;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isArray.js
	var require_isArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = Array.isArray;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseGetAllKeys.js
	var require__baseGetAllKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var arrayPush = require__arrayPush(), isArray = require_isArray();
		/**
		* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
		* `keysFunc` and `symbolsFunc` to get the enumerable property names and
		* symbols of `object`.
		*
		* @private
		* @param {Object} object The object to query.
		* @param {Function} keysFunc The function to get the keys of `object`.
		* @param {Function} symbolsFunc The function to get the symbols of `object`.
		* @returns {Array} Returns the array of property names and symbols.
		*/
		function baseGetAllKeys(object, keysFunc, symbolsFunc) {
			var result = keysFunc(object);
			return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
		}
		module.exports = baseGetAllKeys;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_arrayFilter.js
	var require__arrayFilter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* A specialized version of `_.filter` for arrays without support for
		* iteratee shorthands.
		*
		* @private
		* @param {Array} [array] The array to iterate over.
		* @param {Function} predicate The function invoked per iteration.
		* @returns {Array} Returns the new filtered array.
		*/
		function arrayFilter(array, predicate) {
			var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
			while (++index < length) {
				var value = array[index];
				if (predicate(value, index, array)) result[resIndex++] = value;
			}
			return result;
		}
		module.exports = arrayFilter;
	}));
	//#endregion
	//#region ../../node_modules/lodash/stubArray.js
	var require_stubArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* This method returns a new empty array.
		*
		* @static
		* @memberOf _
		* @since 4.13.0
		* @category Util
		* @returns {Array} Returns the new empty array.
		* @example
		*
		* var arrays = _.times(2, _.stubArray);
		*
		* console.log(arrays);
		* // => [[], []]
		*
		* console.log(arrays[0] === arrays[1]);
		* // => false
		*/
		function stubArray() {
			return [];
		}
		module.exports = stubArray;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getSymbols.js
	var require__getSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var arrayFilter = require__arrayFilter(), stubArray = require_stubArray();
		/** Built-in value references. */
		var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
		var nativeGetSymbols = Object.getOwnPropertySymbols;
		module.exports = !nativeGetSymbols ? stubArray : function(object) {
			if (object == null) return [];
			object = Object(object);
			return arrayFilter(nativeGetSymbols(object), function(symbol) {
				return propertyIsEnumerable.call(object, symbol);
			});
		};
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseTimes.js
	var require__baseTimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* The base implementation of `_.times` without support for iteratee shorthands
		* or max array length checks.
		*
		* @private
		* @param {number} n The number of times to invoke `iteratee`.
		* @param {Function} iteratee The function invoked per iteration.
		* @returns {Array} Returns the array of results.
		*/
		function baseTimes(n, iteratee) {
			var index = -1, result = Array(n);
			while (++index < n) result[index] = iteratee(index);
			return result;
		}
		module.exports = baseTimes;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isObjectLike.js
	var require_isObjectLike = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Checks if `value` is object-like. A value is object-like if it's not `null`
		* and has a `typeof` result of "object".
		*
		* @static
		* @memberOf _
		* @since 4.0.0
		* @category Lang
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
		* @example
		*
		* _.isObjectLike({});
		* // => true
		*
		* _.isObjectLike([1, 2, 3]);
		* // => true
		*
		* _.isObjectLike(_.noop);
		* // => false
		*
		* _.isObjectLike(null);
		* // => false
		*/
		function isObjectLike(value) {
			return value != null && typeof value == "object";
		}
		module.exports = isObjectLike;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseIsArguments.js
	var require__baseIsArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseGetTag = require__baseGetTag(), isObjectLike = require_isObjectLike();
		/** `Object#toString` result references. */
		var argsTag = "[object Arguments]";
		/**
		* The base implementation of `_.isArguments`.
		*
		* @private
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is an `arguments` object,
		*/
		function baseIsArguments(value) {
			return isObjectLike(value) && baseGetTag(value) == argsTag;
		}
		module.exports = baseIsArguments;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isArguments.js
	var require_isArguments = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseIsArguments = require__baseIsArguments(), isObjectLike = require_isObjectLike();
		/** Used for built-in method references. */
		var objectProto = Object.prototype;
		/** Used to check objects for own properties. */
		var hasOwnProperty = objectProto.hasOwnProperty;
		/** Built-in value references. */
		var propertyIsEnumerable = objectProto.propertyIsEnumerable;
		module.exports = baseIsArguments(function() {
			return arguments;
		}()) ? baseIsArguments : function(value) {
			return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
		};
	}));
	//#endregion
	//#region ../../node_modules/lodash/stubFalse.js
	var require_stubFalse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* This method returns `false`.
		*
		* @static
		* @memberOf _
		* @since 4.13.0
		* @category Util
		* @returns {boolean} Returns `false`.
		* @example
		*
		* _.times(2, _.stubFalse);
		* // => [false, false]
		*/
		function stubFalse() {
			return false;
		}
		module.exports = stubFalse;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isBuffer.js
	var require_isBuffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var root = require__root(), stubFalse = require_stubFalse();
		/** Detect free variable `exports`. */
		var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
		/** Detect free variable `module`. */
		var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
		/** Built-in value references. */
		var Buffer = freeModule && freeModule.exports === freeExports ? root.Buffer : void 0;
		module.exports = (Buffer ? Buffer.isBuffer : void 0) || stubFalse;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_isIndex.js
	var require__isIndex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** Used as references for various `Number` constants. */
		var MAX_SAFE_INTEGER = 9007199254740991;
		/** Used to detect unsigned integer values. */
		var reIsUint = /^(?:0|[1-9]\d*)$/;
		/**
		* Checks if `value` is a valid array-like index.
		*
		* @private
		* @param {*} value The value to check.
		* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
		* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
		*/
		function isIndex(value, length) {
			var type = typeof value;
			length = length == null ? MAX_SAFE_INTEGER : length;
			return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
		}
		module.exports = isIndex;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isLength.js
	var require_isLength = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** Used as references for various `Number` constants. */
		var MAX_SAFE_INTEGER = 9007199254740991;
		/**
		* Checks if `value` is a valid array-like length.
		*
		* **Note:** This method is loosely based on
		* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
		*
		* @static
		* @memberOf _
		* @since 4.0.0
		* @category Lang
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
		* @example
		*
		* _.isLength(3);
		* // => true
		*
		* _.isLength(Number.MIN_VALUE);
		* // => false
		*
		* _.isLength(Infinity);
		* // => false
		*
		* _.isLength('3');
		* // => false
		*/
		function isLength(value) {
			return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
		}
		module.exports = isLength;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseIsTypedArray.js
	var require__baseIsTypedArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseGetTag = require__baseGetTag(), isLength = require_isLength(), isObjectLike = require_isObjectLike();
		/** `Object#toString` result references. */
		var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
		var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
		/** Used to identify `toStringTag` values of typed arrays. */
		var typedArrayTags = {};
		typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
		typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
		/**
		* The base implementation of `_.isTypedArray` without Node.js optimizations.
		*
		* @private
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
		*/
		function baseIsTypedArray(value) {
			return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
		}
		module.exports = baseIsTypedArray;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseUnary.js
	var require__baseUnary = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* The base implementation of `_.unary` without support for storing metadata.
		*
		* @private
		* @param {Function} func The function to cap arguments for.
		* @returns {Function} Returns the new capped function.
		*/
		function baseUnary(func) {
			return function(value) {
				return func(value);
			};
		}
		module.exports = baseUnary;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_nodeUtil.js
	var require__nodeUtil = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var freeGlobal = require__freeGlobal();
		/** Detect free variable `exports`. */
		var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
		/** Detect free variable `module`. */
		var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
		/** Detect free variable `process` from Node.js. */
		var freeProcess = freeModule && freeModule.exports === freeExports && freeGlobal.process;
		module.exports = function() {
			try {
				var types = freeModule && freeModule.require && freeModule.require("util").types;
				if (types) return types;
				return freeProcess && freeProcess.binding && freeProcess.binding("util");
			} catch (e) {}
		}();
	}));
	//#endregion
	//#region ../../node_modules/lodash/isTypedArray.js
	var require_isTypedArray = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseIsTypedArray = require__baseIsTypedArray(), baseUnary = require__baseUnary(), nodeUtil = require__nodeUtil();
		var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
		module.exports = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_arrayLikeKeys.js
	var require__arrayLikeKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseTimes = require__baseTimes(), isArguments = require_isArguments(), isArray = require_isArray(), isBuffer = require_isBuffer(), isIndex = require__isIndex(), isTypedArray = require_isTypedArray();
		/** Used to check objects for own properties. */
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/**
		* Creates an array of the enumerable property names of the array-like `value`.
		*
		* @private
		* @param {*} value The value to query.
		* @param {boolean} inherited Specify returning inherited property names.
		* @returns {Array} Returns the array of property names.
		*/
		function arrayLikeKeys(value, inherited) {
			var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
			for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) result.push(key);
			return result;
		}
		module.exports = arrayLikeKeys;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_isPrototype.js
	var require__isPrototype = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/** Used for built-in method references. */
		var objectProto = Object.prototype;
		/**
		* Checks if `value` is likely a prototype object.
		*
		* @private
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
		*/
		function isPrototype(value) {
			var Ctor = value && value.constructor;
			return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
		}
		module.exports = isPrototype;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_overArg.js
	var require__overArg = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		/**
		* Creates a unary function that invokes `func` with its argument transformed.
		*
		* @private
		* @param {Function} func The function to wrap.
		* @param {Function} transform The argument transform.
		* @returns {Function} Returns the new function.
		*/
		function overArg(func, transform) {
			return function(arg) {
				return func(transform(arg));
			};
		}
		module.exports = overArg;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_nativeKeys.js
	var require__nativeKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__overArg()(Object.keys, Object);
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseKeys.js
	var require__baseKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isPrototype = require__isPrototype(), nativeKeys = require__nativeKeys();
		/** Used to check objects for own properties. */
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/**
		* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
		*
		* @private
		* @param {Object} object The object to query.
		* @returns {Array} Returns the array of property names.
		*/
		function baseKeys(object) {
			if (!isPrototype(object)) return nativeKeys(object);
			var result = [];
			for (var key in Object(object)) if (hasOwnProperty.call(object, key) && key != "constructor") result.push(key);
			return result;
		}
		module.exports = baseKeys;
	}));
	//#endregion
	//#region ../../node_modules/lodash/isArrayLike.js
	var require_isArrayLike = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isFunction = require_isFunction(), isLength = require_isLength();
		/**
		* Checks if `value` is array-like. A value is considered array-like if it's
		* not a function and has a `value.length` that's an integer greater than or
		* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
		*
		* @static
		* @memberOf _
		* @since 4.0.0
		* @category Lang
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
		* @example
		*
		* _.isArrayLike([1, 2, 3]);
		* // => true
		*
		* _.isArrayLike(document.body.children);
		* // => true
		*
		* _.isArrayLike('abc');
		* // => true
		*
		* _.isArrayLike(_.noop);
		* // => false
		*/
		function isArrayLike(value) {
			return value != null && isLength(value.length) && !isFunction(value);
		}
		module.exports = isArrayLike;
	}));
	//#endregion
	//#region ../../node_modules/lodash/keys.js
	var require_keys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var arrayLikeKeys = require__arrayLikeKeys(), baseKeys = require__baseKeys(), isArrayLike = require_isArrayLike();
		/**
		* Creates an array of the own enumerable property names of `object`.
		*
		* **Note:** Non-object values are coerced to objects. See the
		* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
		* for more details.
		*
		* @static
		* @since 0.1.0
		* @memberOf _
		* @category Object
		* @param {Object} object The object to query.
		* @returns {Array} Returns the array of property names.
		* @example
		*
		* function Foo() {
		*   this.a = 1;
		*   this.b = 2;
		* }
		*
		* Foo.prototype.c = 3;
		*
		* _.keys(new Foo);
		* // => ['a', 'b'] (iteration order is not guaranteed)
		*
		* _.keys('hi');
		* // => ['0', '1']
		*/
		function keys(object) {
			return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
		}
		module.exports = keys;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getAllKeys.js
	var require__getAllKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseGetAllKeys = require__baseGetAllKeys(), getSymbols = require__getSymbols(), keys = require_keys();
		/**
		* Creates an array of own enumerable property names and symbols of `object`.
		*
		* @private
		* @param {Object} object The object to query.
		* @returns {Array} Returns the array of property names and symbols.
		*/
		function getAllKeys(object) {
			return baseGetAllKeys(object, keys, getSymbols);
		}
		module.exports = getAllKeys;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_equalObjects.js
	var require__equalObjects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var getAllKeys = require__getAllKeys();
		/** Used to compose bitmasks for value comparisons. */
		var COMPARE_PARTIAL_FLAG = 1;
		/** Used to check objects for own properties. */
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/**
		* A specialized version of `baseIsEqualDeep` for objects with support for
		* partial deep comparisons.
		*
		* @private
		* @param {Object} object The object to compare.
		* @param {Object} other The other object to compare.
		* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
		* @param {Function} customizer The function to customize comparisons.
		* @param {Function} equalFunc The function to determine equivalents of values.
		* @param {Object} stack Tracks traversed `object` and `other` objects.
		* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
		*/
		function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
			var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length;
			if (objLength != getAllKeys(other).length && !isPartial) return false;
			var index = objLength;
			while (index--) {
				var key = objProps[index];
				if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) return false;
			}
			var objStacked = stack.get(object);
			var othStacked = stack.get(other);
			if (objStacked && othStacked) return objStacked == other && othStacked == object;
			var result = true;
			stack.set(object, other);
			stack.set(other, object);
			var skipCtor = isPartial;
			while (++index < objLength) {
				key = objProps[index];
				var objValue = object[key], othValue = other[key];
				if (customizer) var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
				if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
					result = false;
					break;
				}
				skipCtor || (skipCtor = key == "constructor");
			}
			if (result && !skipCtor) {
				var objCtor = object.constructor, othCtor = other.constructor;
				if (objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) result = false;
			}
			stack["delete"](object);
			stack["delete"](other);
			return result;
		}
		module.exports = equalObjects;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_DataView.js
	var require__DataView = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__getNative()(require__root(), "DataView");
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Promise.js
	var require__Promise = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__getNative()(require__root(), "Promise");
	}));
	//#endregion
	//#region ../../node_modules/lodash/_Set.js
	var require__Set = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__getNative()(require__root(), "Set");
	}));
	//#endregion
	//#region ../../node_modules/lodash/_WeakMap.js
	var require__WeakMap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		module.exports = require__getNative()(require__root(), "WeakMap");
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getTag.js
	var require__getTag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var DataView = require__DataView(), Map = require__Map(), Promise = require__Promise(), Set = require__Set(), WeakMap = require__WeakMap(), baseGetTag = require__baseGetTag(), toSource = require__toSource();
		/** `Object#toString` result references. */
		var mapTag = "[object Map]", objectTag = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
		var dataViewTag = "[object DataView]";
		/** Used to detect maps, sets, and weakmaps. */
		var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
		/**
		* Gets the `toStringTag` of `value`.
		*
		* @private
		* @param {*} value The value to query.
		* @returns {string} Returns the `toStringTag`.
		*/
		var getTag = baseGetTag;
		if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) getTag = function(value) {
			var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
			if (ctorString) switch (ctorString) {
				case dataViewCtorString: return dataViewTag;
				case mapCtorString: return mapTag;
				case promiseCtorString: return promiseTag;
				case setCtorString: return setTag;
				case weakMapCtorString: return weakMapTag;
			}
			return result;
		};
		module.exports = getTag;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseIsEqualDeep.js
	var require__baseIsEqualDeep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Stack = require__Stack(), equalArrays = require__equalArrays(), equalByTag = require__equalByTag(), equalObjects = require__equalObjects(), getTag = require__getTag(), isArray = require_isArray(), isBuffer = require_isBuffer(), isTypedArray = require_isTypedArray();
		/** Used to compose bitmasks for value comparisons. */
		var COMPARE_PARTIAL_FLAG = 1;
		/** `Object#toString` result references. */
		var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
		/** Used to check objects for own properties. */
		var hasOwnProperty = Object.prototype.hasOwnProperty;
		/**
		* A specialized version of `baseIsEqual` for arrays and objects which performs
		* deep comparisons and tracks traversed objects enabling objects with circular
		* references to be compared.
		*
		* @private
		* @param {Object} object The object to compare.
		* @param {Object} other The other object to compare.
		* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
		* @param {Function} customizer The function to customize comparisons.
		* @param {Function} equalFunc The function to determine equivalents of values.
		* @param {Object} [stack] Tracks traversed `object` and `other` objects.
		* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
		*/
		function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
			var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
			objTag = objTag == argsTag ? objectTag : objTag;
			othTag = othTag == argsTag ? objectTag : othTag;
			var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
			if (isSameTag && isBuffer(object)) {
				if (!isBuffer(other)) return false;
				objIsArr = true;
				objIsObj = false;
			}
			if (isSameTag && !objIsObj) {
				stack || (stack = new Stack());
				return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
			}
			if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
				var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
				if (objIsWrapped || othIsWrapped) {
					var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
					stack || (stack = new Stack());
					return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
				}
			}
			if (!isSameTag) return false;
			stack || (stack = new Stack());
			return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
		}
		module.exports = baseIsEqualDeep;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseIsEqual.js
	var require__baseIsEqual = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseIsEqualDeep = require__baseIsEqualDeep(), isObjectLike = require_isObjectLike();
		/**
		* The base implementation of `_.isEqual` which supports partial comparisons
		* and tracks traversed objects.
		*
		* @private
		* @param {*} value The value to compare.
		* @param {*} other The other value to compare.
		* @param {boolean} bitmask The bitmask flags.
		*  1 - Unordered comparison
		*  2 - Partial comparison
		* @param {Function} [customizer] The function to customize comparisons.
		* @param {Object} [stack] Tracks traversed `value` and `other` objects.
		* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
		*/
		function baseIsEqual(value, other, bitmask, customizer, stack) {
			if (value === other) return true;
			if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) return value !== value && other !== other;
			return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
		}
		module.exports = baseIsEqual;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_baseIsMatch.js
	var require__baseIsMatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var Stack = require__Stack(), baseIsEqual = require__baseIsEqual();
		/** Used to compose bitmasks for value comparisons. */
		var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
		/**
		* The base implementation of `_.isMatch` without support for iteratee shorthands.
		*
		* @private
		* @param {Object} object The object to inspect.
		* @param {Object} source The object of property values to match.
		* @param {Array} matchData The property names, values, and compare flags to match.
		* @param {Function} [customizer] The function to customize comparisons.
		* @returns {boolean} Returns `true` if `object` is a match, else `false`.
		*/
		function baseIsMatch(object, source, matchData, customizer) {
			var index = matchData.length, length = index, noCustomizer = !customizer;
			if (object == null) return !length;
			object = Object(object);
			while (index--) {
				var data = matchData[index];
				if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) return false;
			}
			while (++index < length) {
				data = matchData[index];
				var key = data[0], objValue = object[key], srcValue = data[1];
				if (noCustomizer && data[2]) {
					if (objValue === void 0 && !(key in object)) return false;
				} else {
					var stack = new Stack();
					if (customizer) var result = customizer(objValue, srcValue, key, object, source, stack);
					if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) return false;
				}
			}
			return true;
		}
		module.exports = baseIsMatch;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_isStrictComparable.js
	var require__isStrictComparable = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isObject = require_isObject();
		/**
		* Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
		*
		* @private
		* @param {*} value The value to check.
		* @returns {boolean} Returns `true` if `value` if suitable for strict
		*  equality comparisons, else `false`.
		*/
		function isStrictComparable(value) {
			return value === value && !isObject(value);
		}
		module.exports = isStrictComparable;
	}));
	//#endregion
	//#region ../../node_modules/lodash/_getMatchData.js
	var require__getMatchData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		var isStrictComparable = require__isStrictComparable(), keys = require_keys();
		/**
		* Gets the property names, values, and compare flags of `object`.
		*
		* @private
		* @param {Object} object The object to query.
		* @returns {Array} Returns the match data of `object`.
		*/
		function getMatchData(object) {
			var result = keys(object), length = result.length;
			while (length--) {
				var key = result[length], value = object[key];
				result[length] = [
					key,
					value,
					isStrictComparable(value)
				];
			}
			return result;
		}
		module.exports = getMatchData;
	}));
	//#endregion
	//#region ../loot-core/src/server/reports/app.ts
	var import_isMatch = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
		var baseIsMatch = require__baseIsMatch(), getMatchData = require__getMatchData();
		/**
		* Performs a partial deep comparison between `object` and `source` to
		* determine if `object` contains equivalent property values.
		*
		* **Note:** This method is equivalent to `_.matches` when `source` is
		* partially applied.
		*
		* Partial comparisons will match empty array and empty object `source`
		* values against any array or object value, respectively. See `_.isEqual`
		* for a list of supported value comparisons.
		*
		* @static
		* @memberOf _
		* @since 3.0.0
		* @category Lang
		* @param {Object} object The object to inspect.
		* @param {Object} source The object of property values to match.
		* @returns {boolean} Returns `true` if `object` is a match, else `false`.
		* @example
		*
		* var object = { 'a': 1, 'b': 2 };
		*
		* _.isMatch(object, { 'b': 2 });
		* // => true
		*
		* _.isMatch(object, { 'b': 1 });
		* // => false
		*/
		function isMatch(object, source) {
			return object === source || baseIsMatch(object, source, getMatchData(source));
		}
		module.exports = isMatch;
	})))());
	var reportModel = {
		validate(report, { update } = {}) {
			requiredFields("Report", report, ["conditionsOp"], update);
			if (!update || "conditionsOp" in report) {
				if (!["and", "or"].includes(report.conditionsOp)) throw new ValidationError("Invalid filter conditionsOp: " + report.conditionsOp);
			}
			return report;
		},
		toJS(row) {
			return {
				id: row.id,
				name: row.name ?? "",
				startDate: row.start_date,
				endDate: row.end_date,
				isDateStatic: row.date_static === 1,
				dateRange: row.date_range,
				mode: row.mode,
				groupBy: row.group_by,
				sortBy: row.sort_by,
				interval: row.interval,
				balanceType: row.balance_type,
				showEmpty: row.show_empty === 1,
				showOffBudget: row.show_offbudget === 1,
				showHiddenCategories: row.show_hidden === 1,
				showUncategorized: row.show_uncategorized === 1,
				trimIntervals: row.trim_intervals === 1,
				includeCurrentInterval: row.include_current === 1,
				graphType: row.graph_type,
				conditions: row.conditions ?? [],
				conditionsOp: row.conditions_op ?? "and",
				metadata: row.metadata
			};
		},
		fromJS(report) {
			return {
				id: report.id,
				name: report.name,
				start_date: report.startDate,
				end_date: report.endDate,
				date_static: report.isDateStatic ? 1 : 0,
				date_range: report.dateRange,
				mode: report.mode,
				group_by: report.groupBy,
				sort_by: report.sortBy ?? "desc",
				interval: report.interval,
				balance_type: report.balanceType,
				show_empty: report.showEmpty ? 1 : 0,
				show_offbudget: report.showOffBudget ? 1 : 0,
				show_hidden: report.showHiddenCategories ? 1 : 0,
				show_uncategorized: report.showUncategorized ? 1 : 0,
				trim_intervals: report.trimIntervals ? 1 : 0,
				include_current: report.includeCurrentInterval ? 1 : 0,
				graph_type: report.graphType,
				conditions: report.conditions,
				conditions_op: report.conditionsOp
			};
		}
	};
	function sort(reports) {
		return reports.sort((a, b) => a.name && b.name ? a.name.trim().localeCompare(b.name.trim(), void 0, { ignorePunctuation: true }) : 0);
	}
	async function getReports() {
		const { data } = await aqlQuery(q("custom_reports").select("*"));
		return sort(data.map((r) => reportModel.toJS(r)));
	}
	async function reportNameExists(name, reportId, newItem) {
		const idForName = await first$2("SELECT id from custom_reports WHERE tombstone = 0 AND name = ?", [name]);
		if (idForName === null) return false;
		if (!newItem) return idForName.id !== reportId;
		return true;
	}
	async function createReport(report) {
		const reportId = v4();
		const item = {
			...report,
			id: reportId
		};
		if (!item.name) throw new Error("Report name is required");
		if (await reportNameExists(item.name, item.id ?? "", true)) throw new Error("There is already a report named " + item.name);
		await insertWithSchema("custom_reports", reportModel.fromJS(item));
		return reportId;
	}
	async function updateReport(item) {
		if (!item.name) throw new Error("Report name is required");
		if (!item.id) throw new Error("Report recall error");
		if (await reportNameExists(item.name, item.id, false)) throw new Error("There is already a report named " + item.name);
		await updateWithSchema("custom_reports", reportModel.fromJS(item));
	}
	async function deleteReport(id) {
		await delete_("custom_reports", id);
	}
	var app$13 = createApp();
	app$13.method("report/get", getReports);
	app$13.method("report/create", mutator(undoable(createReport)));
	app$13.method("report/update", mutator(undoable(updateReport)));
	app$13.method("report/delete", mutator(undoable(deleteReport)));
	//#endregion
	//#region ../loot-core/src/server/dashboard/app.ts
	function isExportedCustomReportWidget(widget) {
		return widget.type === "custom-report";
	}
	function isWidgetType(type) {
		return [
			"net-worth-card",
			"cash-flow-card",
			"spending-card",
			"crossover-card",
			"budget-analysis-card",
			"markdown-card",
			"summary-card",
			"calendar-card",
			"formula-card",
			"custom-report",
			"sankey-card"
		].includes(type);
	}
	var exportModel = { validate(dashboard) {
		requiredFields("Dashboard", dashboard, ["version", "widgets"]);
		if (!Array.isArray(dashboard.widgets)) throw new ValidationError("Invalid dashboard.widgets data type: it must be an array of widgets.");
		dashboard.widgets.forEach((widget, idx) => {
			requiredFields(`Dashboard widget #${idx}`, widget, [
				"type",
				"x",
				"y",
				"width",
				"height",
				...isExportedCustomReportWidget(widget) ? ["meta"] : []
			]);
			if (!Number.isInteger(widget.x)) throw new ValidationError(`Invalid widget.${idx}.x data-type for value ${widget.x}.`);
			if (!Number.isInteger(widget.y)) throw new ValidationError(`Invalid widget.${idx}.y data-type for value ${widget.y}.`);
			if (!Number.isInteger(widget.width)) throw new ValidationError(`Invalid widget.${idx}.width data-type for value ${widget.width}.`);
			if (!Number.isInteger(widget.height)) throw new ValidationError(`Invalid widget.${idx}.height data-type for value ${widget.height}.`);
			if (!isWidgetType(widget.type)) throw new ValidationError(`Invalid widget.${idx}.type value ${String(widget.type)}.`);
			if (isExportedCustomReportWidget(widget)) reportModel.validate(widget.meta);
		});
	} };
	async function createDashboardPage({ name }) {
		const id = v4();
		await insertWithSchema("dashboard_pages", {
			id,
			name
		});
		return id;
	}
	async function deleteDashboardPage(id) {
		if (((await first$2("SELECT count(*) as c FROM dashboard_pages WHERE tombstone = 0"))?.c ?? 0) <= 1) throw new Error("Cannot delete the last dashboard page");
		const deleting_widgets = await all("SELECT id FROM dashboard WHERE dashboard_page_id = ? AND tombstone = 0", [id]);
		await batchMessages(async () => {
			await delete_("dashboard_pages", id);
			await Promise.all(deleting_widgets.map(({ id }) => delete_("dashboard", id)));
		});
	}
	async function renameDashboardPage({ id, name }) {
		await updateWithSchema("dashboard_pages", {
			id,
			name
		});
	}
	async function updateDashboard(widgets) {
		const { data: dbWidgets } = await aqlQuery(q("dashboard").filter({ id: { $oneof: widgets.map(({ id }) => id) } }).select("*"));
		const dbWidgetMap = new Map(dbWidgets.map((widget) => [widget.id, widget]));
		await Promise.all(widgets.filter((widget) => !(0, import_isMatch.default)(dbWidgetMap.get(widget.id) ?? {}, widget)).map((widget) => update("dashboard", widget)));
	}
	async function updateDashboardWidget(widget) {
		await updateWithSchema("dashboard", widget);
	}
	async function resetDashboard(id) {
		await batchMessages(async () => {
			const widgets = await selectWithSchema("dashboard", "SELECT id FROM dashboard WHERE dashboard_page_id = ? AND tombstone = 0", [id]);
			await Promise.all([...widgets.map(({ id }) => delete_("dashboard", id)), ...DEFAULT_DASHBOARD_STATE.map((widget) => insertWithSchema("dashboard", {
				...widget,
				dashboard_page_id: id
			}))]);
		});
	}
	async function addDashboardWidget(widget) {
		if (!("x" in widget) && !("y" in widget)) {
			const data = await first$2("SELECT x, y, width, height FROM dashboard WHERE dashboard_page_id = ? AND tombstone = 0 ORDER BY y DESC, x DESC", [widget.dashboard_page_id]);
			if (!data) {
				widget.x = 0;
				widget.y = 0;
			} else {
				const xBoundaryCheck = data.x + data.width + widget.width;
				widget.x = xBoundaryCheck > 12 ? 0 : data.x + data.width;
				widget.y = data.y + (xBoundaryCheck > 12 ? data.height : 0);
			}
		}
		const { dashboard_page_id, ...widgetWithoutDashboardPageId } = widget;
		await insertWithSchema("dashboard", {
			...widgetWithoutDashboardPageId,
			dashboard_page_id
		});
	}
	async function removeDashboardWidget(widgetId) {
		await delete_("dashboard", widgetId);
	}
	async function copyDashboardWidget({ id, targetDashboardPageId }) {
		const widget = await first$2("SELECT * FROM dashboard WHERE id = ? AND tombstone = 0", [id]);
		if (!widget) throw new Error(`Widget not found: ${id}`);
		await batchMessages(async () => {
			if (isWidgetType(widget.type)) await addDashboardWidget({
				type: widget.type,
				width: widget.width,
				height: widget.height,
				meta: widget.meta ? JSON.parse(widget.meta) : {},
				dashboard_page_id: targetDashboardPageId
			});
			else throw new Error(`Unsupported widget type: ${widget.type}`);
		});
	}
	async function importDashboard({ filePath, dashboardPageId }) {
		try {
			if (!await exists$1(filePath)) throw new Error(`File not found at the provided path: ${filePath}`);
			const content = await readFile(filePath);
			const parsedContent = JSON.parse(content);
			exportModel.validate(parsedContent);
			const customReportIds = await all("SELECT id from custom_reports");
			const customReportIdSet = new Set(customReportIds.map(({ id }) => id));
			const existingWidgets = await selectWithSchema("dashboard", "SELECT id FROM dashboard WHERE dashboard_page_id = ? AND tombstone = 0", [dashboardPageId]);
			await batchMessages(async () => {
				await Promise.all([
					...existingWidgets.map(({ id }) => delete_("dashboard", id)),
					...parsedContent.widgets.map((widget) => insertWithSchema("dashboard", {
						type: widget.type,
						width: widget.width,
						height: widget.height,
						x: widget.x,
						y: widget.y,
						dashboard_page_id: dashboardPageId,
						meta: isExportedCustomReportWidget(widget) ? { id: widget.meta.id } : widget.meta
					})),
					...parsedContent.widgets.filter(isExportedCustomReportWidget).filter(({ meta }) => !customReportIdSet.has(meta.id)).map(({ meta }) => insertWithSchema("custom_reports", reportModel.fromJS(meta))),
					...parsedContent.widgets.filter(isExportedCustomReportWidget).filter(({ meta }) => customReportIdSet.has(meta.id)).map(({ meta }) => updateWithSchema("custom_reports", {
						...Object.fromEntries(Object.entries(reportModel.fromJS(meta)).map(([key, value]) => [key, value ?? null])),
						tombstone: false
					}))
				]);
			});
			return { status: "ok" };
		} catch (err) {
			if (err instanceof Error) {
				err.message = "Error importing file: " + err.message;
				captureException(err);
			}
			if (err instanceof SyntaxError) throw new Error("Invalid JSON file.", { cause: "json-parse-error" });
			if (err instanceof ValidationError) throw new Error(err.message, { cause: "validation-error" });
			throw new Error("Internal error occurred during import.", { cause: "internal-error" });
		}
	}
	var app$12 = createApp();
	app$12.method("dashboard-create", mutator(undoable(createDashboardPage)));
	app$12.method("dashboard-delete", mutator(undoable(deleteDashboardPage)));
	app$12.method("dashboard-rename", mutator(undoable(renameDashboardPage)));
	app$12.method("dashboard-update", mutator(undoable(updateDashboard)));
	app$12.method("dashboard-update-widget", mutator(undoable(updateDashboardWidget)));
	app$12.method("dashboard-reset", mutator(undoable(resetDashboard)));
	app$12.method("dashboard-add-widget", mutator(undoable(addDashboardWidget)));
	app$12.method("dashboard-remove-widget", mutator(undoable(removeDashboardWidget)));
	app$12.method("dashboard-copy-widget", mutator(undoable(copyDashboardWidget)));
	app$12.method("dashboard-import", mutator(undoable(importDashboard)));
	//#endregion
	//#region ../loot-core/src/server/encryption/app.ts
	init_dist();
	var app$11 = createApp();
	app$11.method("key-make", keyMake);
	app$11.method("key-test", keyTest);
	async function keyMake({ password }) {
		if (!getPrefs()) throw new Error("key-make must be called with file loaded");
		const salt = randomBytes(32).toString("base64");
		const key = await createKey({
			id: v4(),
			password,
			salt
		});
		await loadKey(key);
		const testContent = await makeTestMessage(key.getId());
		return await resetSync$1({
			key,
			salt,
			testContent: JSON.stringify({
				...testContent,
				value: testContent.value.toString("base64")
			})
		});
	}
	async function keyTest({ cloudFileId, password }) {
		const userToken = await getItem("user-token");
		if (cloudFileId == null) cloudFileId = getPrefs().cloudFileId;
		let validCloudFileId;
		let res;
		try {
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			res = await post(serverConfig.SYNC_SERVER + "/user-get-key", {
				token: userToken,
				fileId: cloudFileId
			});
			validCloudFileId = cloudFileId;
		} catch (e) {
			logger.log(e);
			return { error: { reason: "network" } };
		}
		const { id, salt, test: originalTest } = res;
		if (!originalTest) return { error: { reason: "old-key-style" } };
		const test = JSON.parse(originalTest);
		const key = await createKey({
			id,
			password,
			salt
		});
		await loadKey(key);
		try {
			await decrypt(Buffer$1.from(test.value, "base64"), test.meta);
		} catch (e) {
			logger.log(e);
			unloadKey(key);
			return { error: { reason: "decrypt-failure" } };
		}
		const keys = JSON.parse(await getItem(`encrypt-keys`) || "{}");
		keys[validCloudFileId] = key.serialize();
		await setItem("encrypt-keys", JSON.stringify(keys));
		if (getPrefs()) await savePrefs({ encryptKeyId: key.getId() });
		return {};
	}
	//#endregion
	//#region ../loot-core/src/server/filters/app.ts
	var filterModel = {
		validate(filter, { update } = {}) {
			requiredFields("transaction_filters", filter, ["conditions"], update);
			if (!update || "conditionsOp" in filter) {
				if (!["and", "or"].includes(filter.conditionsOp)) throw new Error("Invalid filter conditionsOp: " + filter.conditionsOp);
			}
			return filter;
		},
		toJS(row) {
			const { conditions, conditions_op, ...fields } = row;
			return {
				...fields,
				conditionsOp: conditions_op,
				conditions: parseConditionsOrActions(conditions)
			};
		},
		fromJS(filter) {
			const { conditionsOp, ...row } = filter;
			if (conditionsOp) row.conditions_op = conditionsOp;
			return row;
		}
	};
	async function filterNameExists(name, filterId, newItem) {
		const idForName = await first$2("SELECT id from transaction_filters WHERE tombstone = 0 AND name = ?", [name]);
		if (idForName === null) return false;
		if (!newItem) return idForName.id !== filterId;
		return true;
	}
	function conditionExists(item, filters, newItem) {
		const { conditions, conditionsOp } = item;
		let fConditionFound = null;
		filters.some((filter) => {
			if ((conditions.length === 1 || filter.conditionsOp === conditionsOp) && !filter.tombstone && filter.conditions.length === conditions.length) {
				if (!conditions.some((cond) => !filter.conditions.some((fcond) => cond.value === fcond.value && cond.op === fcond.op && cond.field === fcond.field && filterOptionsMatch(cond.options, fcond.options)))) {
					fConditionFound = filter;
					return true;
				}
			}
			return false;
		});
		if (!newItem) return fConditionFound ? fConditionFound.id !== item.id ? fConditionFound.name : false : false;
		return fConditionFound ? fConditionFound.name : false;
	}
	function filterOptionsMatch(options1, options2) {
		const opt1 = options1 ?? {};
		const opt2 = options2 ?? {};
		const keys1 = Object.keys(opt1);
		const keys2 = Object.keys(opt2);
		if (keys1.length !== keys2.length) return false;
		return keys1.every((key) => opt1[key] === opt2[key]);
	}
	async function createFilter(filter) {
		const filterId = v4();
		const item = {
			id: filterId,
			conditions: filter.state.conditions,
			conditionsOp: filter.state.conditionsOp,
			name: filter.state.name
		};
		if (item.name) {
			if (await filterNameExists(item.name, item.id, true)) throw new Error("There is already a filter named " + item.name);
		} else throw new Error("Filter name is required");
		if (item.conditions.length > 0) {
			const condExists = conditionExists(item, filter.filters, true);
			if (condExists) throw new Error("Duplicate filter warning: conditions already exist. Filter name: " + condExists);
		} else throw new Error("Conditions are required");
		await insertWithSchema("transaction_filters", filterModel.fromJS(item));
		return filterId;
	}
	async function updateFilter(filter) {
		const item = {
			id: filter.state.id,
			conditions: filter.state.conditions,
			conditionsOp: filter.state.conditionsOp,
			name: filter.state.name
		};
		if (item.name) {
			if (await filterNameExists(item.name, item.id, false)) throw new Error("There is already a filter named " + item.name);
		} else throw new Error("Filter name is required");
		if (item.conditions.length > 0) {
			const condExists = conditionExists(item, filter.filters, false);
			if (condExists) throw new Error("Duplicate filter warning: conditions already exist. Filter name: " + condExists);
		} else throw new Error("Conditions are required");
		await updateWithSchema("transaction_filters", filterModel.fromJS(item));
	}
	async function deleteFilter(id) {
		await delete_("transaction_filters", id);
	}
	var app$10 = createApp();
	app$10.method("filter-create", mutator(createFilter));
	app$10.method("filter-update", mutator(updateFilter));
	app$10.method("filter-delete", mutator(undoable(deleteFilter)));
	//#endregion
	//#region ../loot-core/src/server/forecast/forecast-accounts.ts
	function getAccountName(account) {
		return account.name.toLowerCase();
	}
	function matchesAccountCondition(account, condition) {
		switch (condition.op) {
			case "is": return account.id === condition.value;
			case "isNot": return account.id !== condition.value;
			case "oneOf": return condition.value.includes(account.id);
			case "notOneOf": return !condition.value.includes(account.id);
			case "contains": return getAccountName(account).includes(String(condition.value).toLowerCase());
			case "doesNotContain": return !getAccountName(account).includes(String(condition.value).toLowerCase());
			case "matches": try {
				return new RegExp(String(condition.value)).test(String(account.name).toLowerCase());
			} catch {
				return false;
			}
			case "onBudget": return account.offbudget === 0;
			case "offBudget": return account.offbudget === 1;
			default: return false;
		}
	}
	async function resolveAccountIdsFromConditions(conditions, conditionsOp) {
		const accountConditions = conditions.filter((condition) => condition.field === "account");
		if (accountConditions.length === 0) return;
		return (await getAccounts$2()).filter((account) => {
			const matches = accountConditions.map((condition) => matchesAccountCondition(account, condition));
			return conditionsOp === "or" ? matches.some(Boolean) : matches.every(Boolean);
		}).map((account) => account.id);
	}
	function getAccountRestrictionMode(conditions, conditionsOp) {
		if (conditions.length === 0) return false;
		if (conditions.filter((condition) => condition.field === "account").length === 0) return false;
		return !conditions.some((condition) => condition.field !== "account") || conditionsOp === "and";
	}
	async function getAccounts(accountIds) {
		const accounts = await getAccounts$2();
		const selectedAccounts = accountIds === void 0 ? accounts : accounts.filter((account) => accountIds.includes(account.id));
		if (selectedAccounts.length === 0) return [];
		const ids = selectedAccounts.map((account) => account.id);
		const { data: balanceRows } = await aqlQuery(q("transactions").filter({
			"account.id": { $oneof: ids },
			tombstone: false
		}).groupBy("account").select(["account", { balance_current: { $sum: "$amount" } }]).serialize());
		const balanceByAccount = /* @__PURE__ */ new Map();
		for (const row of balanceRows) balanceByAccount.set(row.account, row.balance_current ?? 0);
		return selectedAccounts.map((account) => ({
			id: account.id,
			name: account.name,
			closed: account.closed,
			offbudget: account.offbudget,
			balance_current: balanceByAccount.get(account.id) ?? 0
		}));
	}
	async function resolveForecastAccounts({ accountIds, plainConditions, resolvedConditionsOp, canRestrictAccounts }) {
		let resolvedAccountIds = accountIds;
		if (canRestrictAccounts && plainConditions.length > 0) {
			const conditionAccountIds = await resolveAccountIdsFromConditions(plainConditions, resolvedConditionsOp);
			if (conditionAccountIds !== void 0) resolvedAccountIds = resolvedAccountIds !== void 0 ? resolvedAccountIds.filter((id) => conditionAccountIds.includes(id)) : conditionAccountIds;
		}
		return getAccounts(resolvedAccountIds);
	}
	//#endregion
	//#region ../loot-core/src/server/forecast/forecast-filters.ts
	function buildFilterInfo(conditions, conditionsOp) {
		const resolvedConditionsOp = conditionsOp ?? "and";
		const plainConditions = (conditions ?? []).filter((cond) => !cond.customName);
		const { filters } = conditionsToAQL(plainConditions);
		return {
			filterInfo: {
				filters: [...filters, ...plainConditions.flatMap((condition) => condition.queryFilter ? [condition.queryFilter] : [])],
				conditionsOpKey: resolvedConditionsOp === "or" ? "$or" : "$and",
				canRestrictAccounts: getAccountRestrictionMode(plainConditions, resolvedConditionsOp)
			},
			plainConditions,
			resolvedConditionsOp
		};
	}
	async function getTransactions(accountIds, filterInfo) {
		let query = q("transactions").filter({ tombstone: false }).select("*").options({ splits: "inline" });
		if (accountIds !== void 0) {
			if (accountIds.length === 0) return [];
			query = query.filter({ "account.id": { $oneof: accountIds } });
		}
		if (filterInfo.filters.length > 0) query = query.filter({ [filterInfo.conditionsOpKey]: filterInfo.filters });
		const { data } = await aqlQuery(query);
		return data;
	}
	function escapeRegex(value) {
		return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
	}
	function getValueByPath(object, path) {
		return path.split(".").reduce((current, key) => {
			if (current == null || typeof current !== "object") return;
			return current[key];
		}, object);
	}
	function normalizeComparisonValue(value) {
		if (value != null && typeof value === "object" && "id" in value) return value.id;
		return value;
	}
	/** AQL from {@link conditionsToAQL} uses booleans for account.offbudget; enriched accounts use 0/1. */
	function equalComparableFilterValues(actual, expected) {
		const a = normalizeComparisonValue(actual);
		if (a === expected) return true;
		if (typeof expected === "boolean" && (a === 0 || a === 1)) return expected === false && a === 0 || expected === true && a === 1;
		return false;
	}
	function applyTransform(value, transform) {
		if (transform === "$lower" && typeof value === "string") return value.toLowerCase();
		if (transform === "$neg" && typeof value === "number") return -value;
		return value;
	}
	function likeToRegex(pattern) {
		const regex = "^" + escapeRegex(pattern).replace(/%/g, ".*") + "$";
		return new RegExp(regex, "i");
	}
	function evaluateClause(actualValue, clause) {
		if (Array.isArray(clause)) return clause.every((item) => evaluateClause(actualValue, item));
		if (clause == null || typeof clause !== "object") return equalComparableFilterValues(actualValue, clause);
		const typedClause = clause;
		const transform = typedClause.$transform;
		const transformedActualValue = applyTransform(actualValue, transform);
		return Object.entries(typedClause).filter(([key]) => key !== "$transform").every(([operator, expectedValue]) => {
			const normalizedActualValue = normalizeComparisonValue(transformedActualValue);
			switch (operator) {
				case "$eq": return equalComparableFilterValues(normalizedActualValue, expectedValue);
				case "$ne": return !equalComparableFilterValues(normalizedActualValue, expectedValue);
				case "$gt": return normalizedActualValue != null && (typeof normalizedActualValue === "number" || typeof normalizedActualValue === "string") && (typeof expectedValue === "number" || typeof expectedValue === "string") && normalizedActualValue > expectedValue;
				case "$gte": return normalizedActualValue != null && (typeof normalizedActualValue === "number" || typeof normalizedActualValue === "string") && (typeof expectedValue === "number" || typeof expectedValue === "string") && normalizedActualValue >= expectedValue;
				case "$lt": return normalizedActualValue != null && (typeof normalizedActualValue === "number" || typeof normalizedActualValue === "string") && (typeof expectedValue === "number" || typeof expectedValue === "string") && normalizedActualValue < expectedValue;
				case "$lte": return normalizedActualValue != null && (typeof normalizedActualValue === "number" || typeof normalizedActualValue === "string") && (typeof expectedValue === "number" || typeof expectedValue === "string") && normalizedActualValue <= expectedValue;
				case "$oneof": return Array.isArray(expectedValue) && expectedValue.some((expectedItem) => equalComparableFilterValues(normalizedActualValue, expectedItem));
				case "$like": return typeof normalizedActualValue === "string" && typeof expectedValue === "string" && likeToRegex(expectedValue).test(normalizedActualValue);
				case "$notlike": return typeof normalizedActualValue === "string" && typeof expectedValue === "string" && !likeToRegex(expectedValue).test(normalizedActualValue);
				case "$regexp":
					if (typeof normalizedActualValue !== "string" || typeof expectedValue !== "string") return false;
					try {
						return new RegExp(expectedValue).test(normalizedActualValue);
					} catch {
						return false;
					}
				default: return false;
			}
		});
	}
	function matchesAQLFilter(object, filter) {
		if ("$and" in filter) {
			const clauses = filter.$and;
			return Array.isArray(clauses) ? clauses.every((clause) => matchesAQLFilter(object, clause)) : false;
		}
		if ("$or" in filter) {
			const clauses = filter.$or;
			return Array.isArray(clauses) ? clauses.some((clause) => matchesAQLFilter(object, clause)) : false;
		}
		return Object.entries(filter).every(([field, value]) => {
			const fieldValue = getValueByPath(object, field);
			if (Array.isArray(value)) return value.every((clause) => evaluateClause(fieldValue, clause));
			if (value != null && typeof value === "object") return evaluateClause(fieldValue, value);
			return equalComparableFilterValues(fieldValue, value);
		});
	}
	function matchesForecastFilters(filterObject, filterInfo) {
		if (filterInfo.filters.length === 0) return true;
		const method = filterInfo.conditionsOpKey === "$or" ? "some" : "every";
		return filterInfo.filters[method]((filter) => matchesAQLFilter(filterObject, filter));
	}
	async function enrichForecastFilterObjects(transactions, accountsById) {
		const payeeIds = [...new Set(transactions.flatMap((tx) => tx.payee ? [tx.payee] : []))];
		const categoryIds = [...new Set(transactions.flatMap((tx) => tx.category ? [tx.category] : []))];
		const [{ data: payees }, { data: categories }] = await Promise.all([payeeIds.length > 0 ? aqlQuery(q("payees").filter({ id: { $oneof: payeeIds } }).select([
			"id",
			"name",
			"transfer_acct"
		])) : Promise.resolve({ data: [] }), categoryIds.length > 0 ? aqlQuery(q("categories").filter({ id: { $oneof: categoryIds } }).select([
			"id",
			"name",
			"group"
		])) : Promise.resolve({ data: [] })]);
		const categoryGroupIds = [...new Set(categories.flatMap((category) => category.group ? [category.group] : []))];
		const { data: categoryGroups } = categoryGroupIds.length > 0 ? await aqlQuery(q("category_groups").filter({ id: { $oneof: categoryGroupIds } }).select(["id", "name"])) : { data: [] };
		const payeesById = new Map(payees.map((payee) => [payee.id, payee]));
		const categoryGroupsById = new Map(categoryGroups.map((group) => [group.id, group]));
		const categoriesById = new Map(categories.map((category) => [category.id, {
			id: category.id,
			name: category.name,
			group: category.group ? categoryGroupsById.get(category.group) ?? null : null
		}]));
		return new Map(transactions.map((transaction) => [transaction.id, {
			id: transaction.id,
			amount: transaction.amount,
			date: transaction.date,
			notes: transaction.notes ?? null,
			cleared: !!transaction.cleared,
			reconciled: !!transaction.reconciled,
			transfer_id: transaction.transfer_id ?? null,
			is_parent: !!transaction.is_parent,
			imported_payee: transaction.imported_payee ?? null,
			account: accountsById.get(transaction.account) ?? null,
			payee: transaction.payee ? payeesById.get(transaction.payee) ?? null : null,
			category: transaction.category ? categoriesById.get(transaction.category) ?? null : null
		}]));
	}
	//#endregion
	//#region ../loot-core/src/server/forecast/forecast-projection.ts
	function maxDate(...dates) {
		return dates.reduce((latest, current) => current > latest ? current : latest);
	}
	function buildForecastDateContext(startDate, endDate) {
		const today = /* @__PURE__ */ new Date();
		const forecastStartDate = startDate || format$2(today, "yyyy-MM-dd");
		const forecastEndDate = endDate || format$2(addMonths$1(today, 12), "yyyy-MM-dd");
		const todayString = format$2(today, "yyyy-MM-dd");
		return {
			forecastStartDate,
			forecastEndDate,
			forecastDays: dayRangeInclusive(forecastStartDate, forecastEndDate),
			firstForecastDate: forecastEndDate < todayString ? forecastStartDate : maxDate(forecastStartDate, todayString),
			endDateObj: endDate ? parseDate(endDate) : addMonths$1(today, 12)
		};
	}
	function createEmptyForecastResult(forecastStartDate, forecastEndDate) {
		return {
			dataPoints: [],
			lowestBalance: {
				date: forecastStartDate,
				balance: 0,
				accountId: "",
				accountName: ""
			},
			forecastStartDate,
			forecastEndDate
		};
	}
	function addScheduleOccurrence(scheduleOccurrencesByAccount, accountId, date, occurrence) {
		if (!scheduleOccurrencesByAccount[accountId]) scheduleOccurrencesByAccount[accountId] = {};
		if (!scheduleOccurrencesByAccount[accountId][date]) scheduleOccurrencesByAccount[accountId][date] = [];
		scheduleOccurrencesByAccount[accountId][date].push(occurrence);
	}
	function indexScheduleOccurrences(futureOccurrences, accountIdSet, filterInfo, firstForecastDate, forecastEndDate) {
		const scheduleOccurrencesByAccount = {};
		for (const occurrence of futureOccurrences) {
			if (occurrence.transaction.date < firstForecastDate || occurrence.transaction.date > forecastEndDate || !accountIdSet.has(occurrence.transaction.account) || !matchesForecastFilters(occurrence.filterObject, filterInfo)) continue;
			addScheduleOccurrence(scheduleOccurrencesByAccount, occurrence.transaction.account, occurrence.transaction.date, {
				amount: occurrence.amount,
				payee: occurrence.payee,
				scheduleId: occurrence.scheduleId,
				scheduleName: occurrence.scheduleName
			});
		}
		return scheduleOccurrencesByAccount;
	}
	function groupTransactionsByAccount(transactions) {
		return transactions.reduce((grouped, tx) => {
			const accountTransactions = grouped.get(tx.account);
			if (accountTransactions) accountTransactions.push(tx);
			else grouped.set(tx.account, [tx]);
			return grouped;
		}, /* @__PURE__ */ new Map());
	}
	function summarizePostedTransactions(accountTransactions, forecastStartDate, forecastEndDate) {
		const summary = {
			startingBalance: 0,
			txsByDay: {}
		};
		for (const tx of accountTransactions) {
			if (tx.date < forecastStartDate) {
				summary.startingBalance += tx.amount;
				continue;
			}
			if (tx.date > forecastEndDate) continue;
			summary.txsByDay[tx.date] = (summary.txsByDay[tx.date] || 0) + tx.amount;
		}
		return summary;
	}
	function buildAccountForecastDataPoints(account, postedTransactions, scheduleOccurrencesByDay, forecastDays) {
		let runningBalance = postedTransactions.startingBalance;
		return forecastDays.map((day) => {
			const txDelta = postedTransactions.txsByDay[day] || 0;
			const scheduleTxns = scheduleOccurrencesByDay[day] || [];
			const scheduleDelta = scheduleTxns.reduce((sum, tx) => sum + tx.amount, 0);
			runningBalance += txDelta + scheduleDelta;
			return {
				date: day,
				balance: runningBalance,
				accountId: account.id,
				accountName: account.name,
				transactions: scheduleTxns.map((scheduleTxn) => ({
					amount: scheduleTxn.amount,
					payee: scheduleTxn.payee,
					scheduleId: scheduleTxn.scheduleId,
					scheduleName: scheduleTxn.scheduleName
				}))
			};
		});
	}
	function calculateLowestBalance(dataPoints, accounts, forecastStartDate) {
		const combinedByDate = {};
		for (const dataPoint of dataPoints) combinedByDate[dataPoint.date] = (combinedByDate[dataPoint.date] || 0) + dataPoint.balance;
		let lowestBalance = {
			date: forecastStartDate,
			balance: Infinity,
			accountId: "",
			accountName: ""
		};
		for (const [date, combinedBalance] of Object.entries(combinedByDate)) if (combinedBalance < lowestBalance.balance) lowestBalance = {
			date,
			balance: combinedBalance,
			accountId: "",
			accountName: ""
		};
		if (lowestBalance.balance === Infinity) return {
			date: forecastStartDate,
			balance: accounts.reduce((sum, account) => sum + account.balance_current, 0),
			accountId: "",
			accountName: ""
		};
		return lowestBalance;
	}
	function projectForecastData({ accounts, transactions, futureOccurrences, filterInfo, dateContext }) {
		const accountIdsToQuery = accounts.map((account) => account.id);
		const scheduleOccurrencesByAccount = indexScheduleOccurrences(futureOccurrences, new Set(accountIdsToQuery), filterInfo, dateContext.firstForecastDate, dateContext.forecastEndDate);
		const transactionsByAccount = groupTransactionsByAccount(transactions);
		const dataPoints = accounts.flatMap((account) => buildAccountForecastDataPoints(account, summarizePostedTransactions(transactionsByAccount.get(account.id) ?? [], dateContext.forecastStartDate, dateContext.forecastEndDate), scheduleOccurrencesByAccount[account.id] ?? {}, dateContext.forecastDays));
		dataPoints.sort((a, b) => a.date.localeCompare(b.date));
		return {
			dataPoints,
			lowestBalance: calculateLowestBalance(dataPoints, accounts, dateContext.forecastStartDate)
		};
	}
	//#endregion
	//#region ../loot-core/src/server/forecast/forecast-schedules.ts
	/** Synthetic account for schedules with no account; combined forecast only when explicitly included. */
	var FORECAST_UNASSIGNED_ACCOUNT_ID = "__unassigned_schedule__";
	async function getSchedules() {
		return (await aqlQuery(q("schedules").filter({
			tombstone: false,
			completed: false
		}).select("*"))).data;
	}
	function normalizeSchedule(schedule) {
		const conditions = extractScheduleConds(schedule._conditions || []);
		const accountId = schedule._account ?? conditions.account?.value ?? "__unassigned_schedule__";
		const amountValue = schedule._amount ?? conditions.amount?.value;
		const dateValue = schedule._date ?? conditions.date?.value;
		if (amountValue == null || dateValue == null) return null;
		return {
			id: schedule.id,
			name: schedule.name,
			next_date: schedule.next_date,
			rule: schedule.rule,
			_payee: schedule._payee ?? conditions.payee?.value ?? null,
			_account: accountId,
			_amount: getScheduledAmount(amountValue),
			_date: dateValue
		};
	}
	async function getNormalizedSchedules() {
		return (await getSchedules()).flatMap((schedule) => {
			const normalizedSchedule = normalizeSchedule(schedule);
			return normalizedSchedule ? [normalizedSchedule] : [];
		});
	}
	async function getTransferPayeesByAccountIds(accountIds) {
		if (accountIds.length === 0) return /* @__PURE__ */ new Map();
		const { data: payees } = await aqlQuery(q("payees").filter({ transfer_acct: { $oneof: accountIds } }).select([
			"id",
			"name",
			"transfer_acct"
		]));
		return new Map(payees.filter((payee) => payee.transfer_acct != null).map((payee) => [payee.transfer_acct, payee]));
	}
	function getFutureOccurrenceDates(schedule, endDate) {
		if (typeof schedule._date === "string") {
			const singleDate = parseDate(schedule._date);
			return singleDate <= endDate ? [format$2(singleDate, "yyyy-MM-dd")] : [];
		}
		const dateCondition = {
			op: "is",
			field: "date",
			value: schedule._date
		};
		const maxIterations = 1e4;
		const dates = [schedule.next_date];
		const seenDates = new Set(dates);
		let day = parseDate(schedule.next_date);
		let iterations = 0;
		while (day <= endDate && iterations < maxIterations) {
			iterations++;
			const nextDate = getNextDate(dateCondition, day);
			const parsedNextDate = nextDate != null ? parseDate(nextDate) : null;
			if (!nextDate || !parsedNextDate || parsedNextDate > endDate) break;
			if (parsedNextDate <= day) {
				if (seenDates.has(nextDate)) {
					day = parseDate(addDays(day, 1));
					continue;
				}
				break;
			}
			dates.push(nextDate);
			seenDates.add(nextDate);
			day = parseDate(addDays(nextDate, 1));
		}
		return dates;
	}
	async function buildFutureScheduleOccurrences(schedules, endDateObj, accountsById, ruleAccountsById) {
		const transferPayeesByAccountId = await getTransferPayeesByAccountIds([...ruleAccountsById.keys()]);
		const payeesById = /* @__PURE__ */ new Map();
		const simulatedTransactions = [];
		const occurrences = [];
		for (const schedule of schedules) {
			const scheduleName = schedule.name ?? "Unknown";
			for (const date of getFutureOccurrenceDates(schedule, endDateObj)) {
				const sourceTransaction = await runRules$1({
					id: `forecast-${schedule.id}-${date}`,
					account: schedule._account,
					amount: schedule._amount,
					payee: schedule._payee,
					date,
					schedule: schedule.id,
					cleared: false
				}, ruleAccountsById);
				simulatedTransactions.push(sourceTransaction);
				occurrences.push({
					accountId: sourceTransaction.account,
					transactionId: sourceTransaction.id,
					amount: sourceTransaction.amount,
					scheduleId: schedule.id,
					scheduleName
				});
				if (sourceTransaction.account === "__unassigned_schedule__") continue;
				let transferPayee = null;
				if (sourceTransaction.payee != null) if (payeesById.has(sourceTransaction.payee)) transferPayee = payeesById.get(sourceTransaction.payee) ?? null;
				else {
					transferPayee = await getPayee$1(sourceTransaction.payee);
					payeesById.set(sourceTransaction.payee, transferPayee);
				}
				const transferAccountId = transferPayee?.transfer_acct;
				if (!transferAccountId || transferAccountId === sourceTransaction.account) continue;
				const reverseTransferPayee = transferPayeesByAccountId.get(sourceTransaction.account);
				const transferTransaction = await runRules$1({
					id: `${sourceTransaction.id}-transfer`,
					account: transferAccountId,
					amount: -sourceTransaction.amount,
					payee: reverseTransferPayee?.id ?? null,
					date: sourceTransaction.date,
					transfer_id: sourceTransaction.id,
					notes: sourceTransaction.notes ?? null,
					schedule: sourceTransaction.schedule,
					cleared: false
				}, ruleAccountsById);
				const sourceAccount = accountsById.get(sourceTransaction.account);
				const transferAccount = accountsById.get(transferTransaction.account);
				if (sourceAccount != null && transferAccount != null && sourceAccount.offbudget === transferAccount.offbudget) {
					sourceTransaction.category = void 0;
					transferTransaction.category = void 0;
				}
				sourceTransaction.transfer_id = transferTransaction.id;
				simulatedTransactions.push(transferTransaction);
				occurrences.push({
					accountId: transferTransaction.account,
					transactionId: transferTransaction.id,
					amount: transferTransaction.amount,
					scheduleId: schedule.id,
					scheduleName
				});
			}
		}
		const filterObjectsByTransactionId = await enrichForecastFilterObjects(simulatedTransactions, accountsById);
		const transactionsById = new Map(simulatedTransactions.map((transaction) => [transaction.id, transaction]));
		return occurrences.map((occurrence) => {
			const filterObject = filterObjectsByTransactionId.get(occurrence.transactionId);
			const transaction = transactionsById.get(occurrence.transactionId);
			if (!filterObject || !transaction) throw new Error("Missing simulated forecast transaction data");
			return {
				transaction,
				filterObject,
				amount: occurrence.amount,
				payee: filterObject.payee?.name ?? occurrence.scheduleName,
				scheduleId: occurrence.scheduleId,
				scheduleName: occurrence.scheduleName
			};
		});
	}
	//#endregion
	//#region ../loot-core/src/server/forecast/app.ts
	function createUnassignedForecastAccount() {
		return {
			id: FORECAST_UNASSIGNED_ACCOUNT_ID,
			name: "",
			closed: 0,
			offbudget: 0,
			balance_current: 0
		};
	}
	function createUnassignedRuleAccountStub() {
		return {
			id: FORECAST_UNASSIGNED_ACCOUNT_ID,
			name: "",
			offbudget: 0,
			closed: 0,
			tombstone: 0,
			sort_order: -1,
			bankName: "",
			bankId: ""
		};
	}
	async function generateForecast({ accountIds, conditions, conditionsOp, startDate, endDate, includeAccountlessSchedules }) {
		const includeUnassigned = includeAccountlessSchedules ?? false;
		const dateContext = buildForecastDateContext(startDate, endDate);
		const { filterInfo, plainConditions, resolvedConditionsOp } = buildFilterInfo(conditions, conditionsOp);
		let accounts = await resolveForecastAccounts({
			accountIds,
			plainConditions,
			resolvedConditionsOp,
			canRestrictAccounts: filterInfo.canRestrictAccounts
		});
		if (accounts.length === 0) return createEmptyForecastResult(dateContext.forecastStartDate, dateContext.forecastEndDate);
		if (includeUnassigned && !accounts.some((account) => account.id === "__unassigned_schedule__")) accounts = [...accounts, createUnassignedForecastAccount()];
		const accountIdsToQuery = accounts.map((account) => account.id);
		const accountsById = new Map(accounts.map((account) => [account.id, account]));
		const [schedulesRaw, transactions, ruleAccounts] = await Promise.all([
			getNormalizedSchedules(),
			getTransactions(accountIdsToQuery, filterInfo),
			getAccounts$2()
		]);
		const schedules = includeUnassigned ? schedulesRaw : schedulesRaw.filter((schedule) => schedule._account !== FORECAST_UNASSIGNED_ACCOUNT_ID);
		const ruleAccountsById = new Map(ruleAccounts.map((account) => [account.id, account]));
		if (includeUnassigned) ruleAccountsById.set(FORECAST_UNASSIGNED_ACCOUNT_ID, createUnassignedRuleAccountStub());
		const futureOccurrences = await buildFutureScheduleOccurrences(schedules, dateContext.endDateObj, accountsById, ruleAccountsById);
		const { dataPoints, lowestBalance } = projectForecastData({
			accounts,
			transactions,
			futureOccurrences,
			filterInfo,
			dateContext
		});
		return {
			dataPoints,
			lowestBalance,
			forecastStartDate: dateContext.forecastStartDate,
			forecastEndDate: dateContext.forecastEndDate
		};
	}
	var app$9 = createApp();
	app$9.method("forecast/generate", generateForecast);
	//#endregion
	//#region ../loot-core/src/server/notes/app.ts
	var app$8 = createApp();
	app$8.method("notes-save", updateNotes);
	app$8.method("notes-save-undoable", mutator(undoable(updateNotes)));
	app$8.method("notes-get", getNote);
	async function updateNotes({ id, note }) {
		await update("notes", {
			id,
			note
		});
	}
	async function getNote({ id }) {
		return first$2("SELECT id, note FROM notes WHERE id = ?", [id]);
	}
	//#endregion
	//#region ../loot-core/src/server/payees/app.ts
	var app$7 = createApp();
	app$7.method("payee-create", mutator(undoable(createPayee)));
	app$7.method("common-payees-get", getCommonPayees);
	app$7.method("payees-get", getPayees);
	app$7.method("payees-get-orphaned", getOrphanedPayees);
	app$7.method("payees-get-rule-counts", getPayeeRuleCounts);
	app$7.method("payees-merge", mutator(undoable(mergePayees, (args) => ({
		mergeIds: args.mergeIds,
		targetId: args.targetId
	}))));
	app$7.method("payees-batch-change", mutator(undoable(batchChangePayees)));
	app$7.method("payees-check-orphaned", checkOrphanedPayees);
	app$7.method("payees-get-rules", getPayeeRules);
	app$7.method("payee-location-create", mutator(createPayeeLocation));
	app$7.method("payee-locations-get", getPayeeLocations);
	app$7.method("payee-location-delete", mutator(deletePayeeLocation));
	app$7.method("payees-get-nearby", getNearbyPayees);
	async function createPayee({ name }) {
		return insertPayee({ name });
	}
	async function getCommonPayees() {
		return (await getCommonPayees$1()).map((p) => payeeModel$1.fromDb(p));
	}
	async function getPayees() {
		return (await getPayees$1()).map((p) => payeeModel$1.fromDb(p));
	}
	async function getOrphanedPayees() {
		return await syncGetOrphanedPayees();
	}
	async function getPayeeRuleCounts() {
		const payeeCounts = {};
		iterateIds(getRules$1(), "payee", (rule, id) => {
			if (payeeCounts[id] == null) payeeCounts[id] = 0;
			payeeCounts[id]++;
		});
		return payeeCounts;
	}
	async function mergePayees({ targetId, mergeIds }) {
		await mergePayees$1(targetId, mergeIds);
	}
	async function batchChangePayees({ added, deleted, updated }) {
		await batchMessages(async () => {
			if (deleted) await Promise.all(deleted.map((p) => ({ id: p.id })).map((p) => deletePayee(p)));
			if (added) await Promise.all(added.map((p) => payeeModel$1.toDb(p)).map((p) => insertPayee(p)));
			if (updated) await Promise.all(updated.map((p) => payeeModel$1.toDb(p, { update: true })).map((p) => updatePayee(p)));
		});
	}
	async function checkOrphanedPayees({ ids }) {
		const orphaned = new Set(await getOrphanedPayees$1());
		return ids.filter((id) => orphaned.has(id));
	}
	async function getPayeeRules({ id }) {
		return getRulesForPayee(id).map((rule) => rule.serialize());
	}
	async function createPayeeLocation({ payeeId, latitude, longitude }) {
		const created_at = Date.now();
		if (!Number.isFinite(latitude) || !Number.isFinite(longitude) || latitude < -90 || latitude > 90 || longitude < -180 || longitude > 180) throw new Error("Invalid coordinates: latitude must be between -90 and 90, longitude must be between -180 and 180");
		return await insertWithUUID("payee_locations", {
			payee_id: payeeId,
			latitude,
			longitude,
			created_at
		});
	}
	async function getPayeeLocations({ payeeId } = {}) {
		let query = "SELECT * FROM payee_locations WHERE tombstone IS NOT 1";
		let params = [];
		if (payeeId) {
			query += " AND payee_id = ?";
			params = [payeeId];
		}
		query += " ORDER BY created_at DESC";
		return runQuery(query, params, true);
	}
	async function deletePayeeLocation({ id }) {
		await delete_("payee_locations", id);
	}
	async function getNearbyPayees({ latitude, longitude, maxDistance = 500 }) {
		if (!Number.isFinite(latitude) || !Number.isFinite(longitude) || latitude < -90 || latitude > 90 || longitude < -180 || longitude > 180) throw new Error("Invalid coordinates: latitude must be between -90 and 90, longitude must be between -180 and 180");
		if (!Number.isFinite(maxDistance) || maxDistance <= 0) throw new Error("Invalid maxDistance: must be a finite positive number greater than 0");
		return runQuery(`
    WITH payee_distances AS (
      SELECT
        pl.id as location_id,
        pl.payee_id,
        pl.latitude,
        pl.longitude,
        pl.created_at,
        p.id,
        p.name,
        p.transfer_acct,
        p.favorite,
        p.learn_categories,
        p.tombstone,
        -- Haversine formula to calculate distance
        ((6371 * acos(
          MIN(1, MAX(-1,
            cos(radians(?)) * cos(radians(pl.latitude)) *
            cos(radians(pl.longitude) - radians(?)) +
            sin(radians(?)) * sin(radians(pl.latitude))
          ))
        ))) * 1000 as distance,
        -- Rank locations by distance for each payee
        ROW_NUMBER() OVER (PARTITION BY pl.payee_id ORDER BY (
          (6371 * acos(
            MIN(1, MAX(-1,
              cos(radians(?)) * cos(radians(pl.latitude)) *
              cos(radians(pl.longitude) - radians(?)) +
              sin(radians(?)) * sin(radians(pl.latitude))
            ))
          )) * 1000
        )) as distance_rank
      FROM payee_locations pl
      JOIN payees p ON pl.payee_id = p.id
      WHERE p.tombstone IS NOT 1
        AND pl.tombstone IS NOT 1
        -- Filter by distance using Haversine formula
        AND (6371 * acos(
          MIN(1, MAX(-1,
            cos(radians(?)) * cos(radians(pl.latitude)) *
            cos(radians(pl.longitude) - radians(?)) +
            sin(radians(?)) * sin(radians(pl.latitude))
          ))
        )) * 1000 <= ?
    )
    SELECT
      location_id,
      payee_id,
      latitude,
      longitude,
      created_at,
      id,
      name,
      transfer_acct,
      favorite,
      learn_categories,
      tombstone,
      distance
    FROM payee_distances
    WHERE distance_rank = 1
    ORDER BY distance ASC
    LIMIT 10
  `, [
			latitude,
			longitude,
			latitude,
			latitude,
			longitude,
			latitude,
			latitude,
			longitude,
			latitude,
			maxDistance
		], true).map((row) => {
			return {
				payee: payeeModel$1.fromDb({
					id: row.id,
					name: row.name,
					transfer_acct: row.transfer_acct,
					favorite: row.favorite,
					learn_categories: row.learn_categories,
					tombstone: row.tombstone
				}),
				location: {
					id: row.location_id,
					payee_id: row.payee_id,
					latitude: row.latitude,
					longitude: row.longitude,
					created_at: row.created_at,
					distance: row.distance
				}
			};
		});
	}
	//#endregion
	//#region ../loot-core/src/server/preferences/app.ts
	var app$6 = createApp();
	app$6.method("preferences/save", mutator(undoable(saveSyncedPrefs)));
	app$6.method("preferences/get", getSyncedPrefs);
	app$6.method("save-global-prefs", saveGlobalPrefs);
	app$6.method("load-global-prefs", loadGlobalPrefs);
	app$6.method("save-prefs", saveMetadataPrefs);
	app$6.method("load-prefs", loadMetadataPrefs);
	app$6.method("save-server-prefs", saveServerPrefs);
	async function saveSyncedPrefs({ id, value }) {
		if (!id) return;
		await update("preferences", {
			id,
			value
		});
	}
	async function getSyncedPrefs() {
		return (await all("SELECT id, value FROM preferences")).reduce((carry, { value, id }) => {
			carry[id] = value;
			return carry;
		}, {});
	}
	async function saveGlobalPrefs(prefs) {
		if (!prefs) return "ok";
		if (prefs.maxMonths !== void 0) await setItem("max-months", "" + prefs.maxMonths);
		if (prefs.categoryExpandedState !== void 0) await setItem("category-expanded-state", "" + prefs.categoryExpandedState);
		if (prefs.documentDir !== void 0 && await exists$1(prefs.documentDir)) await setItem("document-dir", prefs.documentDir);
		if (prefs.floatingSidebar !== void 0) await setItem("floating-sidebar", "" + prefs.floatingSidebar);
		if (prefs.language !== void 0) await setItem("language", prefs.language);
		if (prefs.theme !== void 0) await setItem("theme", prefs.theme);
		if (prefs.preferredDarkTheme !== void 0) await setItem("preferred-dark-theme", prefs.preferredDarkTheme);
		if (prefs.installedCustomLightTheme !== void 0) await setItem("installed-custom-theme", prefs.installedCustomLightTheme);
		if (prefs.installedCustomDarkTheme !== void 0) await setItem("installed-custom-dark-theme", prefs.installedCustomDarkTheme);
		if (prefs.customCssOverride !== void 0) await setItem("custom-css-override", prefs.customCssOverride);
		if (prefs.serverSelfSignedCert !== void 0) await setItem("server-self-signed-cert", prefs.serverSelfSignedCert);
		if (prefs.syncServerConfig !== void 0) await setItem("syncServerConfig", prefs.syncServerConfig);
		if (prefs.notifyWhenUpdateIsAvailable !== void 0) await setItem("notifyWhenUpdateIsAvailable", prefs.notifyWhenUpdateIsAvailable);
		return "ok";
	}
	async function loadGlobalPrefs() {
		const { "floating-sidebar": floatingSidebar, "category-expanded-state": categoryExpandedState, "max-months": maxMonths, "document-dir": documentDir, "encrypt-key": encryptKey, language, theme, "preferred-dark-theme": preferredDarkTheme, "installed-custom-theme": installedCustomLightTheme, "installed-custom-dark-theme": installedCustomDarkTheme, "custom-css-override": customCssOverride, "server-self-signed-cert": serverSelfSignedCert, syncServerConfig, notifyWhenUpdateIsAvailable } = await multiGet([
			"floating-sidebar",
			"category-expanded-state",
			"max-months",
			"document-dir",
			"encrypt-key",
			"language",
			"theme",
			"preferred-dark-theme",
			"installed-custom-theme",
			"installed-custom-dark-theme",
			"custom-css-override",
			"server-self-signed-cert",
			"syncServerConfig",
			"notifyWhenUpdateIsAvailable"
		]);
		return {
			floatingSidebar: floatingSidebar === "true",
			categoryExpandedState: stringToInteger(categoryExpandedState || "") || 0,
			maxMonths: stringToInteger(maxMonths || "") || 1,
			documentDir: documentDir || getDefaultDocumentDir(),
			keyId: encryptKey && JSON.parse(encryptKey).id,
			language,
			theme: theme === "light" || theme === "dark" || theme === "auto" || theme === "midnight" ? theme : "auto",
			preferredDarkTheme: preferredDarkTheme === "dark" || preferredDarkTheme === "midnight" ? preferredDarkTheme : "dark",
			installedCustomLightTheme: installedCustomLightTheme || void 0,
			installedCustomDarkTheme: installedCustomDarkTheme || void 0,
			customCssOverride: customCssOverride || void 0,
			serverSelfSignedCert: serverSelfSignedCert || void 0,
			syncServerConfig: syncServerConfig || void 0,
			notifyWhenUpdateIsAvailable: notifyWhenUpdateIsAvailable === void 0 ? true : notifyWhenUpdateIsAvailable
		};
	}
	async function saveMetadataPrefs(prefsToSet) {
		if (!prefsToSet) return "ok";
		const { cloudFileId } = getPrefs();
		if (prefsToSet.budgetName && cloudFileId) {
			const userToken = await getItem("user-token");
			const syncServer = getServer()?.SYNC_SERVER;
			if (!syncServer) throw new Error("No sync server set");
			await post(syncServer + "/update-user-filename", {
				token: userToken,
				fileId: cloudFileId,
				name: prefsToSet.budgetName
			});
		}
		await savePrefs(prefsToSet);
		return "ok";
	}
	async function loadMetadataPrefs() {
		return getPrefs();
	}
	async function saveServerPrefs({ prefs }) {
		const userToken = await getItem("user-token");
		if (!userToken) return { error: "not-logged-in" };
		try {
			const serverConfig = getServer();
			if (!serverConfig) throw new Error("No sync server configured.");
			await post(serverConfig.SIGNUP_SERVER + "/server-prefs", {
				token: userToken,
				prefs
			});
		} catch (err) {
			if (err instanceof PostError) return { error: err.reason || "network-failure" };
			throw err;
		}
		return {};
	}
	//#endregion
	//#region ../loot-core/src/server/rules/app.ts
	function validateRule(rule) {
		function runValidation(array, validate) {
			const result = array.map((item) => {
				try {
					validate(item);
				} catch (e) {
					if (e instanceof RuleError) {
						logger.warn("Invalid rule", e);
						return e.type;
					}
					throw e;
				}
				return null;
			});
			return result.filter((res) => typeof res === "string").length ? result : null;
		}
		const conditionErrors = runValidation(rule.conditions, (cond) => new Condition(cond.op, cond.field, cond.value, cond.options));
		const actionErrors = runValidation(rule.actions, (action) => action.op === "delete-transaction" ? new Action(action.op, null, null, null) : action.op === "set-split-amount" ? new Action(action.op, null, action.value, action.options) : action.op === "link-schedule" ? new Action(action.op, null, action.value, null) : action.op === "prepend-notes" || action.op === "append-notes" ? new Action(action.op, null, action.value, null) : new Action(action.op, action.field, action.value, action.options));
		if (conditionErrors || actionErrors) return {
			conditionErrors,
			actionErrors
		};
		return null;
	}
	var app$5 = createApp();
	app$5.method("rule-validate", ruleValidate);
	app$5.method("rule-add", mutator(addRule));
	app$5.method("rule-update", mutator(undoable(updateRule)));
	app$5.method("rule-delete", mutator(undoable(deleteRule)));
	app$5.method("rule-delete-all", mutator(undoable(deleteAllRules)));
	app$5.method("rule-apply-actions", mutator(undoable(applyRuleActions)));
	app$5.method("rule-add-payee-rename", mutator(addRulePayeeRename));
	app$5.method("rules-get", getRules);
	app$5.method("rule-get", getRule);
	app$5.method("rules-run", runRules);
	async function ruleValidate(rule) {
		return { error: validateRule(rule) };
	}
	async function addRule(rule) {
		const error = validateRule(rule);
		if (error) return { error };
		return {
			id: await insertRule(rule),
			...rule
		};
	}
	async function updateRule(rule) {
		const error = validateRule(rule);
		if (error) return { error };
		await updateRule$1(rule);
		return rule;
	}
	async function deleteRule(id) {
		return deleteRule$1(id);
	}
	async function deleteAllRules(ids) {
		let someDeletionsFailed = false;
		await batchMessages(async () => {
			for (const id of ids) if (await deleteRule$1(id) === false) someDeletionsFailed = true;
		});
		return { someDeletionsFailed };
	}
	async function applyRuleActions({ transactions, actions }) {
		return applyActions(transactions, actions);
	}
	async function addRulePayeeRename({ fromNames, to }) {
		return updatePayeeRenameRule(fromNames, to);
	}
	async function getRule({ id }) {
		const rule = getRules$1().find((rule) => rule.id === id);
		return rule ? rule.serialize() : null;
	}
	async function getRules() {
		return rankRules(getRules$1()).map((rule) => rule.serialize());
	}
	async function runRules({ transaction }) {
		return runRules$1(transaction);
	}
	//#endregion
	//#region ../loot-core/src/server/spreadsheet/app.ts
	var app$4 = createApp();
	app$4.method("get-cell", getCell);
	app$4.method("get-cell-names", getCellNames);
	app$4.method("create-query", createQuery);
	async function getCell({ sheetName, name }) {
		const node = get$2()._getNode(resolveName(sheetName, name));
		return {
			name: node.name,
			value: node.value
		};
	}
	async function getCellNames({ sheetName }) {
		const names = [];
		for (const name of get$2().getNodes().keys()) {
			const { sheet: nodeSheet, name: nodeName } = unresolveName(name);
			if (nodeSheet === sheetName) names.push(nodeName);
		}
		return names;
	}
	async function createQuery({ sheetName, name, query }) {
		get$2().createQuery(sheetName, name, query);
		return "ok";
	}
	//#endregion
	//#region ../loot-core/src/server/sync/app.ts
	var app$3 = createApp();
	app$3.method("sync", sync);
	app$3.method("sync-reset", resetSync);
	app$3.method("sync-repair", repairSync);
	async function sync() {
		return await fullSync();
	}
	async function resetSync() {
		return await resetSync$1();
	}
	async function repairSync() {
		await repairSync$1();
	}
	//#endregion
	//#region ../loot-core/src/server/tags/app.ts
	var app$2 = createApp();
	app$2.method("tags-get", getTags);
	app$2.method("tags-create", mutator(undoable(createTag)));
	app$2.method("tags-delete", mutator(undoable(deleteTag)));
	app$2.method("tags-delete-all", mutator(deleteAllTags));
	app$2.method("tags-update", mutator(undoable(updateTag)));
	app$2.method("tags-discover", mutator(discoverTags));
	var collator = new Intl.Collator(void 0, {
		numeric: true,
		sensitivity: "base"
	});
	async function getTags() {
		const tags = await getTags$1();
		tags.sort((a, b) => collator.compare(a.tag, b.tag));
		return tags;
	}
	async function createTag({ tag, color = null, description = null }) {
		const { id: tagId = null } = (await getAllTags()).find((t) => t.tag === tag) || {};
		if (tagId) {
			await updateTag$1({
				id: tagId,
				tag,
				color,
				description,
				tombstone: 0
			});
			return {
				id: tagId,
				tag,
				color,
				description
			};
		}
		return {
			id: await insertTag({
				tag: tag.trim(),
				color: color ? color.trim() : null,
				description
			}),
			tag,
			color,
			description
		};
	}
	async function deleteTag(tag) {
		await deleteTag$1(tag);
		return tag.id;
	}
	async function deleteAllTags(ids) {
		await batchMessages(async () => {
			for (const id of ids) await deleteTag$1({ id });
		});
		return ids;
	}
	async function updateTag(tag) {
		await updateTag$1(tag);
		return tag;
	}
	async function discoverTags() {
		const taggedNotes = await findTags();
		const tags = await getTags();
		for (const { notes } of taggedNotes) for (const [_, tag] of notes.matchAll(/(?<!#)#([^#\s]+)/g)) if (!tags.find((t) => t.tag === tag)) tags.push(await createTag({ tag }));
		return tags.sort(function(a, b) {
			if (a.tag < b.tag) return -1;
			if (a.tag > b.tag) return 1;
			return 0;
		});
	}
	//#endregion
	//#region ../loot-core/src/server/tools/app.ts
	var app$1 = createApp();
	app$1.method("tools/fix-split-transactions", fixSplitTransactions);
	async function fixSplitTransactions() {
		const blankPayeeRows = await all(`
    SELECT t.*, p.payee AS parentPayee FROM v_transactions_internal t
    LEFT JOIN v_transactions_internal p ON t.parent_id = p.id
    WHERE t.is_child = 1 AND t.payee IS NULL AND p.payee IS NOT NULL
  `);
		await runMutator(async () => {
			await batchUpdateTransactions({ updated: blankPayeeRows.map((row) => ({
				id: row.id,
				payee: row.parentPayee
			})) });
		});
		const clearedRows = await all(`
    SELECT t.id, p.cleared FROM v_transactions_internal t
    LEFT JOIN v_transactions_internal p ON t.parent_id = p.id
    WHERE t.is_child = 1 AND t.cleared != p.cleared
  `);
		await runMutator(async () => {
			await batchUpdateTransactions({ updated: clearedRows.map((row) => ({
				id: row.id,
				cleared: row.cleared === 1
			})) });
		});
		const deletedRows = await all(`
    SELECT t.* FROM v_transactions_internal t
    LEFT JOIN v_transactions_internal p ON t.parent_id = p.id
    WHERE t.is_child = 1 AND t.tombstone = 0 AND (p.tombstone = 1 OR p.id IS NULL)
  `);
		await runMutator(async () => {
			await batchUpdateTransactions({ updated: deletedRows.map((row) => ({
				id: row.id,
				tombstone: true
			})) });
		});
		const mismatchedSplits = (await aqlQuery(q("transactions").options({ splits: "grouped" }).filter({ is_parent: true }).select("*"))).data.filter((t) => {
			return t.subtransactions.reduce((acc, st) => acc + st.amount, 0) !== t.amount;
		});
		const brokenTransfers = await all(`
    SELECT t1.id
    FROM v_transactions_internal t1
           JOIN accounts a1 ON t1.account = a1.id
           JOIN v_transactions_internal t2 ON t1.transfer_id = t2.id
           JOIN accounts a2 ON t2.account = a2.id
    WHERE a1.offbudget = a2.offbudget
      AND t1.category IS NOT NULL
  `);
		await runMutator(async () => {
			await batchUpdateTransactions({ updated: brokenTransfers.map((row) => ({
				id: row.id,
				category: null
			})) });
		});
		const errorRows = await all(`
    SELECT id FROM v_transactions_internal WHERE error IS NOT NULL AND is_parent = 0
  `);
		await runMutator(async () => {
			await batchUpdateTransactions({ updated: errorRows.map(({ id }) => ({
				id,
				error: null
			})) });
		});
		const parentTransactionsWithCategory = await all(`
    SELECT id FROM transactions WHERE isParent = 1 AND category IS NOT NULL
  `);
		await runMutator(async () => {
			await batchUpdateTransactions({ updated: parentTransactionsWithCategory.map(({ id }) => ({
				id,
				category: null
			})) });
		});
		return {
			numBlankPayees: blankPayeeRows.length,
			numCleared: clearedRows.length,
			numDeleted: deletedRows.length,
			numTransfersFixed: brokenTransfers.length,
			numNonParentErrorsFixed: errorRows.length,
			numParentTransactionsWithCategoryFixed: parentTransactionsWithCategory.length,
			mismatchedSplits
		};
	}
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/utils/get.js
	var charCodeOfDot = ".".charCodeAt(0);
	var reEscapeChar = /\\(\\)?/g;
	var rePropName = RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))", "g");
	var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
	var reIsPlainProp = /^\w*$/;
	var getTag = function(value) {
		return Object.prototype.toString.call(value);
	};
	var isSymbol = function(value) {
		const type = typeof value;
		return type === "symbol" || type === "object" && value && getTag(value) === "[object Symbol]";
	};
	var isKey = function(value, object) {
		if (Array.isArray(value)) return false;
		const type = typeof value;
		if (type === "number" || type === "symbol" || type === "boolean" || !value || isSymbol(value)) return true;
		return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
	};
	var stringToPath = function(string) {
		const result = [];
		if (string.charCodeAt(0) === charCodeOfDot) result.push("");
		string.replace(rePropName, function(match, expression, quote, subString) {
			let key = match;
			if (quote) key = subString.replace(reEscapeChar, "$1");
			else if (expression) key = expression.trim();
			result.push(key);
		});
		return result;
	};
	var castPath = function(value, object) {
		if (Array.isArray(value)) return value;
		else return isKey(value, object) ? [value] : stringToPath(value);
	};
	var toKey = function(value) {
		if (typeof value === "string" || isSymbol(value)) return value;
		const result = `${value}`;
		return result == "0" && 1 / value == -Infinity ? "-0" : result;
	};
	var get = function(object, path) {
		path = castPath(path, object);
		let index = 0;
		const length = path.length;
		while (object != null && index < length) object = object[toKey(path[index++])];
		return index && index === length ? object : void 0;
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/utils/is_object.js
	var is_object$1 = function(obj) {
		return typeof obj === "object" && obj !== null && !Array.isArray(obj);
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/api/normalize_columns.js
	var normalize_columns = function(columns) {
		if (columns === void 0 || columns === null) return [void 0, void 0];
		if (typeof columns !== "object") return [Error("Invalid option \"columns\": expect an array or an object")];
		if (!Array.isArray(columns)) {
			const newcolumns = [];
			for (const k in columns) newcolumns.push({
				key: k,
				header: columns[k]
			});
			columns = newcolumns;
		} else {
			const newcolumns = [];
			for (const column of columns) if (typeof column === "string") newcolumns.push({
				key: column,
				header: column
			});
			else if (typeof column === "object" && column !== null && !Array.isArray(column)) {
				if (!column.key) return [Error("Invalid column definition: property \"key\" is required")];
				if (column.header === void 0) column.header = column.key;
				newcolumns.push(column);
			} else return [Error("Invalid column definition: expect a string or an object")];
			columns = newcolumns;
		}
		return [void 0, columns];
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/api/CsvError.js
	init_dist();
	var CsvError$1 = class CsvError$1 extends Error {
		constructor(code, message, ...contexts) {
			if (Array.isArray(message)) message = message.join(" ");
			super(message);
			if (Error.captureStackTrace !== void 0) Error.captureStackTrace(this, CsvError$1);
			this.code = code;
			for (const context of contexts) for (const key in context) {
				const value = context[key];
				this[key] = Buffer$1.isBuffer(value) ? value.toString() : value == null ? value : JSON.parse(JSON.stringify(value));
			}
		}
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/utils/underscore.js
	var underscore$1 = function(str) {
		return str.replace(/([A-Z])/g, function(_, match) {
			return "_" + match.toLowerCase();
		});
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/api/normalize_options.js
	init_dist();
	var normalize_options$1 = function(opts) {
		const options = {};
		for (const opt in opts) options[underscore$1(opt)] = opts[opt];
		if (options.bom === void 0 || options.bom === null || options.bom === false) options.bom = false;
		else if (options.bom !== true) return [new CsvError$1("CSV_OPTION_BOOLEAN_INVALID_TYPE", ["option `bom` is optional and must be a boolean value,", `got ${JSON.stringify(options.bom)}`])];
		if (options.delimiter === void 0 || options.delimiter === null) options.delimiter = ",";
		else if (Buffer$1.isBuffer(options.delimiter)) options.delimiter = options.delimiter.toString();
		else if (typeof options.delimiter !== "string") return [new CsvError$1("CSV_OPTION_DELIMITER_INVALID_TYPE", ["option `delimiter` must be a buffer or a string,", `got ${JSON.stringify(options.delimiter)}`])];
		if (options.quote === void 0 || options.quote === null) options.quote = "\"";
		else if (options.quote === true) options.quote = "\"";
		else if (options.quote === false) options.quote = "";
		else if (Buffer$1.isBuffer(options.quote)) options.quote = options.quote.toString();
		else if (typeof options.quote !== "string") return [new CsvError$1("CSV_OPTION_QUOTE_INVALID_TYPE", ["option `quote` must be a boolean, a buffer or a string,", `got ${JSON.stringify(options.quote)}`])];
		if (options.quoted === void 0 || options.quoted === null) options.quoted = false;
		if (options.escape_formulas === void 0 || options.escape_formulas === null) options.escape_formulas = false;
		else if (typeof options.escape_formulas !== "boolean") return [new CsvError$1("CSV_OPTION_ESCAPE_FORMULAS_INVALID_TYPE", ["option `escape_formulas` must be a boolean,", `got ${JSON.stringify(options.escape_formulas)}`])];
		if (options.quoted_empty === void 0 || options.quoted_empty === null) options.quoted_empty = void 0;
		if (options.quoted_match === void 0 || options.quoted_match === null || options.quoted_match === false) options.quoted_match = null;
		else if (!Array.isArray(options.quoted_match)) options.quoted_match = [options.quoted_match];
		if (options.quoted_match) for (const quoted_match of options.quoted_match) {
			const isString = typeof quoted_match === "string";
			const isRegExp = quoted_match instanceof RegExp;
			if (!isString && !isRegExp) return [new CsvError$1("CSV_OPTION_QUOTED_MATCH", ["option `quoted_match` must be a string or a regex,", `got ${JSON.stringify(options.quoted_match)}`])];
		}
		if (options.quoted_string === void 0 || options.quoted_string === null) options.quoted_string = false;
		if (options.eof === void 0 || options.eof === null) options.eof = true;
		if (options.escape === void 0 || options.escape === null) options.escape = "\"";
		else if (Buffer$1.isBuffer(options.escape)) options.escape = options.escape.toString();
		else if (typeof options.escape !== "string") return [Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify(options.escape)}`)];
		if (options.escape.length > 1) return [Error(`Invalid Option: escape must be one character, got ${options.escape.length} characters`)];
		if (options.header === void 0 || options.header === null || options.header === false) options.header = false;
		else if (options.header !== true) throw new CsvError$1("CSV_INVALID_OPTION_HEADER", ["option `header` is expected to be a boolean,", `got ${JSON.stringify(options.header)}`], options);
		if (options.header_as_comment === void 0 || options.header_as_comment === null || options.header_as_comment === false) options.header_as_comment = false;
		else if (options.header_as_comment === true) options.header_as_comment = "#";
		else if (Buffer$1.isBuffer(options.header_as_comment)) options.header_as_comment = options.header_as_comment.toString();
		else if (typeof options.header_as_comment !== "string") throw new CsvError$1("CSV_INVALID_OPTION_HEADER_AS_COMMENT", ["option `header_as_comment` must be a boolean, a string or a buffer,", `got ${JSON.stringify(options.header_as_comment)}`], options);
		const [errColumns, columns] = normalize_columns(options.columns);
		if (errColumns !== void 0) return [errColumns];
		options.columns = columns;
		if (options.quoted === void 0 || options.quoted === null) options.quoted = false;
		if (options.cast === void 0 || options.cast === null) options.cast = {};
		if (options.cast.bigint === void 0 || options.cast.bigint === null) options.cast.bigint = (value) => "" + value;
		if (options.cast.boolean === void 0 || options.cast.boolean === null) options.cast.boolean = (value) => value ? "1" : "";
		if (options.cast.date === void 0 || options.cast.date === null) options.cast.date = (value) => "" + value.getTime();
		if (options.cast.number === void 0 || options.cast.number === null) options.cast.number = (value) => "" + value;
		if (options.cast.object === void 0 || options.cast.object === null) options.cast.object = (value) => JSON.stringify(value);
		if (options.cast.string === void 0 || options.cast.string === null) options.cast.string = function(value) {
			return value;
		};
		if (options.on_record !== void 0 && typeof options.on_record !== "function") return [Error(`Invalid Option: "on_record" must be a function.`)];
		if (options.record_delimiter === void 0 || options.record_delimiter === null) options.record_delimiter = "\n";
		else if (Buffer$1.isBuffer(options.record_delimiter)) options.record_delimiter = options.record_delimiter.toString();
		else if (typeof options.record_delimiter !== "string") return [Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify(options.record_delimiter)}`)];
		switch (options.record_delimiter) {
			case "unix":
				options.record_delimiter = "\n";
				break;
			case "mac":
				options.record_delimiter = "\r";
				break;
			case "windows":
				options.record_delimiter = "\r\n";
				break;
			case "ascii":
				options.record_delimiter = "";
				break;
			case "unicode":
				options.record_delimiter = "\u2028";
				break;
		}
		return [void 0, options];
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/api/index.js
	init_dist();
	var bom_utf8 = Buffer$1.from([
		239,
		187,
		191
	]);
	var stringifier = function(options, state, info) {
		return {
			options,
			state,
			info,
			__transform: function(chunk, push) {
				if (!Array.isArray(chunk) && typeof chunk !== "object") return Error(`Invalid Record: expect an array or an object, got ${JSON.stringify(chunk)}`);
				if (this.info.records === 0) {
					if (Array.isArray(chunk)) {
						if (this.options.header === true && this.options.columns === void 0) return Error("Undiscoverable Columns: header option requires column option or object records");
					} else if (this.options.columns === void 0) {
						const [err, columns] = normalize_columns(Object.keys(chunk));
						if (err) return;
						this.options.columns = columns;
					}
				}
				if (this.info.records === 0) {
					this.bom(push);
					const err = this.headers(push);
					if (err) return err;
				}
				try {
					if (this.options.on_record) this.options.on_record(chunk, this.info.records);
				} catch (err) {
					return err;
				}
				let err, chunk_string;
				if (this.options.eof) {
					[err, chunk_string] = this.stringify(chunk);
					if (err) return err;
					if (chunk_string === void 0) return;
					else chunk_string = chunk_string + this.options.record_delimiter;
				} else {
					[err, chunk_string] = this.stringify(chunk);
					if (err) return err;
					if (chunk_string === void 0) return;
					else if (this.options.header || this.info.records) chunk_string = this.options.record_delimiter + chunk_string;
				}
				this.info.records++;
				push(chunk_string);
			},
			stringify: function(chunk, chunkIsHeader = false) {
				if (typeof chunk !== "object") return [void 0, chunk];
				const { columns } = this.options;
				const record = [];
				if (Array.isArray(chunk)) {
					if (columns) chunk.splice(columns.length);
					for (let i = 0; i < chunk.length; i++) {
						const field = chunk[i];
						const [err, value] = this.__cast(field, {
							index: i,
							column: i,
							records: this.info.records,
							header: chunkIsHeader
						});
						if (err) return [err];
						record[i] = [value, field];
					}
				} else for (let i = 0; i < columns.length; i++) {
					const field = get(chunk, columns[i].key);
					const [err, value] = this.__cast(field, {
						index: i,
						column: columns[i].key,
						records: this.info.records,
						header: chunkIsHeader
					});
					if (err) return [err];
					record[i] = [value, field];
				}
				let csvrecord = "";
				for (let i = 0; i < record.length; i++) {
					let options, err;
					let [value, field] = record[i];
					if (typeof value === "string") options = this.options;
					else if (is_object$1(value)) {
						options = value;
						value = options.value;
						delete options.value;
						if (typeof value !== "string" && value !== void 0 && value !== null) {
							if (err) return [Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(value)}`)];
						}
						options = {
							...this.options,
							...options
						};
						[err, options] = normalize_options$1(options);
						if (err !== void 0) return [err];
					} else if (value === void 0 || value === null) options = this.options;
					else return [Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(value)}`)];
					const { delimiter, escape, quote, quoted, quoted_empty, quoted_string, quoted_match, record_delimiter, escape_formulas } = options;
					if ("" === value && "" === field) {
						let quotedMatch = quoted_match && quoted_match.filter((quoted_match) => {
							if (typeof quoted_match === "string") return value.indexOf(quoted_match) !== -1;
							else return quoted_match.test(value);
						});
						quotedMatch = quotedMatch && quotedMatch.length > 0;
						if ((quotedMatch || true === quoted_empty || true === quoted_string && false !== quoted_empty) === true) value = quote + value + quote;
						csvrecord += value;
					} else if (value) {
						if (typeof value !== "string") return [Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(value)}`)];
						const containsdelimiter = delimiter.length && value.indexOf(delimiter) >= 0;
						const containsQuote = quote !== "" && value.indexOf(quote) >= 0;
						const containsEscape = value.indexOf(escape) >= 0 && escape !== quote;
						const containsRecordDelimiter = value.indexOf(record_delimiter) >= 0;
						const quotedString = quoted_string && typeof field === "string";
						let quotedMatch = quoted_match && quoted_match.filter((quoted_match) => {
							if (typeof quoted_match === "string") return value.indexOf(quoted_match) !== -1;
							else return quoted_match.test(value);
						});
						quotedMatch = quotedMatch && quotedMatch.length > 0;
						if (escape_formulas) switch (value[0]) {
							case "=":
							case "+":
							case "-":
							case "@":
							case "	":
							case "\r":
							case "＝":
							case "＋":
							case "－":
							case "＠":
								value = `'${value}`;
								break;
						}
						const shouldQuote = containsQuote === true || containsdelimiter || containsRecordDelimiter || quoted || quotedString || quotedMatch;
						if (shouldQuote === true && containsEscape === true) {
							const regexp = escape === "\\" ? new RegExp(escape + escape, "g") : new RegExp(escape, "g");
							value = value.replace(regexp, escape + escape);
						}
						if (containsQuote === true) {
							const regexp = new RegExp(quote, "g");
							value = value.replace(regexp, escape + quote);
						}
						if (shouldQuote === true) value = quote + value + quote;
						csvrecord += value;
					} else if (quoted_empty === true || field === "" && quoted_string === true && quoted_empty !== false) csvrecord += quote + quote;
					if (i !== record.length - 1) csvrecord += delimiter;
				}
				return [void 0, csvrecord];
			},
			bom: function(push) {
				if (this.options.bom !== true) return;
				push(bom_utf8);
			},
			headers: function(push) {
				if (this.options.header === false) return;
				if (this.options.columns === void 0) return;
				let err;
				let headers = this.options.columns.map((column) => column.header);
				if (this.options.eof) {
					[err, headers] = this.stringify(headers, true);
					headers += this.options.record_delimiter;
				} else [err, headers] = this.stringify(headers);
				if (err) return err;
				if (this.options.header_as_comment) headers = this.options.header_as_comment + " " + headers;
				push(headers);
			},
			__cast: function(value, context) {
				const type = typeof value;
				try {
					if (type === "string") return [void 0, this.options.cast.string(value, context)];
					else if (type === "bigint") return [void 0, this.options.cast.bigint(value, context)];
					else if (type === "number") return [void 0, this.options.cast.number(value, context)];
					else if (type === "boolean") return [void 0, this.options.cast.boolean(value, context)];
					else if (value instanceof Date) return [void 0, this.options.cast.date(value, context)];
					else if (type === "object" && value !== null) return [void 0, this.options.cast.object(value, context)];
					else return [
						void 0,
						value,
						value
					];
				} catch (err) {
					return [err];
				}
			}
		};
	};
	//#endregion
	//#region ../../node_modules/csv-stringify/lib/sync.js
	var stringify = function(records, opts = {}) {
		const data = [];
		const [err, options] = normalize_options$1(opts);
		if (err !== void 0) throw err;
		const api = stringifier(options, { stop: false }, { records: 0 });
		for (const record of records) {
			const err = api.__transform(record, function(record) {
				data.push(record);
			});
			if (err !== void 0) throw err;
		}
		if (data.length === 0) {
			api.bom((d) => {
				data.push(d);
			});
			const err = api.headers((headers) => {
				data.push(headers);
			});
			if (err !== void 0) throw err;
		}
		return data.join("");
	};
	//#endregion
	//#region ../loot-core/src/server/transactions/export/export-to-csv.ts
	var FORMULA_TRIGGERS = /^[=+\-@\t\r]/;
	var csvStringifyOptions = {
		header: true,
		cast: { string: (value) => FORMULA_TRIGGERS.test(value) ? "'" + value : value }
	};
	async function exportToCSV(transactions, accounts, categoryGroups, payees) {
		const accountNamesById = accounts.reduce((reduced, { id, name }) => {
			reduced[id] = name;
			return reduced;
		}, {});
		const categoryNamesById = categoryGroups.reduce((reduced, { name, categories: subCategories }) => {
			subCategories.forEach((subCategory) => reduced[subCategory.id] = `${name}: ${subCategory.name}`);
			return reduced;
		}, {});
		const payeeNamesById = payees.reduce((reduced, { id, name }) => {
			reduced[id] = name;
			return reduced;
		}, {});
		return stringify(transactions.map(({ account, date, payee, notes, category, amount, cleared, reconciled }) => ({
			Account: accountNamesById[account],
			Date: date,
			Payee: payeeNamesById[payee],
			Notes: notes,
			Category: categoryNamesById[category],
			Amount: amount == null ? 0 : integerToAmount(amount),
			Cleared: cleared,
			Reconciled: reconciled
		})), csvStringifyOptions);
	}
	async function exportQueryToCSV(query) {
		const { data: transactions } = await aqlQuery(query.select([
			{ Id: "id" },
			{ Account: "account.name" },
			{ Date: "date" },
			{ Payee: "payee.name" },
			{ ParentId: "parent_id" },
			{ IsParent: "is_parent" },
			{ IsChild: "is_child" },
			{ SortOrder: "sort_order" },
			{ Notes: "notes" },
			{ CategoryGroup: "category.group.name" },
			{ Category: "category.name" },
			{ Amount: "amount" },
			{ Cleared: "cleared" },
			{ Reconciled: "reconciled" }
		]).options({ splits: "all" }));
		const parentsChildCount = /* @__PURE__ */ new Map();
		const childSplitOrder = /* @__PURE__ */ new Map();
		for (const trans of transactions) if (trans.IsChild) {
			let childNumber = parentsChildCount.get(trans.ParentId) || 0;
			childNumber++;
			childSplitOrder.set(trans.Id, childNumber);
			parentsChildCount.set(trans.ParentId, childNumber);
		}
		return stringify(transactions.map((trans) => {
			return {
				Account: trans.Account,
				Date: trans.Date,
				Payee: trans.Payee,
				Notes: trans.IsParent ? "(SPLIT INTO " + parentsChildCount.get(trans.Id) + ") " + (trans.Notes || "") : trans.IsChild ? "(SPLIT " + childSplitOrder.get(trans.Id) + " OF " + parentsChildCount.get(trans.ParentId) + ") " + (trans.Notes || "") : trans.Notes,
				Category_Group: trans.CategoryGroup,
				Category: trans.Category,
				Amount: trans.IsParent ? 0 : trans.Amount == null ? 0 : integerToAmount(trans.Amount),
				Split_Amount: trans.IsParent ? integerToAmount(trans.Amount) : 0,
				Cleared: trans.Reconciled === true ? "Reconciled" : trans.Cleared === true ? "Cleared" : "Not cleared"
			};
		}), csvStringifyOptions);
	}
	//#endregion
	//#region ../../node_modules/csv-parse/lib/api/CsvError.js
	init_dist();
	var CsvError = class CsvError extends Error {
		constructor(code, message, options, ...contexts) {
			if (Array.isArray(message)) message = message.join(" ").trim();
			super(message);
			if (Error.captureStackTrace !== void 0) Error.captureStackTrace(this, CsvError);
			this.code = code;
			for (const context of contexts) for (const key in context) {
				const value = context[key];
				this[key] = Buffer$1.isBuffer(value) ? value.toString(options.encoding) : value == null ? value : JSON.parse(JSON.stringify(value));
			}
		}
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/utils/is_object.js
	var is_object = function(obj) {
		return typeof obj === "object" && obj !== null && !Array.isArray(obj);
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/api/normalize_columns_array.js
	var normalize_columns_array = function(columns) {
		const normalizedColumns = [];
		for (let i = 0, l = columns.length; i < l; i++) {
			const column = columns[i];
			if (column === void 0 || column === null || column === false) normalizedColumns[i] = { disabled: true };
			else if (typeof column === "string" || typeof column === "number") normalizedColumns[i] = { name: `${column}` };
			else if (is_object(column)) {
				if (typeof column.name !== "string") throw new CsvError("CSV_OPTION_COLUMNS_MISSING_NAME", [
					"Option columns missing name:",
					`property "name" is required at position ${i}`,
					"when column is an object literal"
				]);
				normalizedColumns[i] = column;
			} else throw new CsvError("CSV_INVALID_COLUMN_DEFINITION", [
				"Invalid column definition:",
				"expect a string or a literal object,",
				`got ${JSON.stringify(column)} at position ${i}`
			]);
		}
		return normalizedColumns;
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/utils/ResizeableBuffer.js
	init_dist();
	var ResizeableBuffer = class {
		constructor(size = 100) {
			this.size = size;
			this.length = 0;
			this.buf = Buffer$1.allocUnsafe(size);
		}
		prepend(val) {
			if (Buffer$1.isBuffer(val)) {
				const length = this.length + val.length;
				if (length >= this.size) {
					this.resize();
					if (length >= this.size) throw Error("INVALID_BUFFER_STATE");
				}
				const buf = this.buf;
				this.buf = Buffer$1.allocUnsafe(this.size);
				val.copy(this.buf, 0);
				buf.copy(this.buf, val.length);
				this.length += val.length;
			} else {
				const length = this.length++;
				if (length === this.size) this.resize();
				const buf = this.clone();
				this.buf[0] = val;
				buf.copy(this.buf, 1, 0, length);
			}
		}
		append(val) {
			const length = this.length++;
			if (length === this.size) this.resize();
			this.buf[length] = val;
		}
		clone() {
			return Buffer$1.from(this.buf.slice(0, this.length));
		}
		resize() {
			const length = this.length;
			this.size = this.size * 2;
			const buf = Buffer$1.allocUnsafe(this.size);
			this.buf.copy(buf, 0, 0, length);
			this.buf = buf;
		}
		toString(encoding) {
			if (encoding) return this.buf.slice(0, this.length).toString(encoding);
			else return Uint8Array.prototype.slice.call(this.buf.slice(0, this.length));
		}
		toJSON() {
			return this.toString("utf8");
		}
		reset() {
			this.length = 0;
		}
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/api/init_state.js
	init_dist();
	var np = 12;
	var cr$1 = 13;
	var nl$1 = 10;
	var space = 32;
	var tab = 9;
	var init_state = function(options) {
		return {
			bomSkipped: false,
			bufBytesStart: 0,
			castField: options.cast_function,
			commenting: false,
			error: void 0,
			enabled: options.from_line === 1,
			escaping: false,
			escapeIsQuote: Buffer$1.isBuffer(options.escape) && Buffer$1.isBuffer(options.quote) && Buffer$1.compare(options.escape, options.quote) === 0,
			expectedRecordLength: Array.isArray(options.columns) ? options.columns.length : void 0,
			field: new ResizeableBuffer(20),
			firstLineToHeaders: options.cast_first_line_to_header,
			needMoreDataSize: Math.max(options.comment !== null ? options.comment.length : 0, ...options.delimiter.map((delimiter) => delimiter.length), options.quote !== null ? options.quote.length : 0),
			previousBuf: void 0,
			quoting: false,
			stop: false,
			rawBuffer: new ResizeableBuffer(100),
			record: [],
			recordHasError: false,
			record_length: 0,
			recordDelimiterMaxLength: options.record_delimiter.length === 0 ? 0 : Math.max(...options.record_delimiter.map((v) => v.length)),
			trimChars: [Buffer$1.from(" ", options.encoding)[0], Buffer$1.from("	", options.encoding)[0]],
			wasQuoting: false,
			wasRowDelimiter: false,
			timchars: [
				Buffer$1.from(Buffer$1.from([cr$1], "utf8").toString(), options.encoding),
				Buffer$1.from(Buffer$1.from([nl$1], "utf8").toString(), options.encoding),
				Buffer$1.from(Buffer$1.from([np], "utf8").toString(), options.encoding),
				Buffer$1.from(Buffer$1.from([space], "utf8").toString(), options.encoding),
				Buffer$1.from(Buffer$1.from([tab], "utf8").toString(), options.encoding)
			]
		};
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/utils/underscore.js
	var underscore = function(str) {
		return str.replace(/([A-Z])/g, function(_, match) {
			return "_" + match.toLowerCase();
		});
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/api/normalize_options.js
	init_dist();
	var normalize_options = function(opts) {
		const options = {};
		for (const opt in opts) options[underscore(opt)] = opts[opt];
		if (options.encoding === void 0 || options.encoding === true) options.encoding = "utf8";
		else if (options.encoding === null || options.encoding === false) options.encoding = null;
		else if (typeof options.encoding !== "string" && options.encoding !== null) throw new CsvError("CSV_INVALID_OPTION_ENCODING", [
			"Invalid option encoding:",
			"encoding must be a string or null to return a buffer,",
			`got ${JSON.stringify(options.encoding)}`
		], options);
		if (options.bom === void 0 || options.bom === null || options.bom === false) options.bom = false;
		else if (options.bom !== true) throw new CsvError("CSV_INVALID_OPTION_BOM", [
			"Invalid option bom:",
			"bom must be true,",
			`got ${JSON.stringify(options.bom)}`
		], options);
		options.cast_function = null;
		if (options.cast === void 0 || options.cast === null || options.cast === false || options.cast === "") options.cast = void 0;
		else if (typeof options.cast === "function") {
			options.cast_function = options.cast;
			options.cast = true;
		} else if (options.cast !== true) throw new CsvError("CSV_INVALID_OPTION_CAST", [
			"Invalid option cast:",
			"cast must be true or a function,",
			`got ${JSON.stringify(options.cast)}`
		], options);
		if (options.cast_date === void 0 || options.cast_date === null || options.cast_date === false || options.cast_date === "") options.cast_date = false;
		else if (options.cast_date === true) options.cast_date = function(value) {
			const date = Date.parse(value);
			return !isNaN(date) ? new Date(date) : value;
		};
		else if (typeof options.cast_date !== "function") throw new CsvError("CSV_INVALID_OPTION_CAST_DATE", [
			"Invalid option cast_date:",
			"cast_date must be true or a function,",
			`got ${JSON.stringify(options.cast_date)}`
		], options);
		options.cast_first_line_to_header = void 0;
		if (options.columns === true) options.cast_first_line_to_header = void 0;
		else if (typeof options.columns === "function") {
			options.cast_first_line_to_header = options.columns;
			options.columns = true;
		} else if (Array.isArray(options.columns)) options.columns = normalize_columns_array(options.columns);
		else if (options.columns === void 0 || options.columns === null || options.columns === false) options.columns = false;
		else throw new CsvError("CSV_INVALID_OPTION_COLUMNS", [
			"Invalid option columns:",
			"expect an array, a function or true,",
			`got ${JSON.stringify(options.columns)}`
		], options);
		if (options.group_columns_by_name === void 0 || options.group_columns_by_name === null || options.group_columns_by_name === false) options.group_columns_by_name = false;
		else if (options.group_columns_by_name !== true) throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", [
			"Invalid option group_columns_by_name:",
			"expect an boolean,",
			`got ${JSON.stringify(options.group_columns_by_name)}`
		], options);
		else if (options.columns === false) throw new CsvError("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME", ["Invalid option group_columns_by_name:", "the `columns` mode must be activated."], options);
		if (options.comment === void 0 || options.comment === null || options.comment === false || options.comment === "") options.comment = null;
		else {
			if (typeof options.comment === "string") options.comment = Buffer$1.from(options.comment, options.encoding);
			if (!Buffer$1.isBuffer(options.comment)) throw new CsvError("CSV_INVALID_OPTION_COMMENT", [
				"Invalid option comment:",
				"comment must be a buffer or a string,",
				`got ${JSON.stringify(options.comment)}`
			], options);
		}
		if (options.comment_no_infix === void 0 || options.comment_no_infix === null || options.comment_no_infix === false) options.comment_no_infix = false;
		else if (options.comment_no_infix !== true) throw new CsvError("CSV_INVALID_OPTION_COMMENT", [
			"Invalid option comment_no_infix:",
			"value must be a boolean,",
			`got ${JSON.stringify(options.comment_no_infix)}`
		], options);
		const delimiter_json = JSON.stringify(options.delimiter);
		if (!Array.isArray(options.delimiter)) options.delimiter = [options.delimiter];
		if (options.delimiter.length === 0) throw new CsvError("CSV_INVALID_OPTION_DELIMITER", [
			"Invalid option delimiter:",
			"delimiter must be a non empty string or buffer or array of string|buffer,",
			`got ${delimiter_json}`
		], options);
		options.delimiter = options.delimiter.map(function(delimiter) {
			if (delimiter === void 0 || delimiter === null || delimiter === false) return Buffer$1.from(",", options.encoding);
			if (typeof delimiter === "string") delimiter = Buffer$1.from(delimiter, options.encoding);
			if (!Buffer$1.isBuffer(delimiter) || delimiter.length === 0) throw new CsvError("CSV_INVALID_OPTION_DELIMITER", [
				"Invalid option delimiter:",
				"delimiter must be a non empty string or buffer or array of string|buffer,",
				`got ${delimiter_json}`
			], options);
			return delimiter;
		});
		if (options.escape === void 0 || options.escape === true) options.escape = Buffer$1.from("\"", options.encoding);
		else if (typeof options.escape === "string") options.escape = Buffer$1.from(options.escape, options.encoding);
		else if (options.escape === null || options.escape === false) options.escape = null;
		if (options.escape !== null) {
			if (!Buffer$1.isBuffer(options.escape)) throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(options.escape)}`);
		}
		if (options.from === void 0 || options.from === null) options.from = 1;
		else {
			if (typeof options.from === "string" && /\d+/.test(options.from)) options.from = parseInt(options.from);
			if (Number.isInteger(options.from)) {
				if (options.from < 0) throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(opts.from)}`);
			} else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(options.from)}`);
		}
		if (options.from_line === void 0 || options.from_line === null) options.from_line = 1;
		else {
			if (typeof options.from_line === "string" && /\d+/.test(options.from_line)) options.from_line = parseInt(options.from_line);
			if (Number.isInteger(options.from_line)) {
				if (options.from_line <= 0) throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(opts.from_line)}`);
			} else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(opts.from_line)}`);
		}
		if (options.ignore_last_delimiters === void 0 || options.ignore_last_delimiters === null) options.ignore_last_delimiters = false;
		else if (typeof options.ignore_last_delimiters === "number") {
			options.ignore_last_delimiters = Math.floor(options.ignore_last_delimiters);
			if (options.ignore_last_delimiters === 0) options.ignore_last_delimiters = false;
		} else if (typeof options.ignore_last_delimiters !== "boolean") throw new CsvError("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS", [
			"Invalid option `ignore_last_delimiters`:",
			"the value must be a boolean value or an integer,",
			`got ${JSON.stringify(options.ignore_last_delimiters)}`
		], options);
		if (options.ignore_last_delimiters === true && options.columns === false) throw new CsvError("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS", ["The option `ignore_last_delimiters`", "requires the activation of the `columns` option"], options);
		if (options.info === void 0 || options.info === null || options.info === false) options.info = false;
		else if (options.info !== true) throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(options.info)}`);
		if (options.max_record_size === void 0 || options.max_record_size === null || options.max_record_size === false) options.max_record_size = 0;
		else if (Number.isInteger(options.max_record_size) && options.max_record_size >= 0) {} else if (typeof options.max_record_size === "string" && /\d+/.test(options.max_record_size)) options.max_record_size = parseInt(options.max_record_size);
		else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(options.max_record_size)}`);
		if (options.objname === void 0 || options.objname === null || options.objname === false) options.objname = void 0;
		else if (Buffer$1.isBuffer(options.objname)) {
			if (options.objname.length === 0) throw new Error(`Invalid Option: objname must be a non empty buffer`);
			if (options.encoding === null) {} else options.objname = options.objname.toString(options.encoding);
		} else if (typeof options.objname === "string") {
			if (options.objname.length === 0) throw new Error(`Invalid Option: objname must be a non empty string`);
		} else if (typeof options.objname === "number") {} else throw new Error(`Invalid Option: objname must be a string or a buffer, got ${options.objname}`);
		if (options.objname !== void 0) {
			if (typeof options.objname === "number") {
				if (options.columns !== false) throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field");
			} else if (options.columns === false) throw Error("Invalid Option: objname field must be combined with columns or be defined as an index");
		}
		if (options.on_record === void 0 || options.on_record === null) options.on_record = void 0;
		else if (typeof options.on_record !== "function") throw new CsvError("CSV_INVALID_OPTION_ON_RECORD", [
			"Invalid option `on_record`:",
			"expect a function,",
			`got ${JSON.stringify(options.on_record)}`
		], options);
		if (options.on_skip !== void 0 && options.on_skip !== null && typeof options.on_skip !== "function") throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(options.on_skip)}`);
		if (options.quote === null || options.quote === false || options.quote === "") options.quote = null;
		else {
			if (options.quote === void 0 || options.quote === true) options.quote = Buffer$1.from("\"", options.encoding);
			else if (typeof options.quote === "string") options.quote = Buffer$1.from(options.quote, options.encoding);
			if (!Buffer$1.isBuffer(options.quote)) throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(options.quote)}`);
		}
		if (options.raw === void 0 || options.raw === null || options.raw === false) options.raw = false;
		else if (options.raw !== true) throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(options.raw)}`);
		if (options.record_delimiter === void 0) options.record_delimiter = [];
		else if (typeof options.record_delimiter === "string" || Buffer$1.isBuffer(options.record_delimiter)) {
			if (options.record_delimiter.length === 0) throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
				"Invalid option `record_delimiter`:",
				"value must be a non empty string or buffer,",
				`got ${JSON.stringify(options.record_delimiter)}`
			], options);
			options.record_delimiter = [options.record_delimiter];
		} else if (!Array.isArray(options.record_delimiter)) throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
			"Invalid option `record_delimiter`:",
			"value must be a string, a buffer or array of string|buffer,",
			`got ${JSON.stringify(options.record_delimiter)}`
		], options);
		options.record_delimiter = options.record_delimiter.map(function(rd, i) {
			if (typeof rd !== "string" && !Buffer$1.isBuffer(rd)) throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
				"Invalid option `record_delimiter`:",
				"value must be a string, a buffer or array of string|buffer",
				`at index ${i},`,
				`got ${JSON.stringify(rd)}`
			], options);
			else if (rd.length === 0) throw new CsvError("CSV_INVALID_OPTION_RECORD_DELIMITER", [
				"Invalid option `record_delimiter`:",
				"value must be a non empty string or buffer",
				`at index ${i},`,
				`got ${JSON.stringify(rd)}`
			], options);
			if (typeof rd === "string") rd = Buffer$1.from(rd, options.encoding);
			return rd;
		});
		if (typeof options.relax_column_count === "boolean") {} else if (options.relax_column_count === void 0 || options.relax_column_count === null) options.relax_column_count = false;
		else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(options.relax_column_count)}`);
		if (typeof options.relax_column_count_less === "boolean") {} else if (options.relax_column_count_less === void 0 || options.relax_column_count_less === null) options.relax_column_count_less = false;
		else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(options.relax_column_count_less)}`);
		if (typeof options.relax_column_count_more === "boolean") {} else if (options.relax_column_count_more === void 0 || options.relax_column_count_more === null) options.relax_column_count_more = false;
		else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(options.relax_column_count_more)}`);
		if (typeof options.relax_quotes === "boolean") {} else if (options.relax_quotes === void 0 || options.relax_quotes === null) options.relax_quotes = false;
		else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(options.relax_quotes)}`);
		if (typeof options.skip_empty_lines === "boolean") {} else if (options.skip_empty_lines === void 0 || options.skip_empty_lines === null) options.skip_empty_lines = false;
		else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(options.skip_empty_lines)}`);
		if (typeof options.skip_records_with_empty_values === "boolean") {} else if (options.skip_records_with_empty_values === void 0 || options.skip_records_with_empty_values === null) options.skip_records_with_empty_values = false;
		else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(options.skip_records_with_empty_values)}`);
		if (typeof options.skip_records_with_error === "boolean") {} else if (options.skip_records_with_error === void 0 || options.skip_records_with_error === null) options.skip_records_with_error = false;
		else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(options.skip_records_with_error)}`);
		if (options.rtrim === void 0 || options.rtrim === null || options.rtrim === false) options.rtrim = false;
		else if (options.rtrim !== true) throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(options.rtrim)}`);
		if (options.ltrim === void 0 || options.ltrim === null || options.ltrim === false) options.ltrim = false;
		else if (options.ltrim !== true) throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(options.ltrim)}`);
		if (options.trim === void 0 || options.trim === null || options.trim === false) options.trim = false;
		else if (options.trim !== true) throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(options.trim)}`);
		if (options.trim === true && opts.ltrim !== false) options.ltrim = true;
		else if (options.ltrim !== true) options.ltrim = false;
		if (options.trim === true && opts.rtrim !== false) options.rtrim = true;
		else if (options.rtrim !== true) options.rtrim = false;
		if (options.to === void 0 || options.to === null) options.to = -1;
		else if (options.to !== -1) {
			if (typeof options.to === "string" && /\d+/.test(options.to)) options.to = parseInt(options.to);
			if (Number.isInteger(options.to)) {
				if (options.to <= 0) throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(opts.to)}`);
			} else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(opts.to)}`);
		}
		if (options.to_line === void 0 || options.to_line === null) options.to_line = -1;
		else if (options.to_line !== -1) {
			if (typeof options.to_line === "string" && /\d+/.test(options.to_line)) options.to_line = parseInt(options.to_line);
			if (Number.isInteger(options.to_line)) {
				if (options.to_line <= 0) throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(opts.to_line)}`);
			} else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(opts.to_line)}`);
		}
		return options;
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/api/index.js
	init_dist();
	var isRecordEmpty = function(record) {
		return record.every((field) => field == null || field.toString && field.toString().trim() === "");
	};
	var cr = 13;
	var nl = 10;
	var boms = {
		utf8: Buffer$1.from([
			239,
			187,
			191
		]),
		utf16le: Buffer$1.from([255, 254])
	};
	var transform = function(original_options = {}) {
		const info = {
			bytes: 0,
			bytes_records: 0,
			comment_lines: 0,
			empty_lines: 0,
			invalid_field_length: 0,
			lines: 1,
			records: 0
		};
		const options = normalize_options(original_options);
		return {
			info,
			original_options,
			options,
			state: init_state(options),
			__needMoreData: function(i, bufLen, end) {
				if (end) return false;
				const { encoding, escape, quote } = this.options;
				const { quoting, needMoreDataSize, recordDelimiterMaxLength } = this.state;
				return bufLen - i - 1 < Math.max(needMoreDataSize, recordDelimiterMaxLength === 0 ? Buffer$1.from("\r\n", encoding).length : recordDelimiterMaxLength, quoting ? (escape === null ? 0 : escape.length) + quote.length : 0, quoting ? quote.length + recordDelimiterMaxLength : 0);
			},
			parse: function(nextBuf, end, push, close) {
				const { bom, comment_no_infix, encoding, from_line, ltrim, max_record_size, raw, relax_quotes, rtrim, skip_empty_lines, to, to_line } = this.options;
				let { comment, escape, quote, record_delimiter } = this.options;
				const { bomSkipped, previousBuf, rawBuffer, escapeIsQuote } = this.state;
				let buf;
				if (previousBuf === void 0) if (nextBuf === void 0) {
					close();
					return;
				} else buf = nextBuf;
				else if (previousBuf !== void 0 && nextBuf === void 0) buf = previousBuf;
				else buf = Buffer$1.concat([previousBuf, nextBuf]);
				if (bomSkipped === false) if (bom === false) this.state.bomSkipped = true;
				else if (buf.length < 3) {
					if (end === false) {
						this.state.previousBuf = buf;
						return;
					}
				} else {
					for (const encoding in boms) if (boms[encoding].compare(buf, 0, boms[encoding].length) === 0) {
						const bomLength = boms[encoding].length;
						this.state.bufBytesStart += bomLength;
						buf = buf.slice(bomLength);
						const options = normalize_options({
							...this.original_options,
							encoding
						});
						for (const key in options) this.options[key] = options[key];
						({comment, escape, quote} = this.options);
						break;
					}
					this.state.bomSkipped = true;
				}
				const bufLen = buf.length;
				let pos;
				for (pos = 0; pos < bufLen; pos++) {
					if (this.__needMoreData(pos, bufLen, end)) break;
					if (this.state.wasRowDelimiter === true) {
						this.info.lines++;
						this.state.wasRowDelimiter = false;
					}
					if (to_line !== -1 && this.info.lines > to_line) {
						this.state.stop = true;
						close();
						return;
					}
					if (this.state.quoting === false && record_delimiter.length === 0) {
						if (this.__autoDiscoverRecordDelimiter(buf, pos)) record_delimiter = this.options.record_delimiter;
					}
					const chr = buf[pos];
					if (raw === true) rawBuffer.append(chr);
					if ((chr === cr || chr === nl) && this.state.wasRowDelimiter === false) this.state.wasRowDelimiter = true;
					if (this.state.escaping === true) this.state.escaping = false;
					else {
						if (escape !== null && this.state.quoting === true && this.__isEscape(buf, pos, chr) && pos + escape.length < bufLen) if (escapeIsQuote) {
							if (this.__isQuote(buf, pos + escape.length)) {
								this.state.escaping = true;
								pos += escape.length - 1;
								continue;
							}
						} else {
							this.state.escaping = true;
							pos += escape.length - 1;
							continue;
						}
						if (this.state.commenting === false && this.__isQuote(buf, pos)) if (this.state.quoting === true) {
							const nextChr = buf[pos + quote.length];
							const isNextChrTrimable = rtrim && this.__isCharTrimable(buf, pos + quote.length);
							const isNextChrComment = comment !== null && this.__compareBytes(comment, buf, pos + quote.length, nextChr);
							const isNextChrDelimiter = this.__isDelimiter(buf, pos + quote.length, nextChr);
							const isNextChrRecordDelimiter = record_delimiter.length === 0 ? this.__autoDiscoverRecordDelimiter(buf, pos + quote.length) : this.__isRecordDelimiter(nextChr, buf, pos + quote.length);
							if (escape !== null && this.__isEscape(buf, pos, chr) && this.__isQuote(buf, pos + escape.length)) pos += escape.length - 1;
							else if (!nextChr || isNextChrDelimiter || isNextChrRecordDelimiter || isNextChrComment || isNextChrTrimable) {
								this.state.quoting = false;
								this.state.wasQuoting = true;
								pos += quote.length - 1;
								continue;
							} else if (relax_quotes === false) {
								const err = this.__error(new CsvError("CSV_INVALID_CLOSING_QUOTE", [
									"Invalid Closing Quote:",
									`got "${String.fromCharCode(nextChr)}"`,
									`at line ${this.info.lines}`,
									"instead of delimiter, record delimiter, trimable character",
									"(if activated) or comment"
								], this.options, this.__infoField()));
								if (err !== void 0) return err;
							} else {
								this.state.quoting = false;
								this.state.wasQuoting = true;
								this.state.field.prepend(quote);
								pos += quote.length - 1;
							}
						} else if (this.state.field.length !== 0) {
							if (relax_quotes === false) {
								const info = this.__infoField();
								const bom = Object.keys(boms).map((b) => boms[b].equals(this.state.field.toString()) ? b : false).filter(Boolean)[0];
								const err = this.__error(new CsvError("INVALID_OPENING_QUOTE", [
									"Invalid Opening Quote:",
									`a quote is found on field ${JSON.stringify(info.column)} at line ${info.lines}, value is ${JSON.stringify(this.state.field.toString(encoding))}`,
									bom ? `(${bom} bom)` : void 0
								], this.options, info, { field: this.state.field }));
								if (err !== void 0) return err;
							}
						} else {
							this.state.quoting = true;
							pos += quote.length - 1;
							continue;
						}
						if (this.state.quoting === false) {
							const recordDelimiterLength = this.__isRecordDelimiter(chr, buf, pos);
							if (recordDelimiterLength !== 0) {
								if (this.state.commenting && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0) this.info.comment_lines++;
								else {
									if (this.state.enabled === false && this.info.lines + (this.state.wasRowDelimiter === true ? 1 : 0) >= from_line) {
										this.state.enabled = true;
										this.__resetField();
										this.__resetRecord();
										pos += recordDelimiterLength - 1;
										continue;
									}
									if (skip_empty_lines === true && this.state.wasQuoting === false && this.state.record.length === 0 && this.state.field.length === 0) {
										this.info.empty_lines++;
										pos += recordDelimiterLength - 1;
										continue;
									}
									this.info.bytes = this.state.bufBytesStart + pos;
									const errField = this.__onField();
									if (errField !== void 0) return errField;
									this.info.bytes = this.state.bufBytesStart + pos + recordDelimiterLength;
									const errRecord = this.__onRecord(push);
									if (errRecord !== void 0) return errRecord;
									if (to !== -1 && this.info.records >= to) {
										this.state.stop = true;
										close();
										return;
									}
								}
								this.state.commenting = false;
								pos += recordDelimiterLength - 1;
								continue;
							}
							if (this.state.commenting) continue;
							if (comment !== null && (comment_no_infix === false || this.state.record.length === 0 && this.state.field.length === 0)) {
								if (this.__compareBytes(comment, buf, pos, chr) !== 0) {
									this.state.commenting = true;
									continue;
								}
							}
							const delimiterLength = this.__isDelimiter(buf, pos, chr);
							if (delimiterLength !== 0) {
								this.info.bytes = this.state.bufBytesStart + pos;
								const errField = this.__onField();
								if (errField !== void 0) return errField;
								pos += delimiterLength - 1;
								continue;
							}
						}
					}
					if (this.state.commenting === false) {
						if (max_record_size !== 0 && this.state.record_length + this.state.field.length > max_record_size) return this.__error(new CsvError("CSV_MAX_RECORD_SIZE", [
							"Max Record Size:",
							"record exceed the maximum number of tolerated bytes",
							`of ${max_record_size}`,
							`at line ${this.info.lines}`
						], this.options, this.__infoField()));
					}
					const lappend = ltrim === false || this.state.quoting === true || this.state.field.length !== 0 || !this.__isCharTrimable(buf, pos);
					const rappend = rtrim === false || this.state.wasQuoting === false;
					if (lappend === true && rappend === true) this.state.field.append(chr);
					else if (rtrim === true && !this.__isCharTrimable(buf, pos)) return this.__error(new CsvError("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE", [
						"Invalid Closing Quote:",
						"found non trimable byte after quote",
						`at line ${this.info.lines}`
					], this.options, this.__infoField()));
					else {
						if (lappend === false) pos += this.__isCharTrimable(buf, pos) - 1;
						continue;
					}
				}
				if (end === true) {
					if (this.state.quoting === true) {
						const err = this.__error(new CsvError("CSV_QUOTE_NOT_CLOSED", ["Quote Not Closed:", `the parsing is finished with an opening quote at line ${this.info.lines}`], this.options, this.__infoField()));
						if (err !== void 0) return err;
					} else if (this.state.wasQuoting === true || this.state.record.length !== 0 || this.state.field.length !== 0) {
						this.info.bytes = this.state.bufBytesStart + pos;
						const errField = this.__onField();
						if (errField !== void 0) return errField;
						const errRecord = this.__onRecord(push);
						if (errRecord !== void 0) return errRecord;
					} else if (this.state.wasRowDelimiter === true) this.info.empty_lines++;
					else if (this.state.commenting === true) this.info.comment_lines++;
				} else {
					this.state.bufBytesStart += pos;
					this.state.previousBuf = buf.slice(pos);
				}
				if (this.state.wasRowDelimiter === true) {
					this.info.lines++;
					this.state.wasRowDelimiter = false;
				}
			},
			__onRecord: function(push) {
				const { columns, group_columns_by_name, encoding, info, from, relax_column_count, relax_column_count_less, relax_column_count_more, raw, skip_records_with_empty_values } = this.options;
				const { enabled, record } = this.state;
				if (enabled === false) return this.__resetRecord();
				const recordLength = record.length;
				if (columns === true) {
					if (skip_records_with_empty_values === true && isRecordEmpty(record)) {
						this.__resetRecord();
						return;
					}
					return this.__firstLineToColumns(record);
				}
				if (columns === false && this.info.records === 0) this.state.expectedRecordLength = recordLength;
				if (recordLength !== this.state.expectedRecordLength) {
					const err = columns === false ? new CsvError("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH", [
						"Invalid Record Length:",
						`expect ${this.state.expectedRecordLength},`,
						`got ${recordLength} on line ${this.info.lines}`
					], this.options, this.__infoField(), { record }) : new CsvError("CSV_RECORD_INCONSISTENT_COLUMNS", [
						"Invalid Record Length:",
						`columns length is ${columns.length},`,
						`got ${recordLength} on line ${this.info.lines}`
					], this.options, this.__infoField(), { record });
					if (relax_column_count === true || relax_column_count_less === true && recordLength < this.state.expectedRecordLength || relax_column_count_more === true && recordLength > this.state.expectedRecordLength) {
						this.info.invalid_field_length++;
						this.state.error = err;
					} else {
						const finalErr = this.__error(err);
						if (finalErr) return finalErr;
					}
				}
				if (skip_records_with_empty_values === true && isRecordEmpty(record)) {
					this.__resetRecord();
					return;
				}
				if (this.state.recordHasError === true) {
					this.__resetRecord();
					this.state.recordHasError = false;
					return;
				}
				this.info.records++;
				if (from === 1 || this.info.records >= from) {
					const { objname } = this.options;
					if (columns !== false) {
						const obj = {};
						for (let i = 0, l = record.length; i < l; i++) {
							if (columns[i] === void 0 || columns[i].disabled) continue;
							if (group_columns_by_name === true && obj[columns[i].name] !== void 0) if (Array.isArray(obj[columns[i].name])) obj[columns[i].name] = obj[columns[i].name].concat(record[i]);
							else obj[columns[i].name] = [obj[columns[i].name], record[i]];
							else obj[columns[i].name] = record[i];
						}
						if (raw === true || info === true) {
							const extRecord = Object.assign({ record: obj }, raw === true ? { raw: this.state.rawBuffer.toString(encoding) } : {}, info === true ? { info: this.__infoRecord() } : {});
							const err = this.__push(objname === void 0 ? extRecord : [obj[objname], extRecord], push);
							if (err) return err;
						} else {
							const err = this.__push(objname === void 0 ? obj : [obj[objname], obj], push);
							if (err) return err;
						}
					} else if (raw === true || info === true) {
						const extRecord = Object.assign({ record }, raw === true ? { raw: this.state.rawBuffer.toString(encoding) } : {}, info === true ? { info: this.__infoRecord() } : {});
						const err = this.__push(objname === void 0 ? extRecord : [record[objname], extRecord], push);
						if (err) return err;
					} else {
						const err = this.__push(objname === void 0 ? record : [record[objname], record], push);
						if (err) return err;
					}
				}
				this.__resetRecord();
			},
			__firstLineToColumns: function(record) {
				const { firstLineToHeaders } = this.state;
				try {
					const headers = firstLineToHeaders === void 0 ? record : firstLineToHeaders.call(null, record);
					if (!Array.isArray(headers)) return this.__error(new CsvError("CSV_INVALID_COLUMN_MAPPING", [
						"Invalid Column Mapping:",
						"expect an array from column function,",
						`got ${JSON.stringify(headers)}`
					], this.options, this.__infoField(), { headers }));
					const normalizedHeaders = normalize_columns_array(headers);
					this.state.expectedRecordLength = normalizedHeaders.length;
					this.options.columns = normalizedHeaders;
					this.__resetRecord();
					return;
				} catch (err) {
					return err;
				}
			},
			__resetRecord: function() {
				if (this.options.raw === true) this.state.rawBuffer.reset();
				this.state.error = void 0;
				this.state.record = [];
				this.state.record_length = 0;
			},
			__onField: function() {
				const { cast, encoding, rtrim, max_record_size } = this.options;
				const { enabled, wasQuoting } = this.state;
				if (enabled === false) return this.__resetField();
				let field = this.state.field.toString(encoding);
				if (rtrim === true && wasQuoting === false) field = field.trimRight();
				if (cast === true) {
					const [err, f] = this.__cast(field);
					if (err !== void 0) return err;
					field = f;
				}
				this.state.record.push(field);
				if (max_record_size !== 0 && typeof field === "string") this.state.record_length += field.length;
				this.__resetField();
			},
			__resetField: function() {
				this.state.field.reset();
				this.state.wasQuoting = false;
			},
			__push: function(record, push) {
				const { on_record } = this.options;
				if (on_record !== void 0) {
					const info = this.__infoRecord();
					try {
						record = on_record.call(null, record, info);
					} catch (err) {
						return err;
					}
					if (record === void 0 || record === null) return;
				}
				this.info.bytes_records += this.info.bytes;
				push(record);
			},
			__cast: function(field) {
				const { columns, relax_column_count } = this.options;
				if (Array.isArray(columns) === true && relax_column_count && this.options.columns.length <= this.state.record.length) return [void 0, void 0];
				if (this.state.castField !== null) try {
					const info = this.__infoField();
					return [void 0, this.state.castField.call(null, field, info)];
				} catch (err) {
					return [err];
				}
				if (this.__isFloat(field)) return [void 0, parseFloat(field)];
				else if (this.options.cast_date !== false) {
					const info = this.__infoField();
					return [void 0, this.options.cast_date.call(null, field, info)];
				}
				return [void 0, field];
			},
			__isCharTrimable: function(buf, pos) {
				const isTrim = (buf, pos) => {
					const { timchars } = this.state;
					loop1: for (let i = 0; i < timchars.length; i++) {
						const timchar = timchars[i];
						for (let j = 0; j < timchar.length; j++) if (timchar[j] !== buf[pos + j]) continue loop1;
						return timchar.length;
					}
					return 0;
				};
				return isTrim(buf, pos);
			},
			__isFloat: function(value) {
				return value - parseFloat(value) + 1 >= 0;
			},
			__compareBytes: function(sourceBuf, targetBuf, targetPos, firstByte) {
				if (sourceBuf[0] !== firstByte) return 0;
				const sourceLength = sourceBuf.length;
				for (let i = 1; i < sourceLength; i++) if (sourceBuf[i] !== targetBuf[targetPos + i]) return 0;
				return sourceLength;
			},
			__isDelimiter: function(buf, pos, chr) {
				const { delimiter, ignore_last_delimiters } = this.options;
				if (ignore_last_delimiters === true && this.state.record.length === this.options.columns.length - 1) return 0;
				else if (ignore_last_delimiters !== false && typeof ignore_last_delimiters === "number" && this.state.record.length === ignore_last_delimiters - 1) return 0;
				loop1: for (let i = 0; i < delimiter.length; i++) {
					const del = delimiter[i];
					if (del[0] === chr) {
						for (let j = 1; j < del.length; j++) if (del[j] !== buf[pos + j]) continue loop1;
						return del.length;
					}
				}
				return 0;
			},
			__isRecordDelimiter: function(chr, buf, pos) {
				const { record_delimiter } = this.options;
				const recordDelimiterLength = record_delimiter.length;
				loop1: for (let i = 0; i < recordDelimiterLength; i++) {
					const rd = record_delimiter[i];
					const rdLength = rd.length;
					if (rd[0] !== chr) continue;
					for (let j = 1; j < rdLength; j++) if (rd[j] !== buf[pos + j]) continue loop1;
					return rd.length;
				}
				return 0;
			},
			__isEscape: function(buf, pos, chr) {
				const { escape } = this.options;
				if (escape === null) return false;
				const l = escape.length;
				if (escape[0] === chr) {
					for (let i = 0; i < l; i++) if (escape[i] !== buf[pos + i]) return false;
					return true;
				}
				return false;
			},
			__isQuote: function(buf, pos) {
				const { quote } = this.options;
				if (quote === null) return false;
				const l = quote.length;
				for (let i = 0; i < l; i++) if (quote[i] !== buf[pos + i]) return false;
				return true;
			},
			__autoDiscoverRecordDelimiter: function(buf, pos) {
				const { encoding } = this.options;
				const rds = [
					Buffer$1.from("\r\n", encoding),
					Buffer$1.from("\n", encoding),
					Buffer$1.from("\r", encoding)
				];
				loop: for (let i = 0; i < rds.length; i++) {
					const l = rds[i].length;
					for (let j = 0; j < l; j++) if (rds[i][j] !== buf[pos + j]) continue loop;
					this.options.record_delimiter.push(rds[i]);
					this.state.recordDelimiterMaxLength = rds[i].length;
					return rds[i].length;
				}
				return 0;
			},
			__error: function(msg) {
				const { encoding, raw, skip_records_with_error } = this.options;
				const err = typeof msg === "string" ? new Error(msg) : msg;
				if (skip_records_with_error) {
					this.state.recordHasError = true;
					if (this.options.on_skip !== void 0) try {
						this.options.on_skip(err, raw ? this.state.rawBuffer.toString(encoding) : void 0);
					} catch (err) {
						return err;
					}
					return;
				} else return err;
			},
			__infoDataSet: function() {
				return {
					...this.info,
					columns: this.options.columns
				};
			},
			__infoRecord: function() {
				const { columns, raw, encoding } = this.options;
				return {
					...this.__infoDataSet(),
					bytes_records: this.info.bytes,
					error: this.state.error,
					header: columns === true,
					index: this.state.record.length,
					raw: raw ? this.state.rawBuffer.toString(encoding) : void 0
				};
			},
			__infoField: function() {
				const { columns } = this.options;
				const isColumns = Array.isArray(columns);
				const bytes_records = this.info.bytes_records;
				return {
					...this.__infoRecord(),
					bytes_records,
					column: isColumns === true ? columns.length > this.state.record.length ? columns[this.state.record.length].name : null : this.state.record.length,
					quoting: this.state.wasQuoting
				};
			}
		};
	};
	//#endregion
	//#region ../../node_modules/csv-parse/lib/sync.js
	init_dist();
	var parse = function(data, opts = {}) {
		if (typeof data === "string") data = Buffer$1.from(data);
		const records = opts && opts.objname ? {} : [];
		const parser = transform(opts);
		const push = (record) => {
			if (parser.options.objname === void 0) records.push(record);
			else records[record[0]] = record[1];
		};
		const close = () => {};
		const error = parser.parse(data, true, push, close);
		if (error !== void 0) throw error;
		return records;
	};
	//#endregion
	//#region ../../node_modules/xml2js/lib/defaults.js
	var require_defaults = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			exports.defaults = {
				"0.1": {
					explicitCharkey: false,
					trim: true,
					normalize: true,
					normalizeTags: false,
					attrkey: "@",
					charkey: "#",
					explicitArray: false,
					ignoreAttrs: false,
					mergeAttrs: false,
					explicitRoot: false,
					validator: null,
					xmlns: false,
					explicitChildren: false,
					childkey: "@@",
					charsAsChildren: false,
					includeWhiteChars: false,
					async: false,
					strict: true,
					attrNameProcessors: null,
					attrValueProcessors: null,
					tagNameProcessors: null,
					valueProcessors: null,
					emptyTag: ""
				},
				"0.2": {
					explicitCharkey: false,
					trim: false,
					normalize: false,
					normalizeTags: false,
					attrkey: "$",
					charkey: "_",
					explicitArray: true,
					ignoreAttrs: false,
					mergeAttrs: false,
					explicitRoot: true,
					validator: null,
					xmlns: false,
					explicitChildren: false,
					preserveChildrenOrder: false,
					childkey: "$$",
					charsAsChildren: false,
					includeWhiteChars: false,
					async: false,
					strict: true,
					attrNameProcessors: null,
					attrValueProcessors: null,
					tagNameProcessors: null,
					valueProcessors: null,
					rootName: "root",
					xmldec: {
						"version": "1.0",
						"encoding": "UTF-8",
						"standalone": true
					},
					doctype: null,
					renderOpts: {
						"pretty": true,
						"indent": "  ",
						"newline": "\n"
					},
					headless: false,
					chunkSize: 1e4,
					emptyTag: "",
					cdata: false
				}
			};
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/Utility.js
	var require_Utility = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var assign, getValue, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty;
			assign = function() {
				var i, key, len, source, sources, target = arguments[0];
				sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
				if (isFunction(Object.assign)) Object.assign.apply(null, arguments);
				else for (i = 0, len = sources.length; i < len; i++) {
					source = sources[i];
					if (source != null) for (key in source) {
						if (!hasProp.call(source, key)) continue;
						target[key] = source[key];
					}
				}
				return target;
			};
			isFunction = function(val) {
				return !!val && Object.prototype.toString.call(val) === "[object Function]";
			};
			isObject = function(val) {
				var ref;
				return !!val && ((ref = typeof val) === "function" || ref === "object");
			};
			isArray = function(val) {
				if (isFunction(Array.isArray)) return Array.isArray(val);
				else return Object.prototype.toString.call(val) === "[object Array]";
			};
			isEmpty = function(val) {
				var key;
				if (isArray(val)) return !val.length;
				else {
					for (key in val) {
						if (!hasProp.call(val, key)) continue;
						return false;
					}
					return true;
				}
			};
			isPlainObject = function(val) {
				var ctor, proto;
				return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && typeof ctor === "function" && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object);
			};
			getValue = function(obj) {
				if (isFunction(obj.valueOf)) return obj.valueOf();
				else return obj;
			};
			module.exports.assign = assign;
			module.exports.isFunction = isFunction;
			module.exports.isObject = isObject;
			module.exports.isArray = isArray;
			module.exports.isEmpty = isEmpty;
			module.exports.isPlainObject = isPlainObject;
			module.exports.getValue = getValue;
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDOMImplementation.js
	var require_XMLDOMImplementation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = (function() {
				function XMLDOMImplementation() {}
				XMLDOMImplementation.prototype.hasFeature = function(feature, version) {
					return true;
				};
				XMLDOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId) {
					throw new Error("This DOM method is not implemented.");
				};
				XMLDOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype) {
					throw new Error("This DOM method is not implemented.");
				};
				XMLDOMImplementation.prototype.createHTMLDocument = function(title) {
					throw new Error("This DOM method is not implemented.");
				};
				XMLDOMImplementation.prototype.getFeature = function(feature, version) {
					throw new Error("This DOM method is not implemented.");
				};
				return XMLDOMImplementation;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js
	var require_XMLDOMErrorHandler = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = (function() {
				function XMLDOMErrorHandler() {}
				XMLDOMErrorHandler.prototype.handleError = function(error) {
					throw new Error(error);
				};
				return XMLDOMErrorHandler;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDOMStringList.js
	var require_XMLDOMStringList = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = (function() {
				function XMLDOMStringList(arr) {
					this.arr = arr || [];
				}
				Object.defineProperty(XMLDOMStringList.prototype, "length", { get: function() {
					return this.arr.length;
				} });
				XMLDOMStringList.prototype.item = function(index) {
					return this.arr[index] || null;
				};
				XMLDOMStringList.prototype.contains = function(str) {
					return this.arr.indexOf(str) !== -1;
				};
				return XMLDOMStringList;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDOMConfiguration.js
	var require_XMLDOMConfiguration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var XMLDOMErrorHandler = require_XMLDOMErrorHandler(), XMLDOMStringList = require_XMLDOMStringList();
			module.exports = (function() {
				function XMLDOMConfiguration() {
					this.defaultParams = {
						"canonical-form": false,
						"cdata-sections": false,
						"comments": false,
						"datatype-normalization": false,
						"element-content-whitespace": true,
						"entities": true,
						"error-handler": new XMLDOMErrorHandler(),
						"infoset": true,
						"validate-if-schema": false,
						"namespaces": true,
						"namespace-declarations": true,
						"normalize-characters": false,
						"schema-location": "",
						"schema-type": "",
						"split-cdata-sections": true,
						"validate": false,
						"well-formed": true
					};
					this.params = Object.create(this.defaultParams);
				}
				Object.defineProperty(XMLDOMConfiguration.prototype, "parameterNames", { get: function() {
					return new XMLDOMStringList(Object.keys(this.defaultParams));
				} });
				XMLDOMConfiguration.prototype.getParameter = function(name) {
					if (this.params.hasOwnProperty(name)) return this.params[name];
					else return null;
				};
				XMLDOMConfiguration.prototype.canSetParameter = function(name, value) {
					return true;
				};
				XMLDOMConfiguration.prototype.setParameter = function(name, value) {
					if (value != null) return this.params[name] = value;
					else return delete this.params[name];
				};
				return XMLDOMConfiguration;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/NodeType.js
	var require_NodeType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = {
				Element: 1,
				Attribute: 2,
				Text: 3,
				CData: 4,
				EntityReference: 5,
				EntityDeclaration: 6,
				ProcessingInstruction: 7,
				Comment: 8,
				Document: 9,
				DocType: 10,
				DocumentFragment: 11,
				NotationDeclaration: 12,
				Declaration: 201,
				Raw: 202,
				AttributeDeclaration: 203,
				ElementDeclaration: 204,
				Dummy: 205
			};
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLAttribute.js
	var require_XMLAttribute = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType = require_NodeType();
			require_XMLNode();
			module.exports = (function() {
				function XMLAttribute(parent, name, value) {
					this.parent = parent;
					if (this.parent) {
						this.options = this.parent.options;
						this.stringify = this.parent.stringify;
					}
					if (name == null) throw new Error("Missing attribute name. " + this.debugInfo(name));
					this.name = this.stringify.name(name);
					this.value = this.stringify.attValue(value);
					this.type = NodeType.Attribute;
					this.isId = false;
					this.schemaTypeInfo = null;
				}
				Object.defineProperty(XMLAttribute.prototype, "nodeType", { get: function() {
					return this.type;
				} });
				Object.defineProperty(XMLAttribute.prototype, "ownerElement", { get: function() {
					return this.parent;
				} });
				Object.defineProperty(XMLAttribute.prototype, "textContent", {
					get: function() {
						return this.value;
					},
					set: function(value) {
						return this.value = value || "";
					}
				});
				Object.defineProperty(XMLAttribute.prototype, "namespaceURI", { get: function() {
					return "";
				} });
				Object.defineProperty(XMLAttribute.prototype, "prefix", { get: function() {
					return "";
				} });
				Object.defineProperty(XMLAttribute.prototype, "localName", { get: function() {
					return this.name;
				} });
				Object.defineProperty(XMLAttribute.prototype, "specified", { get: function() {
					return true;
				} });
				XMLAttribute.prototype.clone = function() {
					return Object.create(this);
				};
				XMLAttribute.prototype.toString = function(options) {
					return this.options.writer.attribute(this, this.options.writer.filterOptions(options));
				};
				XMLAttribute.prototype.debugInfo = function(name) {
					name = name || this.name;
					if (name == null) return "parent: <" + this.parent.name + ">";
					else return "attribute: {" + name + "}, parent: <" + this.parent.name + ">";
				};
				XMLAttribute.prototype.isEqualNode = function(node) {
					if (node.namespaceURI !== this.namespaceURI) return false;
					if (node.prefix !== this.prefix) return false;
					if (node.localName !== this.localName) return false;
					if (node.value !== this.value) return false;
					return true;
				};
				return XMLAttribute;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLNamedNodeMap.js
	var require_XMLNamedNodeMap = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = (function() {
				function XMLNamedNodeMap(nodes) {
					this.nodes = nodes;
				}
				Object.defineProperty(XMLNamedNodeMap.prototype, "length", { get: function() {
					return Object.keys(this.nodes).length || 0;
				} });
				XMLNamedNodeMap.prototype.clone = function() {
					return this.nodes = null;
				};
				XMLNamedNodeMap.prototype.getNamedItem = function(name) {
					return this.nodes[name];
				};
				XMLNamedNodeMap.prototype.setNamedItem = function(node) {
					var oldNode = this.nodes[node.nodeName];
					this.nodes[node.nodeName] = node;
					return oldNode || null;
				};
				XMLNamedNodeMap.prototype.removeNamedItem = function(name) {
					var oldNode = this.nodes[name];
					delete this.nodes[name];
					return oldNode || null;
				};
				XMLNamedNodeMap.prototype.item = function(index) {
					return this.nodes[Object.keys(this.nodes)[index]] || null;
				};
				XMLNamedNodeMap.prototype.getNamedItemNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented.");
				};
				XMLNamedNodeMap.prototype.setNamedItemNS = function(node) {
					throw new Error("This DOM method is not implemented.");
				};
				XMLNamedNodeMap.prototype.removeNamedItemNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented.");
				};
				return XMLNamedNodeMap;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLElement.js
	var require_XMLElement = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLAttribute, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			ref = require_Utility(), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			XMLAttribute = require_XMLAttribute();
			XMLNamedNodeMap = require_XMLNamedNodeMap();
			module.exports = (function(superClass) {
				extend(XMLElement, superClass);
				function XMLElement(parent, name, attributes) {
					var child, j, len, ref1;
					XMLElement.__super__.constructor.call(this, parent);
					if (name == null) throw new Error("Missing element name. " + this.debugInfo());
					this.name = this.stringify.name(name);
					this.type = NodeType.Element;
					this.attribs = {};
					this.schemaTypeInfo = null;
					if (attributes != null) this.attribute(attributes);
					if (parent.type === NodeType.Document) {
						this.isRoot = true;
						this.documentObject = parent;
						parent.rootObject = this;
						if (parent.children) {
							ref1 = parent.children;
							for (j = 0, len = ref1.length; j < len; j++) {
								child = ref1[j];
								if (child.type === NodeType.DocType) {
									child.name = this.name;
									break;
								}
							}
						}
					}
				}
				Object.defineProperty(XMLElement.prototype, "tagName", { get: function() {
					return this.name;
				} });
				Object.defineProperty(XMLElement.prototype, "namespaceURI", { get: function() {
					return "";
				} });
				Object.defineProperty(XMLElement.prototype, "prefix", { get: function() {
					return "";
				} });
				Object.defineProperty(XMLElement.prototype, "localName", { get: function() {
					return this.name;
				} });
				Object.defineProperty(XMLElement.prototype, "id", { get: function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				} });
				Object.defineProperty(XMLElement.prototype, "className", { get: function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				} });
				Object.defineProperty(XMLElement.prototype, "classList", { get: function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				} });
				Object.defineProperty(XMLElement.prototype, "attributes", { get: function() {
					if (!this.attributeMap || !this.attributeMap.nodes) this.attributeMap = new XMLNamedNodeMap(this.attribs);
					return this.attributeMap;
				} });
				XMLElement.prototype.clone = function() {
					var att, attName, clonedSelf = Object.create(this), ref1;
					if (clonedSelf.isRoot) clonedSelf.documentObject = null;
					clonedSelf.attribs = {};
					ref1 = this.attribs;
					for (attName in ref1) {
						if (!hasProp.call(ref1, attName)) continue;
						att = ref1[attName];
						clonedSelf.attribs[attName] = att.clone();
					}
					clonedSelf.children = [];
					this.children.forEach(function(child) {
						var clonedChild = child.clone();
						clonedChild.parent = clonedSelf;
						return clonedSelf.children.push(clonedChild);
					});
					return clonedSelf;
				};
				XMLElement.prototype.attribute = function(name, value) {
					var attName, attValue;
					if (name != null) name = getValue(name);
					if (isObject(name)) for (attName in name) {
						if (!hasProp.call(name, attName)) continue;
						attValue = name[attName];
						this.attribute(attName, attValue);
					}
					else {
						if (isFunction(value)) value = value.apply();
						if (this.options.keepNullAttributes && value == null) this.attribs[name] = new XMLAttribute(this, name, "");
						else if (value != null) this.attribs[name] = new XMLAttribute(this, name, value);
					}
					return this;
				};
				XMLElement.prototype.removeAttribute = function(name) {
					var attName, j, len;
					if (name == null) throw new Error("Missing attribute name. " + this.debugInfo());
					name = getValue(name);
					if (Array.isArray(name)) for (j = 0, len = name.length; j < len; j++) {
						attName = name[j];
						delete this.attribs[attName];
					}
					else delete this.attribs[name];
					return this;
				};
				XMLElement.prototype.toString = function(options) {
					return this.options.writer.element(this, this.options.writer.filterOptions(options));
				};
				XMLElement.prototype.att = function(name, value) {
					return this.attribute(name, value);
				};
				XMLElement.prototype.a = function(name, value) {
					return this.attribute(name, value);
				};
				XMLElement.prototype.getAttribute = function(name) {
					if (this.attribs.hasOwnProperty(name)) return this.attribs[name].value;
					else return null;
				};
				XMLElement.prototype.setAttribute = function(name, value) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getAttributeNode = function(name) {
					if (this.attribs.hasOwnProperty(name)) return this.attribs[name];
					else return null;
				};
				XMLElement.prototype.setAttributeNode = function(newAttr) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.removeAttributeNode = function(oldAttr) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getElementsByTagName = function(name) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getAttributeNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.setAttributeNS = function(namespaceURI, qualifiedName, value) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.removeAttributeNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getAttributeNodeNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.setAttributeNodeNS = function(newAttr) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.hasAttribute = function(name) {
					return this.attribs.hasOwnProperty(name);
				};
				XMLElement.prototype.hasAttributeNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.setIdAttribute = function(name, isId) {
					if (this.attribs.hasOwnProperty(name)) return this.attribs[name].isId;
					else return isId;
				};
				XMLElement.prototype.setIdAttributeNS = function(namespaceURI, localName, isId) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.setIdAttributeNode = function(idAttr, isId) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getElementsByTagName = function(tagname) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.getElementsByClassName = function(classNames) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLElement.prototype.isEqualNode = function(node) {
					var i, j, ref1;
					if (!XMLElement.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) return false;
					if (node.namespaceURI !== this.namespaceURI) return false;
					if (node.prefix !== this.prefix) return false;
					if (node.localName !== this.localName) return false;
					if (node.attribs.length !== this.attribs.length) return false;
					for (i = j = 0, ref1 = this.attribs.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) if (!this.attribs[i].isEqualNode(node.attribs[i])) return false;
					return true;
				};
				return XMLElement;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLCharacterData.js
	var require_XMLCharacterData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var XMLNode, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			XMLNode = require_XMLNode();
			module.exports = (function(superClass) {
				extend(XMLCharacterData, superClass);
				function XMLCharacterData(parent) {
					XMLCharacterData.__super__.constructor.call(this, parent);
					this.value = "";
				}
				Object.defineProperty(XMLCharacterData.prototype, "data", {
					get: function() {
						return this.value;
					},
					set: function(value) {
						return this.value = value || "";
					}
				});
				Object.defineProperty(XMLCharacterData.prototype, "length", { get: function() {
					return this.value.length;
				} });
				Object.defineProperty(XMLCharacterData.prototype, "textContent", {
					get: function() {
						return this.value;
					},
					set: function(value) {
						return this.value = value || "";
					}
				});
				XMLCharacterData.prototype.clone = function() {
					return Object.create(this);
				};
				XMLCharacterData.prototype.substringData = function(offset, count) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLCharacterData.prototype.appendData = function(arg) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLCharacterData.prototype.insertData = function(offset, arg) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLCharacterData.prototype.deleteData = function(offset, count) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLCharacterData.prototype.replaceData = function(offset, count, arg) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLCharacterData.prototype.isEqualNode = function(node) {
					if (!XMLCharacterData.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) return false;
					if (node.data !== this.data) return false;
					return true;
				};
				return XMLCharacterData;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLCData.js
	var require_XMLCData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLCharacterData, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			NodeType = require_NodeType();
			XMLCharacterData = require_XMLCharacterData();
			module.exports = (function(superClass) {
				extend(XMLCData, superClass);
				function XMLCData(parent, text) {
					XMLCData.__super__.constructor.call(this, parent);
					if (text == null) throw new Error("Missing CDATA text. " + this.debugInfo());
					this.name = "#cdata-section";
					this.type = NodeType.CData;
					this.value = this.stringify.cdata(text);
				}
				XMLCData.prototype.clone = function() {
					return Object.create(this);
				};
				XMLCData.prototype.toString = function(options) {
					return this.options.writer.cdata(this, this.options.writer.filterOptions(options));
				};
				return XMLCData;
			})(XMLCharacterData);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLComment.js
	var require_XMLComment = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLCharacterData, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			NodeType = require_NodeType();
			XMLCharacterData = require_XMLCharacterData();
			module.exports = (function(superClass) {
				extend(XMLComment, superClass);
				function XMLComment(parent, text) {
					XMLComment.__super__.constructor.call(this, parent);
					if (text == null) throw new Error("Missing comment text. " + this.debugInfo());
					this.name = "#comment";
					this.type = NodeType.Comment;
					this.value = this.stringify.comment(text);
				}
				XMLComment.prototype.clone = function() {
					return Object.create(this);
				};
				XMLComment.prototype.toString = function(options) {
					return this.options.writer.comment(this, this.options.writer.filterOptions(options));
				};
				return XMLComment;
			})(XMLCharacterData);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDeclaration.js
	var require_XMLDeclaration = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, isObject, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			isObject = require_Utility().isObject;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			module.exports = (function(superClass) {
				extend(XMLDeclaration, superClass);
				function XMLDeclaration(parent, version, encoding, standalone) {
					var ref;
					XMLDeclaration.__super__.constructor.call(this, parent);
					if (isObject(version)) ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
					if (!version) version = "1.0";
					this.type = NodeType.Declaration;
					this.version = this.stringify.xmlVersion(version);
					if (encoding != null) this.encoding = this.stringify.xmlEncoding(encoding);
					if (standalone != null) this.standalone = this.stringify.xmlStandalone(standalone);
				}
				XMLDeclaration.prototype.toString = function(options) {
					return this.options.writer.declaration(this, this.options.writer.filterOptions(options));
				};
				return XMLDeclaration;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDTDAttList.js
	var require_XMLDTDAttList = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			module.exports = (function(superClass) {
				extend(XMLDTDAttList, superClass);
				function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
					XMLDTDAttList.__super__.constructor.call(this, parent);
					if (elementName == null) throw new Error("Missing DTD element name. " + this.debugInfo());
					if (attributeName == null) throw new Error("Missing DTD attribute name. " + this.debugInfo(elementName));
					if (!attributeType) throw new Error("Missing DTD attribute type. " + this.debugInfo(elementName));
					if (!defaultValueType) throw new Error("Missing DTD attribute default. " + this.debugInfo(elementName));
					if (defaultValueType.indexOf("#") !== 0) defaultValueType = "#" + defaultValueType;
					if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(elementName));
					if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(elementName));
					this.elementName = this.stringify.name(elementName);
					this.type = NodeType.AttributeDeclaration;
					this.attributeName = this.stringify.name(attributeName);
					this.attributeType = this.stringify.dtdAttType(attributeType);
					if (defaultValue) this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
					this.defaultValueType = defaultValueType;
				}
				XMLDTDAttList.prototype.toString = function(options) {
					return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(options));
				};
				return XMLDTDAttList;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDTDEntity.js
	var require_XMLDTDEntity = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, isObject, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			isObject = require_Utility().isObject;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			module.exports = (function(superClass) {
				extend(XMLDTDEntity, superClass);
				function XMLDTDEntity(parent, pe, name, value) {
					XMLDTDEntity.__super__.constructor.call(this, parent);
					if (name == null) throw new Error("Missing DTD entity name. " + this.debugInfo(name));
					if (value == null) throw new Error("Missing DTD entity value. " + this.debugInfo(name));
					this.pe = !!pe;
					this.name = this.stringify.name(name);
					this.type = NodeType.EntityDeclaration;
					if (!isObject(value)) {
						this.value = this.stringify.dtdEntityValue(value);
						this.internal = true;
					} else {
						if (!value.pubID && !value.sysID) throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(name));
						if (value.pubID && !value.sysID) throw new Error("System identifier is required for a public external entity. " + this.debugInfo(name));
						this.internal = false;
						if (value.pubID != null) this.pubID = this.stringify.dtdPubID(value.pubID);
						if (value.sysID != null) this.sysID = this.stringify.dtdSysID(value.sysID);
						if (value.nData != null) this.nData = this.stringify.dtdNData(value.nData);
						if (this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(name));
					}
				}
				Object.defineProperty(XMLDTDEntity.prototype, "publicId", { get: function() {
					return this.pubID;
				} });
				Object.defineProperty(XMLDTDEntity.prototype, "systemId", { get: function() {
					return this.sysID;
				} });
				Object.defineProperty(XMLDTDEntity.prototype, "notationName", { get: function() {
					return this.nData || null;
				} });
				Object.defineProperty(XMLDTDEntity.prototype, "inputEncoding", { get: function() {
					return null;
				} });
				Object.defineProperty(XMLDTDEntity.prototype, "xmlEncoding", { get: function() {
					return null;
				} });
				Object.defineProperty(XMLDTDEntity.prototype, "xmlVersion", { get: function() {
					return null;
				} });
				XMLDTDEntity.prototype.toString = function(options) {
					return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(options));
				};
				return XMLDTDEntity;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDTDElement.js
	var require_XMLDTDElement = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			module.exports = (function(superClass) {
				extend(XMLDTDElement, superClass);
				function XMLDTDElement(parent, name, value) {
					XMLDTDElement.__super__.constructor.call(this, parent);
					if (name == null) throw new Error("Missing DTD element name. " + this.debugInfo());
					if (!value) value = "(#PCDATA)";
					if (Array.isArray(value)) value = "(" + value.join(",") + ")";
					this.name = this.stringify.name(name);
					this.type = NodeType.ElementDeclaration;
					this.value = this.stringify.dtdElementValue(value);
				}
				XMLDTDElement.prototype.toString = function(options) {
					return this.options.writer.dtdElement(this, this.options.writer.filterOptions(options));
				};
				return XMLDTDElement;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDTDNotation.js
	var require_XMLDTDNotation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			module.exports = (function(superClass) {
				extend(XMLDTDNotation, superClass);
				function XMLDTDNotation(parent, name, value) {
					XMLDTDNotation.__super__.constructor.call(this, parent);
					if (name == null) throw new Error("Missing DTD notation name. " + this.debugInfo(name));
					if (!value.pubID && !value.sysID) throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(name));
					this.name = this.stringify.name(name);
					this.type = NodeType.NotationDeclaration;
					if (value.pubID != null) this.pubID = this.stringify.dtdPubID(value.pubID);
					if (value.sysID != null) this.sysID = this.stringify.dtdSysID(value.sysID);
				}
				Object.defineProperty(XMLDTDNotation.prototype, "publicId", { get: function() {
					return this.pubID;
				} });
				Object.defineProperty(XMLDTDNotation.prototype, "systemId", { get: function() {
					return this.sysID;
				} });
				XMLDTDNotation.prototype.toString = function(options) {
					return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(options));
				};
				return XMLDTDNotation;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDocType.js
	var require_XMLDocType = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLNamedNodeMap, XMLNode, isObject, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			isObject = require_Utility().isObject;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			XMLDTDAttList = require_XMLDTDAttList();
			XMLDTDEntity = require_XMLDTDEntity();
			XMLDTDElement = require_XMLDTDElement();
			XMLDTDNotation = require_XMLDTDNotation();
			XMLNamedNodeMap = require_XMLNamedNodeMap();
			module.exports = (function(superClass) {
				extend(XMLDocType, superClass);
				function XMLDocType(parent, pubID, sysID) {
					var child, i, len, ref, ref1, ref2;
					XMLDocType.__super__.constructor.call(this, parent);
					this.type = NodeType.DocType;
					if (parent.children) {
						ref = parent.children;
						for (i = 0, len = ref.length; i < len; i++) {
							child = ref[i];
							if (child.type === NodeType.Element) {
								this.name = child.name;
								break;
							}
						}
					}
					this.documentObject = parent;
					if (isObject(pubID)) ref1 = pubID, pubID = ref1.pubID, sysID = ref1.sysID;
					if (sysID == null) ref2 = [pubID, sysID], sysID = ref2[0], pubID = ref2[1];
					if (pubID != null) this.pubID = this.stringify.dtdPubID(pubID);
					if (sysID != null) this.sysID = this.stringify.dtdSysID(sysID);
				}
				Object.defineProperty(XMLDocType.prototype, "entities", { get: function() {
					var child, i, len, nodes = {}, ref = this.children;
					for (i = 0, len = ref.length; i < len; i++) {
						child = ref[i];
						if (child.type === NodeType.EntityDeclaration && !child.pe) nodes[child.name] = child;
					}
					return new XMLNamedNodeMap(nodes);
				} });
				Object.defineProperty(XMLDocType.prototype, "notations", { get: function() {
					var child, i, len, nodes = {}, ref = this.children;
					for (i = 0, len = ref.length; i < len; i++) {
						child = ref[i];
						if (child.type === NodeType.NotationDeclaration) nodes[child.name] = child;
					}
					return new XMLNamedNodeMap(nodes);
				} });
				Object.defineProperty(XMLDocType.prototype, "publicId", { get: function() {
					return this.pubID;
				} });
				Object.defineProperty(XMLDocType.prototype, "systemId", { get: function() {
					return this.sysID;
				} });
				Object.defineProperty(XMLDocType.prototype, "internalSubset", { get: function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				} });
				XMLDocType.prototype.element = function(name, value) {
					var child = new XMLDTDElement(this, name, value);
					this.children.push(child);
					return this;
				};
				XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
					var child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
					this.children.push(child);
					return this;
				};
				XMLDocType.prototype.entity = function(name, value) {
					var child = new XMLDTDEntity(this, false, name, value);
					this.children.push(child);
					return this;
				};
				XMLDocType.prototype.pEntity = function(name, value) {
					var child = new XMLDTDEntity(this, true, name, value);
					this.children.push(child);
					return this;
				};
				XMLDocType.prototype.notation = function(name, value) {
					var child = new XMLDTDNotation(this, name, value);
					this.children.push(child);
					return this;
				};
				XMLDocType.prototype.toString = function(options) {
					return this.options.writer.docType(this, this.options.writer.filterOptions(options));
				};
				XMLDocType.prototype.ele = function(name, value) {
					return this.element(name, value);
				};
				XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
					return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
				};
				XMLDocType.prototype.ent = function(name, value) {
					return this.entity(name, value);
				};
				XMLDocType.prototype.pent = function(name, value) {
					return this.pEntity(name, value);
				};
				XMLDocType.prototype.not = function(name, value) {
					return this.notation(name, value);
				};
				XMLDocType.prototype.up = function() {
					return this.root() || this.documentObject;
				};
				XMLDocType.prototype.isEqualNode = function(node) {
					if (!XMLDocType.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) return false;
					if (node.name !== this.name) return false;
					if (node.publicId !== this.publicId) return false;
					if (node.systemId !== this.systemId) return false;
					return true;
				};
				return XMLDocType;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLRaw.js
	var require_XMLRaw = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			NodeType = require_NodeType();
			XMLNode = require_XMLNode();
			module.exports = (function(superClass) {
				extend(XMLRaw, superClass);
				function XMLRaw(parent, text) {
					XMLRaw.__super__.constructor.call(this, parent);
					if (text == null) throw new Error("Missing raw text. " + this.debugInfo());
					this.type = NodeType.Raw;
					this.value = this.stringify.raw(text);
				}
				XMLRaw.prototype.clone = function() {
					return Object.create(this);
				};
				XMLRaw.prototype.toString = function(options) {
					return this.options.writer.raw(this, this.options.writer.filterOptions(options));
				};
				return XMLRaw;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLText.js
	var require_XMLText = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLCharacterData, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			NodeType = require_NodeType();
			XMLCharacterData = require_XMLCharacterData();
			module.exports = (function(superClass) {
				extend(XMLText, superClass);
				function XMLText(parent, text) {
					XMLText.__super__.constructor.call(this, parent);
					if (text == null) throw new Error("Missing element text. " + this.debugInfo());
					this.name = "#text";
					this.type = NodeType.Text;
					this.value = this.stringify.text(text);
				}
				Object.defineProperty(XMLText.prototype, "isElementContentWhitespace", { get: function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				} });
				Object.defineProperty(XMLText.prototype, "wholeText", { get: function() {
					var next, prev, str = "";
					prev = this.previousSibling;
					while (prev) {
						str = prev.data + str;
						prev = prev.previousSibling;
					}
					str += this.data;
					next = this.nextSibling;
					while (next) {
						str = str + next.data;
						next = next.nextSibling;
					}
					return str;
				} });
				XMLText.prototype.clone = function() {
					return Object.create(this);
				};
				XMLText.prototype.toString = function(options) {
					return this.options.writer.text(this, this.options.writer.filterOptions(options));
				};
				XMLText.prototype.splitText = function(offset) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLText.prototype.replaceWholeText = function(content) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				return XMLText;
			})(XMLCharacterData);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLProcessingInstruction.js
	var require_XMLProcessingInstruction = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLCharacterData, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			NodeType = require_NodeType();
			XMLCharacterData = require_XMLCharacterData();
			module.exports = (function(superClass) {
				extend(XMLProcessingInstruction, superClass);
				function XMLProcessingInstruction(parent, target, value) {
					XMLProcessingInstruction.__super__.constructor.call(this, parent);
					if (target == null) throw new Error("Missing instruction target. " + this.debugInfo());
					this.type = NodeType.ProcessingInstruction;
					this.target = this.stringify.insTarget(target);
					this.name = this.target;
					if (value) this.value = this.stringify.insValue(value);
				}
				XMLProcessingInstruction.prototype.clone = function() {
					return Object.create(this);
				};
				XMLProcessingInstruction.prototype.toString = function(options) {
					return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(options));
				};
				XMLProcessingInstruction.prototype.isEqualNode = function(node) {
					if (!XMLProcessingInstruction.__super__.isEqualNode.apply(this, arguments).isEqualNode(node)) return false;
					if (node.target !== this.target) return false;
					return true;
				};
				return XMLProcessingInstruction;
			})(XMLCharacterData);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDummy.js
	var require_XMLDummy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLNode, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			module.exports = (function(superClass) {
				extend(XMLDummy, superClass);
				function XMLDummy(parent) {
					XMLDummy.__super__.constructor.call(this, parent);
					this.type = NodeType.Dummy;
				}
				XMLDummy.prototype.clone = function() {
					return Object.create(this);
				};
				XMLDummy.prototype.toString = function(options) {
					return "";
				};
				return XMLDummy;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLNodeList.js
	var require_XMLNodeList = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = (function() {
				function XMLNodeList(nodes) {
					this.nodes = nodes;
				}
				Object.defineProperty(XMLNodeList.prototype, "length", { get: function() {
					return this.nodes.length || 0;
				} });
				XMLNodeList.prototype.clone = function() {
					return this.nodes = null;
				};
				XMLNodeList.prototype.item = function(index) {
					return this.nodes[index] || null;
				};
				return XMLNodeList;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/DocumentPosition.js
	var require_DocumentPosition = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = {
				Disconnected: 1,
				Preceding: 2,
				Following: 4,
				Contains: 8,
				ContainedBy: 16,
				ImplementationSpecific: 32
			};
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLNode.js
	var require_XMLNode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1, hasProp = {}.hasOwnProperty;
			ref1 = require_Utility(), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
			XMLElement = null;
			XMLCData = null;
			XMLComment = null;
			XMLDeclaration = null;
			XMLDocType = null;
			XMLRaw = null;
			XMLText = null;
			XMLProcessingInstruction = null;
			XMLDummy = null;
			NodeType = null;
			XMLNodeList = null;
			DocumentPosition = null;
			module.exports = (function() {
				function XMLNode(parent1) {
					this.parent = parent1;
					if (this.parent) {
						this.options = this.parent.options;
						this.stringify = this.parent.stringify;
					}
					this.value = null;
					this.children = [];
					this.baseURI = null;
					if (!XMLElement) {
						XMLElement = require_XMLElement();
						XMLCData = require_XMLCData();
						XMLComment = require_XMLComment();
						XMLDeclaration = require_XMLDeclaration();
						XMLDocType = require_XMLDocType();
						XMLRaw = require_XMLRaw();
						XMLText = require_XMLText();
						XMLProcessingInstruction = require_XMLProcessingInstruction();
						XMLDummy = require_XMLDummy();
						NodeType = require_NodeType();
						XMLNodeList = require_XMLNodeList();
						require_XMLNamedNodeMap();
						DocumentPosition = require_DocumentPosition();
					}
				}
				Object.defineProperty(XMLNode.prototype, "nodeName", { get: function() {
					return this.name;
				} });
				Object.defineProperty(XMLNode.prototype, "nodeType", { get: function() {
					return this.type;
				} });
				Object.defineProperty(XMLNode.prototype, "nodeValue", { get: function() {
					return this.value;
				} });
				Object.defineProperty(XMLNode.prototype, "parentNode", { get: function() {
					return this.parent;
				} });
				Object.defineProperty(XMLNode.prototype, "childNodes", { get: function() {
					if (!this.childNodeList || !this.childNodeList.nodes) this.childNodeList = new XMLNodeList(this.children);
					return this.childNodeList;
				} });
				Object.defineProperty(XMLNode.prototype, "firstChild", { get: function() {
					return this.children[0] || null;
				} });
				Object.defineProperty(XMLNode.prototype, "lastChild", { get: function() {
					return this.children[this.children.length - 1] || null;
				} });
				Object.defineProperty(XMLNode.prototype, "previousSibling", { get: function() {
					var i = this.parent.children.indexOf(this);
					return this.parent.children[i - 1] || null;
				} });
				Object.defineProperty(XMLNode.prototype, "nextSibling", { get: function() {
					var i = this.parent.children.indexOf(this);
					return this.parent.children[i + 1] || null;
				} });
				Object.defineProperty(XMLNode.prototype, "ownerDocument", { get: function() {
					return this.document() || null;
				} });
				Object.defineProperty(XMLNode.prototype, "textContent", {
					get: function() {
						var child, j, len, ref2, str;
						if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
							str = "";
							ref2 = this.children;
							for (j = 0, len = ref2.length; j < len; j++) {
								child = ref2[j];
								if (child.textContent) str += child.textContent;
							}
							return str;
						} else return null;
					},
					set: function(value) {
						throw new Error("This DOM method is not implemented." + this.debugInfo());
					}
				});
				XMLNode.prototype.setParent = function(parent) {
					var child, j, len, ref2, results;
					this.parent = parent;
					if (parent) {
						this.options = parent.options;
						this.stringify = parent.stringify;
					}
					ref2 = this.children;
					results = [];
					for (j = 0, len = ref2.length; j < len; j++) {
						child = ref2[j];
						results.push(child.setParent(this));
					}
					return results;
				};
				XMLNode.prototype.element = function(name, attributes, text) {
					var childNode, item, j, k, key, lastChild = null, len, len1, ref2, ref3, val;
					if (attributes === null && text == null) ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
					if (attributes == null) attributes = {};
					attributes = getValue(attributes);
					if (!isObject(attributes)) ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
					if (name != null) name = getValue(name);
					if (Array.isArray(name)) for (j = 0, len = name.length; j < len; j++) {
						item = name[j];
						lastChild = this.element(item);
					}
					else if (isFunction(name)) lastChild = this.element(name.apply());
					else if (isObject(name)) for (key in name) {
						if (!hasProp.call(name, key)) continue;
						val = name[key];
						if (isFunction(val)) val = val.apply();
						if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
						else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) lastChild = this.dummy();
						else if (isObject(val) && isEmpty(val)) lastChild = this.element(key);
						else if (!this.options.keepNullNodes && val == null) lastChild = this.dummy();
						else if (!this.options.separateArrayItems && Array.isArray(val)) for (k = 0, len1 = val.length; k < len1; k++) {
							item = val[k];
							childNode = {};
							childNode[key] = item;
							lastChild = this.element(childNode);
						}
						else if (isObject(val)) if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) lastChild = this.element(val);
						else {
							lastChild = this.element(key);
							lastChild.element(val);
						}
						else lastChild = this.element(key, val);
					}
					else if (!this.options.keepNullNodes && text === null) lastChild = this.dummy();
					else if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) lastChild = this.text(text);
					else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) lastChild = this.cdata(text);
					else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) lastChild = this.comment(text);
					else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) lastChild = this.raw(text);
					else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
					else lastChild = this.node(name, attributes, text);
					if (lastChild == null) throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
					return lastChild;
				};
				XMLNode.prototype.insertBefore = function(name, attributes, text) {
					var child, i, newChild, refChild, removed;
					if (name != null ? name.type : void 0) {
						newChild = name;
						refChild = attributes;
						newChild.setParent(this);
						if (refChild) {
							i = children.indexOf(refChild);
							removed = children.splice(i);
							children.push(newChild);
							Array.prototype.push.apply(children, removed);
						} else children.push(newChild);
						return newChild;
					} else {
						if (this.isRoot) throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
						i = this.parent.children.indexOf(this);
						removed = this.parent.children.splice(i);
						child = this.parent.element(name, attributes, text);
						Array.prototype.push.apply(this.parent.children, removed);
						return child;
					}
				};
				XMLNode.prototype.insertAfter = function(name, attributes, text) {
					var child, i, removed;
					if (this.isRoot) throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
					i = this.parent.children.indexOf(this);
					removed = this.parent.children.splice(i + 1);
					child = this.parent.element(name, attributes, text);
					Array.prototype.push.apply(this.parent.children, removed);
					return child;
				};
				XMLNode.prototype.remove = function() {
					var i;
					if (this.isRoot) throw new Error("Cannot remove the root element. " + this.debugInfo());
					i = this.parent.children.indexOf(this);
					[].splice.apply(this.parent.children, [i, i - i + 1].concat([]));
					return this.parent;
				};
				XMLNode.prototype.node = function(name, attributes, text) {
					var child, ref2;
					if (name != null) name = getValue(name);
					attributes || (attributes = {});
					attributes = getValue(attributes);
					if (!isObject(attributes)) ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
					child = new XMLElement(this, name, attributes);
					if (text != null) child.text(text);
					this.children.push(child);
					return child;
				};
				XMLNode.prototype.text = function(value) {
					var child;
					if (isObject(value)) this.element(value);
					child = new XMLText(this, value);
					this.children.push(child);
					return this;
				};
				XMLNode.prototype.cdata = function(value) {
					var child = new XMLCData(this, value);
					this.children.push(child);
					return this;
				};
				XMLNode.prototype.comment = function(value) {
					var child = new XMLComment(this, value);
					this.children.push(child);
					return this;
				};
				XMLNode.prototype.commentBefore = function(value) {
					var i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i);
					this.parent.comment(value);
					Array.prototype.push.apply(this.parent.children, removed);
					return this;
				};
				XMLNode.prototype.commentAfter = function(value) {
					var i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1);
					this.parent.comment(value);
					Array.prototype.push.apply(this.parent.children, removed);
					return this;
				};
				XMLNode.prototype.raw = function(value) {
					var child = new XMLRaw(this, value);
					this.children.push(child);
					return this;
				};
				XMLNode.prototype.dummy = function() {
					return new XMLDummy(this);
				};
				XMLNode.prototype.instruction = function(target, value) {
					var insTarget, insValue, instruction, j, len;
					if (target != null) target = getValue(target);
					if (value != null) value = getValue(value);
					if (Array.isArray(target)) for (j = 0, len = target.length; j < len; j++) {
						insTarget = target[j];
						this.instruction(insTarget);
					}
					else if (isObject(target)) for (insTarget in target) {
						if (!hasProp.call(target, insTarget)) continue;
						insValue = target[insTarget];
						this.instruction(insTarget, insValue);
					}
					else {
						if (isFunction(value)) value = value.apply();
						instruction = new XMLProcessingInstruction(this, target, value);
						this.children.push(instruction);
					}
					return this;
				};
				XMLNode.prototype.instructionBefore = function(target, value) {
					var i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i);
					this.parent.instruction(target, value);
					Array.prototype.push.apply(this.parent.children, removed);
					return this;
				};
				XMLNode.prototype.instructionAfter = function(target, value) {
					var i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1);
					this.parent.instruction(target, value);
					Array.prototype.push.apply(this.parent.children, removed);
					return this;
				};
				XMLNode.prototype.declaration = function(version, encoding, standalone) {
					var doc = this.document(), xmldec = new XMLDeclaration(doc, version, encoding, standalone);
					if (doc.children.length === 0) doc.children.unshift(xmldec);
					else if (doc.children[0].type === NodeType.Declaration) doc.children[0] = xmldec;
					else doc.children.unshift(xmldec);
					return doc.root() || doc;
				};
				XMLNode.prototype.dtd = function(pubID, sysID) {
					var child, doc = this.document(), doctype = new XMLDocType(doc, pubID, sysID), i, j, k, len, len1, ref2 = doc.children, ref3;
					for (i = j = 0, len = ref2.length; j < len; i = ++j) {
						child = ref2[i];
						if (child.type === NodeType.DocType) {
							doc.children[i] = doctype;
							return doctype;
						}
					}
					ref3 = doc.children;
					for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
						child = ref3[i];
						if (child.isRoot) {
							doc.children.splice(i, 0, doctype);
							return doctype;
						}
					}
					doc.children.push(doctype);
					return doctype;
				};
				XMLNode.prototype.up = function() {
					if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
					return this.parent;
				};
				XMLNode.prototype.root = function() {
					var node = this;
					while (node) if (node.type === NodeType.Document) return node.rootObject;
					else if (node.isRoot) return node;
					else node = node.parent;
				};
				XMLNode.prototype.document = function() {
					var node = this;
					while (node) if (node.type === NodeType.Document) return node;
					else node = node.parent;
				};
				XMLNode.prototype.end = function(options) {
					return this.document().end(options);
				};
				XMLNode.prototype.prev = function() {
					var i = this.parent.children.indexOf(this);
					if (i < 1) throw new Error("Already at the first node. " + this.debugInfo());
					return this.parent.children[i - 1];
				};
				XMLNode.prototype.next = function() {
					var i = this.parent.children.indexOf(this);
					if (i === -1 || i === this.parent.children.length - 1) throw new Error("Already at the last node. " + this.debugInfo());
					return this.parent.children[i + 1];
				};
				XMLNode.prototype.importDocument = function(doc) {
					var clonedRoot = doc.root().clone();
					clonedRoot.parent = this;
					clonedRoot.isRoot = false;
					this.children.push(clonedRoot);
					return this;
				};
				XMLNode.prototype.debugInfo = function(name) {
					var ref2, ref3;
					name = name || this.name;
					if (name == null && !((ref2 = this.parent) != null ? ref2.name : void 0)) return "";
					else if (name == null) return "parent: <" + this.parent.name + ">";
					else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) return "node: <" + name + ">";
					else return "node: <" + name + ">, parent: <" + this.parent.name + ">";
				};
				XMLNode.prototype.ele = function(name, attributes, text) {
					return this.element(name, attributes, text);
				};
				XMLNode.prototype.nod = function(name, attributes, text) {
					return this.node(name, attributes, text);
				};
				XMLNode.prototype.txt = function(value) {
					return this.text(value);
				};
				XMLNode.prototype.dat = function(value) {
					return this.cdata(value);
				};
				XMLNode.prototype.com = function(value) {
					return this.comment(value);
				};
				XMLNode.prototype.ins = function(target, value) {
					return this.instruction(target, value);
				};
				XMLNode.prototype.doc = function() {
					return this.document();
				};
				XMLNode.prototype.dec = function(version, encoding, standalone) {
					return this.declaration(version, encoding, standalone);
				};
				XMLNode.prototype.e = function(name, attributes, text) {
					return this.element(name, attributes, text);
				};
				XMLNode.prototype.n = function(name, attributes, text) {
					return this.node(name, attributes, text);
				};
				XMLNode.prototype.t = function(value) {
					return this.text(value);
				};
				XMLNode.prototype.d = function(value) {
					return this.cdata(value);
				};
				XMLNode.prototype.c = function(value) {
					return this.comment(value);
				};
				XMLNode.prototype.r = function(value) {
					return this.raw(value);
				};
				XMLNode.prototype.i = function(target, value) {
					return this.instruction(target, value);
				};
				XMLNode.prototype.u = function() {
					return this.up();
				};
				XMLNode.prototype.importXMLBuilder = function(doc) {
					return this.importDocument(doc);
				};
				XMLNode.prototype.replaceChild = function(newChild, oldChild) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.removeChild = function(oldChild) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.appendChild = function(newChild) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.hasChildNodes = function() {
					return this.children.length !== 0;
				};
				XMLNode.prototype.cloneNode = function(deep) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.normalize = function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.isSupported = function(feature, version) {
					return true;
				};
				XMLNode.prototype.hasAttributes = function() {
					return this.attribs.length !== 0;
				};
				XMLNode.prototype.compareDocumentPosition = function(other) {
					var ref = this, res;
					if (ref === other) return 0;
					else if (this.document() !== other.document()) {
						res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
						if (Math.random() < .5) res |= DocumentPosition.Preceding;
						else res |= DocumentPosition.Following;
						return res;
					} else if (ref.isAncestor(other)) return DocumentPosition.Contains | DocumentPosition.Preceding;
					else if (ref.isDescendant(other)) return DocumentPosition.Contains | DocumentPosition.Following;
					else if (ref.isPreceding(other)) return DocumentPosition.Preceding;
					else return DocumentPosition.Following;
				};
				XMLNode.prototype.isSameNode = function(other) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.lookupPrefix = function(namespaceURI) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.isDefaultNamespace = function(namespaceURI) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.lookupNamespaceURI = function(prefix) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.isEqualNode = function(node) {
					var i, j, ref2;
					if (node.nodeType !== this.nodeType) return false;
					if (node.children.length !== this.children.length) return false;
					for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) if (!this.children[i].isEqualNode(node.children[i])) return false;
					return true;
				};
				XMLNode.prototype.getFeature = function(feature, version) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.setUserData = function(key, data, handler) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.getUserData = function(key) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLNode.prototype.contains = function(other) {
					if (!other) return false;
					return other === this || this.isDescendant(other);
				};
				XMLNode.prototype.isDescendant = function(node) {
					var child, isDescendantChild, j, len, ref2 = this.children;
					for (j = 0, len = ref2.length; j < len; j++) {
						child = ref2[j];
						if (node === child) return true;
						isDescendantChild = child.isDescendant(node);
						if (isDescendantChild) return true;
					}
					return false;
				};
				XMLNode.prototype.isAncestor = function(node) {
					return node.isDescendant(this);
				};
				XMLNode.prototype.isPreceding = function(node) {
					var nodePos = this.treePosition(node), thisPos = this.treePosition(this);
					if (nodePos === -1 || thisPos === -1) return false;
					else return nodePos < thisPos;
				};
				XMLNode.prototype.isFollowing = function(node) {
					var nodePos = this.treePosition(node), thisPos = this.treePosition(this);
					if (nodePos === -1 || thisPos === -1) return false;
					else return nodePos > thisPos;
				};
				XMLNode.prototype.treePosition = function(node) {
					var found, pos = 0;
					found = false;
					this.foreachTreeNode(this.document(), function(childNode) {
						pos++;
						if (!found && childNode === node) return found = true;
					});
					if (found) return pos;
					else return -1;
				};
				XMLNode.prototype.foreachTreeNode = function(node, func) {
					var child, j, len, ref2, res;
					node || (node = this.document());
					ref2 = node.children;
					for (j = 0, len = ref2.length; j < len; j++) {
						child = ref2[j];
						if (res = func(child)) return res;
						else {
							res = this.foreachTreeNode(child, func);
							if (res) return res;
						}
					}
				};
				return XMLNode;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLStringifier.js
	var require_XMLStringifier = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var bind = function(fn, me) {
				return function() {
					return fn.apply(me, arguments);
				};
			}, hasProp = {}.hasOwnProperty;
			module.exports = (function() {
				function XMLStringifier(options) {
					this.assertLegalName = bind(this.assertLegalName, this);
					this.assertLegalChar = bind(this.assertLegalChar, this);
					var key, ref, value;
					options || (options = {});
					this.options = options;
					if (!this.options.version) this.options.version = "1.0";
					ref = options.stringify || {};
					for (key in ref) {
						if (!hasProp.call(ref, key)) continue;
						value = ref[key];
						this[key] = value;
					}
				}
				XMLStringifier.prototype.name = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalName("" + val || "");
				};
				XMLStringifier.prototype.text = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar(this.textEscape("" + val || ""));
				};
				XMLStringifier.prototype.cdata = function(val) {
					if (this.options.noValidation) return val;
					val = "" + val || "";
					val = val.replace("]]>", "]]]]><![CDATA[>");
					return this.assertLegalChar(val);
				};
				XMLStringifier.prototype.comment = function(val) {
					if (this.options.noValidation) return val;
					val = "" + val || "";
					if (val.match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + val);
					return this.assertLegalChar(val);
				};
				XMLStringifier.prototype.raw = function(val) {
					if (this.options.noValidation) return val;
					return "" + val || "";
				};
				XMLStringifier.prototype.attValue = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar(this.attEscape(val = "" + val || ""));
				};
				XMLStringifier.prototype.insTarget = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.insValue = function(val) {
					if (this.options.noValidation) return val;
					val = "" + val || "";
					if (val.match(/\?>/)) throw new Error("Invalid processing instruction value: " + val);
					return this.assertLegalChar(val);
				};
				XMLStringifier.prototype.xmlVersion = function(val) {
					if (this.options.noValidation) return val;
					val = "" + val || "";
					if (!val.match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + val);
					return val;
				};
				XMLStringifier.prototype.xmlEncoding = function(val) {
					if (this.options.noValidation) return val;
					val = "" + val || "";
					if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) throw new Error("Invalid encoding: " + val);
					return this.assertLegalChar(val);
				};
				XMLStringifier.prototype.xmlStandalone = function(val) {
					if (this.options.noValidation) return val;
					if (val) return "yes";
					else return "no";
				};
				XMLStringifier.prototype.dtdPubID = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.dtdSysID = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.dtdElementValue = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.dtdAttType = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.dtdAttDefault = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.dtdEntityValue = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.dtdNData = function(val) {
					if (this.options.noValidation) return val;
					return this.assertLegalChar("" + val || "");
				};
				XMLStringifier.prototype.convertAttKey = "@";
				XMLStringifier.prototype.convertPIKey = "?";
				XMLStringifier.prototype.convertTextKey = "#text";
				XMLStringifier.prototype.convertCDataKey = "#cdata";
				XMLStringifier.prototype.convertCommentKey = "#comment";
				XMLStringifier.prototype.convertRawKey = "#raw";
				XMLStringifier.prototype.assertLegalChar = function(str) {
					var regex, res;
					if (this.options.noValidation) return str;
					regex = "";
					if (this.options.version === "1.0") {
						regex = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
						if (res = str.match(regex)) throw new Error("Invalid character in string: " + str + " at index " + res.index);
					} else if (this.options.version === "1.1") {
						regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
						if (res = str.match(regex)) throw new Error("Invalid character in string: " + str + " at index " + res.index);
					}
					return str;
				};
				XMLStringifier.prototype.assertLegalName = function(str) {
					var regex;
					if (this.options.noValidation) return str;
					this.assertLegalChar(str);
					regex = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;
					if (!str.match(regex)) throw new Error("Invalid character in name");
					return str;
				};
				XMLStringifier.prototype.textEscape = function(str) {
					var ampregex;
					if (this.options.noValidation) return str;
					ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
					return str.replace(ampregex, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;");
				};
				XMLStringifier.prototype.attEscape = function(str) {
					var ampregex;
					if (this.options.noValidation) return str;
					ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
					return str.replace(ampregex, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;");
				};
				return XMLStringifier;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/WriterState.js
	var require_WriterState = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			module.exports = {
				None: 0,
				OpenTag: 1,
				InsideTag: 2,
				CloseTag: 3
			};
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLWriterBase.js
	var require_XMLWriterBase = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, WriterState, assign, hasProp = {}.hasOwnProperty;
			assign = require_Utility().assign;
			NodeType = require_NodeType();
			require_XMLDeclaration();
			require_XMLDocType();
			require_XMLCData();
			require_XMLComment();
			require_XMLElement();
			require_XMLRaw();
			require_XMLText();
			require_XMLProcessingInstruction();
			require_XMLDummy();
			require_XMLDTDAttList();
			require_XMLDTDElement();
			require_XMLDTDEntity();
			require_XMLDTDNotation();
			WriterState = require_WriterState();
			module.exports = (function() {
				function XMLWriterBase(options) {
					var key, ref, value;
					options || (options = {});
					this.options = options;
					ref = options.writer || {};
					for (key in ref) {
						if (!hasProp.call(ref, key)) continue;
						value = ref[key];
						this["_" + key] = this[key];
						this[key] = value;
					}
				}
				XMLWriterBase.prototype.filterOptions = function(options) {
					var filteredOptions, ref, ref1, ref2, ref3, ref4, ref5, ref6;
					options || (options = {});
					options = assign({}, this.options, options);
					filteredOptions = { writer: this };
					filteredOptions.pretty = options.pretty || false;
					filteredOptions.allowEmpty = options.allowEmpty || false;
					filteredOptions.indent = (ref = options.indent) != null ? ref : "  ";
					filteredOptions.newline = (ref1 = options.newline) != null ? ref1 : "\n";
					filteredOptions.offset = (ref2 = options.offset) != null ? ref2 : 0;
					filteredOptions.dontPrettyTextNodes = (ref3 = (ref4 = options.dontPrettyTextNodes) != null ? ref4 : options.dontprettytextnodes) != null ? ref3 : 0;
					filteredOptions.spaceBeforeSlash = (ref5 = (ref6 = options.spaceBeforeSlash) != null ? ref6 : options.spacebeforeslash) != null ? ref5 : "";
					if (filteredOptions.spaceBeforeSlash === true) filteredOptions.spaceBeforeSlash = " ";
					filteredOptions.suppressPrettyCount = 0;
					filteredOptions.user = {};
					filteredOptions.state = WriterState.None;
					return filteredOptions;
				};
				XMLWriterBase.prototype.indent = function(node, options, level) {
					var indentLevel;
					if (!options.pretty || options.suppressPrettyCount) return "";
					else if (options.pretty) {
						indentLevel = (level || 0) + options.offset + 1;
						if (indentLevel > 0) return new Array(indentLevel).join(options.indent);
					}
					return "";
				};
				XMLWriterBase.prototype.endline = function(node, options, level) {
					if (!options.pretty || options.suppressPrettyCount) return "";
					else return options.newline;
				};
				XMLWriterBase.prototype.attribute = function(att, options, level) {
					var r;
					this.openAttribute(att, options, level);
					r = " " + att.name + "=\"" + att.value + "\"";
					this.closeAttribute(att, options, level);
					return r;
				};
				XMLWriterBase.prototype.cdata = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<![CDATA[";
					options.state = WriterState.InsideTag;
					r += node.value;
					options.state = WriterState.CloseTag;
					r += "]]>" + this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.comment = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<!-- ";
					options.state = WriterState.InsideTag;
					r += node.value;
					options.state = WriterState.CloseTag;
					r += " -->" + this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.declaration = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<?xml";
					options.state = WriterState.InsideTag;
					r += " version=\"" + node.version + "\"";
					if (node.encoding != null) r += " encoding=\"" + node.encoding + "\"";
					if (node.standalone != null) r += " standalone=\"" + node.standalone + "\"";
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + "?>";
					r += this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.docType = function(node, options, level) {
					var child, i, len, r, ref;
					level || (level = 0);
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level);
					r += "<!DOCTYPE " + node.root().name;
					if (node.pubID && node.sysID) r += " PUBLIC \"" + node.pubID + "\" \"" + node.sysID + "\"";
					else if (node.sysID) r += " SYSTEM \"" + node.sysID + "\"";
					if (node.children.length > 0) {
						r += " [";
						r += this.endline(node, options, level);
						options.state = WriterState.InsideTag;
						ref = node.children;
						for (i = 0, len = ref.length; i < len; i++) {
							child = ref[i];
							r += this.writeChildNode(child, options, level + 1);
						}
						options.state = WriterState.CloseTag;
						r += "]";
					}
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + ">";
					r += this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.element = function(node, options, level) {
					var att, child, childNodeCount, firstChildNode, i, j, len, len1, name, prettySuppressed, r, ref, ref1, ref2;
					level || (level = 0);
					prettySuppressed = false;
					r = "";
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r += this.indent(node, options, level) + "<" + node.name;
					ref = node.attribs;
					for (name in ref) {
						if (!hasProp.call(ref, name)) continue;
						att = ref[name];
						r += this.attribute(att, options, level);
					}
					childNodeCount = node.children.length;
					firstChildNode = childNodeCount === 0 ? null : node.children[0];
					if (childNodeCount === 0 || node.children.every(function(e) {
						return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === "";
					})) if (options.allowEmpty) {
						r += ">";
						options.state = WriterState.CloseTag;
						r += "</" + node.name + ">" + this.endline(node, options, level);
					} else {
						options.state = WriterState.CloseTag;
						r += options.spaceBeforeSlash + "/>" + this.endline(node, options, level);
					}
					else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && firstChildNode.value != null) {
						r += ">";
						options.state = WriterState.InsideTag;
						options.suppressPrettyCount++;
						prettySuppressed = true;
						r += this.writeChildNode(firstChildNode, options, level + 1);
						options.suppressPrettyCount--;
						prettySuppressed = false;
						options.state = WriterState.CloseTag;
						r += "</" + node.name + ">" + this.endline(node, options, level);
					} else {
						if (options.dontPrettyTextNodes) {
							ref1 = node.children;
							for (i = 0, len = ref1.length; i < len; i++) {
								child = ref1[i];
								if ((child.type === NodeType.Text || child.type === NodeType.Raw) && child.value != null) {
									options.suppressPrettyCount++;
									prettySuppressed = true;
									break;
								}
							}
						}
						r += ">" + this.endline(node, options, level);
						options.state = WriterState.InsideTag;
						ref2 = node.children;
						for (j = 0, len1 = ref2.length; j < len1; j++) {
							child = ref2[j];
							r += this.writeChildNode(child, options, level + 1);
						}
						options.state = WriterState.CloseTag;
						r += this.indent(node, options, level) + "</" + node.name + ">";
						if (prettySuppressed) options.suppressPrettyCount--;
						r += this.endline(node, options, level);
						options.state = WriterState.None;
					}
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.writeChildNode = function(node, options, level) {
					switch (node.type) {
						case NodeType.CData: return this.cdata(node, options, level);
						case NodeType.Comment: return this.comment(node, options, level);
						case NodeType.Element: return this.element(node, options, level);
						case NodeType.Raw: return this.raw(node, options, level);
						case NodeType.Text: return this.text(node, options, level);
						case NodeType.ProcessingInstruction: return this.processingInstruction(node, options, level);
						case NodeType.Dummy: return "";
						case NodeType.Declaration: return this.declaration(node, options, level);
						case NodeType.DocType: return this.docType(node, options, level);
						case NodeType.AttributeDeclaration: return this.dtdAttList(node, options, level);
						case NodeType.ElementDeclaration: return this.dtdElement(node, options, level);
						case NodeType.EntityDeclaration: return this.dtdEntity(node, options, level);
						case NodeType.NotationDeclaration: return this.dtdNotation(node, options, level);
						default: throw new Error("Unknown XML node type: " + node.constructor.name);
					}
				};
				XMLWriterBase.prototype.processingInstruction = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<?";
					options.state = WriterState.InsideTag;
					r += node.target;
					if (node.value) r += " " + node.value;
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + "?>";
					r += this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.raw = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level);
					options.state = WriterState.InsideTag;
					r += node.value;
					options.state = WriterState.CloseTag;
					r += this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.text = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level);
					options.state = WriterState.InsideTag;
					r += node.value;
					options.state = WriterState.CloseTag;
					r += this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.dtdAttList = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<!ATTLIST";
					options.state = WriterState.InsideTag;
					r += " " + node.elementName + " " + node.attributeName + " " + node.attributeType;
					if (node.defaultValueType !== "#DEFAULT") r += " " + node.defaultValueType;
					if (node.defaultValue) r += " \"" + node.defaultValue + "\"";
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.dtdElement = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<!ELEMENT";
					options.state = WriterState.InsideTag;
					r += " " + node.name + " " + node.value;
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.dtdEntity = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<!ENTITY";
					options.state = WriterState.InsideTag;
					if (node.pe) r += " %";
					r += " " + node.name;
					if (node.value) r += " \"" + node.value + "\"";
					else {
						if (node.pubID && node.sysID) r += " PUBLIC \"" + node.pubID + "\" \"" + node.sysID + "\"";
						else if (node.sysID) r += " SYSTEM \"" + node.sysID + "\"";
						if (node.nData) r += " NDATA " + node.nData;
					}
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.dtdNotation = function(node, options, level) {
					var r;
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					r = this.indent(node, options, level) + "<!NOTATION";
					options.state = WriterState.InsideTag;
					r += " " + node.name;
					if (node.pubID && node.sysID) r += " PUBLIC \"" + node.pubID + "\" \"" + node.sysID + "\"";
					else if (node.pubID) r += " PUBLIC \"" + node.pubID + "\"";
					else if (node.sysID) r += " SYSTEM \"" + node.sysID + "\"";
					options.state = WriterState.CloseTag;
					r += options.spaceBeforeSlash + ">" + this.endline(node, options, level);
					options.state = WriterState.None;
					this.closeNode(node, options, level);
					return r;
				};
				XMLWriterBase.prototype.openNode = function(node, options, level) {};
				XMLWriterBase.prototype.closeNode = function(node, options, level) {};
				XMLWriterBase.prototype.openAttribute = function(att, options, level) {};
				XMLWriterBase.prototype.closeAttribute = function(att, options, level) {};
				return XMLWriterBase;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLStringWriter.js
	var require_XMLStringWriter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var XMLWriterBase, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			XMLWriterBase = require_XMLWriterBase();
			module.exports = (function(superClass) {
				extend(XMLStringWriter, superClass);
				function XMLStringWriter(options) {
					XMLStringWriter.__super__.constructor.call(this, options);
				}
				XMLStringWriter.prototype.document = function(doc, options) {
					var child, i, len, r, ref;
					options = this.filterOptions(options);
					r = "";
					ref = doc.children;
					for (i = 0, len = ref.length; i < len; i++) {
						child = ref[i];
						r += this.writeChildNode(child, options, 0);
					}
					if (options.pretty && r.slice(-options.newline.length) === options.newline) r = r.slice(0, -options.newline.length);
					return r;
				};
				return XMLStringWriter;
			})(XMLWriterBase);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDocument.js
	var require_XMLDocument = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, XMLDOMConfiguration, XMLDOMImplementation, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			isPlainObject = require_Utility().isPlainObject;
			XMLDOMImplementation = require_XMLDOMImplementation();
			XMLDOMConfiguration = require_XMLDOMConfiguration();
			XMLNode = require_XMLNode();
			NodeType = require_NodeType();
			XMLStringifier = require_XMLStringifier();
			XMLStringWriter = require_XMLStringWriter();
			module.exports = (function(superClass) {
				extend(XMLDocument, superClass);
				function XMLDocument(options) {
					XMLDocument.__super__.constructor.call(this, null);
					this.name = "#document";
					this.type = NodeType.Document;
					this.documentURI = null;
					this.domConfig = new XMLDOMConfiguration();
					options || (options = {});
					if (!options.writer) options.writer = new XMLStringWriter();
					this.options = options;
					this.stringify = new XMLStringifier(options);
				}
				Object.defineProperty(XMLDocument.prototype, "implementation", { value: new XMLDOMImplementation() });
				Object.defineProperty(XMLDocument.prototype, "doctype", { get: function() {
					var child, i, len, ref = this.children;
					for (i = 0, len = ref.length; i < len; i++) {
						child = ref[i];
						if (child.type === NodeType.DocType) return child;
					}
					return null;
				} });
				Object.defineProperty(XMLDocument.prototype, "documentElement", { get: function() {
					return this.rootObject || null;
				} });
				Object.defineProperty(XMLDocument.prototype, "inputEncoding", { get: function() {
					return null;
				} });
				Object.defineProperty(XMLDocument.prototype, "strictErrorChecking", { get: function() {
					return false;
				} });
				Object.defineProperty(XMLDocument.prototype, "xmlEncoding", { get: function() {
					if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) return this.children[0].encoding;
					else return null;
				} });
				Object.defineProperty(XMLDocument.prototype, "xmlStandalone", { get: function() {
					if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) return this.children[0].standalone === "yes";
					else return false;
				} });
				Object.defineProperty(XMLDocument.prototype, "xmlVersion", { get: function() {
					if (this.children.length !== 0 && this.children[0].type === NodeType.Declaration) return this.children[0].version;
					else return "1.0";
				} });
				Object.defineProperty(XMLDocument.prototype, "URL", { get: function() {
					return this.documentURI;
				} });
				Object.defineProperty(XMLDocument.prototype, "origin", { get: function() {
					return null;
				} });
				Object.defineProperty(XMLDocument.prototype, "compatMode", { get: function() {
					return null;
				} });
				Object.defineProperty(XMLDocument.prototype, "characterSet", { get: function() {
					return null;
				} });
				Object.defineProperty(XMLDocument.prototype, "contentType", { get: function() {
					return null;
				} });
				XMLDocument.prototype.end = function(writer) {
					var writerOptions = {};
					if (!writer) writer = this.options.writer;
					else if (isPlainObject(writer)) {
						writerOptions = writer;
						writer = this.options.writer;
					}
					return writer.document(this, writer.filterOptions(writerOptions));
				};
				XMLDocument.prototype.toString = function(options) {
					return this.options.writer.document(this, this.options.writer.filterOptions(options));
				};
				XMLDocument.prototype.createElement = function(tagName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createDocumentFragment = function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createTextNode = function(data) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createComment = function(data) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createCDATASection = function(data) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createProcessingInstruction = function(target, data) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createAttribute = function(name) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createEntityReference = function(name) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.getElementsByTagName = function(tagname) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.importNode = function(importedNode, deep) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createElementNS = function(namespaceURI, qualifiedName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createAttributeNS = function(namespaceURI, qualifiedName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.getElementsByTagNameNS = function(namespaceURI, localName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.getElementById = function(elementId) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.adoptNode = function(source) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.normalizeDocument = function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.renameNode = function(node, namespaceURI, qualifiedName) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.getElementsByClassName = function(classNames) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createEvent = function(eventInterface) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createRange = function() {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createNodeIterator = function(root, whatToShow, filter) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				XMLDocument.prototype.createTreeWalker = function(root, whatToShow, filter) {
					throw new Error("This DOM method is not implemented." + this.debugInfo());
				};
				return XMLDocument;
			})(XMLNode);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLDocumentCB.js
	var require_XMLDocumentCB = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, WriterState, XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocument, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, getValue, isFunction, isObject, isPlainObject, ref, hasProp = {}.hasOwnProperty;
			ref = require_Utility(), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject, getValue = ref.getValue;
			NodeType = require_NodeType();
			XMLDocument = require_XMLDocument();
			XMLElement = require_XMLElement();
			XMLCData = require_XMLCData();
			XMLComment = require_XMLComment();
			XMLRaw = require_XMLRaw();
			XMLText = require_XMLText();
			XMLProcessingInstruction = require_XMLProcessingInstruction();
			XMLDeclaration = require_XMLDeclaration();
			XMLDocType = require_XMLDocType();
			XMLDTDAttList = require_XMLDTDAttList();
			XMLDTDEntity = require_XMLDTDEntity();
			XMLDTDElement = require_XMLDTDElement();
			XMLDTDNotation = require_XMLDTDNotation();
			XMLAttribute = require_XMLAttribute();
			XMLStringifier = require_XMLStringifier();
			XMLStringWriter = require_XMLStringWriter();
			WriterState = require_WriterState();
			module.exports = (function() {
				function XMLDocumentCB(options, onData, onEnd) {
					var writerOptions;
					this.name = "?xml";
					this.type = NodeType.Document;
					options || (options = {});
					writerOptions = {};
					if (!options.writer) options.writer = new XMLStringWriter();
					else if (isPlainObject(options.writer)) {
						writerOptions = options.writer;
						options.writer = new XMLStringWriter();
					}
					this.options = options;
					this.writer = options.writer;
					this.writerOptions = this.writer.filterOptions(writerOptions);
					this.stringify = new XMLStringifier(options);
					this.onDataCallback = onData || function() {};
					this.onEndCallback = onEnd || function() {};
					this.currentNode = null;
					this.currentLevel = -1;
					this.openTags = {};
					this.documentStarted = false;
					this.documentCompleted = false;
					this.root = null;
				}
				XMLDocumentCB.prototype.createChildNode = function(node) {
					var att, attName, attributes, child, i, len, ref1, ref2;
					switch (node.type) {
						case NodeType.CData:
							this.cdata(node.value);
							break;
						case NodeType.Comment:
							this.comment(node.value);
							break;
						case NodeType.Element:
							attributes = {};
							ref1 = node.attribs;
							for (attName in ref1) {
								if (!hasProp.call(ref1, attName)) continue;
								att = ref1[attName];
								attributes[attName] = att.value;
							}
							this.node(node.name, attributes);
							break;
						case NodeType.Dummy:
							this.dummy();
							break;
						case NodeType.Raw:
							this.raw(node.value);
							break;
						case NodeType.Text:
							this.text(node.value);
							break;
						case NodeType.ProcessingInstruction:
							this.instruction(node.target, node.value);
							break;
						default: throw new Error("This XML node type is not supported in a JS object: " + node.constructor.name);
					}
					ref2 = node.children;
					for (i = 0, len = ref2.length; i < len; i++) {
						child = ref2[i];
						this.createChildNode(child);
						if (child.type === NodeType.Element) this.up();
					}
					return this;
				};
				XMLDocumentCB.prototype.dummy = function() {
					return this;
				};
				XMLDocumentCB.prototype.node = function(name, attributes, text) {
					var ref1;
					if (name == null) throw new Error("Missing node name.");
					if (this.root && this.currentLevel === -1) throw new Error("Document can only have one root node. " + this.debugInfo(name));
					this.openCurrent();
					name = getValue(name);
					if (attributes == null) attributes = {};
					attributes = getValue(attributes);
					if (!isObject(attributes)) ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
					this.currentNode = new XMLElement(this, name, attributes);
					this.currentNode.children = false;
					this.currentLevel++;
					this.openTags[this.currentLevel] = this.currentNode;
					if (text != null) this.text(text);
					return this;
				};
				XMLDocumentCB.prototype.element = function(name, attributes, text) {
					var child, i, len, oldValidationFlag, ref1, root;
					if (this.currentNode && this.currentNode.type === NodeType.DocType) this.dtdElement.apply(this, arguments);
					else if (Array.isArray(name) || isObject(name) || isFunction(name)) {
						oldValidationFlag = this.options.noValidation;
						this.options.noValidation = true;
						root = new XMLDocument(this.options).element("TEMP_ROOT");
						root.element(name);
						this.options.noValidation = oldValidationFlag;
						ref1 = root.children;
						for (i = 0, len = ref1.length; i < len; i++) {
							child = ref1[i];
							this.createChildNode(child);
							if (child.type === NodeType.Element) this.up();
						}
					} else this.node(name, attributes, text);
					return this;
				};
				XMLDocumentCB.prototype.attribute = function(name, value) {
					var attName, attValue;
					if (!this.currentNode || this.currentNode.children) throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(name));
					if (name != null) name = getValue(name);
					if (isObject(name)) for (attName in name) {
						if (!hasProp.call(name, attName)) continue;
						attValue = name[attName];
						this.attribute(attName, attValue);
					}
					else {
						if (isFunction(value)) value = value.apply();
						if (this.options.keepNullAttributes && value == null) this.currentNode.attribs[name] = new XMLAttribute(this, name, "");
						else if (value != null) this.currentNode.attribs[name] = new XMLAttribute(this, name, value);
					}
					return this;
				};
				XMLDocumentCB.prototype.text = function(value) {
					var node;
					this.openCurrent();
					node = new XMLText(this, value);
					this.onData(this.writer.text(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.cdata = function(value) {
					var node;
					this.openCurrent();
					node = new XMLCData(this, value);
					this.onData(this.writer.cdata(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.comment = function(value) {
					var node;
					this.openCurrent();
					node = new XMLComment(this, value);
					this.onData(this.writer.comment(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.raw = function(value) {
					var node;
					this.openCurrent();
					node = new XMLRaw(this, value);
					this.onData(this.writer.raw(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.instruction = function(target, value) {
					var i, insTarget, insValue, len, node;
					this.openCurrent();
					if (target != null) target = getValue(target);
					if (value != null) value = getValue(value);
					if (Array.isArray(target)) for (i = 0, len = target.length; i < len; i++) {
						insTarget = target[i];
						this.instruction(insTarget);
					}
					else if (isObject(target)) for (insTarget in target) {
						if (!hasProp.call(target, insTarget)) continue;
						insValue = target[insTarget];
						this.instruction(insTarget, insValue);
					}
					else {
						if (isFunction(value)) value = value.apply();
						node = new XMLProcessingInstruction(this, target, value);
						this.onData(this.writer.processingInstruction(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					}
					return this;
				};
				XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) {
					var node;
					this.openCurrent();
					if (this.documentStarted) throw new Error("declaration() must be the first node.");
					node = new XMLDeclaration(this, version, encoding, standalone);
					this.onData(this.writer.declaration(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {
					this.openCurrent();
					if (root == null) throw new Error("Missing root node name.");
					if (this.root) throw new Error("dtd() must come before the root node.");
					this.currentNode = new XMLDocType(this, pubID, sysID);
					this.currentNode.rootNodeName = root;
					this.currentNode.children = false;
					this.currentLevel++;
					this.openTags[this.currentLevel] = this.currentNode;
					return this;
				};
				XMLDocumentCB.prototype.dtdElement = function(name, value) {
					var node;
					this.openCurrent();
					node = new XMLDTDElement(this, name, value);
					this.onData(this.writer.dtdElement(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
					var node;
					this.openCurrent();
					node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
					this.onData(this.writer.dtdAttList(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.entity = function(name, value) {
					var node;
					this.openCurrent();
					node = new XMLDTDEntity(this, false, name, value);
					this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.pEntity = function(name, value) {
					var node;
					this.openCurrent();
					node = new XMLDTDEntity(this, true, name, value);
					this.onData(this.writer.dtdEntity(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.notation = function(name, value) {
					var node;
					this.openCurrent();
					node = new XMLDTDNotation(this, name, value);
					this.onData(this.writer.dtdNotation(node, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
					return this;
				};
				XMLDocumentCB.prototype.up = function() {
					if (this.currentLevel < 0) throw new Error("The document node has no parent.");
					if (this.currentNode) {
						if (this.currentNode.children) this.closeNode(this.currentNode);
						else this.openNode(this.currentNode);
						this.currentNode = null;
					} else this.closeNode(this.openTags[this.currentLevel]);
					delete this.openTags[this.currentLevel];
					this.currentLevel--;
					return this;
				};
				XMLDocumentCB.prototype.end = function() {
					while (this.currentLevel >= 0) this.up();
					return this.onEnd();
				};
				XMLDocumentCB.prototype.openCurrent = function() {
					if (this.currentNode) {
						this.currentNode.children = true;
						return this.openNode(this.currentNode);
					}
				};
				XMLDocumentCB.prototype.openNode = function(node) {
					var att, chunk, name, ref1;
					if (!node.isOpen) {
						if (!this.root && this.currentLevel === 0 && node.type === NodeType.Element) this.root = node;
						chunk = "";
						if (node.type === NodeType.Element) {
							this.writerOptions.state = WriterState.OpenTag;
							chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<" + node.name;
							ref1 = node.attribs;
							for (name in ref1) {
								if (!hasProp.call(ref1, name)) continue;
								att = ref1[name];
								chunk += this.writer.attribute(att, this.writerOptions, this.currentLevel);
							}
							chunk += (node.children ? ">" : "/>") + this.writer.endline(node, this.writerOptions, this.currentLevel);
							this.writerOptions.state = WriterState.InsideTag;
						} else {
							this.writerOptions.state = WriterState.OpenTag;
							chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "<!DOCTYPE " + node.rootNodeName;
							if (node.pubID && node.sysID) chunk += " PUBLIC \"" + node.pubID + "\" \"" + node.sysID + "\"";
							else if (node.sysID) chunk += " SYSTEM \"" + node.sysID + "\"";
							if (node.children) {
								chunk += " [";
								this.writerOptions.state = WriterState.InsideTag;
							} else {
								this.writerOptions.state = WriterState.CloseTag;
								chunk += ">";
							}
							chunk += this.writer.endline(node, this.writerOptions, this.currentLevel);
						}
						this.onData(chunk, this.currentLevel);
						return node.isOpen = true;
					}
				};
				XMLDocumentCB.prototype.closeNode = function(node) {
					var chunk;
					if (!node.isClosed) {
						chunk = "";
						this.writerOptions.state = WriterState.CloseTag;
						if (node.type === NodeType.Element) chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "</" + node.name + ">" + this.writer.endline(node, this.writerOptions, this.currentLevel);
						else chunk = this.writer.indent(node, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(node, this.writerOptions, this.currentLevel);
						this.writerOptions.state = WriterState.None;
						this.onData(chunk, this.currentLevel);
						return node.isClosed = true;
					}
				};
				XMLDocumentCB.prototype.onData = function(chunk, level) {
					this.documentStarted = true;
					return this.onDataCallback(chunk, level + 1);
				};
				XMLDocumentCB.prototype.onEnd = function() {
					this.documentCompleted = true;
					return this.onEndCallback();
				};
				XMLDocumentCB.prototype.debugInfo = function(name) {
					if (name == null) return "";
					else return "node: <" + name + ">";
				};
				XMLDocumentCB.prototype.ele = function() {
					return this.element.apply(this, arguments);
				};
				XMLDocumentCB.prototype.nod = function(name, attributes, text) {
					return this.node(name, attributes, text);
				};
				XMLDocumentCB.prototype.txt = function(value) {
					return this.text(value);
				};
				XMLDocumentCB.prototype.dat = function(value) {
					return this.cdata(value);
				};
				XMLDocumentCB.prototype.com = function(value) {
					return this.comment(value);
				};
				XMLDocumentCB.prototype.ins = function(target, value) {
					return this.instruction(target, value);
				};
				XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {
					return this.declaration(version, encoding, standalone);
				};
				XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {
					return this.doctype(root, pubID, sysID);
				};
				XMLDocumentCB.prototype.e = function(name, attributes, text) {
					return this.element(name, attributes, text);
				};
				XMLDocumentCB.prototype.n = function(name, attributes, text) {
					return this.node(name, attributes, text);
				};
				XMLDocumentCB.prototype.t = function(value) {
					return this.text(value);
				};
				XMLDocumentCB.prototype.d = function(value) {
					return this.cdata(value);
				};
				XMLDocumentCB.prototype.c = function(value) {
					return this.comment(value);
				};
				XMLDocumentCB.prototype.r = function(value) {
					return this.raw(value);
				};
				XMLDocumentCB.prototype.i = function(target, value) {
					return this.instruction(target, value);
				};
				XMLDocumentCB.prototype.att = function() {
					if (this.currentNode && this.currentNode.type === NodeType.DocType) return this.attList.apply(this, arguments);
					else return this.attribute.apply(this, arguments);
				};
				XMLDocumentCB.prototype.a = function() {
					if (this.currentNode && this.currentNode.type === NodeType.DocType) return this.attList.apply(this, arguments);
					else return this.attribute.apply(this, arguments);
				};
				XMLDocumentCB.prototype.ent = function(name, value) {
					return this.entity(name, value);
				};
				XMLDocumentCB.prototype.pent = function(name, value) {
					return this.pEntity(name, value);
				};
				XMLDocumentCB.prototype.not = function(name, value) {
					return this.notation(name, value);
				};
				return XMLDocumentCB;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/XMLStreamWriter.js
	var require_XMLStreamWriter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, WriterState, XMLWriterBase, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			NodeType = require_NodeType();
			XMLWriterBase = require_XMLWriterBase();
			WriterState = require_WriterState();
			module.exports = (function(superClass) {
				extend(XMLStreamWriter, superClass);
				function XMLStreamWriter(stream, options) {
					this.stream = stream;
					XMLStreamWriter.__super__.constructor.call(this, options);
				}
				XMLStreamWriter.prototype.endline = function(node, options, level) {
					if (node.isLastRootNode && options.state === WriterState.CloseTag) return "";
					else return XMLStreamWriter.__super__.endline.call(this, node, options, level);
				};
				XMLStreamWriter.prototype.document = function(doc, options) {
					var child, i, j, k, len, len1, ref = doc.children, ref1, results;
					for (i = j = 0, len = ref.length; j < len; i = ++j) {
						child = ref[i];
						child.isLastRootNode = i === doc.children.length - 1;
					}
					options = this.filterOptions(options);
					ref1 = doc.children;
					results = [];
					for (k = 0, len1 = ref1.length; k < len1; k++) {
						child = ref1[k];
						results.push(this.writeChildNode(child, options, 0));
					}
					return results;
				};
				XMLStreamWriter.prototype.attribute = function(att, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.attribute.call(this, att, options, level));
				};
				XMLStreamWriter.prototype.cdata = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.cdata.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.comment = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.comment.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.declaration = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.declaration.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.docType = function(node, options, level) {
					var child, j, len, ref;
					level || (level = 0);
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					this.stream.write(this.indent(node, options, level));
					this.stream.write("<!DOCTYPE " + node.root().name);
					if (node.pubID && node.sysID) this.stream.write(" PUBLIC \"" + node.pubID + "\" \"" + node.sysID + "\"");
					else if (node.sysID) this.stream.write(" SYSTEM \"" + node.sysID + "\"");
					if (node.children.length > 0) {
						this.stream.write(" [");
						this.stream.write(this.endline(node, options, level));
						options.state = WriterState.InsideTag;
						ref = node.children;
						for (j = 0, len = ref.length; j < len; j++) {
							child = ref[j];
							this.writeChildNode(child, options, level + 1);
						}
						options.state = WriterState.CloseTag;
						this.stream.write("]");
					}
					options.state = WriterState.CloseTag;
					this.stream.write(options.spaceBeforeSlash + ">");
					this.stream.write(this.endline(node, options, level));
					options.state = WriterState.None;
					return this.closeNode(node, options, level);
				};
				XMLStreamWriter.prototype.element = function(node, options, level) {
					var att, child, childNodeCount, firstChildNode, j, len, name, ref, ref1;
					level || (level = 0);
					this.openNode(node, options, level);
					options.state = WriterState.OpenTag;
					this.stream.write(this.indent(node, options, level) + "<" + node.name);
					ref = node.attribs;
					for (name in ref) {
						if (!hasProp.call(ref, name)) continue;
						att = ref[name];
						this.attribute(att, options, level);
					}
					childNodeCount = node.children.length;
					firstChildNode = childNodeCount === 0 ? null : node.children[0];
					if (childNodeCount === 0 || node.children.every(function(e) {
						return (e.type === NodeType.Text || e.type === NodeType.Raw) && e.value === "";
					})) if (options.allowEmpty) {
						this.stream.write(">");
						options.state = WriterState.CloseTag;
						this.stream.write("</" + node.name + ">");
					} else {
						options.state = WriterState.CloseTag;
						this.stream.write(options.spaceBeforeSlash + "/>");
					}
					else if (options.pretty && childNodeCount === 1 && (firstChildNode.type === NodeType.Text || firstChildNode.type === NodeType.Raw) && firstChildNode.value != null) {
						this.stream.write(">");
						options.state = WriterState.InsideTag;
						options.suppressPrettyCount++;
						this.writeChildNode(firstChildNode, options, level + 1);
						options.suppressPrettyCount--;
						options.state = WriterState.CloseTag;
						this.stream.write("</" + node.name + ">");
					} else {
						this.stream.write(">" + this.endline(node, options, level));
						options.state = WriterState.InsideTag;
						ref1 = node.children;
						for (j = 0, len = ref1.length; j < len; j++) {
							child = ref1[j];
							this.writeChildNode(child, options, level + 1);
						}
						options.state = WriterState.CloseTag;
						this.stream.write(this.indent(node, options, level) + "</" + node.name + ">");
					}
					this.stream.write(this.endline(node, options, level));
					options.state = WriterState.None;
					return this.closeNode(node, options, level);
				};
				XMLStreamWriter.prototype.processingInstruction = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.processingInstruction.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.raw = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.raw.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.text = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.text.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.dtdAttList = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.dtdAttList.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.dtdElement = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.dtdElement.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.dtdEntity = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.dtdEntity.call(this, node, options, level));
				};
				XMLStreamWriter.prototype.dtdNotation = function(node, options, level) {
					return this.stream.write(XMLStreamWriter.__super__.dtdNotation.call(this, node, options, level));
				};
				return XMLStreamWriter;
			})(XMLWriterBase);
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xmlbuilder/lib/index.js
	var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
		(function() {
			var NodeType, WriterState, XMLDOMImplementation, XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref = require_Utility();
			assign = ref.assign, isFunction = ref.isFunction;
			XMLDOMImplementation = require_XMLDOMImplementation();
			XMLDocument = require_XMLDocument();
			XMLDocumentCB = require_XMLDocumentCB();
			XMLStringWriter = require_XMLStringWriter();
			XMLStreamWriter = require_XMLStreamWriter();
			NodeType = require_NodeType();
			WriterState = require_WriterState();
			module.exports.create = function(name, xmldec, doctype, options) {
				var doc, root;
				if (name == null) throw new Error("Root element needs a name.");
				options = assign({}, xmldec, doctype, options);
				doc = new XMLDocument(options);
				root = doc.element(name);
				if (!options.headless) {
					doc.declaration(options);
					if (options.pubID != null || options.sysID != null) doc.dtd(options);
				}
				return root;
			};
			module.exports.begin = function(options, onData, onEnd) {
				var ref1;
				if (isFunction(options)) {
					ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
					options = {};
				}
				if (onData) return new XMLDocumentCB(options, onData, onEnd);
				else return new XMLDocument(options);
			};
			module.exports.stringWriter = function(options) {
				return new XMLStringWriter(options);
			};
			module.exports.streamWriter = function(stream, options) {
				return new XMLStreamWriter(stream, options);
			};
			module.exports.implementation = new XMLDOMImplementation();
			module.exports.nodeType = NodeType;
			module.exports.writerState = WriterState;
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xml2js/lib/builder.js
	var require_builder = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA, hasProp = {}.hasOwnProperty;
			builder = require_lib();
			defaults = require_defaults().defaults;
			requiresCDATA = function(entry) {
				return typeof entry === "string" && (entry.indexOf("&") >= 0 || entry.indexOf(">") >= 0 || entry.indexOf("<") >= 0);
			};
			wrapCDATA = function(entry) {
				return "<![CDATA[" + escapeCDATA(entry) + "]]>";
			};
			escapeCDATA = function(entry) {
				return entry.replace("]]>", "]]]]><![CDATA[>");
			};
			exports.Builder = (function() {
				function Builder(opts) {
					var key, ref, value;
					this.options = {};
					ref = defaults["0.2"];
					for (key in ref) {
						if (!hasProp.call(ref, key)) continue;
						value = ref[key];
						this.options[key] = value;
					}
					for (key in opts) {
						if (!hasProp.call(opts, key)) continue;
						value = opts[key];
						this.options[key] = value;
					}
				}
				Builder.prototype.buildObject = function(rootObj) {
					var attrkey = this.options.attrkey, charkey = this.options.charkey, render, rootElement, rootName;
					if (Object.keys(rootObj).length === 1 && this.options.rootName === defaults["0.2"].rootName) {
						rootName = Object.keys(rootObj)[0];
						rootObj = rootObj[rootName];
					} else rootName = this.options.rootName;
					render = (function(_this) {
						return function(element, obj) {
							var attr, child, entry, index, key, value;
							if (typeof obj !== "object") if (_this.options.cdata && requiresCDATA(obj)) element.raw(wrapCDATA(obj));
							else element.txt(obj);
							else if (Array.isArray(obj)) for (index in obj) {
								if (!hasProp.call(obj, index)) continue;
								child = obj[index];
								for (key in child) {
									entry = child[key];
									element = render(element.ele(key), entry).up();
								}
							}
							else for (key in obj) {
								if (!hasProp.call(obj, key)) continue;
								child = obj[key];
								if (key === attrkey) {
									if (typeof child === "object") for (attr in child) {
										value = child[attr];
										element = element.att(attr, value);
									}
								} else if (key === charkey) if (_this.options.cdata && requiresCDATA(child)) element = element.raw(wrapCDATA(child));
								else element = element.txt(child);
								else if (Array.isArray(child)) for (index in child) {
									if (!hasProp.call(child, index)) continue;
									entry = child[index];
									if (typeof entry === "string") if (_this.options.cdata && requiresCDATA(entry)) element = element.ele(key).raw(wrapCDATA(entry)).up();
									else element = element.ele(key, entry).up();
									else element = render(element.ele(key), entry).up();
								}
								else if (typeof child === "object") element = render(element.ele(key), child).up();
								else if (typeof child === "string" && _this.options.cdata && requiresCDATA(child)) element = element.ele(key).raw(wrapCDATA(child)).up();
								else {
									if (child == null) child = "";
									element = element.ele(key, child.toString()).up();
								}
							}
							return element;
						};
					})(this);
					rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
						headless: this.options.headless,
						allowSurrogateChars: this.options.allowSurrogateChars
					});
					return render(rootElement, rootObj).end(this.options.renderOpts);
				};
				return Builder;
			})();
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/sax/lib/sax.js
	var require_sax = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist();
		(function(sax) {
			sax.parser = function(strict, opt) {
				return new SAXParser(strict, opt);
			};
			sax.SAXParser = SAXParser;
			sax.SAXStream = SAXStream;
			sax.createStream = createStream;
			sax.MAX_BUFFER_LENGTH = 64 * 1024;
			var buffers = [
				"comment",
				"sgmlDecl",
				"textNode",
				"tagName",
				"doctype",
				"procInstName",
				"procInstBody",
				"entity",
				"attribName",
				"attribValue",
				"cdata",
				"script"
			];
			sax.EVENTS = [
				"text",
				"processinginstruction",
				"sgmldeclaration",
				"doctype",
				"comment",
				"opentagstart",
				"attribute",
				"opentag",
				"closetag",
				"opencdata",
				"cdata",
				"closecdata",
				"error",
				"end",
				"ready",
				"script",
				"opennamespace",
				"closenamespace"
			];
			function SAXParser(strict, opt) {
				if (!(this instanceof SAXParser)) return new SAXParser(strict, opt);
				var parser = this;
				clearBuffers(parser);
				parser.q = parser.c = "";
				parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
				parser.opt = opt || {};
				parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
				parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
				parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512;
				parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4;
				parser.entityCount = parser.entityDepth = 0;
				parser.tags = [];
				parser.closed = parser.closedRoot = parser.sawRoot = false;
				parser.tag = parser.error = null;
				parser.strict = !!strict;
				parser.noscript = !!(strict || parser.opt.noscript);
				parser.state = S.BEGIN;
				parser.strictEntities = parser.opt.strictEntities;
				parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES);
				parser.attribList = [];
				if (parser.opt.xmlns) parser.ns = Object.create(rootNS);
				if (parser.opt.unquotedAttributeValues === void 0) parser.opt.unquotedAttributeValues = !strict;
				parser.trackPosition = parser.opt.position !== false;
				if (parser.trackPosition) parser.position = parser.line = parser.column = 0;
				emit(parser, "onready");
			}
			if (!Object.create) Object.create = function(o) {
				function F() {}
				F.prototype = o;
				return new F();
			};
			if (!Object.keys) Object.keys = function(o) {
				var a = [];
				for (var i in o) if (o.hasOwnProperty(i)) a.push(i);
				return a;
			};
			function checkBufferLength(parser) {
				var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10);
				var maxActual = 0;
				for (var i = 0, l = buffers.length; i < l; i++) {
					var len = parser[buffers[i]].length;
					if (len > maxAllowed) switch (buffers[i]) {
						case "textNode":
							closeText(parser);
							break;
						case "cdata":
							emitNode(parser, "oncdata", parser.cdata);
							parser.cdata = "";
							break;
						case "script":
							emitNode(parser, "onscript", parser.script);
							parser.script = "";
							break;
						default: error(parser, "Max buffer length exceeded: " + buffers[i]);
					}
					maxActual = Math.max(maxActual, len);
				}
				parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH - maxActual + parser.position;
			}
			function clearBuffers(parser) {
				for (var i = 0, l = buffers.length; i < l; i++) parser[buffers[i]] = "";
			}
			function flushBuffers(parser) {
				closeText(parser);
				if (parser.cdata !== "") {
					emitNode(parser, "oncdata", parser.cdata);
					parser.cdata = "";
				}
				if (parser.script !== "") {
					emitNode(parser, "onscript", parser.script);
					parser.script = "";
				}
			}
			SAXParser.prototype = {
				end: function() {
					end(this);
				},
				write,
				resume: function() {
					this.error = null;
					return this;
				},
				close: function() {
					return this.write(null);
				},
				flush: function() {
					flushBuffers(this);
				}
			};
			var Stream;
			try {
				Stream = require_stream_browserify().Stream;
			} catch (ex) {
				Stream = function() {};
			}
			if (!Stream) Stream = function() {};
			var streamWraps = sax.EVENTS.filter(function(ev) {
				return ev !== "error" && ev !== "end";
			});
			function createStream(strict, opt) {
				return new SAXStream(strict, opt);
			}
			function SAXStream(strict, opt) {
				if (!(this instanceof SAXStream)) return new SAXStream(strict, opt);
				Stream.apply(this);
				this._parser = new SAXParser(strict, opt);
				this.writable = true;
				this.readable = true;
				var me = this;
				this._parser.onend = function() {
					me.emit("end");
				};
				this._parser.onerror = function(er) {
					me.emit("error", er);
					me._parser.error = null;
				};
				this._decoder = null;
				streamWraps.forEach(function(ev) {
					Object.defineProperty(me, "on" + ev, {
						get: function() {
							return me._parser["on" + ev];
						},
						set: function(h) {
							if (!h) {
								me.removeAllListeners(ev);
								me._parser["on" + ev] = h;
								return h;
							}
							me.on(ev, h);
						},
						enumerable: true,
						configurable: false
					});
				});
			}
			SAXStream.prototype = Object.create(Stream.prototype, { constructor: { value: SAXStream } });
			SAXStream.prototype.write = function(data) {
				if (typeof Buffer$1 === "function" && typeof Buffer$1.isBuffer === "function" && Buffer$1.isBuffer(data)) {
					if (!this._decoder) this._decoder = new TextDecoder("utf8");
					data = this._decoder.decode(data, { stream: true });
				}
				this._parser.write(data.toString());
				this.emit("data", data);
				return true;
			};
			SAXStream.prototype.end = function(chunk) {
				if (chunk && chunk.length) this.write(chunk);
				if (this._decoder) {
					var remaining = this._decoder.decode();
					if (remaining) {
						this._parser.write(remaining);
						this.emit("data", remaining);
					}
				}
				this._parser.end();
				return true;
			};
			SAXStream.prototype.on = function(ev, handler) {
				var me = this;
				if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) me._parser["on" + ev] = function() {
					var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
					args.splice(0, 0, ev);
					me.emit.apply(me, args);
				};
				return Stream.prototype.on.call(me, ev, handler);
			};
			var CDATA = "[CDATA[";
			var DOCTYPE = "DOCTYPE";
			var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
			var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/";
			var rootNS = {
				xml: XML_NAMESPACE,
				xmlns: XMLNS_NAMESPACE
			};
			var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
			var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
			var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
			var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
			function isWhitespace(c) {
				return c === " " || c === "\n" || c === "\r" || c === "	";
			}
			function isQuote(c) {
				return c === "\"" || c === "'";
			}
			function isAttribEnd(c) {
				return c === ">" || isWhitespace(c);
			}
			function isMatch(regex, c) {
				return regex.test(c);
			}
			function notMatch(regex, c) {
				return !isMatch(regex, c);
			}
			var S = 0;
			sax.STATE = {
				BEGIN: S++,
				BEGIN_WHITESPACE: S++,
				TEXT: S++,
				TEXT_ENTITY: S++,
				OPEN_WAKA: S++,
				SGML_DECL: S++,
				SGML_DECL_QUOTED: S++,
				DOCTYPE: S++,
				DOCTYPE_QUOTED: S++,
				DOCTYPE_DTD: S++,
				DOCTYPE_DTD_QUOTED: S++,
				COMMENT_STARTING: S++,
				COMMENT: S++,
				COMMENT_ENDING: S++,
				COMMENT_ENDED: S++,
				CDATA: S++,
				CDATA_ENDING: S++,
				CDATA_ENDING_2: S++,
				PROC_INST: S++,
				PROC_INST_BODY: S++,
				PROC_INST_ENDING: S++,
				OPEN_TAG: S++,
				OPEN_TAG_SLASH: S++,
				ATTRIB: S++,
				ATTRIB_NAME: S++,
				ATTRIB_NAME_SAW_WHITE: S++,
				ATTRIB_VALUE: S++,
				ATTRIB_VALUE_QUOTED: S++,
				ATTRIB_VALUE_CLOSED: S++,
				ATTRIB_VALUE_UNQUOTED: S++,
				ATTRIB_VALUE_ENTITY_Q: S++,
				ATTRIB_VALUE_ENTITY_U: S++,
				CLOSE_TAG: S++,
				CLOSE_TAG_SAW_WHITE: S++,
				SCRIPT: S++,
				SCRIPT_ENDING: S++
			};
			sax.XML_ENTITIES = {
				amp: "&",
				gt: ">",
				lt: "<",
				quot: "\"",
				apos: "'"
			};
			sax.ENTITIES = {
				amp: "&",
				gt: ">",
				lt: "<",
				quot: "\"",
				apos: "'",
				AElig: 198,
				Aacute: 193,
				Acirc: 194,
				Agrave: 192,
				Aring: 197,
				Atilde: 195,
				Auml: 196,
				Ccedil: 199,
				ETH: 208,
				Eacute: 201,
				Ecirc: 202,
				Egrave: 200,
				Euml: 203,
				Iacute: 205,
				Icirc: 206,
				Igrave: 204,
				Iuml: 207,
				Ntilde: 209,
				Oacute: 211,
				Ocirc: 212,
				Ograve: 210,
				Oslash: 216,
				Otilde: 213,
				Ouml: 214,
				THORN: 222,
				Uacute: 218,
				Ucirc: 219,
				Ugrave: 217,
				Uuml: 220,
				Yacute: 221,
				aacute: 225,
				acirc: 226,
				aelig: 230,
				agrave: 224,
				aring: 229,
				atilde: 227,
				auml: 228,
				ccedil: 231,
				eacute: 233,
				ecirc: 234,
				egrave: 232,
				eth: 240,
				euml: 235,
				iacute: 237,
				icirc: 238,
				igrave: 236,
				iuml: 239,
				ntilde: 241,
				oacute: 243,
				ocirc: 244,
				ograve: 242,
				oslash: 248,
				otilde: 245,
				ouml: 246,
				szlig: 223,
				thorn: 254,
				uacute: 250,
				ucirc: 251,
				ugrave: 249,
				uuml: 252,
				yacute: 253,
				yuml: 255,
				copy: 169,
				reg: 174,
				nbsp: 160,
				iexcl: 161,
				cent: 162,
				pound: 163,
				curren: 164,
				yen: 165,
				brvbar: 166,
				sect: 167,
				uml: 168,
				ordf: 170,
				laquo: 171,
				not: 172,
				shy: 173,
				macr: 175,
				deg: 176,
				plusmn: 177,
				sup1: 185,
				sup2: 178,
				sup3: 179,
				acute: 180,
				micro: 181,
				para: 182,
				middot: 183,
				cedil: 184,
				ordm: 186,
				raquo: 187,
				frac14: 188,
				frac12: 189,
				frac34: 190,
				iquest: 191,
				times: 215,
				divide: 247,
				OElig: 338,
				oelig: 339,
				Scaron: 352,
				scaron: 353,
				Yuml: 376,
				fnof: 402,
				circ: 710,
				tilde: 732,
				Alpha: 913,
				Beta: 914,
				Gamma: 915,
				Delta: 916,
				Epsilon: 917,
				Zeta: 918,
				Eta: 919,
				Theta: 920,
				Iota: 921,
				Kappa: 922,
				Lambda: 923,
				Mu: 924,
				Nu: 925,
				Xi: 926,
				Omicron: 927,
				Pi: 928,
				Rho: 929,
				Sigma: 931,
				Tau: 932,
				Upsilon: 933,
				Phi: 934,
				Chi: 935,
				Psi: 936,
				Omega: 937,
				alpha: 945,
				beta: 946,
				gamma: 947,
				delta: 948,
				epsilon: 949,
				zeta: 950,
				eta: 951,
				theta: 952,
				iota: 953,
				kappa: 954,
				lambda: 955,
				mu: 956,
				nu: 957,
				xi: 958,
				omicron: 959,
				pi: 960,
				rho: 961,
				sigmaf: 962,
				sigma: 963,
				tau: 964,
				upsilon: 965,
				phi: 966,
				chi: 967,
				psi: 968,
				omega: 969,
				thetasym: 977,
				upsih: 978,
				piv: 982,
				ensp: 8194,
				emsp: 8195,
				thinsp: 8201,
				zwnj: 8204,
				zwj: 8205,
				lrm: 8206,
				rlm: 8207,
				ndash: 8211,
				mdash: 8212,
				lsquo: 8216,
				rsquo: 8217,
				sbquo: 8218,
				ldquo: 8220,
				rdquo: 8221,
				bdquo: 8222,
				dagger: 8224,
				Dagger: 8225,
				bull: 8226,
				hellip: 8230,
				permil: 8240,
				prime: 8242,
				Prime: 8243,
				lsaquo: 8249,
				rsaquo: 8250,
				oline: 8254,
				frasl: 8260,
				euro: 8364,
				image: 8465,
				weierp: 8472,
				real: 8476,
				trade: 8482,
				alefsym: 8501,
				larr: 8592,
				uarr: 8593,
				rarr: 8594,
				darr: 8595,
				harr: 8596,
				crarr: 8629,
				lArr: 8656,
				uArr: 8657,
				rArr: 8658,
				dArr: 8659,
				hArr: 8660,
				forall: 8704,
				part: 8706,
				exist: 8707,
				empty: 8709,
				nabla: 8711,
				isin: 8712,
				notin: 8713,
				ni: 8715,
				prod: 8719,
				sum: 8721,
				minus: 8722,
				lowast: 8727,
				radic: 8730,
				prop: 8733,
				infin: 8734,
				ang: 8736,
				and: 8743,
				or: 8744,
				cap: 8745,
				cup: 8746,
				int: 8747,
				there4: 8756,
				sim: 8764,
				cong: 8773,
				asymp: 8776,
				ne: 8800,
				equiv: 8801,
				le: 8804,
				ge: 8805,
				sub: 8834,
				sup: 8835,
				nsub: 8836,
				sube: 8838,
				supe: 8839,
				oplus: 8853,
				otimes: 8855,
				perp: 8869,
				sdot: 8901,
				lceil: 8968,
				rceil: 8969,
				lfloor: 8970,
				rfloor: 8971,
				lang: 9001,
				rang: 9002,
				loz: 9674,
				spades: 9824,
				clubs: 9827,
				hearts: 9829,
				diams: 9830
			};
			Object.keys(sax.ENTITIES).forEach(function(key) {
				var e = sax.ENTITIES[key];
				var s = typeof e === "number" ? String.fromCharCode(e) : e;
				sax.ENTITIES[key] = s;
			});
			for (var s in sax.STATE) sax.STATE[sax.STATE[s]] = s;
			S = sax.STATE;
			function emit(parser, event, data) {
				parser[event] && parser[event](data);
			}
			function emitNode(parser, nodeType, data) {
				if (parser.textNode) closeText(parser);
				emit(parser, nodeType, data);
			}
			function closeText(parser) {
				parser.textNode = textopts(parser.opt, parser.textNode);
				if (parser.textNode) emit(parser, "ontext", parser.textNode);
				parser.textNode = "";
			}
			function textopts(opt, text) {
				if (opt.trim) text = text.trim();
				if (opt.normalize) text = text.replace(/\s+/g, " ");
				return text;
			}
			function error(parser, er) {
				closeText(parser);
				if (parser.trackPosition) er += "\nLine: " + parser.line + "\nColumn: " + parser.column + "\nChar: " + parser.c;
				er = new Error(er);
				parser.error = er;
				emit(parser, "onerror", er);
				return parser;
			}
			function end(parser) {
				if (parser.sawRoot && !parser.closedRoot) strictFail(parser, "Unclosed root tag");
				if (parser.state !== S.BEGIN && parser.state !== S.BEGIN_WHITESPACE && parser.state !== S.TEXT) error(parser, "Unexpected end");
				closeText(parser);
				parser.c = "";
				parser.closed = true;
				emit(parser, "onend");
				SAXParser.call(parser, parser.strict, parser.opt);
				return parser;
			}
			function strictFail(parser, message) {
				if (typeof parser !== "object" || !(parser instanceof SAXParser)) throw new Error("bad call to strictFail");
				if (parser.strict) error(parser, message);
			}
			function newTag(parser) {
				if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]();
				var parent = parser.tags[parser.tags.length - 1] || parser;
				var tag = parser.tag = {
					name: parser.tagName,
					attributes: {}
				};
				if (parser.opt.xmlns) tag.ns = parent.ns;
				parser.attribList.length = 0;
				emitNode(parser, "onopentagstart", tag);
			}
			function qname(name, attribute) {
				var qualName = name.indexOf(":") < 0 ? ["", name] : name.split(":");
				var prefix = qualName[0];
				var local = qualName[1];
				if (attribute && name === "xmlns") {
					prefix = "xmlns";
					local = "";
				}
				return {
					prefix,
					local
				};
			}
			function attrib(parser) {
				if (!parser.strict) parser.attribName = parser.attribName[parser.looseCase]();
				if (parser.attribList.indexOf(parser.attribName) !== -1 || parser.tag.attributes.hasOwnProperty(parser.attribName)) {
					parser.attribName = parser.attribValue = "";
					return;
				}
				if (parser.opt.xmlns) {
					var qn = qname(parser.attribName, true);
					var prefix = qn.prefix;
					var local = qn.local;
					if (prefix === "xmlns") if (local === "xml" && parser.attribValue !== XML_NAMESPACE) strictFail(parser, "xml: prefix must be bound to " + XML_NAMESPACE + "\nActual: " + parser.attribValue);
					else if (local === "xmlns" && parser.attribValue !== XMLNS_NAMESPACE) strictFail(parser, "xmlns: prefix must be bound to " + XMLNS_NAMESPACE + "\nActual: " + parser.attribValue);
					else {
						var tag = parser.tag;
						var parent = parser.tags[parser.tags.length - 1] || parser;
						if (tag.ns === parent.ns) tag.ns = Object.create(parent.ns);
						tag.ns[local] = parser.attribValue;
					}
					parser.attribList.push([parser.attribName, parser.attribValue]);
				} else {
					parser.tag.attributes[parser.attribName] = parser.attribValue;
					emitNode(parser, "onattribute", {
						name: parser.attribName,
						value: parser.attribValue
					});
				}
				parser.attribName = parser.attribValue = "";
			}
			function openTag(parser, selfClosing) {
				if (parser.opt.xmlns) {
					var tag = parser.tag;
					var qn = qname(parser.tagName);
					tag.prefix = qn.prefix;
					tag.local = qn.local;
					tag.uri = tag.ns[qn.prefix] || "";
					if (tag.prefix && !tag.uri) {
						strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(parser.tagName));
						tag.uri = qn.prefix;
					}
					var parent = parser.tags[parser.tags.length - 1] || parser;
					if (tag.ns && parent.ns !== tag.ns) Object.keys(tag.ns).forEach(function(p) {
						emitNode(parser, "onopennamespace", {
							prefix: p,
							uri: tag.ns[p]
						});
					});
					for (var i = 0, l = parser.attribList.length; i < l; i++) {
						var nv = parser.attribList[i];
						var name = nv[0];
						var value = nv[1];
						var qualName = qname(name, true);
						var prefix = qualName.prefix;
						var local = qualName.local;
						var uri = prefix === "" ? "" : tag.ns[prefix] || "";
						var a = {
							name,
							value,
							prefix,
							local,
							uri
						};
						if (prefix && prefix !== "xmlns" && !uri) {
							strictFail(parser, "Unbound namespace prefix: " + JSON.stringify(prefix));
							a.uri = prefix;
						}
						parser.tag.attributes[name] = a;
						emitNode(parser, "onattribute", a);
					}
					parser.attribList.length = 0;
				}
				parser.tag.isSelfClosing = !!selfClosing;
				parser.sawRoot = true;
				parser.tags.push(parser.tag);
				emitNode(parser, "onopentag", parser.tag);
				if (!selfClosing) {
					if (!parser.noscript && parser.tagName.toLowerCase() === "script") parser.state = S.SCRIPT;
					else parser.state = S.TEXT;
					parser.tag = null;
					parser.tagName = "";
				}
				parser.attribName = parser.attribValue = "";
				parser.attribList.length = 0;
			}
			function closeTag(parser) {
				if (!parser.tagName) {
					strictFail(parser, "Weird empty close tag.");
					parser.textNode += "</>";
					parser.state = S.TEXT;
					return;
				}
				if (parser.script) {
					if (parser.tagName !== "script") {
						parser.script += "</" + parser.tagName + ">";
						parser.tagName = "";
						parser.state = S.SCRIPT;
						return;
					}
					emitNode(parser, "onscript", parser.script);
					parser.script = "";
				}
				var t = parser.tags.length;
				var tagName = parser.tagName;
				if (!parser.strict) tagName = tagName[parser.looseCase]();
				var closeTo = tagName;
				while (t--) if (parser.tags[t].name !== closeTo) strictFail(parser, "Unexpected close tag");
				else break;
				if (t < 0) {
					strictFail(parser, "Unmatched closing tag: " + parser.tagName);
					parser.textNode += "</" + parser.tagName + ">";
					parser.state = S.TEXT;
					return;
				}
				parser.tagName = tagName;
				var s = parser.tags.length;
				while (s-- > t) {
					var tag = parser.tag = parser.tags.pop();
					parser.tagName = parser.tag.name;
					emitNode(parser, "onclosetag", parser.tagName);
					var x = {};
					for (var i in tag.ns) x[i] = tag.ns[i];
					var parent = parser.tags[parser.tags.length - 1] || parser;
					if (parser.opt.xmlns && tag.ns !== parent.ns) Object.keys(tag.ns).forEach(function(p) {
						var n = tag.ns[p];
						emitNode(parser, "onclosenamespace", {
							prefix: p,
							uri: n
						});
					});
				}
				if (t === 0) parser.closedRoot = true;
				parser.tagName = parser.attribValue = parser.attribName = "";
				parser.attribList.length = 0;
				parser.state = S.TEXT;
			}
			function parseEntity(parser) {
				var entity = parser.entity;
				var entityLC = entity.toLowerCase();
				var num;
				var numStr = "";
				if (parser.ENTITIES[entity]) return parser.ENTITIES[entity];
				if (parser.ENTITIES[entityLC]) return parser.ENTITIES[entityLC];
				entity = entityLC;
				if (entity.charAt(0) === "#") if (entity.charAt(1) === "x") {
					entity = entity.slice(2);
					num = parseInt(entity, 16);
					numStr = num.toString(16);
				} else {
					entity = entity.slice(1);
					num = parseInt(entity, 10);
					numStr = num.toString(10);
				}
				entity = entity.replace(/^0+/, "");
				if (isNaN(num) || numStr.toLowerCase() !== entity || num < 0 || num > 1114111) {
					strictFail(parser, "Invalid character entity");
					return "&" + parser.entity + ";";
				}
				return String.fromCodePoint(num);
			}
			function beginWhiteSpace(parser, c) {
				if (c === "<") {
					parser.state = S.OPEN_WAKA;
					parser.startTagPosition = parser.position;
				} else if (!isWhitespace(c)) {
					strictFail(parser, "Non-whitespace before first tag.");
					parser.textNode = c;
					parser.state = S.TEXT;
				}
			}
			function charAt(chunk, i) {
				var result = "";
				if (i < chunk.length) result = chunk.charAt(i);
				return result;
			}
			function write(chunk) {
				var parser = this;
				if (this.error) throw this.error;
				if (parser.closed) return error(parser, "Cannot write after close. Assign an onready handler.");
				if (chunk === null) return end(parser);
				if (typeof chunk === "object") chunk = chunk.toString();
				var i = 0;
				var c = "";
				while (true) {
					c = charAt(chunk, i++);
					parser.c = c;
					if (!c) break;
					if (parser.trackPosition) {
						parser.position++;
						if (c === "\n") {
							parser.line++;
							parser.column = 0;
						} else parser.column++;
					}
					switch (parser.state) {
						case S.BEGIN:
							parser.state = S.BEGIN_WHITESPACE;
							if (c === "﻿") continue;
							beginWhiteSpace(parser, c);
							continue;
						case S.BEGIN_WHITESPACE:
							beginWhiteSpace(parser, c);
							continue;
						case S.TEXT:
							if (parser.sawRoot && !parser.closedRoot) {
								var starti = i - 1;
								while (c && c !== "<" && c !== "&") {
									c = charAt(chunk, i++);
									if (c && parser.trackPosition) {
										parser.position++;
										if (c === "\n") {
											parser.line++;
											parser.column = 0;
										} else parser.column++;
									}
								}
								parser.textNode += chunk.substring(starti, i - 1);
							}
							if (c === "<" && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
								parser.state = S.OPEN_WAKA;
								parser.startTagPosition = parser.position;
							} else {
								if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) strictFail(parser, "Text data outside of root node.");
								if (c === "&") parser.state = S.TEXT_ENTITY;
								else parser.textNode += c;
							}
							continue;
						case S.SCRIPT:
							if (c === "<") parser.state = S.SCRIPT_ENDING;
							else parser.script += c;
							continue;
						case S.SCRIPT_ENDING:
							if (c === "/") parser.state = S.CLOSE_TAG;
							else {
								parser.script += "<" + c;
								parser.state = S.SCRIPT;
							}
							continue;
						case S.OPEN_WAKA:
							if (c === "!") {
								parser.state = S.SGML_DECL;
								parser.sgmlDecl = "";
							} else if (isWhitespace(c)) {} else if (isMatch(nameStart, c)) {
								parser.state = S.OPEN_TAG;
								parser.tagName = c;
							} else if (c === "/") {
								parser.state = S.CLOSE_TAG;
								parser.tagName = "";
							} else if (c === "?") {
								parser.state = S.PROC_INST;
								parser.procInstName = parser.procInstBody = "";
							} else {
								strictFail(parser, "Unencoded <");
								if (parser.startTagPosition + 1 < parser.position) {
									var pad = parser.position - parser.startTagPosition;
									c = new Array(pad).join(" ") + c;
								}
								parser.textNode += "<" + c;
								parser.state = S.TEXT;
							}
							continue;
						case S.SGML_DECL:
							if (parser.sgmlDecl + c === "--") {
								parser.state = S.COMMENT;
								parser.comment = "";
								parser.sgmlDecl = "";
								continue;
							}
							if (parser.doctype && parser.doctype !== true && parser.sgmlDecl) {
								parser.state = S.DOCTYPE_DTD;
								parser.doctype += "<!" + parser.sgmlDecl + c;
								parser.sgmlDecl = "";
							} else if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
								emitNode(parser, "onopencdata");
								parser.state = S.CDATA;
								parser.sgmlDecl = "";
								parser.cdata = "";
							} else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
								parser.state = S.DOCTYPE;
								if (parser.doctype || parser.sawRoot) strictFail(parser, "Inappropriately located doctype declaration");
								parser.doctype = "";
								parser.sgmlDecl = "";
							} else if (c === ">") {
								emitNode(parser, "onsgmldeclaration", parser.sgmlDecl);
								parser.sgmlDecl = "";
								parser.state = S.TEXT;
							} else if (isQuote(c)) {
								parser.state = S.SGML_DECL_QUOTED;
								parser.sgmlDecl += c;
							} else parser.sgmlDecl += c;
							continue;
						case S.SGML_DECL_QUOTED:
							if (c === parser.q) {
								parser.state = S.SGML_DECL;
								parser.q = "";
							}
							parser.sgmlDecl += c;
							continue;
						case S.DOCTYPE:
							if (c === ">") {
								parser.state = S.TEXT;
								emitNode(parser, "ondoctype", parser.doctype);
								parser.doctype = true;
							} else {
								parser.doctype += c;
								if (c === "[") parser.state = S.DOCTYPE_DTD;
								else if (isQuote(c)) {
									parser.state = S.DOCTYPE_QUOTED;
									parser.q = c;
								}
							}
							continue;
						case S.DOCTYPE_QUOTED:
							parser.doctype += c;
							if (c === parser.q) {
								parser.q = "";
								parser.state = S.DOCTYPE;
							}
							continue;
						case S.DOCTYPE_DTD:
							if (c === "]") {
								parser.doctype += c;
								parser.state = S.DOCTYPE;
							} else if (c === "<") {
								parser.state = S.OPEN_WAKA;
								parser.startTagPosition = parser.position;
							} else if (isQuote(c)) {
								parser.doctype += c;
								parser.state = S.DOCTYPE_DTD_QUOTED;
								parser.q = c;
							} else parser.doctype += c;
							continue;
						case S.DOCTYPE_DTD_QUOTED:
							parser.doctype += c;
							if (c === parser.q) {
								parser.state = S.DOCTYPE_DTD;
								parser.q = "";
							}
							continue;
						case S.COMMENT:
							if (c === "-") parser.state = S.COMMENT_ENDING;
							else parser.comment += c;
							continue;
						case S.COMMENT_ENDING:
							if (c === "-") {
								parser.state = S.COMMENT_ENDED;
								parser.comment = textopts(parser.opt, parser.comment);
								if (parser.comment) emitNode(parser, "oncomment", parser.comment);
								parser.comment = "";
							} else {
								parser.comment += "-" + c;
								parser.state = S.COMMENT;
							}
							continue;
						case S.COMMENT_ENDED:
							if (c !== ">") {
								strictFail(parser, "Malformed comment");
								parser.comment += "--" + c;
								parser.state = S.COMMENT;
							} else if (parser.doctype && parser.doctype !== true) parser.state = S.DOCTYPE_DTD;
							else parser.state = S.TEXT;
							continue;
						case S.CDATA:
							var starti = i - 1;
							while (c && c !== "]") {
								c = charAt(chunk, i++);
								if (c && parser.trackPosition) {
									parser.position++;
									if (c === "\n") {
										parser.line++;
										parser.column = 0;
									} else parser.column++;
								}
							}
							parser.cdata += chunk.substring(starti, i - 1);
							if (c === "]") parser.state = S.CDATA_ENDING;
							continue;
						case S.CDATA_ENDING:
							if (c === "]") parser.state = S.CDATA_ENDING_2;
							else {
								parser.cdata += "]" + c;
								parser.state = S.CDATA;
							}
							continue;
						case S.CDATA_ENDING_2:
							if (c === ">") {
								if (parser.cdata) emitNode(parser, "oncdata", parser.cdata);
								emitNode(parser, "onclosecdata");
								parser.cdata = "";
								parser.state = S.TEXT;
							} else if (c === "]") parser.cdata += "]";
							else {
								parser.cdata += "]]" + c;
								parser.state = S.CDATA;
							}
							continue;
						case S.PROC_INST:
							if (c === "?") parser.state = S.PROC_INST_ENDING;
							else if (isWhitespace(c)) parser.state = S.PROC_INST_BODY;
							else parser.procInstName += c;
							continue;
						case S.PROC_INST_BODY:
							if (!parser.procInstBody && isWhitespace(c)) continue;
							else if (c === "?") parser.state = S.PROC_INST_ENDING;
							else parser.procInstBody += c;
							continue;
						case S.PROC_INST_ENDING:
							if (c === ">") {
								emitNode(parser, "onprocessinginstruction", {
									name: parser.procInstName,
									body: parser.procInstBody
								});
								parser.procInstName = parser.procInstBody = "";
								parser.state = S.TEXT;
							} else {
								parser.procInstBody += "?" + c;
								parser.state = S.PROC_INST_BODY;
							}
							continue;
						case S.OPEN_TAG:
							if (isMatch(nameBody, c)) parser.tagName += c;
							else {
								newTag(parser);
								if (c === ">") openTag(parser);
								else if (c === "/") parser.state = S.OPEN_TAG_SLASH;
								else {
									if (!isWhitespace(c)) strictFail(parser, "Invalid character in tag name");
									parser.state = S.ATTRIB;
								}
							}
							continue;
						case S.OPEN_TAG_SLASH:
							if (c === ">") {
								openTag(parser, true);
								closeTag(parser);
							} else {
								strictFail(parser, "Forward-slash in opening tag not followed by >");
								parser.state = S.ATTRIB;
							}
							continue;
						case S.ATTRIB:
							if (isWhitespace(c)) continue;
							else if (c === ">") openTag(parser);
							else if (c === "/") parser.state = S.OPEN_TAG_SLASH;
							else if (isMatch(nameStart, c)) {
								parser.attribName = c;
								parser.attribValue = "";
								parser.state = S.ATTRIB_NAME;
							} else strictFail(parser, "Invalid attribute name");
							continue;
						case S.ATTRIB_NAME:
							if (c === "=") parser.state = S.ATTRIB_VALUE;
							else if (c === ">") {
								strictFail(parser, "Attribute without value");
								parser.attribValue = parser.attribName;
								attrib(parser);
								openTag(parser);
							} else if (isWhitespace(c)) parser.state = S.ATTRIB_NAME_SAW_WHITE;
							else if (isMatch(nameBody, c)) parser.attribName += c;
							else strictFail(parser, "Invalid attribute name");
							continue;
						case S.ATTRIB_NAME_SAW_WHITE:
							if (c === "=") parser.state = S.ATTRIB_VALUE;
							else if (isWhitespace(c)) continue;
							else {
								strictFail(parser, "Attribute without value");
								parser.tag.attributes[parser.attribName] = "";
								parser.attribValue = "";
								emitNode(parser, "onattribute", {
									name: parser.attribName,
									value: ""
								});
								parser.attribName = "";
								if (c === ">") openTag(parser);
								else if (isMatch(nameStart, c)) {
									parser.attribName = c;
									parser.state = S.ATTRIB_NAME;
								} else {
									strictFail(parser, "Invalid attribute name");
									parser.state = S.ATTRIB;
								}
							}
							continue;
						case S.ATTRIB_VALUE:
							if (isWhitespace(c)) continue;
							else if (isQuote(c)) {
								parser.q = c;
								parser.state = S.ATTRIB_VALUE_QUOTED;
							} else {
								if (!parser.opt.unquotedAttributeValues) error(parser, "Unquoted attribute value");
								parser.state = S.ATTRIB_VALUE_UNQUOTED;
								parser.attribValue = c;
							}
							continue;
						case S.ATTRIB_VALUE_QUOTED:
							if (c !== parser.q) {
								if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_Q;
								else parser.attribValue += c;
								continue;
							}
							attrib(parser);
							parser.q = "";
							parser.state = S.ATTRIB_VALUE_CLOSED;
							continue;
						case S.ATTRIB_VALUE_CLOSED:
							if (isWhitespace(c)) parser.state = S.ATTRIB;
							else if (c === ">") openTag(parser);
							else if (c === "/") parser.state = S.OPEN_TAG_SLASH;
							else if (isMatch(nameStart, c)) {
								strictFail(parser, "No whitespace between attributes");
								parser.attribName = c;
								parser.attribValue = "";
								parser.state = S.ATTRIB_NAME;
							} else strictFail(parser, "Invalid attribute name");
							continue;
						case S.ATTRIB_VALUE_UNQUOTED:
							if (!isAttribEnd(c)) {
								if (c === "&") parser.state = S.ATTRIB_VALUE_ENTITY_U;
								else parser.attribValue += c;
								continue;
							}
							attrib(parser);
							if (c === ">") openTag(parser);
							else parser.state = S.ATTRIB;
							continue;
						case S.CLOSE_TAG:
							if (!parser.tagName) if (isWhitespace(c)) continue;
							else if (notMatch(nameStart, c)) if (parser.script) {
								parser.script += "</" + c;
								parser.state = S.SCRIPT;
							} else strictFail(parser, "Invalid tagname in closing tag.");
							else parser.tagName = c;
							else if (c === ">") closeTag(parser);
							else if (isMatch(nameBody, c)) parser.tagName += c;
							else if (parser.script) {
								parser.script += "</" + parser.tagName + c;
								parser.tagName = "";
								parser.state = S.SCRIPT;
							} else {
								if (!isWhitespace(c)) strictFail(parser, "Invalid tagname in closing tag");
								parser.state = S.CLOSE_TAG_SAW_WHITE;
							}
							continue;
						case S.CLOSE_TAG_SAW_WHITE:
							if (isWhitespace(c)) continue;
							if (c === ">") closeTag(parser);
							else strictFail(parser, "Invalid characters in closing tag");
							continue;
						case S.TEXT_ENTITY:
						case S.ATTRIB_VALUE_ENTITY_Q:
						case S.ATTRIB_VALUE_ENTITY_U:
							var returnState;
							var buffer;
							switch (parser.state) {
								case S.TEXT_ENTITY:
									returnState = S.TEXT;
									buffer = "textNode";
									break;
								case S.ATTRIB_VALUE_ENTITY_Q:
									returnState = S.ATTRIB_VALUE_QUOTED;
									buffer = "attribValue";
									break;
								case S.ATTRIB_VALUE_ENTITY_U:
									returnState = S.ATTRIB_VALUE_UNQUOTED;
									buffer = "attribValue";
									break;
							}
							if (c === ";") {
								var parsedEntity = parseEntity(parser);
								if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) {
									if ((parser.entityCount += 1) > parser.opt.maxEntityCount) error(parser, "Parsed entity count exceeds max entity count");
									if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth) error(parser, "Parsed entity depth exceeds max entity depth");
									parser.entity = "";
									parser.state = returnState;
									parser.write(parsedEntity);
									parser.entityDepth -= 1;
								} else {
									parser[buffer] += parsedEntity;
									parser.entity = "";
									parser.state = returnState;
								}
							} else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) parser.entity += c;
							else {
								strictFail(parser, "Invalid character in entity name");
								parser[buffer] += "&" + parser.entity + c;
								parser.entity = "";
								parser.state = returnState;
							}
							continue;
						default: throw new Error(parser, "Unknown state: " + parser.state);
					}
				}
				if (parser.position >= parser.bufferCheckPosition) checkBufferLength(parser);
				return parser;
			}
			/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
			/* istanbul ignore next */
			if (!String.fromCodePoint) (function() {
				var stringFromCharCode = String.fromCharCode;
				var floor = Math.floor;
				var fromCodePoint = function() {
					var MAX_SIZE = 16384;
					var codeUnits = [];
					var highSurrogate;
					var lowSurrogate;
					var index = -1;
					var length = arguments.length;
					if (!length) return "";
					var result = "";
					while (++index < length) {
						var codePoint = Number(arguments[index]);
						if (!isFinite(codePoint) || codePoint < 0 || codePoint > 1114111 || floor(codePoint) !== codePoint) throw RangeError("Invalid code point: " + codePoint);
						if (codePoint <= 65535) codeUnits.push(codePoint);
						else {
							codePoint -= 65536;
							highSurrogate = (codePoint >> 10) + 55296;
							lowSurrogate = codePoint % 1024 + 56320;
							codeUnits.push(highSurrogate, lowSurrogate);
						}
						if (index + 1 === length || codeUnits.length > MAX_SIZE) {
							result += stringFromCharCode.apply(null, codeUnits);
							codeUnits.length = 0;
						}
					}
					return result;
				};
				/* istanbul ignore next */
				if (Object.defineProperty) Object.defineProperty(String, "fromCodePoint", {
					value: fromCodePoint,
					configurable: true,
					writable: true
				});
				else String.fromCodePoint = fromCodePoint;
			})();
		})(typeof exports === "undefined" ? exports.sax = {} : exports);
	}));
	//#endregion
	//#region ../../node_modules/xml2js/lib/bom.js
	var require_bom = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			exports.stripBOM = function(str) {
				if (str[0] === "﻿") return str.substring(1);
				else return str;
			};
		}).call(exports);
	}));
	//#endregion
	//#region ../../node_modules/xml2js/lib/processors.js
	var require_processors = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			var prefixMatch = /* @__PURE__ */ new RegExp(/(?!xmlns)^.*:/);
			exports.normalize = function(str) {
				return str.toLowerCase();
			};
			exports.firstCharLowerCase = function(str) {
				return str.charAt(0).toLowerCase() + str.slice(1);
			};
			exports.stripPrefix = function(str) {
				return str.replace(prefixMatch, "");
			};
			exports.parseNumbers = function(str) {
				if (!isNaN(str)) str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
				return str;
			};
			exports.parseBooleans = function(str) {
				if (/^(?:true|false)$/i.test(str)) str = str.toLowerCase() === "true";
				return str;
			};
		}).call(exports);
	}));
	var init_setImmediate = __esmMin((() => {
		init_dist$2();
		init_dist$1();
		(function(global, undefined) {
			"use strict";
			if (global.setImmediate) return;
			var nextHandle = 1;
			var tasksByHandle = {};
			var currentlyRunningATask = false;
			var doc = global.document;
			var registerImmediate;
			function setImmediate(callback) {
				if (typeof callback !== "function") callback = new Function("" + callback);
				var args = new Array(arguments.length - 1);
				for (var i = 0; i < args.length; i++) args[i] = arguments[i + 1];
				tasksByHandle[nextHandle] = {
					callback,
					args
				};
				registerImmediate(nextHandle);
				return nextHandle++;
			}
			function clearImmediate(handle) {
				delete tasksByHandle[handle];
			}
			function run(task) {
				var callback = task.callback;
				var args = task.args;
				switch (args.length) {
					case 0:
						callback();
						break;
					case 1:
						callback(args[0]);
						break;
					case 2:
						callback(args[0], args[1]);
						break;
					case 3:
						callback(args[0], args[1], args[2]);
						break;
					default:
						callback.apply(undefined, args);
						break;
				}
			}
			function runIfPresent(handle) {
				if (currentlyRunningATask) setTimeout(runIfPresent, 0, handle);
				else {
					var task = tasksByHandle[handle];
					if (task) {
						currentlyRunningATask = true;
						try {
							run(task);
						} finally {
							clearImmediate(handle);
							currentlyRunningATask = false;
						}
					}
				}
			}
			function installNextTickImplementation() {
				registerImmediate = function(handle) {
					process$1.nextTick(function() {
						runIfPresent(handle);
					});
				};
			}
			function canUsePostMessage() {
				if (global.postMessage && !global.importScripts) {
					var postMessageIsAsynchronous = true;
					var oldOnMessage = global.onmessage;
					global.onmessage = function() {
						postMessageIsAsynchronous = false;
					};
					global.postMessage("", "*");
					global.onmessage = oldOnMessage;
					return postMessageIsAsynchronous;
				}
			}
			function installPostMessageImplementation() {
				var messagePrefix = "setImmediate$" + Math.random() + "$";
				var onGlobalMessage = function(event) {
					if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) runIfPresent(+event.data.slice(messagePrefix.length));
				};
				if (global.addEventListener) global.addEventListener("message", onGlobalMessage, false);
				else global.attachEvent("onmessage", onGlobalMessage);
				registerImmediate = function(handle) {
					global.postMessage(messagePrefix + handle, "*");
				};
			}
			function installMessageChannelImplementation() {
				var channel = new MessageChannel();
				channel.port1.onmessage = function(event) {
					var handle = event.data;
					runIfPresent(handle);
				};
				registerImmediate = function(handle) {
					channel.port2.postMessage(handle);
				};
			}
			function installReadyStateChangeImplementation() {
				var html = doc.documentElement;
				registerImmediate = function(handle) {
					var script = doc.createElement("script");
					script.onreadystatechange = function() {
						runIfPresent(handle);
						script.onreadystatechange = null;
						html.removeChild(script);
						script = null;
					};
					html.appendChild(script);
				};
			}
			function installSetTimeoutImplementation() {
				registerImmediate = function(handle) {
					setTimeout(runIfPresent, 0, handle);
				};
			}
			var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
			attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
			if ({}.toString.call(global.process) === "[object process]") installNextTickImplementation();
			else if (canUsePostMessage()) installPostMessageImplementation();
			else if (global.MessageChannel) installMessageChannelImplementation();
			else if (doc && "onreadystatechange" in doc.createElement("script")) installReadyStateChangeImplementation();
			else installSetTimeoutImplementation();
			attachTo.setImmediate = setImmediate;
			attachTo.clearImmediate = clearImmediate;
		})(typeof self === "undefined" ? typeof global === "undefined" ? void 0 : global : self);
	}));
	//#endregion
	//#region ../../node_modules/timers-browserify/main.js
	var require_main = /* @__PURE__ */ __commonJSMin(((exports) => {
		init_dist$2();
		var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
		var apply = Function.prototype.apply;
		exports.setTimeout = function() {
			return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
		};
		exports.setInterval = function() {
			return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
		};
		exports.clearTimeout = exports.clearInterval = function(timeout) {
			if (timeout) timeout.close();
		};
		function Timeout(id, clearFn) {
			this._id = id;
			this._clearFn = clearFn;
		}
		Timeout.prototype.unref = Timeout.prototype.ref = function() {};
		Timeout.prototype.close = function() {
			this._clearFn.call(scope, this._id);
		};
		exports.enroll = function(item, msecs) {
			clearTimeout(item._idleTimeoutId);
			item._idleTimeout = msecs;
		};
		exports.unenroll = function(item) {
			clearTimeout(item._idleTimeoutId);
			item._idleTimeout = -1;
		};
		exports._unrefActive = exports.active = function(item) {
			clearTimeout(item._idleTimeoutId);
			var msecs = item._idleTimeout;
			if (msecs >= 0) item._idleTimeoutId = setTimeout(function onTimeout() {
				if (item._onTimeout) item._onTimeout();
			}, msecs);
		};
		init_setImmediate();
		exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || exports && exports.setImmediate;
		exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || exports && exports.clearImmediate;
	}));
	//#endregion
	//#region ../../node_modules/xml2js/lib/parser.js
	var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			var bom, defaults, defineProperty, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me) {
				return function() {
					return fn.apply(me, arguments);
				};
			}, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			sax = require_sax();
			events = require_events();
			bom = require_bom();
			processors = require_processors();
			setImmediate = require_main().setImmediate;
			defaults = require_defaults().defaults;
			isEmpty = function(thing) {
				return typeof thing === "object" && thing != null && Object.keys(thing).length === 0;
			};
			processItem = function(processors, item, key) {
				var i, len, process;
				for (i = 0, len = processors.length; i < len; i++) {
					process = processors[i];
					item = process(item, key);
				}
				return item;
			};
			defineProperty = function(obj, key, value) {
				var descriptor = Object.create(null);
				descriptor.value = value;
				descriptor.writable = true;
				descriptor.enumerable = true;
				descriptor.configurable = true;
				return Object.defineProperty(obj, key, descriptor);
			};
			exports.Parser = (function(superClass) {
				extend(Parser, superClass);
				function Parser(opts) {
					this.parseStringPromise = bind(this.parseStringPromise, this);
					this.parseString = bind(this.parseString, this);
					this.reset = bind(this.reset, this);
					this.assignOrPush = bind(this.assignOrPush, this);
					this.processAsync = bind(this.processAsync, this);
					var key, ref, value;
					if (!(this instanceof exports.Parser)) return new exports.Parser(opts);
					this.options = {};
					ref = defaults["0.2"];
					for (key in ref) {
						if (!hasProp.call(ref, key)) continue;
						value = ref[key];
						this.options[key] = value;
					}
					for (key in opts) {
						if (!hasProp.call(opts, key)) continue;
						value = opts[key];
						this.options[key] = value;
					}
					if (this.options.xmlns) this.options.xmlnskey = this.options.attrkey + "ns";
					if (this.options.normalizeTags) {
						if (!this.options.tagNameProcessors) this.options.tagNameProcessors = [];
						this.options.tagNameProcessors.unshift(processors.normalize);
					}
					this.reset();
				}
				Parser.prototype.processAsync = function() {
					var chunk, err;
					try {
						if (this.remaining.length <= this.options.chunkSize) {
							chunk = this.remaining;
							this.remaining = "";
							this.saxParser = this.saxParser.write(chunk);
							return this.saxParser.close();
						} else {
							chunk = this.remaining.substr(0, this.options.chunkSize);
							this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
							this.saxParser = this.saxParser.write(chunk);
							return setImmediate(this.processAsync);
						}
					} catch (error1) {
						err = error1;
						if (!this.saxParser.errThrown) {
							this.saxParser.errThrown = true;
							return this.emit(err);
						}
					}
				};
				Parser.prototype.assignOrPush = function(obj, key, newValue) {
					if (!(key in obj)) if (!this.options.explicitArray) return defineProperty(obj, key, newValue);
					else return defineProperty(obj, key, [newValue]);
					else {
						if (!(obj[key] instanceof Array)) defineProperty(obj, key, [obj[key]]);
						return obj[key].push(newValue);
					}
				};
				Parser.prototype.reset = function() {
					var attrkey, charkey, ontext, stack;
					this.removeAllListeners();
					this.saxParser = sax.parser(this.options.strict, {
						trim: false,
						normalize: false,
						xmlns: this.options.xmlns
					});
					this.saxParser.errThrown = false;
					this.saxParser.onerror = (function(_this) {
						return function(error) {
							_this.saxParser.resume();
							if (!_this.saxParser.errThrown) {
								_this.saxParser.errThrown = true;
								return _this.emit("error", error);
							}
						};
					})(this);
					this.saxParser.onend = (function(_this) {
						return function() {
							if (!_this.saxParser.ended) {
								_this.saxParser.ended = true;
								return _this.emit("end", _this.resultObject);
							}
						};
					})(this);
					this.saxParser.ended = false;
					this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
					this.resultObject = null;
					stack = [];
					attrkey = this.options.attrkey;
					charkey = this.options.charkey;
					this.saxParser.onopentag = (function(_this) {
						return function(node) {
							var key, newValue, obj = {}, processedKey, ref;
							obj[charkey] = "";
							if (!_this.options.ignoreAttrs) {
								ref = node.attributes;
								for (key in ref) {
									if (!hasProp.call(ref, key)) continue;
									if (!(attrkey in obj) && !_this.options.mergeAttrs) obj[attrkey] = {};
									newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
									processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
									if (_this.options.mergeAttrs) _this.assignOrPush(obj, processedKey, newValue);
									else defineProperty(obj[attrkey], processedKey, newValue);
								}
							}
							obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
							if (_this.options.xmlns) obj[_this.options.xmlnskey] = {
								uri: node.uri,
								local: node.local
							};
							return stack.push(obj);
						};
					})(this);
					this.saxParser.onclosetag = (function(_this) {
						return function() {
							var cdata, emptyStr, key, node, nodeName, obj = stack.pop(), objClone, old, s, xpath;
							nodeName = obj["#name"];
							if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) delete obj["#name"];
							if (obj.cdata === true) {
								cdata = obj.cdata;
								delete obj.cdata;
							}
							s = stack[stack.length - 1];
							if (obj[charkey].match(/^\s*$/) && !cdata) {
								emptyStr = obj[charkey];
								delete obj[charkey];
							} else {
								if (_this.options.trim) obj[charkey] = obj[charkey].trim();
								if (_this.options.normalize) obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
								obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
								if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) obj = obj[charkey];
							}
							if (isEmpty(obj)) if (typeof _this.options.emptyTag === "function") obj = _this.options.emptyTag();
							else obj = _this.options.emptyTag !== "" ? _this.options.emptyTag : emptyStr;
							if (_this.options.validator != null) {
								xpath = "/" + (function() {
									var i, len, results = [];
									for (i = 0, len = stack.length; i < len; i++) {
										node = stack[i];
										results.push(node["#name"]);
									}
									return results;
								})().concat(nodeName).join("/");
								(function() {
									var err;
									try {
										return obj = _this.options.validator(xpath, s && s[nodeName], obj);
									} catch (error1) {
										err = error1;
										return _this.emit("error", err);
									}
								})();
							}
							if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === "object") {
								if (!_this.options.preserveChildrenOrder) {
									node = {};
									if (_this.options.attrkey in obj) {
										node[_this.options.attrkey] = obj[_this.options.attrkey];
										delete obj[_this.options.attrkey];
									}
									if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
										node[_this.options.charkey] = obj[_this.options.charkey];
										delete obj[_this.options.charkey];
									}
									if (Object.getOwnPropertyNames(obj).length > 0) node[_this.options.childkey] = obj;
									obj = node;
								} else if (s) {
									s[_this.options.childkey] = s[_this.options.childkey] || [];
									objClone = {};
									for (key in obj) {
										if (!hasProp.call(obj, key)) continue;
										defineProperty(objClone, key, obj[key]);
									}
									s[_this.options.childkey].push(objClone);
									delete obj["#name"];
									if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) obj = obj[charkey];
								}
							}
							if (stack.length > 0) return _this.assignOrPush(s, nodeName, obj);
							else {
								if (_this.options.explicitRoot) {
									old = obj;
									obj = {};
									defineProperty(obj, nodeName, old);
								}
								_this.resultObject = obj;
								_this.saxParser.ended = true;
								return _this.emit("end", _this.resultObject);
							}
						};
					})(this);
					ontext = (function(_this) {
						return function(text) {
							var charChild, s = stack[stack.length - 1];
							if (s) {
								s[charkey] += text;
								if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, "").trim() !== "")) {
									s[_this.options.childkey] = s[_this.options.childkey] || [];
									charChild = { "#name": "__text__" };
									charChild[charkey] = text;
									if (_this.options.normalize) charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
									s[_this.options.childkey].push(charChild);
								}
								return s;
							}
						};
					})(this);
					this.saxParser.ontext = ontext;
					return this.saxParser.oncdata = (function(_this) {
						return function(text) {
							var s = ontext(text);
							if (s) return s.cdata = true;
						};
					})(this);
				};
				Parser.prototype.parseString = function(str, cb) {
					var err;
					if (cb != null && typeof cb === "function") {
						this.on("end", function(result) {
							this.reset();
							return cb(null, result);
						});
						this.on("error", function(err) {
							this.reset();
							return cb(err);
						});
					}
					try {
						str = str.toString();
						if (str.trim() === "") {
							this.emit("end", null);
							return true;
						}
						str = bom.stripBOM(str);
						if (this.options.async) {
							this.remaining = str;
							setImmediate(this.processAsync);
							return this.saxParser;
						}
						return this.saxParser.write(str).close();
					} catch (error1) {
						err = error1;
						if (!(this.saxParser.errThrown || this.saxParser.ended)) {
							this.emit("error", err);
							return this.saxParser.errThrown = true;
						} else if (this.saxParser.ended) throw err;
					}
				};
				Parser.prototype.parseStringPromise = function(str) {
					return new Promise((function(_this) {
						return function(resolve, reject) {
							return _this.parseString(str, function(err, value) {
								if (err) return reject(err);
								else return resolve(value);
							});
						};
					})(this));
				};
				return Parser;
			})(events);
			exports.parseString = function(str, a, b) {
				var cb, options, parser;
				if (b != null) {
					if (typeof b === "function") cb = b;
					if (typeof a === "object") options = a;
				} else {
					if (typeof a === "function") cb = a;
					options = {};
				}
				parser = new exports.Parser(options);
				return parser.parseString(str, cb);
			};
			exports.parseStringPromise = function(str, a) {
				var options, parser;
				if (typeof a === "object") options = a;
				parser = new exports.Parser(options);
				return parser.parseStringPromise(str);
			};
		}).call(exports);
	}));
	//#endregion
	//#region ../loot-core/src/server/transactions/import/ofx2json.ts
	var import_xml2js = (/* @__PURE__ */ __commonJSMin(((exports) => {
		(function() {
			"use strict";
			var builder, defaults, parser, processors, extend = function(child, parent) {
				for (var key in parent) if (hasProp.call(parent, key)) child[key] = parent[key];
				function ctor() {
					this.constructor = child;
				}
				ctor.prototype = parent.prototype;
				child.prototype = new ctor();
				child.__super__ = parent.prototype;
				return child;
			}, hasProp = {}.hasOwnProperty;
			defaults = require_defaults();
			builder = require_builder();
			parser = require_parser();
			processors = require_processors();
			exports.defaults = defaults.defaults;
			exports.processors = processors;
			exports.ValidationError = (function(superClass) {
				extend(ValidationError, superClass);
				function ValidationError(message) {
					this.message = message;
				}
				return ValidationError;
			})(Error);
			exports.Builder = builder.Builder;
			exports.Parser = parser.Parser;
			exports.parseString = parser.parseString;
			exports.parseStringPromise = parser.parseStringPromise;
		}).call(exports);
	})))();
	function sgml2Xml(sgml) {
		return sgml.replace(/&/g, "&#038;").replace(/&amp;/g, "&#038;").replace(/>\s+</g, "><").replace(/\s+</g, "<").replace(/>\s+/g, ">").replace(/\.(?=[^<>]*>)/g, "").replace(/<(\w+?)>([^<]+)/g, "<$1>$2</<added>$1>").replace(/<\/<added>(\w+?)>(<\/\1>)?/g, "</$1>");
	}
	function html2Plain(value) {
		return value?.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&#39;/g, "'").replace(/&quot;/g, "\"").replace(/(&amp;|&#038;)/g, "&");
	}
	async function parseXml(content) {
		return await (0, import_xml2js.parseStringPromise)(content, {
			explicitArray: false,
			trim: true
		});
	}
	function getStmtTrn(data) {
		const ofx = data?.["OFX"];
		if (ofx?.["CREDITCARDMSGSRSV1"] != null) return getCcStmtTrn(ofx);
		else if (ofx?.["INVSTMTMSGSRSV1"] != null) return getInvStmtTrn(ofx);
		else return getBankStmtTrn(ofx);
	}
	function getBankStmtTrn(ofx) {
		const msg = ofx?.["BANKMSGSRSV1"];
		return getAsArray(msg?.["STMTTRNRS"]).flatMap((s) => {
			const stmtTrn = ((s?.["STMTRS"])?.["BANKTRANLIST"])?.["STMTTRN"];
			return getAsArray(stmtTrn);
		});
	}
	function getCcStmtTrn(ofx) {
		const msg = ofx?.["CREDITCARDMSGSRSV1"];
		return getAsArray(msg?.["CCSTMTTRNRS"]).flatMap((s) => {
			const stmtTrn = ((s?.["CCSTMTRS"])?.["BANKTRANLIST"])?.["STMTTRN"];
			return getAsArray(stmtTrn);
		});
	}
	function getInvStmtTrn(ofx) {
		const msg = ofx?.["INVSTMTMSGSRSV1"];
		return getAsArray(msg?.["INVSTMTTRNRS"]).flatMap((s) => {
			const stmtTrn = ((s?.["INVSTMTRS"])?.["INVTRANLIST"])?.["INVBANKTRAN"]?.flatMap((t) => t?.["STMTTRN"]);
			return getAsArray(stmtTrn);
		});
	}
	function getAsArray(value) {
		return Array.isArray(value) ? value : value === void 0 ? [] : [value];
	}
	function mapOfxTransaction(stmtTrn) {
		const dtPosted = stmtTrn["DTPOSTED"];
		const transactionDate = dtPosted ? new Date(Number(dtPosted.substring(0, 4)), Number(dtPosted.substring(4, 6)) - 1, Number(dtPosted.substring(6, 8))) : null;
		return {
			amount: stmtTrn["TRNAMT"],
			type: stmtTrn["TRNTYPE"],
			fitId: stmtTrn["FITID"],
			date: dayFromDate(transactionDate),
			name: html2Plain(stmtTrn["NAME"]),
			memo: html2Plain(stmtTrn["MEMO"])
		};
	}
	async function ofx2json(ofx) {
		const contents = ofx.split(/<OFX\s?>/, 2);
		const headerString = contents[0].split(/\r?\n/);
		const headers = {};
		headerString.forEach((attrs) => {
			if (attrs) {
				const headAttr = attrs.split(/:/, 2);
				headers[headAttr[0]] = headAttr[1];
			}
		});
		const content = `<OFX>${contents[1]}`;
		let dataParsed = null;
		try {
			dataParsed = await parseXml(content);
		} catch {
			dataParsed = await parseXml(sgml2Xml(content));
		}
		return {
			headers,
			transactions: getStmtTrn(dataParsed).map(mapOfxTransaction)
		};
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/import/qif2json.ts
	function qif2json(qif, options = {}) {
		const lines = qif.split("\n").filter(Boolean);
		let line = lines.shift();
		const type = /!Type:([^$]*)$/.exec(line.trim());
		const data = {
			dateFormat: options.dateFormat,
			transactions: []
		};
		const transactions = data.transactions;
		let transaction = {};
		if (!type || !type.length) throw new Error("File does not appear to be a valid qif file: " + line);
		data.type = type[1];
		let division = {};
		while (line = lines.shift()) {
			line = line.trim();
			if (line === "^") {
				transactions.push(transaction);
				transaction = {};
				continue;
			}
			switch (line[0]) {
				case "D":
					transaction.date = line.substring(1);
					break;
				case "T":
					transaction.amount = line.substring(1);
					break;
				case "N":
					transaction.number = line.substring(1);
					break;
				case "M":
					transaction.memo = line.substring(1);
					break;
				case "A":
					transaction.address = (transaction.address || []).concat(line.substring(1));
					break;
				case "P":
					transaction.payee = line.substring(1).replace(/&amp;/g, "&");
					break;
				case "L":
					const lArray = line.substring(1).split(":");
					transaction.category = lArray[0];
					if (lArray[1] !== void 0) transaction.subcategory = lArray[1];
					break;
				case "C":
					transaction.clearedStatus = line.substring(1);
					break;
				case "S":
					const sArray = line.substring(1).split(":");
					division.category = sArray[0];
					if (sArray[1] !== void 0) division.subcategory = sArray[1];
					break;
				case "E":
					division.description = line.substring(1);
					break;
				case "$":
					division.amount = parseFloat(line.substring(1));
					if (!(transaction.division instanceof Array)) transaction.division = [];
					transaction.division.push(division);
					division = {};
					break;
				default: throw new Error("Unknown Detail Code: " + line[0]);
			}
		}
		if (Object.keys(transaction).length) transactions.push(transaction);
		return data;
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/import/xmlcamt2json.ts
	function findKeys(obj, key) {
		let result = [];
		for (const i in obj) {
			if (!obj.hasOwnProperty(i)) continue;
			if (i === key) if (Array.isArray(obj[i])) result = result.concat(obj[i]);
			else result.push(obj[i]);
			if (typeof obj[i] === "object") result = result.concat(findKeys(obj[i], key));
		}
		return result;
	}
	function getPayeeNameFromTxDtls(TxDtls, isDebit) {
		if (TxDtls?.RltdPties) {
			const Nm = findKeys(isDebit ? TxDtls.RltdPties.Cdtr : TxDtls.RltdPties.Dbtr, "Nm");
			return Nm.length > 0 ? Nm[0] : null;
		}
		return null;
	}
	function getNotesFromTxDtls(TxDtls) {
		if (TxDtls?.RmtInf) {
			const Ustrd = TxDtls.RmtInf.Ustrd;
			return Array.isArray(Ustrd) ? Ustrd.join(" ") : Ustrd;
		}
		return null;
	}
	function convertToNumberOrNull(value) {
		const number = Number(value);
		return isNaN(number) ? null : number;
	}
	function getDtOrDtTm(Date) {
		if (!Date) return null;
		if ("DtTm" in Date) return Date.DtTm.slice(0, 10);
		return Date?.Dt;
	}
	async function xmlCAMT2json(content) {
		const entries = findKeys(await (0, import_xml2js.parseStringPromise)(content, { explicitArray: false }), "Ntry");
		const transactions = [];
		for (const entry of entries) {
			const id = entry.AcctSvcrRef;
			const amount = convertToNumberOrNull(entry.Amt?._);
			const isDebit = entry.CdtDbtInd === "DBIT";
			const date = getDtOrDtTm(entry.ValDt) || getDtOrDtTm(entry.BookgDt);
			if (Array.isArray(entry.NtryDtls?.TxDtls)) entry.NtryDtls.TxDtls.forEach((TxDtls) => {
				const subPayee = getPayeeNameFromTxDtls(TxDtls, isDebit);
				const subNotes = getNotesFromTxDtls(TxDtls);
				const Amt = findKeys(TxDtls, "Amt");
				const amount = Amt.length > 0 ? convertToNumberOrNull(Amt[0]._) : null;
				transactions.push({
					amount: isDebit ? -amount : amount,
					date,
					payee_name: subPayee,
					imported_payee: subPayee,
					notes: subNotes
				});
			});
			else {
				let payee_name;
				let notes;
				payee_name = getPayeeNameFromTxDtls(entry.NtryDtls?.TxDtls, isDebit);
				if (!payee_name && entry.AddtlNtryInf) payee_name = entry.AddtlNtryInf;
				notes = getNotesFromTxDtls(entry.NtryDtls?.TxDtls);
				if (!notes && entry.AddtlNtryInf && entry.AddtlNtryInf !== payee_name) notes = entry.AddtlNtryInf;
				if (!payee_name && !notes && entry.NtryRef) notes = entry.NtryRef;
				if (payee_name && notes && payee_name.includes(notes)) notes = null;
				const transaction = {
					amount: isDebit ? -amount : amount,
					date,
					payee_name,
					imported_payee: payee_name,
					notes
				};
				if (id) transaction.imported_id = id;
				transactions.push(transaction);
			}
		}
		return transactions.filter((trans) => trans.date != null && trans.amount != null);
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/import/parse-file.ts
	/**
	* Parse OFX amount strings to numbers.
	* Handles various OFX amount formats including currency symbols, parentheses, and multiple decimal places.
	* Returns null for invalid amounts instead of NaN.
	*/
	function parseOfxAmount(amount) {
		if (!amount || typeof amount !== "string") return null;
		let cleaned = amount.trim();
		if (cleaned.startsWith("(") && cleaned.endsWith(")")) cleaned = "-" + cleaned.slice(1, -1);
		cleaned = cleaned.replace(/[^\d.-]/g, "");
		const decimalIndex = cleaned.indexOf(".");
		if (decimalIndex !== -1) {
			const beforeDecimal = cleaned.slice(0, decimalIndex);
			const afterDecimal = cleaned.slice(decimalIndex + 1).replace(/\./g, "");
			cleaned = beforeDecimal + "." + afterDecimal;
		}
		if (!cleaned || cleaned === "-" || cleaned === ".") return null;
		const parsed = parseFloat(cleaned);
		return isNaN(parsed) ? null : parsed;
	}
	async function parseFile(filepath, options = {}) {
		const errors = Array();
		const m = filepath.match(/\.[^.]*$/);
		if (m) switch (m[0].toLowerCase()) {
			case ".qif": return parseQIF(filepath, options);
			case ".csv":
			case ".tsv": return parseCSV(filepath, options);
			case ".ofx":
			case ".qfx": return parseOFX(filepath, options);
			case ".xml": return parseCAMT(filepath, options);
			default:
		}
		errors.push({
			message: "Invalid file type",
			internal: ""
		});
		return {
			errors,
			transactions: []
		};
	}
	async function parseCSV(filepath, options) {
		const errors = Array();
		let contents = await readFile(filepath);
		const skipStart = Math.max(0, options.skipStartLines || 0);
		const skipEnd = Math.max(0, options.skipEndLines || 0);
		if (skipStart > 0 || skipEnd > 0) {
			const lines = contents.split(/\r?\n/);
			if (skipStart + skipEnd >= lines.length) {
				errors.push({
					message: "Cannot skip more lines than exist in the file",
					internal: `Attempted to skip ${skipStart} start + ${skipEnd} end lines from ${lines.length} total lines`
				});
				return {
					errors,
					transactions: []
				};
			}
			const startLine = skipStart;
			const endLine = skipEnd > 0 ? lines.length - skipEnd : lines.length;
			contents = lines.slice(startLine, endLine).join("\r\n");
		}
		let data;
		try {
			data = parse(contents, {
				columns: options?.hasHeaderRow,
				bom: true,
				delimiter: options?.delimiter || ",",
				quote: "\"",
				trim: true,
				relax_column_count: true,
				skip_empty_lines: true
			});
		} catch (err) {
			errors.push({
				message: "Failed parsing: " + err.message,
				internal: err.message
			});
			return {
				errors,
				transactions: []
			};
		}
		return {
			errors,
			transactions: data
		};
	}
	async function parseQIF(filepath, options = {}) {
		const errors = Array();
		const contents = await readFile(filepath);
		let data;
		try {
			data = qif2json(contents);
		} catch (err) {
			errors.push({
				message: "Failed parsing: doesn't look like a valid QIF file.",
				internal: err.stack
			});
			return {
				errors,
				transactions: []
			};
		}
		const swap = options.swapPayeeAndMemo;
		return {
			errors: [],
			transactions: data.transactions.map((trans) => {
				const payeeSource = swap ? trans.memo : trans.payee;
				const memoSource = swap ? trans.payee : trans.memo;
				const fallbackUsed = !payeeSource && swap;
				return {
					amount: trans.amount != null ? looselyParseAmount(trans.amount) : null,
					date: trans.date,
					payee_name: payeeSource || (fallbackUsed ? memoSource : null),
					imported_payee: payeeSource || (fallbackUsed ? memoSource : null),
					category: trans.subcategory || trans.category || null,
					notes: options.importNotes && !fallbackUsed ? memoSource || null : null
				};
			}).filter((trans) => trans.date != null && trans.amount != null)
		};
	}
	async function parseOFX(filepath, options) {
		const errors = Array();
		const contents = await readFile(filepath);
		let data;
		try {
			data = await ofx2json(contents);
		} catch (err) {
			errors.push({
				message: "Failed importing file",
				internal: err.stack
			});
			return { errors };
		}
		const useMemoFallback = options.fallbackMissingPayeeToMemo;
		const swap = options.swapPayeeAndMemo;
		return {
			errors,
			transactions: data.transactions.map((trans) => {
				const parsedAmount = parseOfxAmount(trans.amount);
				if (parsedAmount === null) errors.push({
					message: `Invalid amount format: ${trans.amount}`,
					internal: `Failed to parse amount: ${trans.amount}`
				});
				const payeeSource = swap ? trans.memo : trans.name;
				const memoSource = swap ? trans.name : trans.memo;
				const fallbackUsed = !payeeSource && useMemoFallback;
				return {
					amount: parsedAmount || 0,
					imported_id: trans.fitId,
					date: trans.date,
					payee_name: payeeSource || (fallbackUsed ? memoSource : null),
					imported_payee: payeeSource || (fallbackUsed ? memoSource : null),
					notes: options.importNotes && !fallbackUsed ? memoSource || null : null
				};
			})
		};
	}
	async function parseCAMT(filepath, options = {}) {
		const errors = Array();
		const contents = await readFile(filepath);
		let data;
		try {
			data = await xmlCAMT2json(contents);
		} catch (err) {
			logger.error(err);
			errors.push({
				message: "Failed importing file",
				internal: err.stack
			});
			return { errors };
		}
		const swap = options.swapPayeeAndMemo;
		return {
			errors,
			transactions: data.map((trans) => {
				const payeeSource = swap ? trans.notes : trans.payee_name;
				const memoSource = swap ? trans.payee_name : trans.notes;
				const fallbackUsed = !payeeSource && swap;
				return {
					...trans,
					payee_name: payeeSource || (fallbackUsed ? memoSource : null),
					imported_payee: payeeSource || (fallbackUsed ? memoSource : null),
					notes: options.importNotes && !fallbackUsed ? memoSource || null : null
				};
			})
		};
	}
	//#endregion
	//#region ../loot-core/src/shared/merge.ts
	function validForMergeExplanation(transactionA, transactionB) {
		if (!transactionA || !transactionB) return "One of the provided transactions does not exist";
		if (transactionA.account !== transactionB.account) return "Cannot merge transactions from different accounts";
		if (transactionA.amount !== transactionB.amount) return "Cannot merge transactions with different amounts";
		if (transactionA.transfer_id && transactionB.transfer_id && transactionA.payee !== transactionB.payee) return "Cannot merge transfers to different accounts";
		return "";
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/merge.ts
	async function mergeTransactions(transactions) {
		const txIds = transactions?.map((x) => x?.id).filter(Boolean) || [];
		if (txIds.length !== 2) throw new Error("Merging is only possible with 2 transactions, but found " + JSON.stringify(transactions));
		const [a, b] = await mapAndValidateTransactions(txIds[0], txIds[1]);
		const aTransferId = a.transfer_id;
		const bTransferId = b.transfer_id;
		if (!aTransferId && !bTransferId) return mergeTransactionsNoTransfer(a, b);
		const transferAccount = aTransferId ? a.payee : b.payee;
		await setTransfers([
			a.id,
			b.id,
			aTransferId,
			bTransferId
		], null);
		const transferId = await mergeTransfers(aTransferId, bTransferId);
		const keptTxId = await mergeTransactionsNoTransfer(a, b);
		if (transferId) {
			await updateTransaction$2({
				id: keptTxId,
				transfer_id: transferId,
				payee: transferAccount
			});
			await updateTransaction$2({
				id: transferId,
				transfer_id: keptTxId
			});
		}
		if (transferAccount && !(aTransferId && bTransferId)) {
			const account = await getAccount((await getPayee$1(transferAccount))?.transfer_acct ?? "");
			if (account && !account.offbudget) await updateTransaction$2({
				id: keptTxId,
				category: null
			});
		}
		return keptTxId;
	}
	function setTransfers(txIds, transfer_id) {
		return Promise.all(txIds.filter(Boolean).map((txId) => updateTransaction$2({
			id: txId,
			transfer_id: transfer_id ?? null
		})));
	}
	async function mergeTransfers(aTransferId, bTransferId) {
		if (!aTransferId) return bTransferId;
		if (!bTransferId) return aTransferId;
		const [aTransfer, bTransfer] = await mapAndValidateTransactions(aTransferId, bTransferId);
		await setTransfers([aTransfer.id, bTransfer.id], null);
		return mergeTransactionsNoTransfer(aTransfer, bTransfer);
	}
	async function mapAndValidateTransactions(aId, bId) {
		const a = await getTransaction(aId);
		const b = await getTransaction(bId);
		const validForMergeError = validForMergeExplanation(a, b);
		if (validForMergeError) throw new Error(validForMergeError);
		return [a, b];
	}
	async function mergeTransactionsNoTransfer(a, b) {
		const { keep, drop } = determineKeepDrop(a, b);
		const keepSubtransactions = [];
		const dropSubtransactions = [];
		const parents = [];
		if (keep.is_parent) parents.push(keep.id);
		if (drop.is_parent) parents.push(drop.id);
		let rows = [];
		if (parents.length === 2) rows = await all("SELECT * FROM v_transactions WHERE parent_id IN (?, ?)", parents);
		else if (parents.length === 1) rows = await all("SELECT * FROM v_transactions WHERE parent_id = ?", parents);
		for (const row of rows) if (row.parent_id === keep.id) keepSubtransactions.push(row);
		else if (row.parent_id === drop.id) dropSubtransactions.push(row);
		const keepHasSubtransactions = keepSubtransactions.length > 0;
		const dropHasSubtransactions = dropSubtransactions.length > 0;
		if (!keepHasSubtransactions && dropHasSubtransactions) {
			await Promise.all(dropSubtransactions.map((sub) => updateTransaction$2({
				id: sub.id,
				parent_id: keep.id
			})));
			await updateTransaction$2({
				id: keep.id,
				is_parent: true,
				category: null,
				payee: keep.payee || drop.payee,
				notes: keep.notes || drop.notes,
				cleared: keep.cleared || drop.cleared,
				reconciled: keep.reconciled || drop.reconciled,
				schedule: keep.schedule || drop.schedule
			});
		} else await updateTransaction$2({
			id: keep.id,
			payee: keep.payee || drop.payee,
			category: keep.category || drop.category,
			notes: keep.notes || drop.notes,
			cleared: keep.cleared || drop.cleared,
			reconciled: keep.reconciled || drop.reconciled,
			schedule: keep.schedule || drop.schedule
		});
		const { data: transactionsToDelete } = await aqlQuery(q("transactions").filter({ id: drop.id }).select("*").options({ splits: "grouped" }));
		const ungroupedTransactions = ungroupTransactions(transactionsToDelete);
		if (ungroupedTransactions.length > 0) {
			const { diff } = deleteTransaction$1(ungroupedTransactions, drop.id);
			await batchUpdateTransactions(diff);
		}
		return keep.id;
	}
	function determineKeepDrop(a, b) {
		if (b.imported_id && !a.imported_id) return {
			keep: b,
			drop: a
		};
		else if (a.imported_id && !b.imported_id) return {
			keep: a,
			drop: b
		};
		if (b.imported_payee && !a.imported_payee) return {
			keep: b,
			drop: a
		};
		else if (a.imported_payee && !b.imported_payee) return {
			keep: a,
			drop: b
		};
		if (a.date.localeCompare(b.date) < 0) return {
			keep: a,
			drop: b
		};
		else return {
			keep: b,
			drop: a
		};
	}
	//#endregion
	//#region ../loot-core/src/server/transactions/app.ts
	async function handleBatchUpdateTransactions({ added, deleted, updated, learnCategories, runTransfers = true }) {
		return await batchUpdateTransactions({
			added,
			updated,
			deleted,
			learnCategories,
			runTransfers
		});
	}
	async function addTransaction(transaction) {
		await handleBatchUpdateTransactions({ added: [transaction] });
		return {};
	}
	async function updateTransaction(transaction) {
		await handleBatchUpdateTransactions({ updated: [transaction] });
		return {};
	}
	async function deleteTransaction(transaction) {
		await handleBatchUpdateTransactions({ deleted: [transaction] });
		return {};
	}
	async function moveTransaction({ id, accountId, targetId }) {
		const transaction = await getTransaction(id);
		if (!transaction) throw new Error(`Transaction not found: ${id}`);
		if (transaction.account !== accountId) throw new Error(`Account mismatch: transaction belongs to account ${transaction.account}, not ${accountId}`);
		await moveTransaction$1(id, accountId, targetId);
		return {};
	}
	async function parseTransactionsFile({ filepath, options }) {
		return parseFile(filepath, options);
	}
	async function exportTransactions({ transactions, accounts, categoryGroups, payees }) {
		return exportToCSV(transactions, accounts, categoryGroups, payees);
	}
	async function exportTransactionsQuery({ query: queryState }) {
		return exportQueryToCSV(new Query(queryState));
	}
	async function getEarliestTransaction() {
		const { data } = await aqlQuery(q("transactions").options({ splits: "none" }).orderBy({ date: "asc" }).select("*").limit(1));
		return data[0] || null;
	}
	async function getLatestTransaction() {
		const { data } = await aqlQuery(q("transactions").options({ splits: "none" }).orderBy({ date: "desc" }).select("*").limit(1));
		return data[0] || null;
	}
	var app = createApp();
	app.method("transactions-batch-update", mutator(undoable(handleBatchUpdateTransactions)));
	app.method("transactions-merge", mutator(undoable(mergeTransactions)));
	app.method("transaction-add", mutator(addTransaction));
	app.method("transaction-update", mutator(updateTransaction));
	app.method("transaction-delete", mutator(deleteTransaction));
	app.method("transaction-move", mutator(undoable(moveTransaction)));
	app.method("transactions-parse-file", mutator(parseTransactionsFile));
	app.method("transactions-export", mutator(exportTransactions));
	app.method("transactions-export-query", mutator(exportTransactionsQuery));
	app.method("get-earliest-transaction", getEarliestTransaction);
	app.method("get-latest-transaction", getLatestTransaction);
	//#endregion
	//#region ../loot-core/src/server/main.ts
	init_dist$2();
	init_dist$1();
	var handlers = {};
	handlers["undo"] = mutator(async function() {
		return undo();
	});
	handlers["redo"] = mutator(function() {
		return redo();
	});
	handlers["make-filters-from-conditions"] = async function({ conditions, applySpecialCases }) {
		return conditionsToAQL(conditions, { applySpecialCases });
	};
	handlers["query"] = async function(query) {
		if (query["table"] == null) throw new Error("query has no table, did you forgot to call `.serialize`?");
		return aqlQuery(query);
	};
	handlers["get-server-version"] = async function() {
		if (!getServer()) return { error: "no-server" };
		let version;
		try {
			const res = await get$1(getServer().BASE_SERVER + "/info");
			version = JSON.parse(res).build.version;
		} catch {
			return { error: "network-failure" };
		}
		return { version };
	};
	handlers["get-server-url"] = async function() {
		return getServer() && getServer().BASE_SERVER;
	};
	handlers["set-server-url"] = async function({ url, validate = true }) {
		if (url == null) await removeItem("user-token");
		else {
			url = url.replace(/\/+$/, "");
			if (validate) {
				const result = await runHandler(handlers["subscribe-needs-bootstrap"], { url });
				if ("error" in result) return { error: result.error };
			}
		}
		await setItem("server-url", url);
		await setItem("did-bootstrap", true);
		setServer(url);
		return {};
	};
	handlers["app-focused"] = async function() {
		if (getPrefs() && getPrefs().id) fullSync();
	};
	handlers = installAPI(handlers);
	app$20.handlers = handlers;
	app$20.combine(app$17, app$16, app$15, app$12, app$8, app$6, app$1, app$10, app$9, app$13, app$5, app$18, app, app$19, app$7, app$4, app$3, app$14, app$11, app$2);
	function getDefaultDocumentDir() {
		return join$1("/documents", "Actual");
	}
	async function setupDocumentsDir() {
		async function ensureExists(dir) {
			if (!await exists$1(dir)) await mkdir(dir);
		}
		let documentDir = await getItem("document-dir");
		if (documentDir) try {
			await ensureExists(documentDir);
		} catch {
			documentDir = null;
		}
		if (!documentDir) documentDir = getDefaultDocumentDir();
		await ensureExists(documentDir);
		_setDocumentDir(documentDir);
	}
	async function initApp(isDev, socketName) {
		await init$3();
		init$5();
		await init$2();
		await setupDocumentsDir();
		const keysStr = await getItem("encrypt-keys");
		if (keysStr) try {
			const keys = JSON.parse(keysStr);
			await Promise.all(Object.keys(keys).map((fileId) => {
				return loadKey(keys[fileId]);
			}));
		} catch (e) {
			logger.log("Error loading key", e);
			throw new Error("load-key-error");
		}
		const url = await getItem("server-url");
		if (!url) await removeItem("user-token");
		setServer(url);
		init$4(socketName, app$20.handlers);
		global.$query = aqlQuery;
		global.$q = q;
		if (isDev) {
			global.$send = (name, args) => runHandler(app$20.handlers[name], args);
			global.$db = db_exports;
			global.$setSyncingMode = setSyncingMode;
		}
	}
	async function init(config) {
		let dataDir, serverURL;
		if (config) {
			dataDir = config.dataDir;
			serverURL = config.serverURL;
			if (config.verbose !== void 0) setVerboseMode(config.verbose);
		} else {
			dataDir = "/";
			serverURL = {}.ACTUAL_SERVER_URL;
		}
		await init$3();
		init$5({ persist: false });
		await init$2();
		_setDocumentDir(dataDir || process$1.cwd());
		if (serverURL) {
			setServer(serverURL);
			if ("sessionToken" in config && config.sessionToken) {
				await runHandler(handlers["subscribe-set-token"], { token: config.sessionToken });
				const user = await runHandler(handlers["subscribe-get-user"], void 0);
				if (!user || user.tokenExpired === true) {
					await runHandler(handlers["subscribe-set-token"], { token: "" });
					throw new Error("Authentication failed: invalid or expired session token");
				}
				if (user.offline === true) {
					await runHandler(handlers["subscribe-set-token"], { token: "" });
					throw new Error("Authentication failed: server offline or unreachable");
				}
			} else if ("password" in config && config.password) {
				const result = await runHandler(handlers["subscribe-sign-in"], { password: config.password });
				if (result?.error) throw new Error(`Authentication failed: ${result.error}`);
			}
		} else {
			setServer(null);
			app$20.events.on("load-budget", () => {
				setSyncingMode("offline");
			});
		}
		return lib;
	}
	var lib = {
		getDataDir,
		sendMessage: (msg, args) => send$1(msg, args),
		send: async (name, args) => {
			return await runHandler(app$20.handlers[name], args);
		},
		on: (name, func) => app$20.events.on(name, func),
		q,
		db: db_exports,
		amountToInteger,
		integerToAmount
	};
	//#endregion
	exports.getDefaultDocumentDir = getDefaultDocumentDir;
	Object.defineProperty(exports, "handlers", {
		enumerable: true,
		get: function() {
			return handlers;
		}
	});
	exports.init = init;
	exports.initApp = initApp;
	exports.lib = lib;
	return exports;
})({});

//# sourceMappingURL=kcab.worker.Df_vXNHn.js.map